Hallo,
ich arbeite zurzeit mit dem CubePoint-Plugin. Dieses Plugin bietet ja auch die Möglichkeit, die besten User bzw. eine Liste aller User anzuzeigen. Nun werden bei mir auch User angezeigt, welche eine Punktzahl = 0 haben, dies möchte ich gerne Verhindern... Es ist so, dass dieser Code an einer stelle verändert werden muss, nur weiss ich leider nicht an welcher :(
/** CubePoints Top Users Widget */
class cp_topUsersWidget extends WP_Widget {
// constructor
function cp_topUsersWidget() {
parent::WP_Widget('cp_topUsersWidget', 'CubePoints Top Users', array('description' => 'Use this widget to showcase the users with the most points.'));
}
// widget main
function widget($args, $instance) {
extract($args, EXTR_SKIP);
echo $before_widget;
$title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; };
//set default values
if($instance['num'] == '' || $instance['num'] == 0) { $instance['num'] =1; }
if($instance['text'] == '') { $instance['text'] = '%user% (%points%)';}
$top = cp_getAllPoints($instance['num'],get_option('cp_topfilter'));
do_action('cp_topUsersWidget_before');
echo apply_filters('cp_topUsersWidget_before','<ul>');
$line = apply_filters('cp_topUsersWidget_line','<li class="cp_topUsersWidget top_%place%" id="platz_%place%" style="%style%">%string%</li>');
$line = str_replace('%style%', $instance['style'], $line);
foreach($top as $x=>$y){
$user = get_userdata($y['id']);
$string = str_replace('%string%', '', $instance['text']);
$string = str_replace('%string%',$string,$line);
$string = apply_filters('cp_displayUserInfo',$string,$y,$x+1);
echo $string;
}
echo apply_filters('cp_topUsersWidget_after','</ul>');
do_action('cp_topUsersWidget_after');
echo $after_widget;
}
Es wäre echt supeeer, wenn mir dort jemand weiterhelfen könnte..
Lg