prefix("users_points_log")." l LEFT JOIN ".$MAIN_DB -> prefix("users")." u USING(u_id) WHERE u_active='1' AND g_id=2 AND l.time>$time AND points>0 GROUP BY u_id ORDER BY SUM(points) DESC LIMIT 0,3"; $u = new u_query('u'); $u -> set_sql($sql); $u -> get(false,false); $rows = array(); while( $row = $u -> row() ){ if ( $row['points']<=0 ){ continue; } $row['u_interests']= sys_in_html($row['u_interests'] ); $rows[]= arr_to_obj($row); } $t = new PHPTAL( false ); if ( $options=='week' ){ $t -> setSource(TMPL_USER_TOP_WEEK); }else{ $t -> setSource(TMPL_USER_TOP_MONTH); } $t -> rows = $rows; return $t -> execute(); } define("TMPL_USER_TOP_WEEK", <<Íóæíî äîïèñàòü øàáëîí

TMPL_USER_TOP_WEEK ); define("TMPL_USER_TOP_MONTH", <<

+10
 
TMPL_USER_TOP_MONTH ); ?>