/** * 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 }
/artists/<?php artist_slug(); ?> /<?php release_slug(); ?> /</guid> <description><![CDATA[<?php release_blurb_short(); ?> ]]></description> <content:encoded><![CDATA[<img src="<?php release_cover_tiny(); ?> " align="right" style="margin-left: 20px; border: 1px solid #000;" alt="<?php release_title(); ?> "/><?php release_blurb_long(); ?> <p><a href="<?php echo home_url(); ?> /artists/<?php artist_slug(); ?> /<?php release_slug(); ?> ">More Information</a> - <a href="<?php release_player_link();
/** * Add a review of a specific release. * * @return void */ function ribcage_manage_reviews() { global $releases, $release, $artist, $tracks, $track; $release = get_release($_REQUEST['release'], false, true); $reviews = $release['release_reviews']; $artist['artist_name'] = get_artistname_by_id($release['release_artist']); ?> <div class="wrap"> <h2>Manage Reviews of <?php artist_name(); ?> - <?php release_title(); ?> </h2> <?php if (count($reviews) == 0) { echo "<p>No reviews yet. Why not add one now?</p>"; } else { register_column_headers('ribcage-manage-reviews', array('cb' => '<input type="checkbox" />', 'review_' => 'Reviewer')); echo "<pre>" . print_r($reviews) . "</pre>"; } ?> <h3>Add a review</h3> <table class="form-table"> <tr valign="top"> <th scope="row"><label for="review_url">Review URL</label></th> <td><input type="text" name="review_url" value="" class="regular-text code"/><span class="description">The URL of the review, if the review is online.</span> </td> </tr> <tr valign="top"> <th scope="row"><label for="review_url">Publication</label></th> <td><input type="text" name="review_url" value="" class="regular-text code"/><span class="description">The name of the publication that reviewed the release</span> </td> </tr> </table> <p class="submit"> <input type="submit" name="Submit" class="button-primary" value="Add Review" /> </p> </form> </div> <?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 }
/** * Displays a form used for editing or adding a product to database. * * @param string $error Error message from the manage_products form. * @param bool $related_to_release If true then we are passing from adding a release in general so we set the relation to this automatically * @return void */ function ribcage_edit_product_form($error = 0, $related_to_release = 0) { global $artist; global $release, $releases; global $product; if (isset($_REQUEST['product'])) { $product = get_product($_REQUEST['product']); } $releases = list_recent_releases_blurb(); if ($error) { echo '<div id="message" class="error"><p><strong>' . $error . '</strong></p></div>'; } ?> <div class="wrap"> <div id="icon-options-general" class="icon32"><br /></div> <?php if (isset($_REQUEST['product'])) { ?> <h2>Editing <?php product_name(); ?> </h2> <form action="<?php echo home_url(); ?> /wp-admin/admin.php?page=manage_products&product=<?php product_id(); ?> &ribcage_action=edited" method="post" id="ribcage_edit_artist" name="edit_artist"> <?php } else { ?> <h2>Add A Product</h2> <form action="<?php echo home_url(); ?> /wp-admin/admin.php?page=manage_products&ribcage_action=add" method="post" id="ribcage_edit_artist" name="edit_artist"> <?php } ?> <table class="form-table"> <tr valign="top"> <th scope="row"><label for="product_name">Name</label></th> <td> <input type="text" value="<?php product_name(); ?> " name="product_name" id="product_name" class="regular-text"/> </td> </tr> <tr valign="top"> <th scope="row"><label for="product_name">Price</label></th> <td> <input type="text" value="<?php echo $product['product_cost']; ?> " name="product_cost" id="product_cost" class="regular-text"/> </td> </tr> <tr valign="top"> <th scope="row"><label for="product_related_release">Related To Release</label></th> <td> <select name="product_related_release" id="product_related_release"> <option value = "">None</option> <?php while (have_releases()) { the_release(); ?> <?php $artist['artist_name'] = get_artistname_by_id($release['release_artist']); ?> <?php if ($release['release_id'] == $product['product_related_release']) { ?> <option selected value="<?php release_id(); ?> "><?php artist_name(); ?> - <?php release_title(); ?> </option> <?php } else { ?> <option value="<?php release_id(); ?> "><?php artist_name(); ?> - <?php release_title(); ?> </option> <?php } ?> <?php } ?> </select> </td> </tr> <tr valign="top"> <th scope="row"><label for="product_name">Product Description</label></th> <td> <textarea rows="10" cols="100" name="product_description" id="product_description" class="regular-text"><?php product_description(); ?> </textarea> </td> </tr> </table> <p class="submit"> <input type="submit" name="Submit" class="button-primary" value="Save Changes" /> </p> </form> </div> <?php }
/** * Creates a Twitter intent URL for tweeting about downloading a specific release. * * @author Alex Andrews <*****@*****.**> * @param bool $echo When true we echo the link to the MP3 download. * @return string The Twitter URL that pre-sets the tweet we are encouraging. */ function release_twitter_promotional_tweet($echo = true) { $artist = ''; if (artist_has_twitter()) { $artist = '@' . artist_twitter_user_name(false); } else { $artist = artist_name(false); } $release_link = release_download_short_link(false); if (!$release_link) { $release_link = release_download_link(false); } $stream_link = release_stream_short_link(false); if (!$stream_link) { $stream_link = release_soundcloud_url(false); } $tweet = urlencode('I just downloaded ' . release_title(false) . ' by ' . $artist . ' at @recordsonribs - Download now ' . $release_link . ', listen now ' . $stream_link); $url = 'https://twitter.com/intent/tweet?text=' . $tweet; if ($echo) { echo $url; } return $url; }
/** * 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 }