--- userpoints_top_contributors/userpoints_top_contributors.module Mon Apr 12 18:48:14 2010 +++ userpoints_top_contributors/userpoints_top_contributors.module Mon Sep 06 21:47:54 2010 @@ -110,8 +110,8 @@ array('data' => t('Rank'), 'field' => 'p.rank'), array('data' => t('User'), 'field' => 'u.name'), array('data' => t(format_interval(variable_get(userpoints_top_contributors_period, 86400))), 'field' => 'period_points', 'style' => 'text-align:right'), - array('data' => t('Current'), 'field' => 'current_points', 'style' => 'text-align:right'), - array('data' => t('Lifetime'), 'field' => 'lifetime_points', 'sort' => 'desc', 'style' => 'text-align:right'), + array('data' => t('Current'), 'field' => 'current_points', 'sort' => 'desc', 'style' => 'text-align:right'), + array('data' => t('Lifetime'), 'field' => 'lifetime_points', 'style' => 'text-align:right'), ); } else { @@ -170,29 +170,31 @@ if ($delta == 0) { $title = t('Top Contributors'); - $result = db_query_range("SELECT p.uid, u.name, p.lifetime_points + $result = db_query_range("SELECT p.uid, u.name, p.current_points, p.lifetime_points FROM {userpoints_top_contributors} p INNER JOIN {users} u USING (uid) GROUP BY p.uid - ORDER BY p.lifetime_points DESC", 0, $usr_cnt); + ORDER BY p.current_points DESC", 0, $usr_cnt); while ($data = db_fetch_object($result)) { $rows[] = array( - array('data' => theme('username', $data)), - array('data' => number_format($data->lifetime_points), 'style' => 'text-align:right'), + array('data' => theme('username', $data), 'class' => 'uptc-user'), + array('data' => number_format($data->current_points), 'class' => 'uptc-current'), + array('data' => number_format($data->lifetime_points), 'class' => 'uptc-lifetime'), ); } // current user max point total. if ($user->uid) { $data = db_fetch_object(db_query('SELECT * FROM {userpoints_top_contributors} WHERE uid = %d', $user->uid)); $rows[] = array( - array('data' => t('Your current points: @cp
Your lifetime points: @lp', array('@cp' => number_format($data->current_points), '@lp' => number_format($data->lifetime_points))), 'colspan' => '2') + array('data' => t('Your current points: @cp
Your lifetime points: @lp', array('@cp' => number_format($data->current_points), '@lp' => number_format($data->lifetime_points))), 'colspan' => '3', 'class' => 'uptc-my-points') ); } $header = array( - array('data' => t('User')), - array('data' => t('!Points', userpoints_translation()), 'style' => 'text-align:right') + array('data' => t('User'), 'class' => 'uptc-tit-user'), + array('data' => t('!Points', userpoints_translation()), 'class' => 'uptc-tit-current'), + array('data' => t('Ever Points'), 'class' => 'uptc-tit-lifetime') ); $content = theme('table', $header, $rows);