コード例 #1
0
function postratings_page_most_stats($content)
{
    $stats_display = get_option('stats_display');
    $stats_mostlimit = intval(get_option('stats_mostlimit'));
    if ($stats_display['rated_highest_post'] == 1) {
        $content .= '<p><strong>' . sprintf(_n('%s Highest Rated Post', '%s Highest Rated Posts', $stats_mostlimit, 'wp-postratings'), number_format_i18n($stats_mostlimit)) . '</strong></p>' . "\n";
        $content .= '<ul>' . "\n";
        $content .= get_highest_rated('post', 0, $stats_mostlimit, 0, false);
        $content .= '</ul>' . "\n";
    }
    if ($stats_display['rated_highest_page'] == 1) {
        $content .= '<p><strong>' . sprintf(_n('%s Highest Rated Page', '%s Highest Rated Pages', $stats_mostlimit, 'wp-postratings'), number_format_i18n($stats_mostlimit)) . '</strong></p>' . "\n";
        $content .= '<ul>' . "\n";
        $content .= get_highest_rated('page', 0, $stats_mostlimit, 0, false);
        $content .= '</ul>' . "\n";
    }
    if ($stats_display['rated_most_post'] == 1) {
        $content .= '<p><strong>' . sprintf(_n('%s Most Rated Post', '%s Most Rated Posts', $stats_mostlimit, 'wp-postratings'), number_format_i18n($stats_mostlimit)) . '</strong></p>' . "\n";
        $content .= '<ul>' . "\n";
        $content .= get_most_rated('post', 0, $stats_mostlimit, 0, false);
        $content .= '</ul>' . "\n";
    }
    if ($stats_display['rated_most_page'] == 1) {
        $content .= '<p><strong>' . sprintf(_n('%s Most Rated Page', '%s Most Rated Pages', $stats_mostlimit, 'wp-postratings'), number_format_i18n($stats_mostlimit)) . '</strong></p>' . "\n";
        $content .= '<ul>' . "\n";
        $content .= get_most_rated('page', 0, $stats_mostlimit, 0, false);
        $content .= '</ul>' . "\n";
    }
    return $content;
}
コード例 #2
0
 function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', esc_attr($instance['title']));
     $type = esc_attr($instance['type']);
     $mode = esc_attr($instance['mode']);
     $limit = intval($instance['limit']);
     $min_votes = intval($instance['min_votes']);
     $chars = intval($instance['chars']);
     $cat_ids = explode(',', esc_attr($instance['cat_ids']));
     $time_range = esc_attr($instance['time_range']);
     echo $before_widget . $before_title . $title . $after_title;
     echo '<ul>' . "\n";
     switch ($type) {
         case 'most_rated':
             get_most_rated($mode, $min_votes, $limit, $chars);
             break;
         case 'most_rated_category':
             get_most_rated($cat_ids, $mode, $min_votes, $limit, $chars);
             break;
         case 'most_rated_range':
             get_most_rated_range($time_range, $mode, $limit, $chars);
             break;
         case 'most_rated_range_category':
             get_most_rated_range_category($time_range, $cat_ids, $mode, $limit, $chars);
             break;
         case 'highest_rated':
             get_highest_rated($mode, $min_votes, $limit, $chars);
             break;
         case 'highest_rated_category':
             get_highest_rated_category($cat_ids, $mode, $min_votes, $limit, $chars);
             break;
         case 'highest_rated_range':
             get_highest_rated_range($time_range, $mode, $limit, $chars);
             break;
         case 'highest_rated_range_category':
             get_highest_rated_range_category($time_range, $cat_ids, $mode, $limit, $chars);
             break;
         case 'lowest_rated':
             get_lowest_rated($mode, $min_votes, $limit, $chars);
             break;
         case 'lowest_rated_category':
             get_lowest_rated_category($cat_ids, $mode, $min_votes, $limit, $chars);
             break;
         case 'lowest_rated_range':
             get_lowest_rated_range($time_range, $mode, $limit, $chars);
             break;
         case 'highest_score':
             get_highest_score($mode, $min_votes, $limit, $chars);
             break;
         case 'highest_score_category':
             get_highest_score_category($cat_ids, $mode, $min_votes, $limit, $chars);
             break;
         case 'highest_score_range':
             get_highest_score_range($time_range, $mode, $limit, $chars);
             break;
         case 'highest_score_range_category':
             get_highest_score_range_category($time_range, $cat_ids, $mode, $limit, $chars);
             break;
     }
     echo '</ul>' . "\n";
     echo $after_widget;
 }
コード例 #3
0
 function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', esc_attr($instance['title']));
     $type = esc_attr($instance['type']);
     $mode = esc_attr($instance['mode']);
     $limit = intval($instance['limit']);
     $min_votes = intval($instance['min_votes']);
     $chars = intval($instance['chars']);
     $cat_ids = explode(',', esc_attr($instance['cat_ids']));
     $time_range = esc_attr($instance['time_range']);
     echo $before_widget . $before_title . '<i class="icon-star menucolor"></i> ' . $title . $after_title;
     // Post list in widget
     wp_carousel(1);
     echo '<div style="clear: both"></div>' . "\n";
     echo '<div class="theme-skinless" style="height:300px; width:98%;  border:0px solid #eeeeee;padding:0px;margin:0px;">' . "\n";
     echo '<a href="#scroll" class="carousel_1_next"><img class="slider-left" src="/wp-content/plugins/wp-carousel/themes/premium-slider/img/arrow_left.png" alt="scroll left" /></a>' . "\n";
     echo '<ul id="carousel_1" class="jcarousel-skin-skinless" style="height:330px; width: 99%; overflow:hidden; border:0px solid #eeeeee;padding: 0px; margin: 0px;">' . "\n";
     //echo '<ul>'."\n";
     switch ($type) {
         case 'most_rated':
             get_most_rated($mode, $min_votes, $limit, $chars);
             break;
         case 'most_rated_category':
             get_most_rated($cat_ids, $mode, $min_votes, $limit, $chars);
             break;
         case 'most_rated_range':
             get_most_rated_range($time_range, $mode, $limit, $chars);
             break;
         case 'most_rated_range_category':
             get_most_rated_range_category($time_range, $cat_ids, $mode, $limit, $chars);
             break;
         case 'highest_rated':
             get_highest_rated($mode, $min_votes, $limit, $chars);
             break;
         case 'highest_rated_category':
             get_highest_rated_category($cat_ids, $mode, $min_votes, $limit, $chars);
             break;
         case 'highest_rated_range':
             get_highest_rated_range($time_range, $mode, $limit, $chars);
             break;
         case 'highest_rated_range_category':
             get_highest_rated_range_category($time_range, $cat_ids, $mode, $limit, $chars);
             break;
         case 'lowest_rated':
             get_lowest_rated($mode, $min_votes, $limit, $chars);
             break;
         case 'lowest_rated_category':
             get_lowest_rated_category($cat_ids, $mode, $min_votes, $limit, $chars);
             break;
         case 'lowest_rated_range':
             get_lowest_rated_range($time_range, $mode, $limit, $chars);
             break;
         case 'highest_score':
             get_highest_score($mode, $min_votes, $limit, $chars);
             break;
         case 'highest_score_category':
             get_highest_score_category($cat_ids, $mode, $min_votes, $limit, $chars);
             break;
         case 'highest_score_range':
             get_highest_score_range($time_range, $mode, $limit, $chars);
             break;
         case 'highest_score_range_category':
             get_highest_score_range_category($time_range, $cat_ids, $mode, $limit, $chars);
             break;
     }
     echo '</ul>';
     echo '<a href="#scroll" class="carousel_1_prev"><img class="slider-right" style="margin-bottom:-60px;" src="/wp-content/plugins/wp-carousel/themes/premium-slider/img/arrow_right.png" alt="scroll right" /></a>' . "\n";
     echo '</div>';
     //echo '</ul>'."\n";
     echo $after_widget;
 }