/** * Manages artists - adds, deletes, edits. * * @author Alex Andrews <*****@*****.**> * @return void **/ function ribcage_manage_artists() { global $artists; global $artist; $index = false; // If we aren't on an artist page then we are on the index page. if (isset($_REQUEST['artist'])) { $artist_id = (int) $_REQUEST['artist']; } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'add_artist') { $index = false; } else { $index = true; } register_column_headers('ribcage-manage-artist', array('cb' => '<input type="checkbox" />', 'artist' => 'Artist')); if (isset($_REQUEST['ribcage_action'])) { global $wpdb; // Refactor, this is a terrible place for this to do this. if ($_REQUEST['ribcage_action'] !== 'add') { check_admin_referer('manage_artists'); } else { check_admin_referer('add_artist'); } unset($_POST['_wpnonce']); unset($_POST['_wp_http_referer']); unset($_POST['Submit']); //split apart associative array into different parts to prepare for implodes $post_keys = array_keys($_POST); $post_vals = array_values($_POST); //construct field name list and vals to post $string_keys = implode($post_keys, ","); $string_vals = "'" . implode($post_vals, "','") . "'"; $wpdb->show_errors(); switch ($_REQUEST['ribcage_action']) { case 'edit': $sql = "UPDATE " . $wpdb->prefix . "ribcage_artists\n\t\t\t\t\t\tSET "; $i = 0; foreach ($post_keys as $field) { $sql .= $field . "='" . $post_vals[$i] . "', "; $i++; } $sql .= " artist_id = " . $artist_id . " \n\t\t\t\t\t\tWHERE artist_id = " . $artist_id; $results = $wpdb->query($sql); $wpdb->hide_errors(); $artist = get_artist($artist_id); $message = 'updated'; break; case 'add': $sql = "INSERT INTO " . $wpdb->prefix . "ribcage_artists\n\t\t\t\t\t\t({$string_keys})\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t({$string_vals})"; $results = $wpdb->query($sql); $wpdb->hide_errors(); $artist = get_artist_by_slug($_POST['artist_slug']); $message = 'added'; break; case 'delete': $del_artist = get_artistname_by_id($_REQUEST['artist']); delete_artist($_REQUEST['artist']); $message = "{$del_artist} deleted"; $index = 1; break; } echo '<div id="message" class="updated fade"><p><strong>Artist ' . $message . '.</strong></p></div>'; } if (!$index) { if (isset($_REQUEST['artist'])) { $artist = get_artist($_REQUEST['artist']); } ?> <div class="wrap"> <div id="icon-options-general" class="icon32"><br /></div> <?php if ($_REQUEST['page'] == 'add_artist') { ?> <h2>Add Artist</h2> <form action="<?php echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']); ?> &ribcage_action=add" method="post" id="ribcage_edit_artist" name="edit_artist"> <?php wp_nonce_field('add_artist'); ?> <?php } ?> <?php if (isset($_REQUEST['artist'])) { ?> <h2>Managing <?php artist_name(); ?> </h2> <form action="<?php echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']); ?> &ribcage_action=edit" method="post" id="ribcage_edit_artist" name="edit_artist"> <?php wp_nonce_field('manage_artists'); ?> <?php } ?> <table class="form-table"> <tr valign="top"> <th scope="row"><label for="artist_name">Name</label></th> <td> <input type="text" value="<?php artist_name(); ?> " name="artist_name" id="artist_name" class="regular-text"/> </td> </tr> <tr valign="top"> <th scope="row">Sort Name</th> <td> <input type="text" value="<?php artist_name_sort(); ?> " name="artist_name_sort" id="artist_name_sort" class="regular-text" /> <span class="description">The name of the artist to be alphabetized. For example, 'Butterfly, The'.</span> </td> </tr> <tr valign="top"> <th scope="row">Artist Slug</th> <td> <input type="text" style="width:320px;" class="regular-text code" value="<?php artist_slug(); ?> " name="artist_slug" id="artist_slug" /><span class="description">The URL you want for the artist - for example <a href="<?php echo home_url(); ?> /artists/artist_slug</span> </td> </tr> <tr valign="top"> <th scope="row">Signup Date</th> <td> <input type="text" style="width:100px;" class="regular-text code" value="<?php echo $artist['artist_signed']; ?> " name="artist_signed" id="artist_signed" maxlength="50" /><span class="description">The date the artist signed for your label</span> </td> </tr> <tr valign="top"> <th scope="row">Creative Commons license</th> <td> <?php echo ribcage_cc_dropdown($artist_license_val); ?> </td> </tr> <tr valign="top"> <th scope="row">Artist's Music Brainz ID</th> <td> <input type="text" style="width:320px;" class="regular-text code" value="<?php artist_musicbrainz(); ?> " name="artist_mbid" id="artist_mbid" maxlength="50" /> </td> </tr> <tr valign="top"> <th scope="row">Website URL</th> <td> <input type="text" style="width:320px;" class="regular-text code" value="<?php artist_website_link(); ?> " name="artist_link_website" id="artist_link_website" maxlength="200" /> </td> </tr> <tr valign="top"> <th scope="row">MySpace URL</th> <td> <input type="text" style="width:320px;" class="regular-text code" value="<?php artist_myspace_link(); ?> " name="artist_link_myspace" id="artist_link_myspace" maxlength="200" /> </td> </tr> <tr valign="top"> <th scope="row">Facebook URL</th> <td> <input type="text" style="width:320px;" class="regular-text code" value="<?php artist_facebook_link(); ?> " name="artist_link_facebook" id="artist_link_facebook" maxlength="200" /> </td> </tr> <tr valign="top"> <th scope="row">Artist Biography</th> <td> <textarea rows="5" cols="50" name="artist_bio" id="artist_bio" class="regular-text"><?php echo $artist['artist_bio']; ?> </textarea> </td> </tr> <tr valign="top"> <th scope="row">Short One Paragraph Description of Artist</th> <td> <textarea rows="5" cols="50" name="artist_blurb_tiny" id="artist_blurb_tiny" class="regular-text"><?php echo $artist['artist_blurb_tiny']; ?> </textarea> </td> </tr> <tr valign="top"> <th scope="row">Artist Picture 1</th> <td> <input type="text" style="width:320px;" class="regular-text code" value="<?php artist_picture_1(); ?> " name="artist_picture_1" id="artist_picture_1" maxlength="200" /> </td> </tr> <tr valign="top"> <th scope="row">Artist Picture 2</th> <td> <input type="text" style="width:320px;" class="regular-text code" value="<?php artist_picture_2(); ?> " name="artist_picture_2" id="artist_picture_2" maxlength="200" /> </td> </tr> <tr valign="top"> <th scope="row">Artist Picture 3</th> <td> <input type="text" style="width:320px;" class="regular-text code" value="<?php artist_picture_3(); ?> " name="artist_picture_3" id="artist_picture_3" maxlength="200" /> </td> </tr> <tr valign="top"> <th scope="row">Artist Picture HQ Zipfile URL</th> <td> <input type="text" style="width:320px;" class="regular-text code" value="<?php echo $artist_picture_zip_val; ?> " name="artist_picture_zip" id="artist_picture_zip" maxlength="200" /> </td> </tr> </table> <p class="submit"> <input type="submit" name="Submit" class="button-primary" value="Save Changes" /> </p> </form> </div> <?php } else { ?> <?php $artists = list_artists_blurb(); $alt = 0; ?> <div class="wrap"> <div id="icon-plugins" class="icon32"><br /></div> <h2>Manage Artists</h2> <form action="<?php echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']); ?> " method="post" id="ribcage_manage_artists" name="manage_artists"> <table class="widefat post fixed" cellspacing="0"> <thead> <tr> <?php print_column_headers('ribcage-manage-artist'); ?> </tr> </thead> <tfoot> <tr> <?php print_column_headers('ribcage-manage-artist', FALSE); ?> </tr> </tfoot> <tbody> <?php while (have_artists()) { the_artist(); ?> <?php $manage_link = wp_nonce_url('?page=ribcage&artist=' . artist_id(false), 'manage_artists'); $delete_link = wp_nonce_url('?page=ribcage&artist=' . artist_id(false) . '&ribcage_action=delete', 'manage_artists'); ?> <?php echo $alt % 2 ? '<tr valign="top" class="">' : '<tr valign="top" class="alternate">'; ++$alt; ?> <th scope="row" class="check-column"><input type="checkbox" name="artistcheck[]" value="2" /></th> <td class="column-name"> <strong><a class="row-title" href="?page=manage_artists&artist=<?php artist_id(); ?> " title="<?php artist_name(); ?> " ><?php artist_name(); ?> </strong></a><br /><div class="row-actions"><span class='edit'><a href="<?php echo $manage_link; ?> ">Edit</a> | </span><span class='delete'><a class='submitdelete' href='<?php echo $delete_link; ?> ' onclick="if ( confirm('You are about to delete \'<?php artist_name(); ?> \'\n \'Cancel\' to stop, \'OK\' to delete.') ) { return true;}return false;">Delete</a></span></div></td> </tr> <?php } ?> </tbody> </table> </form> </div> <?php } }
/** * Runs the whole of Ribcage. * A filter on the template that tries to find out if we are on a Ribcage page and responds accordingly. * * @author Alex Andrews <*****@*****.**> * @return void */ function ribcage_init() { global $wp_query; global $artists, $artist, $current_artist; global $releases, $release, $current_release; global $tracks, $track, $current_track; global $reviews, $review, $current_review; global $product; wp_enqueue_script('ribcage-player-popup', plugins_url('js/player.js', __FILE__), null, '3.0'); // Add our streams. add_filter('wp_head', 'ribcage_release_feeds'); if (is_ribcage_page() == 0) { return; } $GLOBALS['ribcage_page'] = TRUE; // Add our bits to the page title in the header ans elsewhere. add_filter('wp_title', 'ribcage_page_title', 10, 3); // Donate IPN from Paypal if (isset($wp_query->query_vars['ribcage_donate_ipn'])) { ribcage_donate_ipn(); } // Artist Index if (isset($wp_query->query_vars['artist_index'])) { $artists = list_artists_blurb(); $artist = $artists[$current_artist]; $wp_query->query_vars['pagename'] = 'artists'; $load = ribcage_load_template('artist-index.php'); } // Individual Artist (including bio, contact et al) if (isset($wp_query->query_vars['artist_slug'])) { $artist = get_artist_by_slug($wp_query->query_vars['artist_slug']); if (is_wp_error($artist)) { ribcage_404(); } $wp_query->query_vars['pagename'] = $wp_query->query_vars['artist_slug']; if (is_artist_page()) { switch ($wp_query->query_vars['artist_page']) { case 'press': $releases = list_artist_releases($artist['artist_id'], TRUE); $load = ribcage_load_template('press.php'); break; case 'bio': $load = ribcage_load_template('bio.php'); break; case 'feed': $releases = list_artist_releases($artist['artist_id']); $load = ribcage_load_template('feeds/artist-rss2.php'); break; default: $release = get_release_by_slug($wp_query->query_vars['artist_page']); if (is_wp_error($release)) { ribcage_404(); } $tracks = $release['release_tracks']; $reviews = $release['release_reviews']; $load = ribcage_load_template('release.php'); } } else { $releases = list_artist_releases($artist['artist_id']); $load = ribcage_load_template('artist.php'); } } // Releases Index if (isset($wp_query->query_vars['release_index']) or isset($wp_query->query_vars['release_feed'])) { $releases = list_recent_releases_blurb(); $artists = list_artists_blurb(); $wp_query->query_vars['pagename'] = 'releases'; if (isset($wp_query->query_vars['release_feed'])) { $load = ribcage_load_template('feeds/release-rss2.php'); } else { $load = ribcage_load_template('release-index.php'); } } // Downloads if (isset($wp_query->query_vars['ribcage_download'])) { // Download whole release. if (isset($wp_query->query_vars['release_slug']) && isset($wp_query->query_vars['format'])) { // Re-direct them to donate at Paypal if ($wp_query->query_vars['format'] == 'donate') { $release = get_release_by_slug($wp_query->query_vars['release_slug'], FALSE, FALSE); if (is_wp_error($release)) { ribcage_404(); } $artist = get_artist($release['release_artist']); if (is_wp_error($artist)) { ribcage_404(); } ribcage_donate(); } else { if ($wp_query->query_vars['format'] == 'back') { ribcage_donate_download_thanks(); } else { if ($wp_query->query_vars['format'] == 'skip') { $release = get_release_by_slug($wp_query->query_vars['release_slug'], FALSE, FALSE); if (is_wp_error($release)) { ribcage_404(); } $artist = get_artist($release['release_artist']); if (is_wp_error($artist)) { ribcage_404(); } $load = ribcage_load_template('download.php'); } else { $release = get_release_by_slug($wp_query->query_vars['release_slug'], FALSE, FALSE); if (is_wp_error($release)) { ribcage_404(); } $artist = get_artist($release['release_artist']); if (is_wp_error($artist)) { ribcage_404(); } $load = ribcage_load_template('post-download.php'); } } } } else { if (isset($wp_query->query_vars['track_slug'])) { $load = download_track($wp_query->query_vars['track_slug'], $wp_query->query_vars['format']); } else { if (isset($wp_query->query_vars['release_slug'])) { $release = get_release_by_slug($wp_query->query_vars['release_slug'], FALSE, FALSE); if (is_wp_error($release)) { ribcage_404(); } $artist = get_artist($release['release_artist']); if (is_wp_error($artist)) { ribcage_404(); } // Special case for Matthew Jenning's Christmas Koto if ($release["release_slug"] === 'christmas-koto') { $load = ribcage_load_template('koto-nag.php'); die; } // If we haven't seen the user before, then nag them about the download. if (!isset($_COOKIE["ask_donate"])) { setcookie("ask_donate", "1", time() + 3600); $load = ribcage_load_template('nag.php'); } else { if (isset($_COOKIE["ask_donate"])) { $random = rand(1, 8); if ($random == 5) { $load = ribcage_load_template('nag.php'); } else { $load = ribcage_load_template('download.php'); } } } // If the user has just got back from Paypal congratulate them on their brillance and given them // the download. Maybe lower the chance of a nag? } } } } // Streams if (isset($wp_query->query_vars['ribcage_stream'])) { // Stream whole release. if (isset($wp_query->query_vars['release_slug'])) { $load = stream_release($wp_query->query_vars['release_slug'], $wp_query->query_vars['stream_format']); } // Stream individual track. if (isset($wp_query->query_vars['track_slug'])) { $load = stream_track($wp_query->query_vars['track_slug']); } } if (isset($wp_query->query_vars['ribcage_player'])) { if ($wp_query->query_vars['release_slug'] == 'stats') { ribcage_log_play(); } else { $load = show_player($wp_query->query_vars['release_slug']); } } // Purchases if (isset($wp_query->query_vars['ribcage_buy']) && isset($wp_query->query_vars['ribcage_product_id'])) { // Lookup the item they are looking for in the database. $product = get_product($wp_query->query_vars['ribcage_product_id']); if (is_wp_error($product)) { ribcage_404(); } // Some products are associated with releases, some are not. if (isset($product['product_related_release'])) { $release = get_release($product['product_related_release']); $artist = get_artist($release['release_artist']); } // Set this so the feeds at the bottom of the page show up for the artist. $wp_query->query_vars['artist_slug'] = true; if (isset($wp_query->query_vars['ribcage_buy_mode'])) { switch ($wp_query->query_vars['ribcage_buy_mode']) { // Send them to Paypal case 'go-ww': case 'go-uk': ribcage_buy_process(); break; // They just got back from Paypal and it was a success. Thank them for it. // They just got back from Paypal and it was a success. Thank them for it. case 'thanks': $load = ribcage_load_template('thanks.php'); break; // We are recieving an IPN ping from Paypal. // We are recieving an IPN ping from Paypal. case 'ipn': ribcage_buy_ipn(); break; // They cancelled. // They cancelled. case 'cancel': echo "Cancelled"; break; } } else { $load = ribcage_load_template('buy.php'); } } // Did we get an error by the end of all this? If so let the user know. if (is_wp_error($load)) { echo $load->get_error_message(); } // Don't output anything else. die; }
/** * 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 drop down menu of all the artists. * * @param string $var_name Optional variable name which the dropdown corresponds to. For example release_artist is the default. * @param int $artist_id Optional artist to make selected. */ function ribcage_artists_dropdown($var_name = 'release_artist', $artist_id = null) { global $artists, $artist; $artists = list_artists_blurb(); $artist = $artists[$current_artist]; ?> <select name="<?php echo $var_name; ?> " id="<?php echo $var_name; ?> "> <?php while (have_artists()) { the_artist(); ?> <?php if ($artist['artist_id'] == $artist_id) { ?> <option selected value="<?php artist_id(); ?> "><?php artist_name(); ?> </option> <?php } else { ?> <option value="<?php artist_id(); ?> "><?php artist_name(); ?> </option> <?php } ?> <?php } ?> <?php }
/** * Loads a random artist into our $artist variable for use. * * @author Alex Andrews <*****@*****.**> **/ function random_artist() { global $artist; $artists = list_artists_blurb(); // An array runs from zero and count() doesn't, so we need to take one off it. $no = rand(0, count($artists) - 1); $artist = $artists[$no]; }
function ribcage_manage_artists($value = '') { if (isset($_REQUEST['artist'])) { global $wpdb; $artist_id = (int) $_REQUEST['artist']; $hidden_field_name = 'ribcage_artist_edit'; $button_name = 'Edit Artist'; if ($_POST[$hidden_field_name] == 'M') { // an artist is posted //slice off two variables at the end to prepare for implodes array_pop($_POST); // hidden var array_pop($_POST); // submit button var //split apart associative array into different parts to prepare for implodes $post_keys = array_keys($_POST); $post_vals = array_values($_POST); //construct field name list and vals to post $string_keys = implode($post_keys, ","); $string_vals = "'" . implode($post_vals, "','") . "'"; $wpdb->show_errors(); //construct query $sql = "UPDATE " . $wpdb->prefix . "ribcage_artists\n\t\t\t\tSET "; $i = 0; foreach ($post_keys as $field) { $sql .= $field . "='" . $post_vals[$i] . "', "; $i++; } $sql .= " artist_id = " . $artist_id . " \n\t\t\t\tWHERE artist_id = " . $artist_id; # echo "<pre>$sql</pre>"; exit(); $results = $wpdb->query($sql); $wpdb->hide_errors(); //display snazzy update fade thing when they are added echo <<<EOT \t\t\t<div id="message" class="updated fade"><p><strong>Artist updated.</strong></p></div> EOT; } $artist = get_artist($_REQUEST['artist']); $artist_name_val = $artist['artist_name']; $artist_name_sort_val = $artist['artist_name_sort']; $artist_slug_val = $artist['artist_slug']; $artist_mbid_val = $artist['artist_mbid']; $artist_signed_val = $artist['artist_signed']; $artist_license_val = $artist['artist_license']; $artist_bio_val = $artist['artist_bio']; $artist_picture1_val = $artist['artist_picture1']; $artist_picture2_val = $artist['artist_picture2']; $artist_picture3_val = $artist['artist_picture3']; $artist_picturezip_val = $artist['artist_picturezip']; $artist_contact_email_val = $artist['artist_contact_email']; $artist_contact_phone_val = $artist['artist_contact_phone']; $artist_blurb_tiny_val = $artist['artist_blurb_tiny']; $artist_blurb_short_val = $artist['artist_blurb_short']; $artist_link_website_val = $artist['artist_link_website']; $artist_link_myspace_val = $artist['artist_link_myspace']; $artist_link_facebook_val = $artist['artist_link_facebook']; ?> <div class="wrap"> <h2>Manage <em><?php echo $artist['artist_name']; ?> </em> (#<?php echo $artist['artist_id']; ?> )</h2> <form action="<?php echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']); ?> " method="post" id="ribcage_edit_artist" name="edit_artist"> <fieldset> <legend>Artist info</legend> <table class="optiontable"> <tr valign="top"> <th scope="row"><strong>Name: </strong></th> <td> <input type="text" style="width:320px;" class="cleardefault" value="<?php echo $artist_name_val; ?> " name="artist_name" id="artist_name" maxlength="200" /> </td> </tr> <tr valign="top"> <th scope="row"><strong>Sort Name: </strong></th> <td> <input type="text" style="width:320px;" class="cleardefault" value="<?php echo $artist_name_sort_val; ?> " name="artist_name_sort" id="artist_name_sort" /> </td> </tr> <tr valign="top"> <th scope="row"><strong>Artist Slug: </strong></th> <td> <input type="text" style="width:320px;" class="cleardefault" value="<?php echo $artist_slug_val; ?> " name="artist_slug" id="artist_slug" /> </td> </tr> <!--<tr valign="top"> <th scope="row"><strong>Starting hits: </strong></th> <td> <input type="text" style="width:100px;" class="cleardefault" value="<?php echo $artist_hits_val; ?> " name="artist_hits" id="artist_hits" maxlength="50" /> </td> </tr>--> <tr valign="top"> <th scope="row"><strong>Artist's Music Brainz ID: </strong></th> <td> <input type="text" style="width:320px;" class="cleardefault" value="<?php echo $artist_mbid_val; ?> " name="artist_mbid" id="artist_mbid" maxlength="50" /> </td> </tr> <tr valign="top"> <th scope="row"><strong>Signup Date: </strong></th> <td> <input type="text" style="width:100px;" class="cleardefault" value="<?php echo $artist_signed_val; ?> " name="artist_signed" id="artist_signed" maxlength="50" /> </td> </tr> <tr valign="top"> <th scope="row"><strong>Creative Commons license: </strong></th> <td> <?php echo ribcage_cc_dropdown($artist_license_val); ?> </td> </tr> <tr valign="top"> <th scope="row"><strong>Artist Biography: </strong></th> <td> <textarea rows="5" cols="50" name="artist_bio" id="artist_bio"><?php echo $artist_bio_val; ?> </textarea> </td> </tr> <tr valign="top"> <th scope="row"><strong>Artist Picture 1: </strong></th> <td> <input type="text" style="width:320px;" class="cleardefault" value="<?php echo $artist_picture_1_val; ?> " name="artist_picture_1" id="artist_picture_1" maxlength="200" /> </td> </tr> <tr valign="top"> <th scope="row"><strong>Artist Picture 2: </strong></th> <td> <input type="text" style="width:320px;" class="cleardefault" value="<?php echo $artist_picture_2_val; ?> " name="artist_picture_2" id="artist_picture_2" maxlength="200" /> </td> </tr> <tr valign="top"> <th scope="row"><strong>Artist Picture 3: </strong></th> <td> <input type="text" style="width:320px;" class="cleardefault" value="<?php echo $artist_picture_3_val; ?> " name="artist_picture_3" id="artist_picture_3" maxlength="200" /> </td> </tr> <tr valign="top"> <th scope="row"><strong>Artist Picture HQ Zipfile URL: </strong></th> <td> <input type="text" style="width:320px;" class="cleardefault" value="<?php echo $artist_picture_zip_val; ?> " name="artist_picture_zip" id="artist_picture_zip" maxlength="200" /> </td> </tr> <tr valign="top"> <th scope="row"><strong>Artist E-mail: </strong></th> <td> <input type="text" style="width:320px;" class="cleardefault" value="<?php echo $artist_contact_email_val; ?> " name="artist_contact_email" id="artist_contact_email" maxlength="150" /> </td> </tr> <tr valign="top"> <th scope="row"><strong>Artist Phone: </strong></th> <td> <input type="text" style="width:100px;" class="cleardefault" value="<?php echo $artist_contact_phone_val; ?> " name="artist_contact_phone" id="artist_contact_phone" maxlength="20" /> </td> </tr> <tr valign="top"> <th scope="row"><strong>One-sentence Description of Artist: </strong></th> <td> <input type="text" style="width:320px;" class="cleardefault" value="<?php echo $artist_blurb_tiny_val; ?> " name="artist_blurb_tiny" id="artist_blurb_tiny" maxlength="255" /> </td> </tr> <tr valign="top"> <th scope="row"><strong>One-paragraph Description of Artist: </strong></th> <td> <textarea rows="5" cols="50" name="artist_blurb_short" id="artist_blurb_short"><?php echo $artist_blurb_short_val; ?> </textarea> </td> </tr> <tr valign="top"> <th scope="row"><strong>Website URL: </strong></th> <td> <input type="text" style="width:320px;" class="cleardefault" value="<?php echo $artist_link_website_val; ?> " name="artist_link_website" id="artist_link_website" maxlength="200" /> </td> </tr> <tr valign="top"> <th scope="row"><strong>MySpace URL: </strong></th> <td> <input type="text" style="width:320px;" class="cleardefault" value="<?php echo $artist_link_myspace_val; ?> " name="artist_link_myspace" id="artist_link_myspace" maxlength="200" /> </td> </tr> <tr valign="top"> <th scope="row"><strong>Facebook URL: </strong></th> <td> <input type="text" style="width:320px;" class="cleardefault" value="<?php echo $artist_link_facebook_val; ?> " name="artist_link_facebook" id="artist_link_facebook" maxlength="200" /> </td> </tr> <tr> <th scope="row"></th> <td> <p class="submit"> <input type="submit" class="btn" name="save" style="padding:5px 30px 5px 30px;" value="<?php echo $button_name; ?> " /> <input type="hidden" name="<?php echo $hidden_field_name; ?> " value="M"> </p> </td> </tr> </table> </fieldset> </form> </div> <?php } else { ?> <div class="wrap"> <h2>Manage Artists</h2> <form action="<?php echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']); ?> " method="post" id="ribcage_manage_artists" name="manage_artists"> <fieldset> <legend>Here's your label's Artists. Take care of them!</legend> <table class="optiontable"> <thead> <tr valign="top"> <td>#</td> <td>Name</td> <td>Sort Name</td> <td>Picture</td> </tr> </thead> <tbody> <?php $artists = list_artists_blurb(); foreach ($artists as $artist) { ?> <tr valign="top"> <td><?php echo $artist['artist_id']; ?> </td> <td><a href="?page=manage_artists&artist=<?php echo $artist['artist_id']; ?> "> <?php echo $artist['artist_name']; ?> </a></td> <td><?php echo $artist['artist_name_sort']; ?> </td> <td><?php echo $artist['artist_thumb']; ?> </td> </tr> <?php } ?> </tbody> </table> </fieldset> </form> </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 }