コード例 #1
0
/releases/</link>
	<description>Records On Ribs Release Feed</description>
	<pubDate><?php 
echo mysql2date('D, d M Y H:i:s +0000', $releases[0]['release_date'], false);
?>
</pubDate>
	<generator>http://wordpress.org/?v=<?php 
bloginfo_rss('version');
?>
</generator>
	<language><?php 
echo get_option('rss_language');
?>
</language>
	<?php 
while (have_releases()) {
    the_release();
    ?>
	<?php 
    $artist = get_artist($release['release_artist']);
    ?>
	<item>
		<title><?php 
    artist_name();
    ?>
 - <?php 
    release_title();
    ?>
</title>
		<link><a href="<?php 
    echo home_url();
コード例 #2
0
ファイル: releases.php プロジェクト: recordsonribs/ribcage
/**
 * Manage releases panel - sends you out to add releases, remove releases, add reviews (and eventually add tracks).
 *
 * @return void
 */
function ribcage_manage_releases()
{
    global $release, $releases, $artist, $tracks;
    $total_downloads = 0;
    $nonce = wp_create_nonce('ribcage_manage_releases');
    if (isset($_REQUEST['release'])) {
        switch ($_REQUEST['ribcage_action']) {
            case 'stats':
                ribcage_release_stats();
                return;
                break;
            case 'edit':
                check_admin_referer('ribcage_manage_releases');
                ?>
			<div class="wrap">
				<div id="icon-options-general" class="icon32"><br /></div>
				<?php 
                $release = get_release($_REQUEST['release']);
                $artist = get_artist($release['release_artist']);
                $tracks = $release['release_tracks'];
                ?>
				<h2>Editing <?php 
                release_title();
                ?>
</h2>
				<?php 
                ribcage_release_form();
                ?>
				<?php 
                ribcage_tracks_form();
                ?>
			</div> <?php 
                return;
                break;
            case 'reviews':
                check_admin_referer('ribcage_manage_releases');
                ribcage_manage_reviews();
                return;
                break;
            case 'delete':
                check_admin_referer('ribcage_manage_releases');
                delete_release($_REQUEST['release']);
                $message = " deleted";
                break;
        }
    }
    if (isset($message)) {
        echo '<div id="message" class="updated fade"><p><strong>Release ' . $message . '.</strong></p></div>';
    }
    register_column_headers('ribcage-manage-releases', array('cb' => '<input type="checkbox" />', 'release_image' => '', 'release_title' => 'Release', 'release_date' => 'Release Date', 'local_downloads' => 'Local Downloads', 'remote_downloads' => 'Remote Downloads', 'total_downloads' => 'Total Downloads'));
    $releases = list_recent_releases_blurb();
    ?>
	<div class="wrap">
			<div id="icon-options-general" class="icon32"><br /></div>
			<h2>Manage Releases</h2>
			<form action="<?php 
    echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']);
    ?>
" method="post" id="ribcage_edit_artist" name="edit_artist">
				<table class="widefat post fixed" cellspacing="0">
						<thead>
						<tr>
						<?php 
    print_column_headers('ribcage-manage-releases');
    ?>
			
						</tr>
						</thead>
						<tfoot>
						<tr>			
						<?php 
    print_column_headers('ribcage-manage-releases', FALSE);
    ?>
	
						</tr>
						</tfoot>            
						<tbody>
							<?php 
    while (have_releases()) {
        the_release();
        ?>
							<?php 
        $artist = get_artist($release['release_artist']);
        ?>
							<?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-icon"><img src="<?php 
        release_cover_tiny();
        ?>
" height="65px" width="65px" alt="<?php 
        release_title();
        ?>
" /></td>
                                                        <td class="column-name"><strong><a class="row-title" href="?page=manage_releases&release=<?php 
        artist_id();
        ?>
" title="<?php 
        artist_name();
        ?>
" ><?php 
        artist_name();
        ?>
 - <?php 
        release_title();
        ?>
</strong></a><br /><div class="row-actions"><span class='stats'><a href="?page=manage_releases&release=<?php 
        release_id();
        ?>
&amp;ribcage_action=stats&amp;_wpnonce=<?php 
        echo $nonce;
        ?>
">Stats</a></span> | <span class='edit'><a href="?page=manage_releases&release=<?php 
        release_id();
        ?>
&amp;ribcage_action=edit&amp;_wpnonce=<?php 
        echo $nonce;
        ?>
">Edit</a></span> | <span class='reviews'><a href="?page=manage_releases&release=<?php 
        release_id();
        ?>
&amp;ribcage_action=reviews&amp;_wpnonce=<?php 
        echo $nonce;
        ?>
">Reviews</a></span> | <span class='delete'><a class='submitdelete' href='?page=manage_releases&release=<?php 
        release_id();
        ?>
&amp;ribcage_action=delete&amp;_wpnonce=<?php 
        echo $nonce;
        ?>
' onclick="if ( confirm('You are about to delete \'<?php 
        artist_name();
        ?>
 - <?php 
        release_title();
        ?>
\'\n  \'Cancel\' to stop, \'OK\' to delete.') ) { return true;}return false;">Delete</a></span></div></td>
							<td class="column-name"><?php 
        echo date('j F Y', strtotime($release['release_date']));
        ?>
</td>
							<td class="column-name"><?php 
        release_downloads();
        ?>
</td>
							<td class="column-name"><?php 
        //remote_downloads();
        ?>
</td>
							<td class="column-name"><?php 
        //echo number_format(remote_downloads(FALSE)+release_downloads(FALSE)); $total_downloads = $total_downloads + remote_downloads(FALSE)+release_downloads(FALSE); update_option('ribcage_total_downloads', $total_downloads);
        ?>
</td>
							</tr>
							<?php 
    }
    ?>
						</tbody>
					</table>
			</form>
			<p>Served <?php 
    echo number_format($total_downloads);
    ?>
 downloads so far.</p>
	</div>
	<?php 
    update_option('ribcage_total_downloads', $total_downloads);
}
コード例 #3
0
ファイル: widget.php プロジェクト: recordsonribs/ribcage
    /**
     * 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 &rsaquo;</a></p>
			</div>
	        <?php 
        echo $after_widget;
        ?>
	<?php 
    }
コード例 #4
0
ファイル: buy.php プロジェクト: recordsonribs/ribcage
/**
 * 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 
}
コード例 #5
0
ファイル: template.php プロジェクト: recordsonribs/ribcage
/**
 * 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 
}
コード例 #6
0
ファイル: widget.php プロジェクト: ericaustinlee/ribcage
    /**
     * 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 
    }