Exemplo n.º 1
0
 function widget($args, $instance)
 {
     global $gdsr, $userdata;
     if (is_single() || is_page()) {
         extract($args, EXTR_SKIP);
         if ($instance["display"] == "hide" || $instance["display"] == "users" && $userdata->ID == 0 || $instance["display"] == "visitors" && $userdata->ID > 0) {
             return;
         }
         echo $before_widget . $before_title . $instance['title'] . $after_title;
         echo GDSRRenderT2::render_wcr($instance);
         echo $after_widget;
     }
 }
Exemplo n.º 2
0
/**
 * Renders comments rating widget element based on the $widget settings array
 *
 * @param array $widget settings to use for rendering
 * @param bool $echo echo results or return it as a string
 * @return string html with rendered contents
 */
function wp_gdsr_render_comments_rating_widget($widget = array(), $echo = true)
{
    if ($echo) {
        echo GDSRRenderT2::render_wcr($widget);
    } else {
        return GDSRRenderT2::render_wcr($widget);
    }
}
Exemplo n.º 3
0
/**
 * Renders comments rating widget element based on the $widget settings array
 *
 * @param array $widget settings to use for rendering
 * @param bool $echo echo results or return it as a string
 * @return string html with rendered contents
 */
function gdsr_render_comments_rating_widget($widget = array(), $echo = true)
{
    global $gdsr;
    $widget = wp_parse_args((array) $widget, $gdsr->default_widget_comments);
    if ($echo) {
        echo GDSRRenderT2::render_wcr($widget);
    } else {
        return GDSRRenderT2::render_wcr($widget);
    }
}
 function widget_comments_display($args, $widget_args = 1)
 {
     extract($args);
     global $gdsr, $userdata;
     if (is_single() || is_page()) {
         if (is_numeric($widget_args)) {
             $widget_args = array('number' => $widget_args);
         }
         $widget_args = wp_parse_args($widget_args, array('number' => -1));
         extract($widget_args, EXTR_SKIP);
         $options_all = get_option('widget_gdstarrating_comments');
         if (!isset($options_all[$number])) {
             return;
         }
         $this->w = $options_all[$number];
         if ($this->w["display"] == "hide" || $this->w["display"] == "users" && $userdata->ID == 0 || $this->w["display"] == "visitors" && $userdata->ID > 0) {
             return;
         }
         echo $before_widget . $before_title . $this->w['title'] . $after_title;
         echo GDSRRenderT2::render_wcr($this->w);
         echo $after_widget;
     }
 }