Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

r-a-y

By: a guest on May 25th, 2010  |  syntax: PHP  |  size: 0.83 KB  |  views: 100  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function cp_topPointsDisplay($count = 10, $return = 0){
  2.         global $wpdb;
  3.         $options = get_option('cp_topPointsWidget');
  4.         if(!is_array($options['cp_topPointsWidget_ufilter'])){$options['cp_topPointsWidget_ufilter']=array();}
  5.         $arr = cp_getAllPoints($count, $options['cp_topPointsWidget_ufilter']);
  6.         $i=0;
  7.         $uniqid=uniqid();
  8.         foreach ($arr as $row => $data) {
  9.                 if($data['user_login']!=''){
  10.                         $id = $wpdb->get_var("SELECT `ID` FROM `".$wpdb->users."` WHERE `user_login` = '".$data['user_login']."' LIMIT 1");
  11.                         $html .= '<li><a href="'.PLUGIN_DIR.'cp_about.php?u='.$id.'&width=500&height=200" title="CubePoints - '.__('About','cp').'" class="thickbox">'.$data['user_login'].' ('.cp_formatPoints((int) $data['meta_value']).')</a></li>';
  12.                 }
  13.         }
  14.         $html = '<ul>'.$html.'</ul>';
  15.         if($return==0){echo $html;}
  16.         else { return $html; }
  17.                
  18. }