X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-beg2.php;h=0ccb815b622ec91872a2f55b0683875b0fe04add;hb=6d08952d672c5a5de7d8522f894a5665599a2a4a;hp=a7e131b107f495377f2163cdf76fdbd08e6e4e0e;hpb=7f104f6fe558bb56b4205241435a2357c2feece1;p=mailer.git diff --git a/inc/modules/member/what-beg2.php b/inc/modules/member/what-beg2.php index a7e131b107..0ccb815b62 100644 --- a/inc/modules/member/what-beg2.php +++ b/inc/modules/member/what-beg2.php @@ -1,7 +1,7 @@ 0))) { // Use last online timestamp to keep inactive members away from here - $LAST = " AND last_online >= (UNIX_TIMESTAMP() - %s)"; - $ONLINE = $_CONFIG['ap_inactive_since']; -} + $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) < {?ap_inactive_since?}'; +} // END - if -// Let's check if there are some points left we can "pay"... -$result = SQL_QUERY_ESC("SELECT userid, beg_points AS beg, last_online FROM "._MYSQL_PREFIX."_user_data -WHERE beg_points > 0 AND status='CONFIRMED'".$LAST." -ORDER BY beg_points DESC, last_online DESC, userid LIMIT %s", - array($ONLINE, $_CONFIG['beg_ranks']), __FILE__, __LINE__); +// Let's check if there are some points left we can pay... +$result = sqlQueryEscaped("SELECT + `userid`, + `beg_points`, + `last_online` +FROM + `{?_MYSQL_PREFIX?}_user_data` +WHERE + `beg_points` > 0 AND + `status`='CONFIRMED' + " . runFilterChain('user_exclusion_sql', ' ') . " + " . $lastOnline . " +ORDER BY + `beg_points` DESC, + `last_online` DESC, + `userid` ASC +LIMIT {?beg_ranks?}", + array( + $ONLINE + ), __FILE__, __LINE__); // Reset temporary variable and check for users -$OUT = ""; -if (SQL_NUMROWS($result) > 0) -{ +$OUT = ''; +if (!ifSqlHasZeroNums($result)) { // Load our winners... - $SW = 2; $cnt = 1; - while(list($uid, $turbo, $last) = SQL_FETCHROW($result)) - { + $count = 1; + while ($content = sqlFetchArray($result)) { // Prepare data for the template - $content = array( - 'sw' => $SW, - 'cnt' => $cnt, - 'uid' => bigintval($uid), - 'points' => TRANSLATE_COMMA($turbo), - 'last' => MAKE_DATETIME($last, "2"), - ); + $content['count'] = $count; + $content['last_online'] = generateDateTime($content['last_online'], '2'); // Load row template - $OUT .= LOAD_TEMPLATE("member_list_beg_row", true, $content); + $OUT .= loadTemplate('member_list_beg_row', TRUE, $content); - // Count one up and switch colors - $cnt++;$SW = 3 - $SW; - } -} - else -{ - // No one is interested in our "active rallye" ! :-( - $OUT = LOAD_TEMPLATE("member_beg_404", true); + // Count one up + $count++; + } // END - while +} else { + // No one is interested in our "begging rallye" ! :-( + $OUT = loadTemplate('member_beg_404', TRUE); } -// Free memory -SQL_FREERESULT($result); +// Prepare content +$content['rows'] = $OUT; -// Remeber row(s) for the template -define('__BEG_ROWS', $OUT); +// Free memory +sqlFreeResult($result); // Load final template -LOAD_TEMPLATE("member_list_beg"); +loadTemplate('member_list_beg', FALSE, $content); -// +// [EOF] ?>