/** * Sends the donating user out to PayPal to make their donation. * * @author Alex Andrews <*****@*****.**> * @return void */ function ribcage_donate() { global $paypal; global $artist, $release; $paypal->add_field('business', get_option('ribcage_paypal_email')); $paypal->add_field('charset', 'utf-8'); $paypal->add_field('return', get_option('home') . '/download/' . release_slug(FALSE) . '/back/'); $paypal->add_field('cancel_return', get_option('home') . '/download/' . release_slug(FALSE)); $paypal->add_field('notify_url', get_option('home') . '/donate/ipn'); $paypal->add_field('item_name', release_title(FALSE) . ' Download Donation'); $paypal->add_field('item_number', release_cat_no(FALSE)); $paypal->add_field('custom', release_id(FALSE)); $paypal->add_field('quantity', '1'); $paypal->add_field('currency_code', 'GBP'); $paypal->submit_paypal_post(); // submit the fields to paypal }
echo home_url(); ?> /artists/<?php artist_slug(); ?> /<?php release_slug(); ?> ">More Information</a> - <a href="<?php release_player_link(); ?> ">Listen Now</a> - <a href="<?php echo home_url(); ?> /download/<?php release_slug(); ?> /">Free Download</a><?php if (release_physical()) { ?> - <a href="<?php echo home_url(); ?> /buy/<?php release_product_id(); ?> ">Buy</a><?php } ?> </p> <p><em>This release is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.</p></em>]]></content:encoded>
/** * Displays a form with all the variables of a particular release. * Note, doesn't display tracks, that is done by ribcage_tracks_form. * * @return void */ function ribcage_release_form() { global $artists, $tracks, $artist, $track, $release; ?> <form action="<?php echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']); ?> &ribcage_action=add_release" method="post" id="ribcage_add_release" name="add_release"> <table class="form-table"> <tr valign="top"> <th scope="row"><label for="release_artist">Release Artist</label></th> <td> <?php ribcage_artists_dropdown('release_artist', $release['release_artist']); ?> </td> </tr> <tr valign="top"> <th scope="row"><label for="release_title">Release Name</label></th> <td> <input type="text" style="width:320px;" class="regular-text code" value="<?php release_title(); ?> " name="release_title" id="release_title" maxlength="200" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="release_title">Release Slug</label></th> <td> <input type="text" style="width:320px;" class="regular-text code" value="<?php release_slug(); ?> " name="release_slug" id="release_slug" maxlength="200" /><span class="description">The URL you want for the release after the artist name, for example <a href="<?php echo home_url(); ?> /artist_name/release_slug</span> </td> </tr> <tr valign="top"> <th scope="row"><label for="release_title">Release Date</label></th> <td> <input type="text" style="width:320px;" class="regular-text code" value="<?php echo $release['release_date']; ?> " name="release_date" id="release_date" maxlength="200" /><span class="description">When is the record going to come out?</span> </td> </tr> <tr valign="top"> <th scope="row"><label for="release_id">Catalogue Number</label></th> <td> <?php echo get_option('ribcage_mark'); ?> <input type="text" style="width:30px;" class="regular-text code" value="<?php echo $release['release_id']; ?> " name="release_id" id="release_id" maxlength="10" /><span class="description">This will be padded to be three digits</span> </td> </tr> <tr valign="top"> <th scope="row"><label for="release_tracks_no">Number Of Tracks</label></th> <td> <input type="text" style="width:30px;" class="regular-text code" value="<?php echo $release['release_tracks_no']; ?> " name="release_tracks_no" id="release_tracks_no" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="release_time">Length of Release</label></th> <td> <input type="text" style="width:70px;" class="regular-text code" value="<?php echo $release['release_time']; ?> " name="release_time" id="time" /><span class="description">Length of release in hh:mm:ss</span> </td> </tr> <tr valign="top"> <th scope="row"><label for="release_physical">Physical Release</label></th> <td> <select name="release_physical" id="release_physical"> <?php if (isset($release['release_physical'])) { ?> <option selected value ="<?php echo $release['release_physical']; ?> "><?php if ($release['release_physical'] == 1) { echo 'Yes'; } else { echo 'No'; } ?> </option> <option value="<?php if ($release['release_physical'] == 1) { echo '0'; } else { echo '1'; } ?> "><?php if ($release['release_physical'] == 1) { echo 'No'; } else { echo 'Yes'; } ?> </option> <?php } ?> <option value ="0">No</option> <option value = "1">Yes</option> </select> <span class="description">Is there a physical version of this release you are intending to sell?</span> </td> </tr> <tr valign="top"> <th scope="row"><label for="allow_downloads">Allow Downloads?</label></th> <td> <select name="allow_download" id="allow_downloads"> <option selected value="1">Yes</option> <option value="0">No</option> </select> </td> </tr> <tr valign="top"> <th scope="row"><label for="allow_torrents">Allow Downloads By Torrent?</label></th> <td> <select name="allow_torrent" id="allow_torrents"> <option selected value="1">Yes</option> <option value="0">No</option> </select> </td> </tr> <tr valign="top"> <th scope="row"><label for="release_blurb_short">Short Description Of Release</label></th> <td><textarea name="release_blurb_short" id="release_blurb_short" rows="5" cols="80"></textarea> </td> </tr> <tr valign="top"> <th scope="row"><label for="release_blurb_long">Long Description Of Release</label></th> <td><textarea name="release_blurb_long" id="release_blurb_long" rows="15" cols="80"></textarea> </td> </tr> </table> <p class="submit"> <input type="submit" name="Submit" class="button-primary" value="Next" /> </p> </form> <?php }
/** * Displays recent releases widget. */ public function widget($args, $instance) { global $releases, $release, $artist; extract($args); $releases = list_recent_releases_blurb('16'); $artists = list_artists_blurb(); ?> <?php echo $before_widget; ?> <?php echo $before_title . 'Recent Releases' . $after_title; ?> <div class="textwidget" align="left"> <?php while (have_releases()) { the_release(); ?> <?php $artist = get_artist($release['release_artist']); ?> <div class="artist_slug"> <a class="slug" href="<?php echo home_url(); ?> /artists/<?php artist_slug(); ?> /<?php release_slug(); ?> "><img src="<?php release_cover_tiny(); ?> " alt="<?php release_title(); ?> " /></a> <div class="artist_slug_info"> <ul class="artist_slug_main"> <li class="artist"><a href="<?php echo home_url(); ?> /artists/<?php artist_slug(); ?> /"><?php artist_name(); ?> </a><h2><a href="<?php echo home_url(); ?> /artists/<?php artist_slug(); ?> /<?php release_slug(); ?> "><?php release_title(); ?> </a></h2></li> </ul> <ul class="artist_slug_meta"> <li class="more"><a href="<?php echo home_url(); ?> /artists/<?php artist_slug(); ?> /<?php release_slug(); ?> ">More</a></li> <li class="listen"><a href="javascript:popUp('<?php release_player_link(); ?> ')">Listen</a></li> <?php if (release_physical()) { ?> <li class="download"><a href="<?php echo home_url(); ?> /download/<?php release_slug(); ?> /">Free Download</a></li> <li class="last buy"><a href="<?php echo home_url(); ?> /buy/<?php release_product_id(); ?> ">Buy</a></li> <?php } else { ?> <li class="last download"><a href="<?php echo home_url(); ?> /download/<?php release_slug(); ?> /">Free Download</a></li> <?php } ?> </ul> </div> <!-- end div.artist_slug_info --> <div class="clear"></div> </div> <!-- end div.artist_slug --> <?php } ?> <div class="clear"></div> <p class="more_link"><a href="<?php echo home_url(); ?> /releases/">more releases ›</a></p> </div> <?php echo $after_widget; ?> <?php }
<?php if (have_releases()) { ?> <?php if (!is_artist_page()) { ?> <h2>Releases</h2><?php } ?> <?php while (have_releases()) { the_release(); ?> <div> <h3><a href="<?php get_option('siteurl') . '/artists/' . $artist['artist_slug'] . release_slug(); ?> "><?php release_title(); ?> </a></h3> </div> <?php } ?> <?php } ?> </div> </div> <?php
<?php header('Content-Type: application/xspf+xml'); header("Content-disposition: attachment; filename=" . release_slug(1) . ".m3u" . ";"); while (have_tracks()) { the_track(); track_stream(); echo "\n"; }
/** * Outputs a number of recent albums in an unordered list of various kinds. * * @author Alex Andrews <*****@*****.**> * @param int $amount The number of recent albums you want to output. * @param string $mode Different formats: 'list' simple list, 'covers' list of covers, similar to the sidebar widget. * @param bool $nav_bar Displays a navigation bar for each release. * @param string $css An optional css marker to put in the style of each element. */ function ribcage_albums($amount = 5, $mode = 'list', $nav_bar = TRUE, $css = NULL) { global $releases, $release; global $artist; if ($releases == NULL) { $releases = list_recent_releases_blurb($amount); } ?> <ul class="ribcage albums<?php if (isset($css)) { print " {$css}"; } ?> "> <?php while (have_releases()) { the_release(); ?> <?php $artist = get_artist($release['release_artist']); ?> <li class="ribcage albums<?php if (isset($css)) { print " {$css}"; } ?> <?php release_slug(); ?> "> <ul class="ribcage albums<?php if (isset($css)) { print " {$css}"; } ?> <?php release_slug(); ?> "> <?php if ($mode == 'covers') { ?> <li class="album_cover"><a class="ribcage albums album_cover" href="<a href="<?php echo home_url(); ?> /artists/<?php artist_slug(); ?> /<?php release_slug(); ?> "><img src="<?php release_cover_tiny(); ?> " alt="<?php release_title(); ?> " /></a></li> <?php } ?> <li class="artist"><a href="<?php echo home_url(); ?> /artists/<?php artist_slug(); ?> /"><?php artist_name(); ?> </a></li> <li class="title"><a href="<?php echo home_url(); ?> /artists/<?php artist_slug(); ?> /<?php release_slug(); ?> "><?php release_title(); ?> </a></li> <?php if ($nav_bar) { ?> <li class="nav"> <ul class="nav"> <li class="more"><a href="<?php echo home_url(); ?> /artists/<?php artist_slug(); ?> /<?php release_slug(); ?> ">More</a></li> <li class="listen"><a href="javascript:popUp('<?php release_player_link(); ?> ')">Listen</a></li> <?php if (release_physical()) { ?> <li class="download"><a href="<?php echo home_url(); ?> /download/<?php release_slug(); ?> /">Download</a></li> <li class="last buy"><a href="<?php echo home_url(); ?> /buy/<?php release_product_id(); ?> ">Buy</a></li> <?php } else { ?> <li class="last download"><a href="<?php echo home_url(); ?> /download/<?php release_slug(); ?> /">Download</a></li> <?php } ?> </ul> </li> <?php } ?> </ul> </li> <?php } ?> </ul> <?php }
<?php if (have_releases()) { ?> <?php if (!is_artist_page()) { ?> <h2>Releases</h2><?php } ?> <?php while (have_releases()) { the_release(); ?> <div> <h3><a href="<?php get_option('home') . '/artists/' . $artist['artist_slug'] . release_slug(); ?> "><?php release_title(); ?> </a></h3> </div> <?php } ?> <?php } ?> </div> </div> <?php
/** * Adds a widget for recent releases, the quantity of which is defined by an option. * * @author Alexander Andrews **/ function recent_releases($args) { global $releases, $release, $artist; extract($args); $releases = list_recent_releases_blurb('5'); $artists = list_artists_blurb(); ?> <?php echo $before_widget; ?> <?php echo $before_title . 'Recent Releases' . $after_title; ?> <div class="textwidget" align="left"> <?php while (have_releases()) { the_release(); ?> <?php $artist = get_artist($release['release_artist']); ?> <div style="margin-bottom:25px;font-size:12px;"><a href="<?php echo get_option('siteurl'); ?> /artists/<?php artist_slug(); ?> /<?php release_slug(); ?> "><img src="<?php release_cover_tiny(); ?> " align="right" style="margin-left: 10px; border: 1px solid #000;" height="65px" width="65px" alt="<?php release_title(); ?> " /></a> <a href="<?php echo get_option('siteurl'); ?> /artists/<?php artist_slug(); ?> /" style="font-size:12px;"><?php artist_name(); ?> </a> - <a href="<?php echo get_option('siteurl'); ?> /artists/<?php artist_slug(); ?> /<?php release_slug(); ?> " style="font-size:12px;"><?php release_title(); ?> </a><br /> <div style="font-size:9px;"> <a href="<?php echo get_option('siteurl'); ?> /artists/<?php artist_slug(); ?> /<?php release_slug(); ?> " style="font-size:11px;color:black;">More</a> - <a href="javascript:popUp('<?php release_player_link(); ?> ')" style="font-size:11px;color:black;">Listen</a> - <a href="<?php echo get_option('siteurl'); ?> /download/<?php release_slug(); ?> /" style="font-size:11px;color:black;">Download</a><?php if (release_physical()) { ?> - <a href="<?php get_option('siteurl'); ?> /buy/<?php release_product_id(); ?> " style="font-size:11px;color:black;">Buy</a><?php } ?> </div> </div> <?php } ?> <p><a href="<?php echo get_option('siteurl'); ?> /releases/">More Releases...</a></p> </div> <?php echo $after_widget; ?> <?php }