function rkv_plugin_sidebar() { // get plugin data global $post; $slug = get_post_meta($post->ID, '_rkv_plugin_slug', true); $data = rkv_plugin_data($slug); $data = unserialize($data); $plugname = $data->name; $plugslug = $data->slug; $version = $data->version; $requires = $data->requires; $tested = $data->tested; $added = $data->added; $updated = $data->last_updated; $downloaded = $data->downloaded; $wordpress = 'http://wordpress.org/extend/plugins/' . $plugslug . '/'; $support = 'http://wordpress.org/support/plugin/' . $plugslug . '/'; // rating calculation $total_rate = $data->num_ratings; $ratings = $data->rating; $star_calc = $ratings / 100 * 92; $star_rate = '<div class="star-holder star-block"><div class="star-rating star-block" style="width:' . $star_calc . 'px">' . $ratings . '</div></div>'; $r_ratings = ceil($ratings); $w_ratings = $r_ratings / 100 * 5; echo '<div class="widget plugin-details" itemtype="http://schema.org/AggregateRating" itemscope="" itemprop="aggregateRating">'; echo '<meta content="0" itemprop="worstRating">'; echo '<meta content="' . $w_ratings . '" itemprop="ratingValue">'; echo '<meta content="5" itemprop="bestRating">'; echo '<meta content="' . $total_rate . '" itemprop="ratingCount">'; echo '<h4 class="nav-header">' . $plugname . ' Details <i class="icon icon-bookmark pull-right"></i></h4>'; echo '<table class="table table-condensed"><tbody>'; echo '<tr><td>Version</td><td>' . $version . '</td></tr>'; echo '<tr><td>Requires</td><td>' . $requires . '</td></tr>'; echo '<tr><td>Compatible</td><td>' . $tested . '</td></tr>'; echo '<tr><td>Released</td><td>' . date('m/d/Y', strtotime($added)) . '</td></tr>'; echo '<tr><td>Last Updated</td><td><span class="updated">' . date('m/d/Y', strtotime($updated)) . '</span> <small><em>(' . rkv_ago(strtotime($updated)) . ' ago)</em></small></td></tr>'; echo '<tr><td>Downloads</td><td>' . $downloaded . '</td></tr>'; echo '<tr><td>Rating</td><td>' . $star_rate . '</td></tr>'; echo '<tr><td class="noline"></td><td class="noline">' . $w_ratings . ' <small>out of</small> 5 stars</td></tr>'; echo '</tbody></table>'; echo '<p class="plugin-links row-fluid">'; echo '<a title="View on WP.org" target="_blank" class="btn btn-primary pull-left" href="' . $wordpress . '"><i class="icon-white icon-cogs"></i> View at WP.org</a>'; echo '<a title="Support Forum" target="_blank" class="btn btn-danger pull-right" href="' . $support . '"><i class="icon-white icon-wrench"></i> Support Forums</a>'; echo '</p>'; echo '<input type="hidden" id="theme-root" value="' . get_bloginfo('stylesheet_directory') . '" />'; echo '<input type="hidden" id="rating-value" value="' . $star_calc . '" />'; echo '</div>'; }
<div class="row well plugin-well"> <section id="plugin-archives" class="span12"> <!-- <div class="row-fluid well"> --> <?php if (have_posts()) { while (have_posts()) { the_post(); global $post; $slug = get_post_meta($post->ID, '_rkv_plugin_slug', true); $banner = get_post_meta($post->ID, '_rkv_plugin_img', true); $link = get_permalink($post->ID); $data = rkv_plugin_data($slug); $data = unserialize($data); // echo preprint( $data ); // plugin data $plugin_name = $data->name; $description = $data->description; echo '<div class="span4 plugin-single">'; echo '<a href="' . $link . '" title="' . $plugin_name . '"><img class="plugin-banner" src="' . $banner . '" alt="' . $plugin_name . '" title="' . $plugin_name . '"></a>'; echo '<h3><a href="' . $link . '" title="' . $plugin_name . '">' . $plugin_name . '</a></h3>'; echo '<div class="plugin-text">' . $description . '</div>'; // echo $description; echo '<p class="plugin-link"><a class="btn" title="View details of ' . $plugin_name . '" href="' . $link . '">View details »</a></p>'; echo '</div>'; } } ?>