X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-top10.php;h=a5ad5e61faac792850edddcf981b50a5fe52f9e2;hb=391c98ab7233ff3e640d8b9fad8df92ce45e9b31;hp=4bdf990b0bfeb157bd6daae14448056699ff4908;hpb=c2e17d983fcbc0c3bd1dd37908d87c678f0367df;p=mailer.git diff --git a/inc/modules/guest/what-top10.php b/inc/modules/guest/what-top10.php index 4bdf990b0b..a5ad5e61fa 100644 --- a/inc/modules/guest/what-top10.php +++ b/inc/modules/guest/what-top10.php @@ -1,7 +1,7 @@ $SW, - 'cnt' => $cnt, + 'cnt' => $count, 'userid' => $content['userid'], 'nickname' => $content['nickname'], 'total_logins' => $content['total_logins'], - 'points' => translateComma(countSumTotalData($content['userid'], 'user_points', 'points')), + 'points' => getTotalPoints($content['userid']), 'last_online' => generateDateTime($content['last_online'], 3), ); // Load row template $OUT .= loadTemplate('guest_top10_row_login', true, $content); - // Switch colors and count one up - $SW = 3 - $SW; $cnt++; + // Count one up + $count++; } // END - while -if ($cnt < getConfig('top10_max')) { +if ($count < getConfig('top10_max')) { // Add more "blank" rows - for ($i = $cnt; $i <= getConfig('top10_max'); $i++) { + for ($i = $count; $i <= getConfig('top10_max'); $i++) { // Prepare data for template $content = array( - 'sw' => $SW, 'index' => $i ); // Load row template $OUT .= loadTemplate('guest_top10_empty5', true, $content); - $SW = 3 - $SW; } // END - for } // END - if @@ -114,7 +110,7 @@ SQL_FREERESULT($result); //// TOP earners $result = SQL_QUERY("SELECT d.userid, - (SUM(p.points) - d.used_points) AS points, + (SUM(p.points) - d.used_points) AS `points`, d.last_online FROM `{?_MYSQL_PREFIX?}_user_data` AS d @@ -132,43 +128,40 @@ ORDER BY d.last_online DESC LIMIT {?top10_max?}", __FILE__, __LINE__); -$OUT = ''; $SW = 2; $cnt = 1; +$OUT = ''; $count = 1; while ($content = SQL_FETCHARRAY($result)) { // Init nickname - $content['nickname'] = '---'; + $content['nickname'] = ''; // Get nickname if (isExtensionActive('nickname')) $content['nickname'] = getNickname($content['userid']); // Prepare data for template $content = array( - 'sw' => $SW, - 'cnt' => $cnt, + 'cnt' => $count, 'userid' => $content['userid'], 'nickname' => $content['nickname'], - 'points' => translateComma($content['points']), + 'points' => $content['points'], 'last_online' => generateDateTime($content['last_online'], 3) ); // Load row template $OUT .= loadTemplate('guest_top10_row_earner', true, $content); - // Switch colors and count one up - $SW = 3 - $SW; $cnt++; + // Count one up + $count++; } // END - while -if ($cnt < getConfig('top10_max')) { +if ($count < getConfig('top10_max')) { // Add more "blank" rows - for ($i = $cnt; $i <= getConfig('top10_max'); $i++) { + for ($i = $count; $i <= getConfig('top10_max'); $i++) { // Prepare data for template $content = array( - 'sw' => $SW, 'index' => $i ); // Load row template $OUT .= loadTemplate('guest_top10_empty4', true, $content); - $SW = 3 - $SW; } // END - for } // END - if @@ -199,44 +192,41 @@ ORDER BY d.last_online DESC LIMIT {?top10_max?}", __FILE__, __LINE__); -$OUT = ''; $SW = 2; $cnt = 1; +$OUT = ''; $count = 1; while ($content = SQL_FETCHARRAY($result)) { // Init nickname - $content['nickname'] = '---'; + $content['nickname'] = ''; // Get nickname if (isExtensionActive('nickname')) $content['nickname'] = getNickname($content['userid']); // Prepare data for template $content = array( - 'sw' => $SW, - 'cnt' => $cnt, + 'cnt' => $count, 'userid' => $content['userid'], 'refs' => $content['refs'], 'nickname' => $content['nickname'], - 'points' => translateComma(countSumTotalData($content['userid'], 'user_points', 'points')), + 'points' => getTotalPoints($content['userid']), 'last_online' => generateDateTime($content['last_online'], 3) ); // Load row template $OUT .= loadTemplate('guest_top10_row_refs', true, $content); - // Switch colors and count one up - $SW = 3 - $SW; $cnt++; + // Count one up + $count++; } // END - while -if ($cnt < getConfig('top10_max')) { +if ($count < getConfig('top10_max')) { // Add more "blank" rows - for ($i = $cnt; $i <= getConfig('top10_max'); $i++) { + for ($i = $count; $i <= getConfig('top10_max'); $i++) { // Prepare data for template $content = array( - 'sw' => $SW, 'index' => $i ); // Load row template $OUT .= loadTemplate('guest_top10_empty5', true, $content); - $SW = 3 - $SW; } // END - for } // END - if