From: Roland Häder Date: Mon, 28 Jun 2010 07:57:54 +0000 (+0000) Subject: Even more rewrites to EL X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=7618bd22d09e9bddab2ca39308f6523c06dd1521 Even more rewrites to EL --- diff --git a/inc/autopurge/purge-general.php b/inc/autopurge/purge-general.php index 1de67fc62a..ef9343478e 100644 --- a/inc/autopurge/purge-general.php +++ b/inc/autopurge/purge-general.php @@ -53,14 +53,11 @@ if ((getConfig('auto_purge_active') == 'Y') && (getConfig('auto_purge') > 0)) { // Init SQLs initSqls(); - // First calculate the timestamp - $PURGE = getConfig('auto_purge'); - // Init variables $admin_points = '0'; // Then check for outdated mail order. We don't delete them just the confirmation links will be deleted. - $result = SQL_QUERY_ESC("SELECT + $result = SQL_QUERY("SELECT s.id, s.userid, s.pool_id, t.price FROM `{?_MYSQL_PREFIX?}_user_stats` AS s @@ -69,10 +66,9 @@ LEFT JOIN ON s.payment_id=t.id WHERE - s.timestamp_ordered <= (UNIX_TIMESTAMP() - %s) + s.timestamp_ordered <= (UNIX_TIMESTAMP() - {?auto_purge?}) ORDER BY - s.userid ASC", - array(bigintval($PURGE)), __FILE__, __LINE__); + s.userid ASC", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Start deleting procedure $userid = '0'; $points = '0'; @@ -114,8 +110,7 @@ ORDER BY // Is the 'bonus' extension installed and activated? if (isExtensionActive('bonus', true)) { // Check for bonus campaigns - $result = SQL_QUERY_ESC("SELECT `id`, `points` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `data_type`='SEND' AND `timestamp` <= %s ORDER BY `id` ASC", - array(bigintval($PURGE)), __FILE__, __LINE__); + $result = SQL_QUERY("SELECT `id`, `points` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `data_type`='SEND' AND `timestamp` <= {?auto_purge?} ORDER BY `id` ASC", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Start deleting procedure $points = '0'; diff --git a/inc/functions.php b/inc/functions.php index 7dfee36d0b..ad3b1e5f55 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -3027,25 +3027,27 @@ function addNewBonusMail ($data, $mode = '', $output=true) { if (!empty($receiver)) { // Add bonus mail to queue addBonusMailToQueue( - $data['subject'], - $data['text'], - $receiver, - $data['points'], - $data['seconds'], - $data['url'], - $data['cat'], - $mode, - $data['receiver'] + $data['subject'], + $data['text'], + $receiver, + $data['points'], + $data['seconds'], + $data['url'], + $data['cat'], + $mode, + $data['receiver'] ); // Mail inserted into bonus pool - if ($output) loadTemplate('admin_settings_saved', false, '{--ADMIN_BONUS_SEND--}'); - } elseif ($output) { + if ($output === true) { + loadTemplate('admin_settings_saved', false, '{--ADMIN_BONUS_SEND--}'); + } // END - if + } elseif ($output === true) { // More entered than can be reached! loadTemplate('admin_settings_saved', false, '{--ADMIN_MORE_SELECTED--}'); } else { // Debug log - logDebugMessage(__FUNCTION__, __LINE__, "cat={$data['cat']},receiver={$data['receiver']},data=".base64_encode(serialize($data))." More selected, than available!"); + logDebugMessage(__FUNCTION__, __LINE__, 'cat=' . $data['cat'] . ',receiver=' . $data['receiver'] . ',data=' . base64_encode(serialize($data)) . ' More selected, than available!'); } } diff --git a/inc/install-inc.php b/inc/install-inc.php index 4f62415814..137257c89e 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -131,10 +131,10 @@ if ((!isInstalled()) || (!isAdminRegistered())) { $content['email'] = postRequestParameter('email'); // Use default SMTP data - $smtpHost = getConfig('SMTP_HOSTNAME'); - $smtpUser = getConfig('SMTP_USER'); - $smtpPass1 = getConfig('SMTP_PASSWORD'); - $smtpPass2 = getConfig('SMTP_PASSWORD'); + $smtpHost = '{?SMTP_HOSTNAME'); + $smtpUser = '{?SMTP_USER?}'; + $smtpPass1 = '{?SMTP_PASSWORD?}'; + $smtpPass2 = '{?SMTP_PASSWORD?}'; // Overwrite it with the data from sent (failed) form if (isPostRequestParameterSet('smtp_host')) $smtpHost = postRequestParameter('smtp_host'); diff --git a/inc/libs/online_functions.php b/inc/libs/online_functions.php index 3e2cf9d02f..562ff0123e 100644 --- a/inc/libs/online_functions.php +++ b/inc/libs/online_functions.php @@ -87,7 +87,7 @@ SET `action`='%s', `what`='%s', `userid`=%s, - `refid`='%s', + `refid`=%s, `is_member`='%s', `is_admin`='%s', `timestamp`=UNIX_TIMESTAMP(), diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index 4b85d3da37..6ba4d34649 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -235,14 +235,11 @@ function outputAdvancedOverview (&$result_main) { if (isExtensionActive('autopurge')) { // Start finding them... - $since = getConfig('ap_inactive_since'); $EXCLUDE_LIST = ''; - if (getConfig('def_refid') > 0) { - $EXCLUDE_LIST = ' AND d.userid != {?def_refid?}'; - } // END - if // Check for more extensions // @TODO These can be rewritten to filter + if (getConfig('def_refid') > 0) $EXCLUDE_LIST .= ' AND d.userid != {?def_refid?}'; if (isExtensionActive('beg')) $EXCLUDE_LIST .= ' AND d.userid != {?beg_userid?}'; if (isExtensionActive('bonus')) $EXCLUDE_LIST .= ' AND d.userid != {?bonus_userid?}'; if (isExtensionActive('doubler')) $EXCLUDE_LIST .= ' AND d.userid != {?doubler_userid?}'; @@ -258,9 +255,9 @@ FROM `{?_MYSQL_PREFIX?}_user_data` AS d WHERE d.`status`='CONFIRMED' AND - d.joined < (UNIX_TIMESTAMP() - ".$since.") AND - d.last_online < (UNIX_TIMESTAMP() - ".$since.") AND - d.ap_notified < (UNIX_TIMESTAMP() - ".$since.") + d.joined < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND + d.last_online < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND + d.ap_notified < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) ".$EXCLUDE_LIST." ORDER BY d.userid ASC"); diff --git a/inc/libs/yoomedia_functions.php b/inc/libs/yoomedia_functions.php index 83167b1275..85ef0445f4 100644 --- a/inc/libs/yoomedia_functions.php +++ b/inc/libs/yoomedia_functions.php @@ -231,18 +231,6 @@ function YOOMEDIA_PREPARE_MAIL_DELIVERY ($data) { // Is the reward below one? if ($data['reward'] < 1) $data['reward'] = 1; - // Add website id - $data['sid'] = getConfig('yoomedia_sid'); - - // Add total receivers - $data['all'] = translateComma(getTotalReceivers()); - - // Add categories - $data['categories'] = generateCategoryOptionsList('normal'); - - // Decode entities - $data['text'] = decodeEntities($data['text']); - // Load template loadTemplate('admin_send_yoomedia', false, $data); } diff --git a/inc/modules/admin/what-config_session.php b/inc/modules/admin/what-config_session.php index 19c11e34f1..a1164b95ad 100644 --- a/inc/modules/admin/what-config_session.php +++ b/inc/modules/admin/what-config_session.php @@ -55,13 +55,8 @@ if (isFormSent()) { loadTemplate('admin_settings_saved', false, '{--ADMIN_SESSION_SAVE_PATH_INVALID--}'); } } else { - // Prepare content - $content = array( - 'session_save_path' => getConfig('session_save_path'), - ); - // Load template - loadTemplate('admin_config_session', false, $content); + loadTemplate('admin_config_session'); } // [EOF] diff --git a/inc/modules/admin/what-config_sponsor.php b/inc/modules/admin/what-config_sponsor.php index af8cc38325..feafa04655 100644 --- a/inc/modules/admin/what-config_sponsor.php +++ b/inc/modules/admin/what-config_sponsor.php @@ -40,26 +40,18 @@ // Some security stuff... if ((!defined('__SECURITY')) || (!isAdmin())) { die(); -} +} // END - if // Add description as navigation point addMenuDescription('admin', __FILE__); if (isFormSent()) { - // Allow only direct points (non-floating) - setPostRequestParameter('sponsor_min_points', bigintval(postRequestParameter('sponsor_min_points'))); - setPostRequestParameter('sponsor_ref_points', bigintval(postRequestParameter('sponsor_ref_points'))); - // Save settings adminSaveSettingsFromPostData(); } else { - // Remember config data in constants for the template - $content['min_points'] = getConfig('sponsor_min_points'); - $content['ref_points'] = getConfig('sponsor_ref_points'); - // Load template - loadTemplate('admin_config_sponsor', false, $content); + loadTemplate('admin_config_sponsor'); } -// +// [EOF] ?> diff --git a/inc/modules/admin/what-config_surfbar.php b/inc/modules/admin/what-config_surfbar.php index 2d4aa10665..9824686b1b 100644 --- a/inc/modules/admin/what-config_surfbar.php +++ b/inc/modules/admin/what-config_surfbar.php @@ -57,18 +57,12 @@ if (isFormSent()) { } else { // Prepare content $content = array( - 'surfbar_static_reward' => translateComma(getConfig('surfbar_static_reward')), - 'surfbar_static_costs' => translateComma(getConfig('surfbar_static_costs')), 'surfbar_static_time' => createTimeSelections(getConfig('surfbar_static_time') , 'surfbar_static_time' , 'ms' , 'left'), 'surfbar_static_lock' => createTimeSelections(getConfig('surfbar_static_lock') , 'surfbar_static_lock' , 'hm' , 'left'), 'surfbar_restart_time' => createTimeSelections(getConfig('surfbar_restart_time') , 'surfbar_restart_time' , 'ms' , 'left'), - 'surfbar_dynamic_percent' => translateComma(getConfig('surfbar_dynamic_percent')), - 'surfbar_max_order' => getConfig('surfbar_max_order'), 'surfbar_stats_reload' => createTimeSelections(getConfig('surfbar_stats_reload') , 'surfbar_stats_reload' , 'ms' , 'left'), 'surfbar_purge_deleted' => createTimeSelections(getConfig('surfbar_purge_deleted') , 'surfbar_purge_deleted' , 'WDh', 'left'), 'surfbar_purge_migrated' => createTimeSelections(getConfig('surfbar_purge_migrated'), 'surfbar_purge_migrated', 'WDh', 'left'), - 'surfbar_pause_url' => getConfig('surfbar_pause_url'), - 'surfbar_warn_low_points' => getConfig('surfbar_warn_low_points'), 'surfbar_low_interval' => createTimeSelections(getConfig('surfbar_low_interval') , 'surfbar_low_interval' , 'WDh', 'left'), ); @@ -82,7 +76,7 @@ if (isFormSent()) { // Even some more... foreach (array('surfbar_pay_model_static','surfbar_pay_model_dynamic','surfbar_pause_mode_internal','surfbar_pause_mode_external','surfbar_notification_mode_instant','surfbar_notification_mode_reset') as $entry) { $content[$entry] = ''; - } // END - if + } // END - foreach // Prepare selections foreach (array('surfbar_pay_model','surfbar_pause_mode','surfbar_notification_mode') as $entry) { diff --git a/inc/modules/admin/what-config_top10.php b/inc/modules/admin/what-config_top10.php index 585d4eb916..3eeb111bff 100644 --- a/inc/modules/admin/what-config_top10.php +++ b/inc/modules/admin/what-config_top10.php @@ -49,11 +49,8 @@ if (isFormSent()) { // Save settings adminSaveSettingsFromPostData(); } else { - // Prepare constants for the template - $content['max'] = getConfig('top10_max'); - // Load form template - loadTemplate('admin_config_top10', false, $content); + loadTemplate('admin_config_top10'); } // [EOF] diff --git a/inc/modules/guest/what-beg.php b/inc/modules/guest/what-beg.php index 408b0fead1..0ea722691d 100644 --- a/inc/modules/guest/what-beg.php +++ b/inc/modules/guest/what-beg.php @@ -50,13 +50,6 @@ if ((!isExtensionActive('beg')) && (!isAdmin())) { return; } // END - if -// Prepare constants -$content['points'] = translateComma(getConfig('beg_points')); -$content['points_max'] = translateComma(getConfig('beg_points_max')); -$content['userid'] = determineReferalId(); - -// Selection boxes are now the default -$content['timeout'] = createFancyTime(getConfig('beg_timeout')); // @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout'))); // Load final template diff --git a/inc/modules/guest/what-register.php b/inc/modules/guest/what-register.php index d38988eb58..c712e17ca7 100644 --- a/inc/modules/guest/what-register.php +++ b/inc/modules/guest/what-register.php @@ -127,10 +127,10 @@ if ((isFormSent()) && (isRegistrationDataComplete())) { // Shall I display the refid or shall I make it editable? if (getConfig('display_refid') == 'Y') { // Load "hide" form template - $content['refid_content'] = loadTemplate('guest_register_refid_hide', true, determineReferalId()); + $content['refid_content'] = loadTemplate('guest_register_refid_hide', true); } else { // Load template to enter it - $content['refid_content'] = loadTemplate('guest_register_refid', true, determineReferalId()); + $content['refid_content'] = loadTemplate('guest_register_refid', true); } // You may want to modify the register_header.tpl.xx file and not this script when you add your scripts etc. :-) diff --git a/inc/modules/guest/what-sponsor_reg.php b/inc/modules/guest/what-sponsor_reg.php index bdfea2200d..10672fb648 100644 --- a/inc/modules/guest/what-sponsor_reg.php +++ b/inc/modules/guest/what-sponsor_reg.php @@ -347,9 +347,6 @@ ORDER BY $content['refid'] = bigintval(postRequestParameter('refid')); } // END - if - // Prepare referal id - $content['refid'] = determineReferalId(); - // Display registration form loadTemplate('guest_sponsor_reg', false, $content); } else { diff --git a/inc/modules/member/what-beg2.php b/inc/modules/member/what-beg2.php index b6632bb791..c13931a6ca 100644 --- a/inc/modules/member/what-beg2.php +++ b/inc/modules/member/what-beg2.php @@ -53,13 +53,12 @@ if ((!isExtensionActive('beg')) && (!isAdmin())) { } // END - if // Autopurge installed? -$lastOnline = "%s"; +$lastOnline = '%s'; $ONLINE = ''; if (isExtensionActive('autopurge')) { // Use last online timestamp to keep inactive members away from here - $lastOnline = " AND `last_online` >= (UNIX_TIMESTAMP() - %s)"; - $ONLINE = '{?ap_inactive_since?}'; + $lastOnline = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})"; } // END - if // Let's check if there are some points left we can 'pay'... diff --git a/inc/modules/member/what-bonus.php b/inc/modules/member/what-bonus.php index 0125ce192d..df6251fa09 100644 --- a/inc/modules/member/what-bonus.php +++ b/inc/modules/member/what-bonus.php @@ -71,8 +71,7 @@ if (isExtensionInstalledAndNewer('bonus', '0.6.9')) { $lastOnline = '%s'; $ONLINE = ''; 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'); + $lastOnline = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})"; } // END - if // Let's check if there are some points left we can 'pay'... diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index 77b8206c67..1e3301a939 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -617,9 +617,9 @@ LIMIT 1", // Pre-output categories $content['category_selection'] = ''; foreach ($categories['id'] as $key => $value) { - $content['category_selection'] .= " '; } // END - foreach // Mail type @@ -628,9 +628,9 @@ LIMIT 1", $P = translateComma($types[$key][1]); if (is_array($value)) { // Output option line - $content['type_selection'] .= " '; } // END - if } // END - foreach diff --git a/inc/reset/reset_birthday.php b/inc/reset/reset_birthday.php index 5dbbb34dc5..e2a95fd471 100644 --- a/inc/reset/reset_birthday.php +++ b/inc/reset/reset_birthday.php @@ -54,10 +54,9 @@ $month = date('m', time()); $year = date('Y', time()); // Shall I include only active members? -$add = "%s"; $value = ''; +$add = '%s'; $value = ''; if ((getConfig('birthday_active')) && (isExtensionActive('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getConfig('ap_inactive_since') > 0)) { - $add = " AND `last_online` >= (UNIX_TIMESTAMP() - %s)"; - $value = getConfig('ap_inactive_since'); + $add = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})"; } // END - if // Only confirmed members shall receive birthday mails... diff --git a/ref.php b/ref.php index cff2ace8d9..6fd272a009 100644 --- a/ref.php +++ b/ref.php @@ -53,7 +53,7 @@ setContentType('text/html'); // No refid by default $URL = 'modules.php?module=index'; -if (determineReferalId() > 0) { +if (determineReferalId() != 0) { // Test if nickname or numeric id if (isExtensionActive('nickname')) { // Nickname in URL, so load the id diff --git a/templates/de/html/admin/admin_config_session.tpl b/templates/de/html/admin/admin_config_session.tpl index 630ea4b5c6..58412401f3 100644 --- a/templates/de/html/admin/admin_config_session.tpl +++ b/templates/de/html/admin/admin_config_session.tpl @@ -11,7 +11,7 @@ {--ADMIN_CONFIG_SESSION_SAVE_PATH--}:
- + diff --git a/templates/de/html/admin/admin_config_surfbar.tpl b/templates/de/html/admin/admin_config_surfbar.tpl index 7ef573f477..ad3e78b6f9 100644 --- a/templates/de/html/admin/admin_config_surfbar.tpl +++ b/templates/de/html/admin/admin_config_surfbar.tpl @@ -11,7 +11,7 @@ {--ADMIN_CONFIG_SURFBAR_STATIC_REWARD--} - + ({?POINTS?}) @@ -20,7 +20,7 @@ {--ADMIN_CONFIG_SURFBAR_STATIC_COSTS--} - + ({?POINTS?}) @@ -45,7 +45,7 @@ {--ADMIN_CONFIG_SURFBAR_DYNAMIC_PERCENT--} - % + % @@ -53,7 +53,7 @@ {--ADMIN_CONFIG_SURFBAR_MAX_ORDER--} - + @@ -135,7 +135,7 @@ {--ADMIN_CONFIG_SURFBAR_PAUSE_URL--} - + @@ -181,7 +181,7 @@ {--ADMIN_CONFIG_SURFBAR_WARN_LOW_POINTS--} - + ({?POINTS?}) diff --git a/templates/de/html/admin/admin_config_top10.tpl b/templates/de/html/admin/admin_config_top10.tpl index 9b5d5e0fdf..4cddda7725 100644 --- a/templates/de/html/admin/admin_config_top10.tpl +++ b/templates/de/html/admin/admin_config_top10.tpl @@ -9,7 +9,7 @@ {--TOP10_ADMIN_MAX_TOP10--}: - + diff --git a/templates/de/html/admin/admin_send_yoomedia.tpl b/templates/de/html/admin/admin_send_yoomedia.tpl index 57aaa84875..265b4c2331 100644 --- a/templates/de/html/admin/admin_send_yoomedia.tpl +++ b/templates/de/html/admin/admin_send_yoomedia.tpl @@ -10,8 +10,8 @@ @@ -43,15 +43,15 @@ {--ENTER_TEXT--}: - + {--MEMBER_ENTER_URL--}: - http://www.yoomedia.de/code/t-mail.php?id=$content[id]&sid=$content[sid] + http://www.yoomedia.de/code/t-mail.php?id=$content[id]&sid={?yoomedia_sid?} - + diff --git a/templates/de/html/guest/guest_beg.tpl b/templates/de/html/guest/guest_beg.tpl index a38eb5c8f9..3e1d5697dd 100644 --- a/templates/de/html/guest/guest_beg.tpl +++ b/templates/de/html/guest/guest_beg.tpl @@ -5,18 +5,18 @@
- {--BEG_GUEST_EARN_1--} $content[points] {?POINTS?} - {--BEG_GUEST_EARN_2--} $content[points_max] {?POINTS?} + {--BEG_GUEST_EARN_1--} {%config,translateComma=beg_points%} {?POINTS?} + {--BEG_GUEST_EARN_2--} {%config,translateComma=beg_points_max%} {?POINTS?} {--BEG_GUEST_EARN_3--}
- {%message,BEG_GUEST_TIMEOUT=$content[timeout]%} + {%message,BEG_GUEST_TIMEOUT={%config,createFancyTime=beg_timeout%}%}
{--BEG_GUEST_HAVE_FUN--}
- {--BEG_CONTINUE_REGISTER--} + {--BEG_CONTINUE_REGISTER--}
diff --git a/templates/de/html/guest/guest_register_refid.tpl b/templates/de/html/guest/guest_register_refid.tpl index a5569ef667..cd03109b74 100644 --- a/templates/de/html/guest/guest_register_refid.tpl +++ b/templates/de/html/guest/guest_register_refid.tpl @@ -3,6 +3,6 @@ {--REFID_BY--}: - + diff --git a/templates/de/html/guest/guest_register_refid_hide.tpl b/templates/de/html/guest/guest_register_refid_hide.tpl index d34402b001..d12812bbaa 100644 --- a/templates/de/html/guest/guest_register_refid_hide.tpl +++ b/templates/de/html/guest/guest_register_refid_hide.tpl @@ -3,7 +3,7 @@ {--REFID_BY--}: - $content - + {%pipe,determineReferalId%} + diff --git a/templates/de/html/guest/guest_sponsor_reg.tpl b/templates/de/html/guest/guest_sponsor_reg.tpl index f1481fe93e..c6b133e5da 100644 --- a/templates/de/html/guest/guest_sponsor_reg.tpl +++ b/templates/de/html/guest/guest_sponsor_reg.tpl @@ -174,7 +174,7 @@ {--SPONSOR_REFID_WAS--}: - $content[refid] + {%pipe,determineReferalId%}