示例#1
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;
 }
 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;
 }