Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- insert this conditional block at top of file after the define and load_plugin lines ~line 20
- if($wpdb->prefix == 'wp_1_'){
- $db_prefix = $wpmuBaseTablePrefix;
- }else {
- $db_prefix = $wpdb->prefix;
- }
- copy and paste this block over existing one taking care to include last } before the next function begins
- function cp_getAllPoints($amt=0,$filter_users=array(),$start=0){
- global $wpdb, $db_prefix;
- if($amt>0){ $limit = ' LIMIT ' . $start.','.$amt; }
- if (count($filter_users)>0){
- $extraquery = ' WHERE '.$db_prefix.'users.user_login != \'';
- $extraquery .= implode("' AND ".$db_prefix."users.user_login != '",$filter_users);
- $extraquery .= '\' ';
- }
- $array = $wpdb->get_results('SELECT '.$db_prefix.'users.id, '.$db_prefix.'users.user_login, '.$db_prefix.'users.display_name, '.$db_prefix.'usermeta.meta_value
- FROM `'.$db_prefix.'users`
- LEFT JOIN `'.$db_prefix.'usermeta` ON '.$db_prefix.'users.id = '.$db_prefix.'usermeta.user_id
- AND '.$db_prefix.'usermeta.meta_key=\''.POINTS.'\''.$extraquery.'
- ORDER BY '.$db_prefix.'usermeta.meta_value+0 DESC'
- . $limit . ';'
- ,ARRAY_A);
- return $array;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement