/** @see WP_Widget::widget */
 function widget($args, $instance)
 {
     global $wpdb;
     global $wppa;
     global $widget_content;
     global $thumb;
     require_once dirname(__FILE__) . '/wppa-links.php';
     require_once dirname(__FILE__) . '/wppa-styles.php';
     require_once dirname(__FILE__) . '/wppa-functions.php';
     require_once dirname(__FILE__) . '/wppa-thumbnails.php';
     require_once dirname(__FILE__) . '/wppa-boxes-html.php';
     require_once dirname(__FILE__) . '/wppa-slideshow.php';
     wppa_initialize_runtime();
     $wppa['in_widget'] = 'bestof';
     $wppa['mocc']++;
     extract($args);
     $instance = wp_parse_args((array) $instance, array('title' => '', 'count' => '1', 'sortby' => 'maxratingcount', 'display' => 'photo', 'period' => 'thisweek', 'maxratings' => 'yes', 'meanrat' => 'yes', 'ratcount' => 'yes', 'linktype' => 'none'));
     $widget_title = apply_filters('widget_title', $instance['title']);
     $page = in_array($instance['linktype'], $wppa['links_no_page']) ? '' : wppa_get_the_landing_page('wppa_bestof_widget_linkpage', __a('Best Of Photos'));
     $count = $instance['count'];
     $sortby = $instance['sortby'];
     $display = $instance['display'];
     $period = $instance['period'];
     $maxratings = $instance['maxratings'];
     $meanrat = $instance['meanrat'];
     $ratcount = $instance['ratcount'];
     $linktype = $instance['linktype'];
     $size = wppa_opt('wppa_widget_width');
     //		$data 			= wppa_get_the_bestof( $count, $period, $sortby, $display );
     $lineheight = wppa_opt('wppa_fontsize_widget_thumb') * 1.5;
     $widget_content = "\n" . '<!-- WPPA+ BestOf Widget start -->';
     $widget_content .= wppa_bestof_html(array('page' => $page, 'count' => $count, 'sortby' => $sortby, 'display' => $display, 'period' => $period, 'maxratings' => $maxratings, 'meanrat' => $meanrat, 'ratcount' => $ratcount, 'linktype' => $linktype, 'size' => $size, 'lineheight' => $lineheight));
     $widget_content .= '<div style="clear:both"></div>';
     $widget_content .= "\n" . '<!-- WPPA+ BestOf Widget end -->';
     echo "\n" . $before_widget;
     if (!empty($widget_title)) {
         echo $before_title . $widget_title . $after_title;
     }
     echo $widget_content . $after_widget;
 }
Exemplo n.º 2
0
function wppa_bestof_box($args)
{
    wppa_container('open');
    wppa_out('<div' . ' id="wppa-bestof-' . wppa('mocc') . '"' . ' class="wppa-box wppa-bestof"' . ' style="' . __wcs('wppa-box') . __wcs('wppa-bestof') . '"' . '>' . wppa_bestof_html($args, false) . '<div style="clear:both; height:4px;">' . '</div>' . '</div>');
    wppa_container('close');
}
Exemplo n.º 3
0
function wppa_bestof_box($args)
{
    global $wppa;
    wppa_container('open');
    $wppa['out'] .= wppa_nltab('+') . '<div id="wppa-bestof-' . $wppa['mocc'] . '" class="wppa-box wppa-bestof" style="' . __wcs('wppa-box') . __wcs('wppa-bestof') . '">';
    $wppa['out'] .= wppa_bestof_html($args, false);
    $wppa['out'] .= wppa_nltab('-') . '<div style="clear:both; height:4px;"></div></div>';
    wppa_container('close');
}