X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_bonus.php;h=b50b650a79f9f76e2921bfe852c821f2d8629ade;hp=8978037e586c6d693931934721061a4c72834b91;hb=7cb246c51e8634735aaf24e546bcbc46c5ce3833;hpb=3f51c40f4fede87228216f9285b745a339e3891d diff --git a/inc/modules/admin/what-list_bonus.php b/inc/modules/admin/what-list_bonus.php index 8978037e58..b50b650a79 100644 --- a/inc/modules/admin/what-list_bonus.php +++ b/inc/modules/admin/what-list_bonus.php @@ -1,7 +1,7 @@ = '0.6.9') { + if (getExtensionVersion('bonus') >= '0.6.9') { // Add more bonus points here $USE = '(0'; - if (getConfig('bonus_click_yn') == 'Y') $USE .= " + `turbo_bonus`"; - if (getConfig('bonus_login_yn') == 'Y') $USE .= " + `login_bonus`"; - if (getConfig('bonus_order_yn') == 'Y') $USE .= " + `bonus_order`"; - if (getConfig('bonus_stats_yn') == 'Y') $USE .= " + `bonus_stats`"; - if (getConfig('bonus_ref_yn') == 'Y') $USE .= " + `bonus_ref`"; + if (getConfig('bonus_click_yn') == 'Y') $USE .= ' + `turbo_bonus`'; + if (getConfig('bonus_login_yn') == 'Y') $USE .= ' + `login_bonus`'; + if (getConfig('bonus_order_yn') == 'Y') $USE .= ' + `bonus_order`'; + if (getConfig('bonus_stats_yn') == 'Y') $USE .= ' + `bonus_stats`'; + if (getConfig('bonus_ref_yn') == 'Y') $USE .= ' + `bonus_ref`'; $USE .= ')'; } else { // Old version ??? @@ -71,22 +70,22 @@ if (getConfig('bonus_active') == 'Y') { // Autopurge installed? $lastOnline = "%s"; $ONLINE = ''; - if (EXT_IS_ACTIVE('autopurge')) { + if (isExtensionActive('autopurge')) { // Use last online timestamp to keep inactive members away from here $lastOnline = " AND `last_online` >= (UNIX_TIMESTAMP() - %s)"; $ONLINE = getConfig('ap_inactive_since'); } // Check if at least one is in the active rallye - $result = SQL_QUERY_ESC("SELECT userid AS uid, email, gender, surname, family, ".$USE." AS points, last_online AS last -FROM `{!_MYSQL_PREFIX!}_user_data` + $result = SQL_QUERY_ESC("SELECT `userid`, `email`, `gender`, `surname`, `family`, ".$USE." AS points, `last_online` +FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status`='CONFIRMED' AND ".$USE." > 0".$lastOnline." -ORDER BY points DESC, last_online DESC, userid", +ORDER BY `points` DESC, `last_online` DESC, `userid` ASC", array($ONLINE), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // List users - $OUT = '';$SW = 2; $cnt = 1; $total = 0; + $OUT = '';$SW = 2; $cnt = 1; $total = '0'; while ($content = SQL_FETCHARRAY($result)) { // Add total points $total += $content['points']; @@ -100,49 +99,50 @@ ORDER BY points DESC, last_online DESC, userid", } // Prepare content - $content['uid'] = generateUserProfileLink($content['uid']); + $content['userid'] = generateUserProfileLink($content['userid']); $content['email'] = generateEmailLink($content['email'], 'user_data'); $content['gender'] = translateGender($content['gender']); $content['points'] = translateComma($content['points']); - $content['last'] = generateDateTime($content['last'], '2'); + $content['last_online'] = generateDateTime($content['last_online'], 2); $content['sw'] = $SW; $content['win1'] = $WIN1; $content['win2'] = $WIN2; $content['cnt'] = $cnt; // Load template and add it - $OUT .= LOAD_TEMPLATE("admin_list_bonus_rows", true, $content); + $OUT .= loadTemplate('admin_list_bonus_rows', true, $content); $SW = 3 - $SW; $cnt++; - } - define('__BONUS_ROWS', $OUT); - define('__TOTAL', translateComma($total)); + } // END - while + + $content['rows'] = $OUT; + $content['total'] = translateComma($total); // Check if we need to display form or not with manuel withdraw if (getConfig('last_month') == date('m', time())) { // Load form - define('__BONUS_WITHDRAW_FORM', LOAD_TEMPLATE("admin_list_bonus_form", true)); + $content['withdraw_form'] = loadTemplate('admin_list_bonus_form', true); } else { // Display message "no manual withdraw possible" - define('__BONUS_WITHDRAW_FORM', "
{--ADMIN_BONUS_ALREADY_WITHDRAW--}
"); + $content['withdraw_form'] = loadTemplate('admin_settings_saved', true, "
{--ADMIN_BONUS_ALREADY_WITHDRAW--}
"); } // Prepare constant for timemark - if (EXT_IS_ACTIVE('autopurge')) { - define('__AUTOPURGE_TIMEOUT', generateDateTime(time() - getConfig('ap_inactive_since'), '2')); + if (isExtensionActive('autopurge')) { + $content['autopurge_timeout'] = generateDateTime(time() - getConfig('ap_inactive_since'), 2); } else { - define('__AUTOPURGE_TIMEOUT', sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'autopurge')); + $content['autopurge_timeout'] = loadTemplate('admin_settings_saved', true, sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'autopurge')); } // Load final template - LOAD_TEMPLATE("admin_list_bonus"); + loadTemplate('admin_list_bonus', false, $content); } else { // No one has become an "activity bonus"... - LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_BONUS_NO_ACTIVE_RALLYE')); + loadTemplate('admin_settings_saved', false, getMessage('ADMIN_BONUS_NO_ACTIVE_RALLYE')); } } else { // Aktive-Rallye not activated - LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_BONUS_RALLYE_DEACTIVATED')); + loadTemplate('admin_settings_saved', false, getMessage('ADMIN_BONUS_RALLYE_DEACTIVATED')); } -// +// [EOF] ?>