WordPress.org

Ready to get started?Download WordPress

Forums

Audiobar
Disable Download Button (2 posts)

  1. GioJovan
    Member
    Posted 2 years ago #

    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/

  2. kalatix
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags