WordPress.org

Support

Support » Plugins and Hacks » Audiobar » [Plugin: Audiobar] Disable Download Button

[Plugin: Audiobar] Disable Download Button

  • So I went searching for a way to disable the download button from the way Audiobar displays MP3 files. I figured it out.

    find this file to edit:
    audiobar/templates/audiobar-buttons.php

    It should look like this:

    <?php // The HTML for the clickable buttons ?>
    <span class="audiobar_container">
    <?php // audiobar_title must directly follow audiobar_play with no whitespace ?>
    <?php if ($show_play_button): ?><a>'); top.play.location.replace(this.href + (top.audiobar.should_force_flash(<?php echo str_replace('"', "'", json_encode($extensions)) ?>) ? '&forceflash' : '')); return false;" href="<?php echo $wpurl ?>?audiobar=bar&play=<?php echo $base ?>&title=<?php echo urlencode($title) ?>&autoplay=1<?php if (in_array('oga', $extensions)) echo '&altogg' ?>" target="play" class="play">play</a><?php endif; ?><span class="audiobar_title"><?php echo $title ?></span>
    <?php for ($i = count($extensions) - 1; $i >= 0; $i-- ): ?>
    <a>" class="download"><?php echo $extensions[$i] == 'oga' ? 'ogg' : $extensions[$i] ?></a>
    <?php endfor; ?>
    <a>" class="text"><?php _e("Download") ?></a>
    </span>

    There are two lines of code that must be removed.
    The first is:
    <a>" class="download"><?php echo $extensions[$i] == 'oga' ? 'ogg' : $extensions[$i] ?></a>

    The second is:
    <a>" class="text"><?php _e("Download") ?></a>

    Once these two lines of code are deleted your file should look like this:

    <?php // The HTML for the clickable buttons ?>
    <span class="audiobar_container">
    <?php // audiobar_title must directly follow audiobar_play with no whitespace ?>
    <?php if ($show_play_button): ?><a>'); top.play.location.replace(this.href + (top.audiobar.should_force_flash(<?php echo str_replace('"', "'", json_encode($extensions)) ?>) ? '&forceflash' : '')); return false;" href="<?php echo $wpurl ?>?audiobar=bar&play=<?php echo $base ?>&title=<?php echo urlencode($title) ?>&autoplay=1<?php if (in_array('oga', $extensions)) echo '&altogg' ?>" target="play" class="play">play</a><?php endif; ?><span class="audiobar_title"><?php echo $title ?></span>
    <?php for ($i = count($extensions) - 1; $i >= 0; $i-- ): ?>
    
    <?php endfor; ?>
    
    </span>

    Hope this helps people that have the same problem.

    http://wordpress.org/extend/plugins/audiobar/

Viewing 1 replies (of 1 total)
  • Hi GioJovan,

    Thanks for sharing your work with us :] It unfortunately doesn’t prevent people downloading the source files (whose URLs are listed in the page’s source code) but it’s definitely a deterrent.

    There is actually a new service being developed to run alongside Audiobar called Audiowall. Audiowall is a protection service that encrypts the mp3’s URL and blocks access to them. It will be a paid service available later this year.

    Audiowall is still in alpha right now, so thanks again for your work!

    Chad.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Audiobar] Disable Download Button’ is closed to new replies.
Skip to toolbar