X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-top10.php;h=db8fb817a31ae95e9667179898bd1ee2e9e56119;hb=3c50057c4da8c632d1923d7879a2b870d1eb7155;hp=a5ad5e61faac792850edddcf981b50a5fe52f9e2;hpb=35c88a3dc0b3f34c29d5a56998579b244e506785;p=mailer.git diff --git a/inc/modules/guest/what-top10.php b/inc/modules/guest/what-top10.php index a5ad5e61fa..db8fb817a3 100644 --- a/inc/modules/guest/what-top10.php +++ b/inc/modules/guest/what-top10.php @@ -16,8 +16,8 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -37,52 +37,45 @@ // Some security stuff... if (!defined('__SECURITY')) { - die(); + exit(); } // END - if // Add description as navigation point addYouAreHereLink('guest', __FILE__); if ((!isExtensionActive('top10')) && (!isAdmin())) { - displayMessage(generateExtensionInactiveNotInstalledMessage('top10')); + displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=top10%}'); return; } // END - if // Init array $rows = array(); -//// TOP logins +// TOP logins $result = SQL_QUERY("SELECT - `userid`, `total_logins`, `last_online` + `userid`, + `last_online` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `total_logins` > 0 AND `status`='CONFIRMED' + " . runFilterChain('user_exclusion_sql', ' ') . " ORDER BY `total_logins` DESC LIMIT {?top10_max?}", __FILE__, __LINE__); $OUT = ''; $count = 1; while ($content = SQL_FETCHARRAY($result)) { - // Init nickname - $content['nickname'] = ''; - - // Get nickname - if (isExtensionActive('nickname')) $content['nickname'] = getNickname($content['userid']); - // Prepare data for template $content = array( - 'cnt' => $count, + 'count' => $count, 'userid' => $content['userid'], - 'nickname' => $content['nickname'], - 'total_logins' => $content['total_logins'], - 'points' => getTotalPoints($content['userid']), - 'last_online' => generateDateTime($content['last_online'], 3), + 'last_online' => generateDateTime($content['last_online'], '3'), ); // Load row template - $OUT .= loadTemplate('guest_top10_row_login', true, $content); + $OUT .= loadTemplate('guest_top10_row_login', TRUE, $content); // Count one up $count++; @@ -97,7 +90,7 @@ if ($count < getConfig('top10_max')) { ); // Load row template - $OUT .= loadTemplate('guest_top10_empty5', true, $content); + $OUT .= loadTemplate('guest_top10_empty5', TRUE, $content); } // END - for } // END - if @@ -107,7 +100,7 @@ $rows['logins_out'] = $OUT; // Free result SQL_FREERESULT($result); -//// TOP earners +// TOP earners $result = SQL_QUERY("SELECT d.userid, (SUM(p.points) - d.used_points) AS `points`, @@ -121,6 +114,7 @@ ON WHERE p.points > 0 AND d.`status`='CONFIRMED' + " . runFilterChain('user_exclusion_sql', ' ') . " GROUP BY p.userid ORDER BY @@ -130,23 +124,12 @@ LIMIT {?top10_max?}", __FILE__, __LINE__); $OUT = ''; $count = 1; while ($content = SQL_FETCHARRAY($result)) { - // Init nickname - $content['nickname'] = ''; - - // Get nickname - if (isExtensionActive('nickname')) $content['nickname'] = getNickname($content['userid']); - // Prepare data for template - $content = array( - 'cnt' => $count, - 'userid' => $content['userid'], - 'nickname' => $content['nickname'], - 'points' => $content['points'], - 'last_online' => generateDateTime($content['last_online'], 3) - ); + $content['count'] = $count; + $content['last_online'] = generateDateTime($content['last_online'], '3'); // Load row template - $OUT .= loadTemplate('guest_top10_row_earner', true, $content); + $OUT .= loadTemplate('guest_top10_row_earner', TRUE, $content); // Count one up $count++; @@ -161,7 +144,7 @@ if ($count < getConfig('top10_max')) { ); // Load row template - $OUT .= loadTemplate('guest_top10_empty4', true, $content); + $OUT .= loadTemplate('guest_top10_empty4', TRUE, $content); } // END - for } // END - if @@ -171,7 +154,7 @@ $rows['points_out'] = $OUT; // Free result SQL_FREERESULT($result); -//// TOP referal "hunter" +// TOP referral "hunter" $result = SQL_QUERY("SELECT d.userid, SUM(r.counter) AS refs, @@ -185,6 +168,7 @@ ON WHERE r.counter > 0 AND d.`status`='CONFIRMED' + " . runFilterChain('user_exclusion_sql', ' ') . " GROUP BY r.userid ORDER BY @@ -194,24 +178,16 @@ LIMIT {?top10_max?}", __FILE__, __LINE__); $OUT = ''; $count = 1; while ($content = SQL_FETCHARRAY($result)) { - // Init nickname - $content['nickname'] = ''; - - // Get nickname - if (isExtensionActive('nickname')) $content['nickname'] = getNickname($content['userid']); - // Prepare data for template $content = array( - 'cnt' => $count, + 'count' => $count, 'userid' => $content['userid'], 'refs' => $content['refs'], - 'nickname' => $content['nickname'], - 'points' => getTotalPoints($content['userid']), - 'last_online' => generateDateTime($content['last_online'], 3) + 'last_online' => generateDateTime($content['last_online'], '3') ); // Load row template - $OUT .= loadTemplate('guest_top10_row_refs', true, $content); + $OUT .= loadTemplate('guest_top10_row_refs', TRUE, $content); // Count one up $count++; @@ -226,18 +202,18 @@ if ($count < getConfig('top10_max')) { ); // Load row template - $OUT .= loadTemplate('guest_top10_empty5', true, $content); + $OUT .= loadTemplate('guest_top10_empty5', TRUE, $content); } // END - for } // END - if // Remember the rows in array -$rows['referals_out'] = $OUT; +$rows['referrals_out'] = $OUT; // Free result SQL_FREERESULT($result); // Load final template -loadTemplate('guest_top10', false, $rows); +loadTemplate('guest_top10', FALSE, $rows); // [EOF] ?>