From 76fd13e5938a334f08e43893eb9a4ff49f72bf07 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 21 Jun 2010 01:39:47 +0000 Subject: [PATCH] More rewrites/templates swapped out: - Two more templates created (swapped out from PHP code) - More rewrites to EL - More double quotes converted to single quotes - Some internal TODOs solved/new created - TODOs.txt updated --- DOCS/TODOs.txt | 103 ++++++++-------- debug.php | 2 +- inc/autopurge/purge-inact.php | 15 +-- inc/config-functions.php | 4 +- inc/fix_menu.php | 13 +- inc/functions.php | 16 +-- inc/install-inc.php | 2 +- inc/libs/bonus_functions.php | 24 ++-- inc/libs/rallye_functions.php | 2 +- inc/libs/refback_functions.php | 47 +++---- inc/libs/theme_functions.php | 5 +- inc/libs/transfer_functions.php | 4 +- inc/libs/user_functions.php | 10 +- inc/modules/admin/admin-inc.php | 15 +++ inc/modules/admin/overview-inc.php | 4 +- inc/modules/admin/what-admin_add.php | 19 +-- inc/modules/admin/what-admins_mails.php | 14 +-- inc/modules/admin/what-config_bonus.php | 12 +- inc/modules/admin/what-config_mods.php | 28 ++--- inc/modules/admin/what-config_register.php | 10 +- inc/modules/admin/what-del_transfer.php | 34 +++--- inc/modules/admin/what-email_archiv.php | 24 +--- inc/modules/admin/what-email_details.php | 115 ++++++++---------- inc/modules/admin/what-list_beg.php | 27 ++-- inc/modules/admin/what-list_cats.php | 5 +- inc/modules/admin/what-list_notifications.php | 36 +++--- inc/modules/admin/what-list_refs.php | 7 +- inc/modules/admin/what-list_transfer.php | 30 ++--- inc/modules/admin/what-list_user.php | 37 +++--- inc/modules/admin/what-stats_mods.php | 2 +- inc/modules/admin/what-theme_edit.php | 35 +++--- inc/modules/admin/what-unlock_emails.php | 4 +- inc/modules/admin/what-user_contct.php | 6 +- inc/modules/guest/what-login.php | 17 +-- inc/modules/guest/what-sponsor_reg.php | 9 +- inc/modules/member/what-surfbar_list.php | 6 +- inc/mysql-manager.php | 6 +- inc/reset/reset_birthday.php | 2 +- .../emails/admin/admin_autopurge_inactive.tpl | 2 +- .../html/admin/admin_config_register_row.tpl | 7 ++ .../de/html/admin/admin_del_transfer_row.tpl | 6 +- .../de/html/admin/admin_email_archiv_row.tpl | 14 +-- .../de/html/admin/admin_list_beg_rows.tpl | 4 +- .../admin/admin_list_bonus_emails_row.tpl | 14 +-- .../de/html/admin/admin_list_emails_row.tpl | 19 ++- .../de/html/admin/admin_list_mods_row.tpl | 12 +- .../admin/admin_list_notify_emails_row.tpl | 18 +-- .../de/html/admin/admin_list_transfer_row.tpl | 24 +++- templates/de/html/admin/admin_list_user.tpl | 10 +- .../de/html/admin/admin_list_user_alpha.tpl | 4 +- .../de/html/admin/admin_list_user_pagenav.tpl | 2 +- .../de/html/admin/admin_list_user_sort.tpl | 2 +- .../html/admin/admin_list_user_sort_form.tpl | 2 +- .../de/html/admin/admin_mods_stats_row.tpl | 2 +- .../de/html/admin/admin_theme_edit_row.tpl | 8 +- .../de/html/member/member_bonus_turbo_row.tpl | 5 + .../html/member/member_surfbar_list_row.tpl | 2 +- 57 files changed, 459 insertions(+), 449 deletions(-) create mode 100644 templates/de/html/admin/admin_config_register_row.tpl create mode 100644 templates/de/html/member/member_bonus_turbo_row.tpl diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index bf006599b1..1bcd6a72b6 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -32,6 +32,7 @@ ./inc/extensions/ext-network.php:38: * @TODO Yoo!Media: What is LayerAd compared to Layer click? * ./inc/extensions/ext-network.php:92: // @TODO network_type_handle is an internal name and needs documentation ./inc/extensions/ext-newsletter.php:220: // @TODO Move these into configuration +./inc/extensions/ext-order.php:344: // @TODO This should be moved out to inc/reset/ ./inc/extensions/ext-rallye.php:331: // @TODO Move this code into rallye_functions.php ./inc/extensions/ext-rallye.php:94: // @TODO Fix config_rallye_prices to list_rallye_prices ./inc/extensions/ext-sql_patches.php:755: // @TODO Rewrite this to a filter @@ -40,27 +41,27 @@ ./inc/extensions-functions.php:143: // @TODO Do we still need this? setExtensionUpdateNotes(''); ./inc/extensions-functions.php:423:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) ) ./inc/extensions-functions.php:539: // @TODO Extension is loaded, what next? -./inc/functions.php:1052:// @TODO $simple is deprecated -./inc/functions.php:1087: // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates -./inc/functions.php:2420: // @TODO This can be easily moved out after the merge from EL branch to this is complete -./inc/functions.php:2569: // @TODO Add a little more infos here -./inc/functions.php:2652: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ? +./inc/functions.php:1055:// @TODO $simple/$constants are deprecated +./inc/functions.php:1082: // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates +./inc/functions.php:2415: // @TODO This can be easily moved out after the merge from EL branch to this is complete +./inc/functions.php:2564: // @TODO Add a little more infos here +./inc/functions.php:2647: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ? ./inc/functions.php:266: // @TODO Remove this sanity-check if all is fine -./inc/functions.php:2675: // @TODO Rewrite this old lost code to a template +./inc/functions.php:2670: // @TODO Rewrite this old lost code to a template ./inc/functions.php:269: // @TODO Try to rewrite all $DATA to $content -./inc/functions.php:2765: // @TODO Are these convertions still required? -./inc/functions.php:2783:// @TODO Rewrite this function to use readFromFile() and writeToFile() -./inc/functions.php:3659:// @TODO Lame description for this function -./inc/functions.php:3681: // @TODO Move this in a filter -./inc/functions.php:3805: // @TODO This is still very static, rewrite it somehow +./inc/functions.php:2760: // @TODO Are these convertions still required? +./inc/functions.php:2778:// @TODO Rewrite this function to use readFromFile() and writeToFile() +./inc/functions.php:3654:// @TODO Lame description for this function +./inc/functions.php:3676: // @TODO Move this in a filter +./inc/functions.php:3800: // @TODO This is still very static, rewrite it somehow ./inc/functions.php:481: // @TODO Do only use $content, not $DATA or raw variables ./inc/functions.php:551: // @TODO Extension 'msg' does not exist ./inc/functions.php:614:// @TODO Rewrite this to an extension 'smtp' ./inc/install-functions.php:63: // @TODO DEACTIVATED: changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0); -./inc/language/de.php:1146:// @TODO Rewrite these two constants -./inc/language/de.php:1161:// @TODO Rewrite these three constants +./inc/language/de.php:1143:// @TODO Rewrite these two constants +./inc/language/de.php:1158:// @TODO Rewrite these three constants ./inc/language/de.php:309: // @TODO Following two are unused? -./inc/language/de.php:841:// @TODO Are these constants longer used? +./inc/language/de.php:838:// @TODO Are these constants longer used? ./inc/language-functions.php:234: // @TODO These are all valid languages, again hard-coded ./inc/language-functions.php:46:// @TODO Rewrite all language constants to this function. ./inc/language/rallye_de.php:13: * @TODO Naming convention not applied for language strings * @@ -68,9 +69,11 @@ ./inc/language/sponsor_de.php:119:// @TODO Rewrite these four constants to one and use sprintf() ./inc/libs/admins_functions.php:440: // @TODO This can be, somehow, rewritten ./inc/libs/beg_functions.php:58: // @TODO Try to rewrite the following unset() -./inc/libs/bonus_functions.php:213: // @TODO Try to find a way for rewriting this constant -./inc/libs/bonus_functions.php:301: // @TODO This query isn't right, it will only update if the user was for a longer time away! +./inc/libs/bonus_functions.php:213: // @TODO Move this HTML to a template +./inc/libs/bonus_functions.php:297: // @TODO This query isn't right, it will only update if the user was for a longer time away! ./inc/libs/doubler_functions.php:46:// @TODO Lame description +./inc/libs/doubler_functions.php:94: // @TODO Can't this be moved into EL? +./inc/libs/mailid_functions.php:49: // @TODO Rewrite this to a dynamic include or so ./inc/libs/rallye_functions.php:724: $EXPIRE = 3; // @TODO The hard-coded value... ./inc/libs/rallye_functions.php:806:// @TODO Please document this function ./inc/libs/rallye_functions.php:864: // Load count @TODO Can't we rewrite this to our API? @@ -79,16 +82,17 @@ ./inc/libs/register_functions.php:375: // @TODO Rewrite this to a filter ./inc/libs/register_functions.php:382: // @TODO Rewrite this whole if() block to addPointsThroughReferalSystem(). This will also make following if() block obsolete ./inc/libs/register_functions.php:383: // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable -./inc/libs/surfbar_functions.php:1549: // @TODO This can be somehow rewritten -./inc/libs/surfbar_functions.php:721:// @TODO Can't we use our new expression language instead of this ugly code? -./inc/libs/surfbar_functions.php:965: // @TODO Invalid salt should be refused +./inc/libs/surfbar_functions.php:1547: // @TODO This can be somehow rewritten +./inc/libs/surfbar_functions.php:719:// @TODO Can't we use our new expression language instead of this ugly code? +./inc/libs/surfbar_functions.php:963: // @TODO Invalid salt should be refused ./inc/libs/task_functions.php:245: // @TODO These can be rewritten to filter ./inc/libs/task_functions.php:53:// @TODO Move all extension-dependent queries into filters -./inc/libs/user_functions.php:138: // @TODO These two constants are no longer used, maybe we reactivate this code? -./inc/libs/user_functions.php:225:// @TODO Double-check configuration entry here -./inc/libs/user_functions.php:317: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content); -./inc/libs/user_functions.php:337: // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON)); -./inc/libs/user_functions.php:413: // @TODO We should try to rewrite this to fetchUserData() somehow +./inc/libs/theme_functions.php:95: // @TODO Can't this be rewritten to an API function? +./inc/libs/user_functions.php:146: // @TODO These two constants are no longer used, maybe we reactivate this code? +./inc/libs/user_functions.php:233:// @TODO Double-check configuration entry here +./inc/libs/user_functions.php:325: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content); +./inc/libs/user_functions.php:345: // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON)); +./inc/libs/user_functions.php:421: // @TODO We should try to rewrite this to fetchUserData() somehow ./inc/libs/yoomedia_functions.php:116: $response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script ./inc/load_config.php:77: // @TODO Rewrite them to avoid this else block ./inc/loader/load_cache-extension.php:13: * @TODO Rewrite this whole file to load_cache-extensions.php * @@ -109,10 +113,9 @@ ./inc/modules/admin/what-admin_add.php:61: // @TODO Cant this be rewritten? ./inc/modules/admin/what-admin_add.php:77: // @TODO This can be somehow rewritten to a function ./inc/modules/admin/what-adminedit.php:58: // @TODO Kill all constants in this file -./inc/modules/admin/what-admins_mails.php:61: // @TODO Can this be rewritten??? +./inc/modules/admin/what-admins_mails.php:61: // @TODO Can this be rewritten to an API function? ./inc/modules/admin/what-bonus.php:48:// @TODO Unused at the moment ./inc/modules/admin/what-config_admins.php:146: // @TODO Rewrite this to filter 'run_sqls' -./inc/modules/admin/what-config_mods.php:141: // @TODO Rewritings: mod->module in template ./inc/modules/admin/what-config_mods.php:57: // @TODO This can be moved into mysql-function.php, see checkModulePermissions() function ./inc/modules/admin/what-config_points.php:113: // @TODO Rewrite this to a filter ./inc/modules/admin/what-config_rallye_prices.php:209: // @TODO Rewritings: level->price_level, infos->info in template @@ -125,14 +128,16 @@ ./inc/modules/admin/what-guest_add.php:69: // @TODO Cant this be rewritten? ./inc/modules/admin/what-guest_add.php:85: // @TODO This can be somehow rewritten to a function ./inc/modules/admin/what-holiday_list.php:48:// @TODO Unused at the moment -./inc/modules/admin/what-list_autopurge.php:55:// @TODO Rewrite those lines to filter +./inc/modules/admin/what-list_autopurge.php:49:// @TODO Rewrite those lines to filter ./inc/modules/admin/what-list_autopurge.php:85: // @TODO Rewritings: surname->surname,family->family in templates ./inc/modules/admin/what-list_bonus.php:131: // @TODO Can't this be moved into our expression language? ./inc/modules/admin/what-list_cats.php:56: // @TODO No longer needed? define('__CATS_BASE' , '' . $login . ''; ./inc/modules/guest/what-sponsor_infos.php:70: // @TODO Rewritings: conv->conv_rate,name->conv_name in template -./inc/modules/guest/what-sponsor_infos.php:90: // @TODO Rewritings: name->pay_name,min->pay_min_count,min->pay_min_count,curr->pay_currency -./inc/modules/guest/what-sponsor_reg.php:287: // @TODO Swap this HTML code to templates +./inc/modules/guest/what-sponsor_reg.php:290: // @TODO Swap this HTML code to templates ./inc/modules/guest/what-stats.php:116: // @TODO This can be somehow rewritten ./inc/modules/guest/what-stats.php:76:// @TODO This can be rewritten in a dynamic include -./inc/modules/member/what-beg.php:64:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout'))); +./inc/modules/member/what-beg.php:56:// @TODO Can't this be moved into EL? +./inc/modules/member/what-beg.php:65:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout'))); ./inc/modules/member/what-bonus.php:57: // @TODO Rewrite this to a filter ./inc/modules/member/what-categories.php:129: // @TODO Rewrite this to use $OUT .= ... ./inc/modules/member/what-doubler.php:56:// @TODO The '*100' is in the way to get moved into the template -./inc/modules/member/what-order.php:456: // @TODO Rewrite this to a filter +./inc/modules/member/what-order.php:458: // @TODO Rewrite this to a filter ./inc/modules/member/what-order.php:65:// @TODO Rewrite this to a filter -./inc/modules/member/what-payout.php:221: // @TODO Rewrite this to a filter +./inc/modules/member/what-payout.php:222: // @TODO Rewrite this to a filter ./inc/modules/member/what-points.php:55:// @TODO Should we rewrite this to a filter? ./inc/modules/member/what-rallyes.php:91: // @TODO Reactivate this: $content['admin'] = '' . $content['login'] . ''; ./inc/modules/member/what-refback.php:131: // @TODO UNUSED: $refRow['status'] = translateUserStatus($refRow['status']); ./inc/modules/member/what-reflinks.php:54:// @TODO Move this into a filter -./inc/modules/member/what-stats.php:119: // @TODO Rewrite in template: clix->clicks ./inc/modules/member/what-transfer.php:132: // @TODO Rewrite this to a filter ./inc/modules/member/what-transfer.php:222: // @TODO Try to rewrite his to $content = SQL_FETCHARRAY(), see some lines above for two different queries ./inc/modules/member/what-transfer.php:304: // @TODO This should be somehow rewritten to $row = SQL_FETCHARRAY(), see switch() block above for SQL queries @@ -187,9 +191,9 @@ ./inc/modules/order.php:76: // @TODO Unused: 2,4 ./inc/monthly/monthly_bonus.php:69: // @TODO Rewrite this to a filter ./inc/mysql-manager.php:1590: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() -./inc/mysql-manager.php:1688: // @TODO Rewrite this to a filter -./inc/mysql-manager.php:2068: // @TODO Rewrite this to a filter -./inc/mysql-manager.php:2109:// @TODO Fix inconsistency between last_module and getWhat() +./inc/mysql-manager.php:1690: // @TODO Rewrite this to a filter +./inc/mysql-manager.php:2070: // @TODO Rewrite this to a filter +./inc/mysql-manager.php:2111:// @TODO Fix inconsistency between last_module and getWhat() ./inc/mysql-manager.php:229: // @TODO Nothing helped??? ./inc/mysql-manager.php:264: // @TODO Rewrite this to a filter ./inc/mysql-manager.php:563: // @TODO Try to rewrite this to one or more functions @@ -202,14 +206,13 @@ ./inc/wrapper-functions.php:455:// @TODO Do some more sanity check here ./inc/wrapper-functions.php:793: * @TODO Do we really need this check? If yes, try to fix this: ./mailid.php:135: // @TODO Rewrite this to a filter -./mailid.php:215: // @TODO Rewrite this to a dynamic include or so ./mailid.php:95: // @TODO Rewrite this to a filter -./mailid_top.php:100: // @TODO Rewrite this to a filter -./mailid_top.php:136: // @TODO Rewrite this to a filter -./mailid_top.php:183: // @TODO Rewrite this to a filter -./mailid_top.php:190: // @TODO Rewrite this to a filter -./mailid_top.php:226: // @TODO Rewrite these blocks to filter -./mailid_top.php:261: // @TODO Try to rewrite the following unset() +./mailid_top.php:132: // @TODO Rewrite this to a filter +./mailid_top.php:179: // @TODO Rewrite this to a filter +./mailid_top.php:186: // @TODO Rewrite this to a filter +./mailid_top.php:222: // @TODO Rewrite these blocks to filter +./mailid_top.php:257: // @TODO Try to rewrite the following unset() +./mailid_top.php:99: // @TODO Rewrite this to a filter ./view.php:70: // @TODO No banner found, output some default banner ./templates/de/html/admin/admin_add_country.tpl:23: ./templates/de/html/admin/admin_admins_contct_form.tpl:4: @@ -220,16 +223,18 @@ ./templates/de/html/admin/admin_list_bonus.tpl:3: ./templates/de/html/admin/admin_list_mods.tpl:4: ./templates/de/html/admin/admin_list_primera_main.tpl:3: +./templates/de/html/admin/admin_list_refs_level.tpl:21: ./templates/de/html/admin/admin_list_unconfirmed_list.tpl:3: ./templates/de/html/admin/admin_list_wernis_main.tpl:2: -./templates/de/html/admin/admin_login_form.tpl:35: @TODO Doesn't work with sessions -./templates/de/html/admin/admin_login_form.tpl:38: @TODO Try to move the select box to our generic functions +./templates/de/html/admin/admin_login_form.tpl:34: @TODO Doesn't work with sessions +./templates/de/html/admin/admin_login_form.tpl:37: @TODO Try to move the select box to our generic functions ./templates/de/html/admin/admin_mods_edit.tpl:3: ./templates/de/html/admin/admin_optimize.tpl:3: ./templates/de/html/admin/admin_send_bonus_form.tpl:4: ./templates/de/html/guest/guest_login.tpl:21: @TODO Deactivated feature, try to implement it or remove it. ./templates/de/html/guest/guest_nickname_login.tpl:21: @TODO Deactivated feature, try to find a solution for this or remove it. ./templates/de/html/guest/guest_stats_member.tpl:21: @TODO We have to fix these counters. +./templates/de/html/member/member_unconfirmed_table_nopoints.tpl:11: ./templates/de/html/surfbar/surfbar_frame_textlinks.tpl:5: ./templates/de/html/surfbar/surfbar_frame_top.tpl:32:// @TODO Try to rewrite this JavaScript to js.php?js=surfbar_frame_top (wouldn't be easy) ### ### DEPRECATION FOLLOWS: ### ### diff --git a/debug.php b/debug.php index 44af72c545..5e8a6b82ed 100644 --- a/debug.php +++ b/debug.php @@ -54,7 +54,7 @@ if ((isExtensionActive('debug')) && (!ifFatalErrorsDetected())) { // Handle the request if (DEBUG_HANDLE_REQUEST(postRequestParameter('request'))) { // Construct FQFN for the module - $inc = sprintf("inc/debug/%s/request_%s", + $inc = sprintf("inc/debug/%s/request_%s.php", getConfig('debug_mode'), SQL_ESCAPE(postRequestParameter('request')) ); diff --git a/inc/autopurge/purge-inact.php b/inc/autopurge/purge-inact.php index 1e725110c5..3f98e7023a 100644 --- a/inc/autopurge/purge-inact.php +++ b/inc/autopurge/purge-inact.php @@ -127,23 +127,18 @@ ORDER BY // Now let's have a look for inactive accounts we want to delete we newly use the same exclude list // here for e.g. excluding holiday users - $result_inactive = SQL_QUERY_ESC("SELECT + $result_inactive = SQL_QUERY("SELECT d.userid, d.email, d.last_online FROM `{?_MYSQL_PREFIX?}_user_data` AS d WHERE `status`='CONFIRMED' AND - `joined` < (UNIX_TIMESTAMP() - %s) AND - `last_online` < (UNIX_TIMESTAMP() - %s) AND - `ap_notified` < (UNIX_TIMESTAMP() - %s) + `joined` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND + `last_online` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND + `ap_notified` < (UNIX_TIMESTAMP() - {?ap_inactive_time?}) ".$EXCLUDE_LIST." ORDER BY - `userid` ASC", - array( - getConfig('ap_inactive_since'), - getConfig('ap_inactive_since'), - getConfig('ap_inactive_time') - ), __FILE__, __LINE__); + `userid` ASC", __FILE__, __LINE__); if (SQL_NUMROWS($result_inactive) > 0) { // Prepare variable... diff --git a/inc/config-functions.php b/inc/config-functions.php index b58db19ee5..b32fcf713f 100644 --- a/inc/config-functions.php +++ b/inc/config-functions.php @@ -224,7 +224,7 @@ function updateOldConfigFile () { /// ... and write it to the new config //* DEBUG: */ outputHtml('function=' . $function . ',new=' . $new . ',comment=' . $comment . "
"); - changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', $comment, $function . "('" . $oldNew . "', \"", "\");", constant($new), 0); + changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', $comment, $function . "('" . $oldNew . "', \"", '");', constant($new), 0); //* DEBUG: */ outputHtml("CHANGED!
"); // Mark it as done @@ -263,7 +263,7 @@ function updateOldConfigFile () { $key = substr(trim($parts[0]), 1, -1); $value = substr(trim($parts[1]), 1, -2); // We can now save the right part in new config file - changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', $comments[$key], " '".$key."' => \"", "\",", $value, 0); + changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', $comments[$key], " '".$key."' => \"", '",', $value, 0); } } // END - foreach diff --git a/inc/fix_menu.php b/inc/fix_menu.php index 31d3f96ff7..1fb3d21da5 100644 --- a/inc/fix_menu.php +++ b/inc/fix_menu.php @@ -74,11 +74,20 @@ foreach (array('guest','member','admin') as $menu) { if (is_null($entry['what'])) { // Main menu is double SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `what` IS NULL LIMIT %s", - array($menu, $entry['action'], ($entries - 1)), __FILE__, __LINE__); + array( + $menu, + $entry['action'], + ($entries - 1) + ), __FILE__, __LINE__); } else { // Sub menu is double SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `what`='%s' LIMIT %s", - array($menu, $entry['action'], $entry['what'], ($entries - 1)), __FILE__, __LINE__); + array( + $menu, + $entry['action'], + $entry['what'], + ($entries - 1) + ), __FILE__, __LINE__); } } // END - if } diff --git a/inc/functions.php b/inc/functions.php index 5e7d2962d2..f010daf758 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2502,7 +2502,7 @@ function generateErrorCodeFromUserStatus ($status='') { // Back-ported from the new ship-simu engine. :-) function debug_get_printable_backtrace () { // Init variable - $backtrace = "
    \n"; + $backtrace = '
      '; // Get and prepare backtrace for output $backtraceArray = debug_backtrace(); @@ -2510,11 +2510,11 @@ function debug_get_printable_backtrace () { if (!isset($trace['file'])) $trace['file'] = __FUNCTION__; if (!isset($trace['line'])) $trace['line'] = __LINE__; if (!isset($trace['args'])) $trace['args'] = array(); - $backtrace .= "
    1. ".basename($trace['file']).":" . $trace['line'].", " . $trace['function'].'('.count($trace['args']).")
    2. \n"; + $backtrace .= '
    3. ' . basename($trace['file']) . ':' . $trace['line'].", " . $trace['function'] . '(' . count($trace['args']) . ')
    4. '; } // END - foreach // Close it - $backtrace .= "
    \n"; + $backtrace .= '
'; // Return the backtrace return $backtrace; @@ -2566,17 +2566,17 @@ function debug_report_bug ($F, $L, $message = '', $sendEmail = true) { } // END - if // Add output - $debug .= "Please report this bug at http://bugs.mxchange.org and include the logfile from " . str_replace(getConfig('PATH'), '', getConfig('CACHE_PATH')) . "debug.log in your report (you can now attach files):
";
+	$debug .= 'Please report this bug at http://bugs.mxchange.org and include the logfile from ' . str_replace(getConfig('PATH'), '', getConfig('CACHE_PATH')) . 'debug.log in your report (you can now attach files):
';
 	$debug .= debug_get_printable_backtrace();
-	$debug .= "
\nRequest-URI: " . getRequestUri()."
\n"; - $debug .= "Thank you for finding bugs."; + $debug .= '
Request-URI: ' . getRequestUri() . '
'; + $debug .= 'Thank you for finding bugs.'; // Send an email? (e.g. not wanted for evaluation errors) if (($sendEmail === true) && (!isInstallationPhase())) { // Prepare content $content = array( - 'message' => trim($message), - 'backtrace' => trim(debug_get_mailable_backtrace()) + 'message' => trim($message), + 'backtrace' => trim(debug_get_mailable_backtrace()) ); // Send email to webmaster diff --git a/inc/install-inc.php b/inc/install-inc.php index 1f70d3aa55..4f62415814 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -179,7 +179,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) { // MySQL data $OUT = ''; foreach ($GLOBALS['install_mysql'] as $key => $value) { - $OUT .= " \n"; + $OUT .= ' '; } // END - foreach $content['mysql_hidden'] = $OUT; diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index 5c99bb2e47..ed24b4b0b3 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -149,7 +149,7 @@ function addBonusRanks ($data, $type, $userid) { } // END - if // Load rankings - $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE %s=%s ORDER BY `level` ASC LIMIT {?bonus_lines?}", + $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `%s`=%s ORDER BY `level` ASC LIMIT {?bonus_lines?}", array($type, $data), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Start generating the ranking list @@ -197,12 +197,8 @@ LIMIT 1", $rows['rank'] = $rank; $rows['sw'] = $SW; - // Output row - $OUT .= " - ".$rows['rank'].". - ".$rows['userid']." - {%pipe,translateComma=".$rows['points']."%} -\n"; + // Load row template + $OUT .= loadTemplate('member_bonus_turbo_row', true, $rows); // Switch color $SW = 3 - $SW; @@ -210,16 +206,16 @@ LIMIT 1", if ($self === false) { // If current user was not found set constant - // @TODO Try to find a way for rewriting this constant $GLOBALS['ranking_content']['rankings'] = getMessage('BONUS_RANK_YOU_ARE_404'); } // END - if } else { // No entries found! - $OUT = " - -
".getMaskedMessage('BONUS_NO_RANKS', $data)."
+ // @TODO Move this HTML to a template + $OUT = ' + +
' . getMaskedMessage('BONUS_NO_RANKS', $data) . '
-\n"; +'; } // Retutn content @@ -299,14 +295,14 @@ function FILTER_ADD_LOGIN_BONUS () { if ((isExtensionInstalledAndNewer('sql_patches', '0.2.8')) && (getConfig('bonus_active') == 'Y') && (getConfig('bonus_login_yn') == 'Y')) { // Update last login if far enougth away // @TODO This query isn't right, it will only update if the user was for a longer time away! - SQL_QUERY_ESC("UPDATE + SQL_QUERY_ESC('UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `last_login`=UNIX_TIMESTAMP() WHERE `userid`=%s AND `last_login` < (UNIX_TIMESTAMP() - {?login_timeout?}) -LIMIT 1", +LIMIT 1', array( getMemberId() ), __FUNCTION__, __LINE__ diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php index 4e03f7ecba..c8662e6dc7 100644 --- a/inc/libs/rallye_functions.php +++ b/inc/libs/rallye_functions.php @@ -55,7 +55,7 @@ function autostartReferalRallyes ($result) { array(bigintval($id)), __FUNCTION__, __LINE__); // Transfer all neccessary data to the $content array - $content['userid_cnt'] = countSumTotalData('CONFIRMED','user_data','userid','status',true); + $content['userid_cnt'] = getTotalConfirmedUser(); $content['start'] = generateDateTime($start, 2); $content['end'] = generateDateTime($end , 2); $content['now_t'] = generateDateTime(time(), 2); diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php index 5dc539c2e7..dcd553bf17 100644 --- a/inc/libs/refback_functions.php +++ b/inc/libs/refback_functions.php @@ -52,7 +52,7 @@ function addRefbackPoints ($userid, $ref, $points, $ref_points) { $return = $points; // Get all ref levels - $result_refs = SQL_QUERY("SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `level` > 0 ORDER BY `level` ASC", + $result_refs = SQL_QUERY('SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `level` > 0 ORDER BY `level` ASC', __FUNCTION__, __LINE__); // "Walk" through all level @@ -114,30 +114,33 @@ function getRefbackPercents ($userid, $ref) { // Skip identical ids if ($userid == $ref) return 0; - // Default is zero - $percents = '0'; - - // Get percents from database - $result = SQL_QUERY_ESC("SELECT refback FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid`=%s AND `refid`=%s LIMIT 1", - array($ref, $userid), __FUNCTION__, __LINE__); - - // Entry found? (Should be!) - if (SQL_NUMROWS($result) == 1) { - // Fetch percents - list($percents) = SQL_FETCHROW($result); - //* DEBUG: */ print(__FUNCTION__ . '(' . __LINE__."):percents={$percents}
"); - } else { - // Debug log - //* DEBUG: */ print(__FUNCTION__ . '(' . __LINE__."): NO ENTRY FOUND! :-(
"); - logDebugMessage(__FUNCTION__, __LINE__, "userid={$userid},ref={$ref} - No entry found! :-("); - } - - // Free result - SQL_FREERESULT($result); + // Is it cached? + if (!isset($GLOBALS['refback_percents'][$userid][$ref])) { + // Default is zero + $GLOBALS['refback_percents'][$userid][$ref] = '0'; + + // Get percents from database + $result = SQL_QUERY_ESC("SELECT `refback` FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid`=%s AND `refid`=%s LIMIT 1", + array($ref, $userid), __FUNCTION__, __LINE__); + + // Entry found? (Should be!) + if (SQL_NUMROWS($result) == 1) { + // Fetch percents + list($GLOBALS['refback_percents'][$userid][$ref]) = SQL_FETCHROW($result); + //* DEBUG: */ print(__FUNCTION__ . '(' . __LINE__."):percents=".$GLOBALS['refback_percents'][$userid][$ref]."
"); + } else { + // Debug log + //* DEBUG: */ print(__FUNCTION__ . '(' . __LINE__."): NO ENTRY FOUND! :-(
"); + logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ' - No entry found! :-('); + } + + // Free result + SQL_FREERESULT($result); + } // END - if // Return percents //* DEBUG: */ print("----------------------- ".__FUNCTION__." - EXIT ------------------------
"); - return $percents; + return $GLOBALS['refback_percents'][$userid][$ref]; } // "Getter" for userid array which will return only one entry diff --git a/inc/libs/theme_functions.php b/inc/libs/theme_functions.php index 2279e5741f..ef2d07b3aa 100644 --- a/inc/libs/theme_functions.php +++ b/inc/libs/theme_functions.php @@ -92,11 +92,12 @@ ORDER BY SQL_FREERESULT($result); // Construct selection form for the box template + // @TODO Can't this be rewritten to an API function? $OUT = ''; foreach ($themesArray['theme_unix'] as $key => $theme) { - $OUT .= " '; } // END - foreach // Remember content diff --git a/inc/libs/transfer_functions.php b/inc/libs/transfer_functions.php index 1104d6bf5a..6c509f4d8d 100644 --- a/inc/libs/transfer_functions.php +++ b/inc/libs/transfer_functions.php @@ -51,7 +51,7 @@ function autoPurgeTransfers ($max, $age) { $remove = SQL_NUMROWS($result) - $max; // This will make it really old, so the final removal query will find it - $result = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_transfers_in` SET `time_trans`=0 ORDER BY `id` LIMIT %s", + $result = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_transfers_in` SET `time_trans`=0 ORDER BY `id` ASC LIMIT %s", array($remove), __FUNCTION__, __LINE__); } // END - if @@ -62,7 +62,7 @@ function autoPurgeTransfers ($max, $age) { $remove = SQL_NUMROWS($result) - $max; // This will make it really old, so the final removal query will find it - $result = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_transfers_out` SET `time_trans`=0 ORDER BY `id` LIMIT %s", + $result = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_transfers_out` SET `time_trans`=0 ORDER BY `id` ASC LIMIT %s", array($remove), __FUNCTION__, __LINE__); } // END - if diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index 549340dd24..012ff2c6b4 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -70,8 +70,14 @@ function alpha ($sortby, $colspan, $return=false) { } } // END - while + // Prepare content + $content = array ( + 'colspan2' => $colspan, + 'alpha_selection' => $OUT + ); + // Load template - $OUT = loadTemplate('admin_list_user_alpha', true, $OUT); + $OUT = loadTemplate('admin_list_user_alpha', true, $content); if ($return === true) { // Return generated code return $OUT; @@ -118,7 +124,9 @@ function addSortLinks ($letter, $sortby, $colspan, $return=false) { } } // END - foreach + // Add list and colspan $content['list'] = substr($OUT, 0, -13); + $content['colspan2'] = $colspan; // Load template $OUT = loadTemplate('admin_list_user_sort', true, $content); diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index b4b8d03dcd..402b3ed7d7 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -1353,5 +1353,20 @@ function doVerifyExpertSettings () { return $return; } +// Generate link to unconfirmed mails for admin +function generateUnconfirmedAdminLink ($id, $unconfirmed, $type = 'bid') { + // Init output + $OUT = $unconfirmed; + + // Do we have unconfirmed mails? + if ($unconfirmed > 0) { + // Add link to list_unconfirmed what-file + $OUT = '' . translateComma($unconfirmed) . ''; + } // END - if + + // Return it + return $OUT; +} + // [EOF] ?> diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index 9685c51acd..b9f2da4b28 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -168,7 +168,7 @@ LIMIT 1", if ($taskData['task_type'] == 'SUPPORT_MEMBER') { $mode = substr($taskData['text'], 0, strpos($taskData['text'], ':')); $taskData['text'] = substr($taskData['text'], strpos($taskData['text'], ':') + 1); - $add = "
  • {--ADMIN_TASK_SUPPORT_MODE--}: " . $mode . "
  • "; + $add = '
  • {--ADMIN_TASK_SUPPORT_MODE--}: ' . $mode . '
  • '; } // END - if // Is a userid assign? @@ -179,7 +179,7 @@ LIMIT 1", $content = getUserDataArray(); // Generate HTML list entry - $add = "
  • {--ADMIN_MEMBER_UID--}: ".generateUserProfileLink($taskData['userid'], 'user_data')." (".translateGender($content['gender']) . ' ' . $content['surname'] . ' ' . $content['family'].")
  • "; + $add = '
  • {--ADMIN_MEMBER_UID--}: ' . generateUserProfileLink($taskData['userid'], 'user_data') . ' (' . translateGender($content['gender']) . ' ' . $content['surname'] . ' ' . $content['family'] . ')
  • '; } else { // Invalid userid, so log and zero it logDebugMessage(__FUNCTION__, __LINE__, 'Invalid userid=' . $taskData['userid'] . ' -> not found!'); diff --git a/inc/modules/admin/what-admin_add.php b/inc/modules/admin/what-admin_add.php index 2ce5fe9133..f4155ec8c9 100644 --- a/inc/modules/admin/what-admin_add.php +++ b/inc/modules/admin/what-admin_add.php @@ -134,24 +134,25 @@ if (!isFormSent()) { } } } - $OUT = " + '; foreach ($below as $key => $m) { if (is_array($m)) { foreach ($m as $key2 => $m2) { - $OUT .= " \n"; + $OUT .= ' (' . $titles[$k] . ')'; + } // END - if + } // END - foreach + $OUT .= ''; } } else { - $OUT .= " \n"; + $OUT .= ' '; } } - $OUT .= ""; + $OUT .= ''; // Prepare selections for template $content['below_selection'] = $OUT; diff --git a/inc/modules/admin/what-admins_mails.php b/inc/modules/admin/what-admins_mails.php index 8afbb9aef9..ec939a6d1e 100644 --- a/inc/modules/admin/what-admins_mails.php +++ b/inc/modules/admin/what-admins_mails.php @@ -58,18 +58,18 @@ if (isFormSent('edit')) { $OUT = ''; $adminId2 = '0'; $id = '0'; while ($content = SQL_FETCHARRAY($result)) { - // @TODO Can this be rewritten??? - $OUT .= "
    ({?POINTS?})
    \n"; + $OUT .= '
  • ({?POINTS?})
  • '; } // END - if $cnt++; } // END - foreach @@ -108,9 +108,9 @@ if (isFormSent()) { // Add more empty fields for ($i = $cnt; $i < $max; $i++) { - $OUT .= "
  • ({?POINTS?})
  • \n"; + $OUT .= '
  • ({?POINTS?})
  • '; } // END - for - $OUT .= "\n"; + $OUT .= ''; $content['trates_list'] = $OUT; // Selection boxes diff --git a/inc/modules/admin/what-config_mods.php b/inc/modules/admin/what-config_mods.php index a24778f086..dee6e47d26 100644 --- a/inc/modules/admin/what-config_mods.php +++ b/inc/modules/admin/what-config_mods.php @@ -125,44 +125,38 @@ if (isFormSent('edit')) { if (countPostSelection() == 0) { // Load module data (We do not need to check if there's at least one...) - $result = SQL_QUERY('SELECT id, module, locked, hidden, admin_only, title, mem_only -FROM `{?_MYSQL_PREFIX?}_mod_reg` -ORDER BY module', __FILE__, __LINE__); + $result = SQL_QUERY('SELECT + `id`, `module`, `locked`, `hidden`, `admin_only`, `title`, `mem_only` +FROM + `{?_MYSQL_PREFIX?}_mod_reg` +ORDER BY + `module` ASC', __FILE__, __LINE__); + $OUT = ''; $SW = 2; while ($content = SQL_FETCHARRAY($result)) { // Reset title to --- if it is NULL if (empty($content['title'])) $content['title'] = '---'; if (($content['module'] == 'index') || ($content['module'] == 'login')) { // Add link to detail statistics - $content['module'] = "" . $content['module'] . ""; + $content['module'] = '' . $content['module'] . ''; } // END - if // Prepare array for the template - // @TODO Rewritings: mod->module in template - $content = array( - 'sw' => $SW, - 'id' => $content['id'], - 'mod' => $content['module'], - 'title' => $content['title'], - 'locked' => translateYesNo($content['locked']), - 'hidden' => translateYesNo($content['hidden']), - 'admin' => translateYesNo($content['admin_only']), - 'mem' => translateYesNo($content['mem_only']), - ); + $content['sw'] = $SW; // Load row template $OUT .= loadTemplate('admin_list_mods_row', true, $content); // Switch colors $SW = 3 - $SW; - } + } // END - while // Free memory SQL_FREERESULT($result); // Load main template loadTemplate('admin_list_mods', false, $OUT); -} +} // END - if // [EOF] ?> diff --git a/inc/modules/admin/what-config_register.php b/inc/modules/admin/what-config_register.php index 4cba9e31e0..0744101ffc 100644 --- a/inc/modules/admin/what-config_register.php +++ b/inc/modules/admin/what-config_register.php @@ -73,16 +73,10 @@ while ($content = SQL_FETCHARRAY($result)) { // Add more data $content['sw'] = $SW; - $content['selection'] = addSelectionBox('yn', $content['field_required'], "sel[".$content['id']."]"); + $content['selection'] = addSelectionBox('yn', $content['field_required'], 'sel[' . $content['id'] . ']'); // @TODO Move this HTML code into a template - $OUT .= " - ".$content['id']." - ".$content['field_name']." - - ".$content['selection']." - -\n"; + $OUT .= loadTemplate('admin_config_register_row', true, $content); // Switch color $SW = 3 - $SW; diff --git a/inc/modules/admin/what-del_transfer.php b/inc/modules/admin/what-del_transfer.php index e6d63adc43..b4fc851c70 100644 --- a/inc/modules/admin/what-del_transfer.php +++ b/inc/modules/admin/what-del_transfer.php @@ -53,9 +53,9 @@ if (isFormSent('del')) { // Delete entries... foreach (postRequestParameter('sel') as $id => $sel) { - addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `trans_id`=%s LIMIT 1", + addSql(SQL_QUERY_ESC('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `trans_id`=%s LIMIT 1', array(bigintval($id)), __FILE__, __LINE__, false)); - addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `trans_id`=%s LIMIT 1", + addSql(SQL_QUERY_ESC('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `trans_id`=%s LIMIT 1', array(bigintval($id)), __FILE__, __LINE__, false)); } // END - foreach @@ -65,39 +65,39 @@ if (isFormSent('del')) { } // END - if // We only need outgoing transfers -$result = SQL_QUERY("SELECT `userid`, `to_userid`, `trans_id`, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_out` ORDER BY `trans_id` ASC", __FILE__, __LINE__); +$result = SQL_QUERY('SELECT + `userid` AS `from_userid`, `to_userid`, `trans_id`, `points`, `reason`, `time_trans` +FROM + `{?_MYSQL_PREFIX?}_user_transfers_out` +ORDER BY + `trans_id` ASC', __FILE__, __LINE__); + $total = '0'; if (SQL_NUMROWS($result) > 0) { // Output rows $OUT = ''; $SW = 2; while ($content = SQL_FETCHARRAY($result)) { // Prepare data for the row template - $content = array( - 'sw' => $SW, - 'trans_id' => $content['trans_id'], - 'time_trans' => generateDateTime($content['time_trans'], 3), - 'userid_from' => generateUserProfileLink($content['userid']), - 'userid_to' => generateUserProfileLink($content['to_userid']), - 'reason' => $content['reason'], - 'points' => translateComma($content['points']), - ); + $content['sw'] = $SW; + $content['time_trans'] = generateDateTime($content['time_trans'], 3); // Load row template $OUT .= loadTemplate('admin_del_transfer_row', true, $content); // Sum points and switch colors - $total += $content['points']; $SW = 3 - $SW; + $total += $content['points']; + $SW = 3 - $SW; } // END - while // Free memory SQL_FREERESULT($result); } else { // Nothing for in and out - $OUT = " - - ".loadTemplate('admin_settings_saved', true, getMessage('TRANSFER_NO_INOUT_TRANSFERS'))." + $OUT = ' + + ' . loadTemplate('admin_settings_saved', true, getMessage('TRANSFER_NO_INOUT_TRANSFERS')) . ' -"; +'; } // ... and add them to a constant for the template diff --git a/inc/modules/admin/what-email_archiv.php b/inc/modules/admin/what-email_archiv.php index 369cf7f321..d840755cd5 100644 --- a/inc/modules/admin/what-email_archiv.php +++ b/inc/modules/admin/what-email_archiv.php @@ -66,7 +66,7 @@ if (!isGetRequestParameterSet('page')) setGetRequestParameter('page' , 1); if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', getConfig('mails_page')); // Add limitation to SQL string -$sql .= " LIMIT ".(getRequestParameter('offset') * getRequestParameter('page') - getRequestParameter('offset')) . ', ' . getRequestParameter('offset'); +$sql .= ' LIMIT ' . (getRequestParameter('offset') * getRequestParameter('page') - getRequestParameter('offset')) . ', ' . getRequestParameter('offset'); // Run SQL query for normal mails $result = SQL_QUERY($sql, __FILE__, __LINE__); @@ -109,23 +109,11 @@ if (SQL_NUMROWS($result) > 0) { } // END - if // Prepare data for the row template - $content = merge_array($content, array( - 'sw' => $SW, - 'u_link' => generateUserProfileLink($pool['sender']), - 'subject' => $pool['subject'], - 'text' => $pool['text'], - 'pay' => getPaymentTitlePrice($pool['payment_id']), - 'cat' => getCategory($pool['cat_id']), - 'sent' => $pool['max_rec'], - 'ruserids' => convertReceivers($pool['receivers']), - 'unconfirmed' => $pool['unconfirmed'], - 'type' => translatePoolType($pool['data_type']), - 'target_send' => $pool['target_send'], - 'frametester' => generateFrametesterUrl($pool['url']), - 'url' => $pool['url'], - 'timestamp' => generateDateTime($pool['timestamp'], 0), - 'mid' => $pool['id'], - )); + $content['sw'] = $SW; + $content['timestamp'] = generateDateTime($pool['timestamp'], 0); + + // Merge pool data with content + $content = merge_array($content, $pool); // Load row template and switch colors $OUT .= loadTemplate('admin_email_archiv_row', true, $content); diff --git a/inc/modules/admin/what-email_details.php b/inc/modules/admin/what-email_details.php index e66c6bb224..22ca7fb20a 100644 --- a/inc/modules/admin/what-email_details.php +++ b/inc/modules/admin/what-email_details.php @@ -56,43 +56,52 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { addMenuDescription('admin', __FILE__); // Normal mails ordered by your members -// 0 1 2 3 4 5 6 7 8 9 10 -$sql = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id -FROM `{?_MYSQL_PREFIX?}_pool` -WHERE data_type IN('ADMIN','TEMP','NEW','ACTIVE') -ORDER BY timestamp DESC"; +$sql = "SELECT + `id`, `sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `target_send`, `cat_id` +FROM + `{?_MYSQL_PREFIX?}_pool` +WHERE + `data_type` IN('ADMIN','TEMP','NEW','ACTIVE') +ORDER BY + `timestamp` DESC"; $WHO = getMessage('_ALL'); $SQL2 = ''; if (isGetRequestParameterSet(('mid'))) { // Only a specific mail shall be displayed - // 0 1 2 3 4 5 6 7 8 9 10 - $sql = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id - FROM `{?_MYSQL_PREFIX?}_pool` - WHERE `id`='".bigintval(getRequestParameter('mid'))."' - LIMIT 1"; - $WHO = getMessage('MAIL_ID').": ".getRequestParameter('mid'); + $sql = "SELECT + `id`, `sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `target_send`, `cat_id` +FROM + `{?_MYSQL_PREFIX?}_pool` +WHERE + `id`='".bigintval(getRequestParameter('mid'))."' +LIMIT 1"; + $WHO = getMessage('MAIL_ID') . ': ' . getRequestParameter('mid'); } elseif (isGetRequestParameterSet('userid')) { // All mails by a specific member shall be displayed - // 0 1 2 3 4 5 6 7 8 9 10 - $sql = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id -FROM `{?_MYSQL_PREFIX?}_pool` -WHERE sender='".bigintval(getRequestParameter('userid'))."' -ORDER by timestamp DESC"; - $WHO = getMessage('USER_ID').": ".getRequestParameter('userid'); + $sql = "SELECT + `id`, `sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `target_send`, `cat_id` +FROM + `{?_MYSQL_PREFIX?}_pool` +WHERE + `sender`='".bigintval(getRequestParameter('userid'))."' +ORDER BY + `timestamp` DESC"; + $WHO = getMessage('USER_ID') . ': ' . getRequestParameter('userid'); } if ((isExtensionActive('bonus')) && ($WHO == getMessage('_ALL'))) { - // Bonus mails sent by you - // 0 1 2 3 4 5 6 7 8 9 10 11 12 - $SQL2 = "SELECT id, subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, mails_sent, clicks -FROM `{?_MYSQL_PREFIX?}_bonus` -WHERE is_notify='N' -ORDER BY timestamp DESC"; - // Check for maximum pages - $result_bonus = SQL_QUERY($SQL2, __FILE__, __LINE__); + $result_bonus = SQL_QUERY("SELECT + `id`, `subject`, `text`, `receivers`, `points`, `time`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`, `mails_sent`, `clicks` + (`mails_sent` - `clicks`) AS `unconfirmed` +FROM + `{?_MYSQL_PREFIX?}_bonus` +WHERE + `is_notify`='N' +ORDER BY + `timestamp` DESC", __FILE__, __LINE__); } // Check for maximum pages @@ -114,7 +123,7 @@ if (!isGetRequestParameterSet('offset')) { // Add limitation to SQL string if (!isGetRequestParameterSet(('mid'))) { // Create limitation line - $add = " LIMIT ".(bigintval(getRequestParameter('offset')) * bigintval(getRequestParameter('page')) - bigintval(getRequestParameter('offset'))).", ".bigintval(getRequestParameter('offset')); + $add = ' LIMIT ' . (bigintval(getRequestParameter('offset')) * bigintval(getRequestParameter('page')) - bigintval(getRequestParameter('offset'))) . ', ' . bigintval(getRequestParameter('offset')); // For normal mails $sql .= $add; @@ -139,35 +148,25 @@ SQL_FREERESULT($result_normal); $MAIL = false; if (SQL_NUMROWS($result_list) > 0) { // Init rows - $OUT = ''; $content = array(); + $OUT = ''; // Walk through all entries - while ($pool = SQL_FETCHARRAY($result_list)) { + while ($content = SQL_FETCHARRAY($result_list)) { // Unconfirmed mails and sent mails - $result_uncon = SQL_QUERY_ESC("SELECT max_rec, clicks FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1", - array(bigintval($pool['id'])), __FILE__, __LINE__); - list($pool['sent_email'], $pool['clicks']) = SQL_FETCHROW($result_uncon); + $result_uncon = SQL_QUERY_ESC("SELECT (`max_rec` - `clicks`) AS `unconfirmed` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1", + array(bigintval($content['id'])), __FILE__, __LINE__); + + // Load and merge data + $content = merge_array($content, SQL_FETCHARRAY($result_uncon)); + + // Free result SQL_FREERESULT($result_uncon); // Unconfirmed mails - $pool['unconfirmed'] = $pool['sent_email'] - $pool['clicks']; - if ($pool['unconfirmed'] > 0) { - // Add link to list_unconfirmed what-file - $pool['unconfirmed'] = "" . $pool['unconfirmed'] . ""; - } elseif ($pool['unconfirmed'] < 0) { - // Sometimes rarely displayed minus values will be "fixed" to zero - $pool['unconfirmed'] = '0'; - } + $content['unconfirmed'] = generateUnconfirmedAdminLink($content['id'], ($content['unconfirmed']), 'mid'); // Prepare content - $content = $pool; - $content['sender_link'] = generateUserProfileLink($pool['sender']); - $content['payment'] = getPaymentTitlePrice($pool['payment_id']); - $content['category'] = getCategory($pool['cat_id']); - $content['receivers'] = convertReceivers($pool['receivers']); - $content['type'] = translatePoolType($pool['data_type']); - $content['frametester'] = generateFrametesterUrl($pool['url']); - $content['timestamp'] = generateDateTime($pool['timestamp'], 0); + $content['timestamp'] = generateDateTime($content['timestamp'], 0); // Load row template $OUT .= loadTemplate('admin_list_emails_row', true, $content); @@ -201,24 +200,12 @@ if ((isExtensionActive('bonus')) && ($WHO == getMessage('_ALL'))) { $PAGES = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5); // List emails - $OUT = ''; $content = array(); - while ($bonus = SQL_FETCHARRAY($result_bonus)) { - // Calculate unconfirmed emails - $bonus['unconfirmed'] = $bonus['mails_sent'] - $bonus['clicks']; - - // Add link? - if ($bonus['unconfirmed'] > 0) { - // Add link to list_unconfirmed what-file - $bonus['unconfirmed'] = "" . $bonus['unconfirmed'] . ""; - } // END - if + $OUT = ''; + while ($content = SQL_FETCHARRAY($result_bonus)) { + // Add link to list_unconfirmed what-file + $content['unconfirmed'] = generateUnconfirmedAdminLink($content['id'], $content['unconfirmed']); // Prepare content - $content = $bonus; - $content['time'] = createFancyTime($content['time']); - $content['category'] = getCategory($content['cat_id']); - $content['receivers'] = convertReceivers($content['receivers']); - $content['type'] = translatePoolType($content['data_type']); - $content['frametester'] = generateFrametesterUrl($content['url']); $content['timestamp'] = generateDateTime($content['timestamp'], 0); // Load row template @@ -243,5 +230,5 @@ if ($MAIL === false) { loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NO_MAILS_IN_POOL')); } // END - if -// +// [EOF] ?> diff --git a/inc/modules/admin/what-list_beg.php b/inc/modules/admin/what-list_beg.php index ebe814aa93..7bf2f906c7 100644 --- a/inc/modules/admin/what-list_beg.php +++ b/inc/modules/admin/what-list_beg.php @@ -56,19 +56,22 @@ if (getConfig('beg_rallye') == 'Y') { } // END - if // Autopurge installed? - $lastOnline = "%s"; $ONLINE = ''; + $lastOnline = ''; 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 // Check if at least one is in the active rallye - $result = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, beg_points, last_online -FROM `{?_MYSQL_PREFIX?}_user_data` -WHERE `status`='CONFIRMED' AND beg_points > 0".$lastOnline." -ORDER BY beg_points DESC, last_online DESC, userid", - array($ONLINE), __FILE__, __LINE__); + $result = SQL_QUERY("SELECT `userid`, `gender`, `surname`, `family`, `email`, `beg_points`, `last_online` +FROM + `{?_MYSQL_PREFIX?}_user_data` +WHERE + `status`='CONFIRMED' AND beg_points > 0".$lastOnline." +ORDER BY + `beg_points` DESC, + `last_online` DESC, + `userid` ASC", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // List users @@ -88,10 +91,8 @@ ORDER BY beg_points DESC, last_online DESC, userid", $content = array( 'userid' => $content['userid'], 'email' => generateEmailLink($content['email'], 'user_data'), - 'gender' => translateGender($content['gender']), - 'surname' => $content['surname'], - 'family' => $content['family'], - 'turbo' => translateComma($content['beg_points']), + 'gender' => $content['gender'], + 'turbo' => $content['beg_points'], 'last_online' => generateDateTime($content['last_online'], 2), 'sw' => $SW, 'win1' => $WIN1, @@ -102,7 +103,7 @@ ORDER BY beg_points DESC, last_online DESC, userid", // Load template and add it $OUT .= loadTemplate('admin_list_beg_rows', true, $content); $SW = 3 - $SW; $cnt++; $total += $content['beg_points']; - } + } // END - while $content['rows'] = $OUT; $content['total'] = translateComma($total); diff --git a/inc/modules/admin/what-list_cats.php b/inc/modules/admin/what-list_cats.php index 96f23cf486..75b3895a0b 100644 --- a/inc/modules/admin/what-list_cats.php +++ b/inc/modules/admin/what-list_cats.php @@ -69,12 +69,13 @@ if (isGetRequestParameterSet('userid')) { $content = merge_array($content, $row); // Check user's selection + // @TODO Rewrite this to countSum.....() function $result_user = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `userid`=%s AND `cat_id`=%s LIMIT 1", array(bigintval(getRequestParameter('userid')), bigintval($content['id'])), __FILE__, __LINE__); // Set selection - $selection = "{--NO--}"; - if (SQL_NUMROWS($result_user) == 1) $selection = "{--YES--}"; + $selection = '{--NO--}'; + if (SQL_NUMROWS($result_user) == 1) $selection = '{--YES--}'; // Add more elements $content['sw'] = $SW; diff --git a/inc/modules/admin/what-list_notifications.php b/inc/modules/admin/what-list_notifications.php index c337999dbb..625df8f4d9 100644 --- a/inc/modules/admin/what-list_notifications.php +++ b/inc/modules/admin/what-list_notifications.php @@ -55,11 +55,15 @@ if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', getCon if (isExtensionActive('bonus')) { // Bonus mails sent by you - // 0 1 2 3 4 5 6 7 8 9 10 11 12 - $SQL2 = "SELECT id, subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, mails_sent, clicks -FROM `{?_MYSQL_PREFIX?}_bonus` -WHERE is_notify='Y' -ORDER BY timestamp DESC"; + $SQL2 = "SELECT + `id`, `subject`, `text`, `receivers`, `points`, `time`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`, + `mails_sent`, `clicks`, (`mails_sent` - `clicks) AS `unconfirmed` +FROM + `{?_MYSQL_PREFIX?}_bonus` +WHERE + `is_notify`='Y' +ORDER BY + `timestamp` DESC"; // Check for maximum pages $result_max = SQL_QUERY($SQL2, __FILE__, __LINE__); @@ -69,7 +73,7 @@ ORDER BY timestamp DESC"; } // Create limitation line -$add = " LIMIT ".(bigintval(getRequestParameter('offset')) * bigintval(getRequestParameter('page')) - bigintval(getRequestParameter('offset'))).", ".bigintval(getRequestParameter('offset')); +$add = ' LIMIT ' . (bigintval(getRequestParameter('offset')) * bigintval(getRequestParameter('page')) - bigintval(getRequestParameter('offset'))) . ', ' . bigintval(getRequestParameter('offset')); // Add limitation if (!empty($SQL2)) $SQL2 .= $add; @@ -85,28 +89,16 @@ if ((isExtensionActive('bonus')) && (SQL_NUMROWS($result_max) > 0) && (!empty($S // List emails $OUT = ''; $content = array(); - while ($bonus = SQL_FETCHARRAY($result_bonus)) { - // Calculate unconfirmed emails - $bonus['unconfirmed'] = $bonus['mails_sent'] - $bonus['clicks']; - - // Add link? - if ($bonus['unconfirmed'] > 0) { - // Add link to list_unconfirmed what-file - $bonus['unconfirmed'] = "" . $bonus['unconfirmed'] . ""; - } // END - if + while ($content = SQL_FETCHARRAY($result_bonus)) { + // Add "unconfirmed-link" + $content['unconfirmed_content'] = generateUnconfirmedAdminLink($content['id'], $content['unconfirmed']); // Prepare content - $content = $bonus; - $content['time'] = createFancyTime($content['time']); - $content['category'] = getCategory($content['cat_id']); - $content['receivers'] = convertReceivers($content['receivers']); - $content['type'] = translatePoolType($content['data_type']); - $content['frametester'] = generateFrametesterUrl($content['url']); $content['timestamp'] = generateDateTime($content['timestamp'], 0); // Load row template $OUT .= loadTemplate('admin_list_notify_emails_row', true, $content); - } + } // END - if // Add navigation (without change box but with colspan=3) $content['nav'] = ''; diff --git a/inc/modules/admin/what-list_refs.php b/inc/modules/admin/what-list_refs.php index 59b6081579..5cbf29c67b 100644 --- a/inc/modules/admin/what-list_refs.php +++ b/inc/modules/admin/what-list_refs.php @@ -107,6 +107,7 @@ ORDER BY $refs_cnt = countSumTotalData(getUserData('userid'), 'user_refs', 'id', 'userid', true); // Prepare data for the template + // @TODO Try to rewrite some to EL $content = array( 'sw' => $SW, 'u_link' => generateUserProfileLink(getUserData('userid')), @@ -114,13 +115,13 @@ ORDER BY 'refs_link' => 0, 'surname' => getUserData('surname'), 'family' => getUserData('family'), - 'email' => "[".getUserData('email')."]", + 'email' => '[' . getUserData('email') . ']', 'status' => translateUserStatus(getUserData('status')), 'registered' => generateDateTime(getUserData('joined'), 3), ); // Check if referal count is larger 0 and update link - if ($refs_cnt > 0) $content['refs_link'] = generateUserProfileLink(getUserData('userid'), $refs_cnt, "list_refs"); + if ($refs_cnt > 0) $content['refs_link'] = generateUserProfileLink(getUserData('userid'), $refs_cnt, 'list_refs'); // Load template for level one $OUT_REFS .= loadTemplate('admin_list_refs_row', true, $content); @@ -160,7 +161,7 @@ ORDER BY 'refs_link' => 0, 'surname' => $levels['surname'], 'family' => $levels['family'], - 'email' => "[".$levels['email']."]", + 'email' => '[' . $levels['email'] . ']', 'status' => translateUserStatus($levels['status']), 'registered' => generateDateTime($levels['joined'], 3), ); diff --git a/inc/modules/admin/what-list_transfer.php b/inc/modules/admin/what-list_transfer.php index 96a8c72526..799d9ab25f 100644 --- a/inc/modules/admin/what-list_transfer.php +++ b/inc/modules/admin/what-list_transfer.php @@ -46,37 +46,37 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { addMenuDescription('admin', __FILE__); // We only need outgoing transfers -$result = SQL_QUERY("SELECT userid, to_userid, trans_id, points, reason, time_trans FROM `{?_MYSQL_PREFIX?}_user_transfers_out` ORDER BY trans_id", __FILE__, __LINE__); +$result = SQL_QUERY('SELECT + `userid` AS `from_userid`, `to_userid`, `trans_id`, `points`, `reason`, `time_trans` +FROM + `{?_MYSQL_PREFIX?}_user_transfers_out` +ORDER BY + `trans_id` ASC', __FILE__, __LINE__); + $total = '0'; if (SQL_NUMROWS($result) > 0) { // Output rows $OUT = ''; $SW = 2; while ($content = SQL_FETCHARRAY($result)) { // Prepare data for the row template - $content = array( - 'sw' => $SW, - 'trans_id' => $content['trans_id'], - 'time_trans' => generateDateTime($content['time_trans'], 3), - 'from_link' => generateUserProfileLink($content['userid']), - 'to_link' => generateUserProfileLink($content['to_userid']), - 'reason' => wordwrap($content['reason'], 15), - 'points' => translateComma($content['points']), - ); + $content['sw'] = $SW; + $content['time_trans'] = generateDateTime($content['time_trans'], 3); + $content['reason'] = wordwrap($content['reason'], 15); // Load row template add points and switch color $OUT .= loadTemplate('admin_list_transfer_row', true, $content); $total += $content['points']; $SW = 3 - $SW; - } + } // END - while // Free memory SQL_FREERESULT($result); } else { // Nothing for in and out - $OUT = " - - ".loadTemplate('admin_settings_saved', true, getMessage('TRANSFER_NO_INOUT_TRANSFERS'))." + $OUT = ' + + ' . loadTemplate('admin_settings_saved', true, getMessage('TRANSFER_NO_INOUT_TRANSFERS')) . ' -"; +'; } // ... and add them to a constant for the template diff --git a/inc/modules/admin/what-list_user.php b/inc/modules/admin/what-list_user.php index ea74ef7da4..c10ec781d7 100644 --- a/inc/modules/admin/what-list_user.php +++ b/inc/modules/admin/what-list_user.php @@ -253,42 +253,38 @@ LIMIT 1", if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', getConfig('user_limit')); // Add limitation to SQL string and run him again - $sql .= " LIMIT ".(getRequestParameter('offset') * getRequestParameter('page') - getRequestParameter('offset')).", ".getRequestParameter('offset'); + $sql .= ' LIMIT ' . (getRequestParameter('offset') * getRequestParameter('page') - getRequestParameter('offset')) . ', ' . getRequestParameter('offset'); $result = SQL_QUERY($sql, __FILE__, __LINE__); - // Count all confirmed users - $user_count = countSumTotalData('CONFIRMED','user_data','userid','status',true); - // Are there some entries? if (SQL_NUMROWS($result_master) > 0) { // We have some (new?) registrations! - define('__COLSPAN2' , ($colspan + 2)); - define('__USER_CNT' , $user_count); + $templateContent['colspan2'] = ($colspan + 2); + $templateContent['user_count'] = getTotalConfirmedUser(); // Sorting links - define('__ALPHA_SORT', alpha(getRequestParameter('sortby'), $colspan, true)); - define('__SORT_LINKS', addSortLinks(getRequestParameter('letter'), getRequestParameter('sortby'), $colspan, true)); + $templateContent['alpha_sort'] = alpha(getRequestParameter('sortby'), ($colspan + 1), true); + $templateContent['sort_links'] = addSortLinks(getRequestParameter('letter'), getRequestParameter('sortby'), ($colspan + 1), true); + $templateContent['page_nav'] = ''; if ($PAGES > 1) { - define('__PAGE_NAV', addPageNavigation($PAGES, getConfig('user_limit'), true, $colspan, true)); - } else { - // No page navigation is required - define('__PAGE_NAV', ''); - } + $templateContent['page_nav'] = addPageNavigation($PAGES, getConfig('user_limit'), true, $colspan, true); + } // END - if // Column with nickname when nickname extension is present - // @TODO Rewrite this into a filter + // @TODO Rewrite this into a filter + $templateContent['nickname_th'] = ''; if (isExtensionActive('nickname')) { // Nickname extension found - define('__NICKNAME_TH', " {--NICKNAME--}"); - } else { - // Not found - define('__NICKNAME_TH', ''); - } + $templateContent['nickname_th'] = '{--NICKNAME--}'; + } // END - if // Load all users $OUT = ''; $SW = 2; while ($content = SQL_FETCHARRAY($result)) { + // Merge more data in + $content = merge_array($content, $templateContent); + // Set refid link if ($content['refid'] > 0) $content['refid'] = generateUserProfileLink($content['refid']); @@ -364,6 +360,9 @@ LIMIT 1", $content['title'] = getMessage(sprintf("ADMIN_LIST_MODE_%s_ACCOUNTS", strtoupper(getRequestParameter('mode')))); } + // Merge more data again + $content = merge_array($content, $templateContent); + // Load main template loadTemplate('admin_list_user', false, $content); } else { diff --git a/inc/modules/admin/what-stats_mods.php b/inc/modules/admin/what-stats_mods.php index 415f0c6177..3520e30163 100644 --- a/inc/modules/admin/what-stats_mods.php +++ b/inc/modules/admin/what-stats_mods.php @@ -79,7 +79,7 @@ if ((getRequestParameter('mod') == 'index') || (getRequestParameter('mod') == 'l if (($content['module'] == 'index') || ($content['module'] == 'login')) { // Add link to detail statistics - $content['module'] = "" . $content['module'] . ""; + $content['module'] = '' . $content['module'] . ''; } // END - if // Add color switch diff --git a/inc/modules/admin/what-theme_edit.php b/inc/modules/admin/what-theme_edit.php index 04b637aa35..88c6bea489 100644 --- a/inc/modules/admin/what-theme_edit.php +++ b/inc/modules/admin/what-theme_edit.php @@ -59,21 +59,21 @@ if (countPostSelection() > 0) { if (isPostRequestParameterSet(('status'))) { // Change status if (postRequestParameter('active', $id) == 'Y') { - $sql = "UPDATE `{?_MYSQL_PREFIX?}_themes` SET theme_active='N' WHERE `id`=" . bigintval($id) . " LIMIT 1"; + $sql = "UPDATE `{?_MYSQL_PREFIX?}_themes` SET `theme_active`='N' WHERE `id`=%s LIMIT 1"; } else { - $sql = "UPDATE `{?_MYSQL_PREFIX?}_themes` SET theme_active='Y' WHERE `id`=" . bigintval($id) . " LIMIT 1"; + $sql = "UPDATE `{?_MYSQL_PREFIX?}_themes` SET `theme_active`='Y' WHERE `id`=%s LIMIT 1"; } $OUT = getMessage('ADMIN_THEMES_UPDATED'); } elseif (isFormSent('del')) { // Delete themes - $sql = "DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_themes` WHERE `id`=" . bigintval($id) . " LIMIT 1"; + $sql = "DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_themes` WHERE `id`=%s LIMIT 1"; $OUT = getMessage('ADMIN_THEMES_DELETED'); } // Run SQL command? if (!empty($sql)) { // Run it - $result = SQL_QUERY($sql, __FILE__, __LINE__); + $result = SQL_QUERY_ESC($sql, array(bigintval($id)), __FILE__, __LINE__); // Rebuild cache rebuildCache('themes', 'them'); @@ -129,16 +129,15 @@ if (SQL_NUMROWS($result) > 0) { // Prepare data for the row template $content = array( - 'sw' => $SW, - 'id' => $content['id'], - 'active' => $content['theme_active'], - 'link' => $LINK, - 'name' => $content['theme_name'], - 'is_act' => translateYesNo($content['theme_active']), - 'email' => '' . $GLOBALS['theme_data']['author'] . '', + 'url_link' => generateDerefererUrl($GLOBALS['theme_data']['url']), + 'url_title' => $GLOBALS['theme_data']['url'], + 'theme_ver' => $content['theme_ver'], ); // Load row template and switch color @@ -150,11 +149,11 @@ if (SQL_NUMROWS($result) > 0) { SQL_FREERESULT($result); } else { // No themes found??? - $OUT .= " - - ".loadTemplate('admin_settings_saved', true, getMessage('ADMIN_NO_THEMES_FOUND'))." + $OUT .= ' + + ' . loadTemplate('admin_settings_saved', true, getMessage('ADMIN_NO_THEMES_FOUND')) . ' -\n"; +'; } // Load template diff --git a/inc/modules/admin/what-unlock_emails.php b/inc/modules/admin/what-unlock_emails.php index 5fb789f51c..75bddbb453 100644 --- a/inc/modules/admin/what-unlock_emails.php +++ b/inc/modules/admin/what-unlock_emails.php @@ -204,9 +204,9 @@ LIMIT 1", 'subject' => $content['subject'], 'tester' => generateFrametesterUrl($content['url']), 'url' => $content['url'], - 'cat_title' => str_replace("\"", '"', getCategory($content['category'])), + 'cat_title' => str_replace('"', '"', getCategory($content['category'])), 'cat_link' => $content['category'], - 'pay_title' => str_replace("\"", '"', getPaymentTitlePrice($content['payment'], true)), + 'pay_title' => str_replace('"', '"', getPaymentTitlePrice($content['payment'], true)), 'pay_link' => $content['payment'], 'timestamp' => generateDateTime($content['timestamp'], 2), 'target_send' => $content['target_send'], diff --git a/inc/modules/admin/what-user_contct.php b/inc/modules/admin/what-user_contct.php index c2dfa2a4fb..74551c3f80 100644 --- a/inc/modules/admin/what-user_contct.php +++ b/inc/modules/admin/what-user_contct.php @@ -60,9 +60,13 @@ if ((isGetRequestParameterSet('userid')) && (bigintval(getRequestParameter('user // Insert text $content['text'] = trim(secureString(postRequestParameter('text'))); + // Load email template + $message = loadEmailTemplate('member_contct', $content, getRequestParameter('userid')); + // Send contact form out - $message = loadEmailTemplate('member_contct', $content); sendEmail($content['email'], getMessage('ADMIN_CONTACT_USER_SUBJECT'), $message); + + // Display message loadTemplate('admin_settings_saved', false, getMessage('ADMIN_USER_CONTACTED')); } else { // Load contact form template diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php index b3e272c6c5..e888b2cbbb 100644 --- a/inc/modules/guest/what-login.php +++ b/inc/modules/guest/what-login.php @@ -105,25 +105,18 @@ $content['message'] = ''; // Login problems? if (!empty($errorCode)) { - // @TODO Move this HTML code into a template - $message = " - - "; - // Do we have a userid set? if (isSessionVariableSet('current_userid')) { // Then prefetch data for this account fetchUserData(getSession('current_userid')); } // END - if - // Convert the code to message - $message .= getMessageFromErrorCode($errorCode); - - // Continue with HTML - $message .= " + // @TODO Move this HTML code into a template + $content['message'] = ' + + ' . getMessageFromErrorCode($errorCode) . ' -\n"; - $content['message'] = $message; +'; } // END - if // Display login form with resend-password form diff --git a/inc/modules/guest/what-sponsor_reg.php b/inc/modules/guest/what-sponsor_reg.php index d0d9fff8bb..3556a9447b 100644 --- a/inc/modules/guest/what-sponsor_reg.php +++ b/inc/modules/guest/what-sponsor_reg.php @@ -279,9 +279,12 @@ WHERE `id`='%s' LIMIT 1", loadTemplate('admin_settings_saved', false, $message); } else { // Check for payment types - $result = SQL_QUERY("SELECT `id`, `pay_name`, `pay_rate`, `pay_currency`, `pay_min_count` -FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` -ORDER BY `pay_name`", __FILE__, __LINE__); + $result = SQL_QUERY('SELECT + `id`, `pay_name`, `pay_rate`, `pay_currency`, `pay_min_count` +FROM + `{?_MYSQL_PREFIX?}_sponsor_paytypes` +ORDER BY + pay_name` ASC', __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Load all types... // @TODO Swap this HTML code to templates diff --git a/inc/modules/member/what-surfbar_list.php b/inc/modules/member/what-surfbar_list.php index da9bfd2551..562ea10b33 100644 --- a/inc/modules/member/what-surfbar_list.php +++ b/inc/modules/member/what-surfbar_list.php @@ -74,15 +74,13 @@ if ((isFormSent()) && (isPostRequestParameterSet(('action'))) && (isPostRequestP foreach ($urlArray as $id => $content) { // "Translate"/insert data $content['sw'] = $SW; - $content['url'] = generateDerefererUrl($content['url']); if ($content['views_total'] > 0) { // Include link to stats - $content['views_total'] = "[".translateComma($content['views_total'])."]"; + $content['views_total'] = '[' . translateComma($content['views_total']) . ']'; } // END - if $content['url_registered'] = generateDateTime($content['url_registered'], 2); $content['url_last_locked'] = generateDateTime($content['url_last_locked'], 2); $content['actions'] = SURFBAR_MEMBER_ACTIONS($content['id'], $content['url_status']); - $content['url_status'] = translateSurfbarUrlStatus($content['url_status']); if (empty($content['url_lock_reason'])) { // Fixes some HTML problems with empty cells $content['url_lock_reason'] = '---'; @@ -102,5 +100,5 @@ if ((isFormSent()) && (isPostRequestParameterSet(('action'))) && (isPostRequestP loadTemplate('admin_settings_saved', false, getMessage('MEMBER_SURFBAR_NO_URLS_FOUND')); } -// +// [EOF] ?> diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index afd2f1caab..362fa1f780 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -1656,7 +1656,8 @@ LEFT JOIN ON p.userid=d.userid WHERE - p.userid=%s", + p.userid=%s +LIMIT 1", array(bigintval($userid)), __FUNCTION__, __LINE__); // Do we have an entry? @@ -1665,7 +1666,8 @@ WHERE $data = SQL_FETCHARRAY($result); // Delete points entries as well - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s", array(bigintval($userid)), __FUNCTION__, __LINE__); + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s", + array(bigintval($userid)), __FUNCTION__, __LINE__); // Update mediadata as well if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) { diff --git a/inc/reset/reset_birthday.php b/inc/reset/reset_birthday.php index ea3f2a4905..5dbbb34dc5 100644 --- a/inc/reset/reset_birthday.php +++ b/inc/reset/reset_birthday.php @@ -68,7 +68,7 @@ WHERE `status`='CONFIRMED' AND `birth_day`=%s AND `birth_month`=%s AND - `birthday_sent` < (UNIX_TIMESTAMP() - ".(getConfig('ONE_DAY') * 364).") + `birthday_sent` < (UNIX_TIMESTAMP() - ({?ONE_DAY?} * 364)) ".$add." ORDER BY `userid` ASC", diff --git a/templates/de/emails/admin/admin_autopurge_inactive.tpl b/templates/de/emails/admin/admin_autopurge_inactive.tpl index c6812dc7ee..d3e5991b6d 100644 --- a/templates/de/emails/admin/admin_autopurge_inactive.tpl +++ b/templates/de/emails/admin/admin_autopurge_inactive.tpl @@ -1,6 +1,6 @@ Hallo Administrator, -In Ihrem {?mt_word?} wurden Mitglieder gefunden, die seit $content[since] Tagen nicht mehr aktiv waren! Sollten diese Mitglieder weitere {!__INACTIVE_TIME!} Tage inaktiv bleiben, werden sie automatisch gelöscht! +In Ihrem {?mt_word?} wurden Mitglieder gefunden, die seit $content[since] Tagen nicht mehr aktiv waren! Sollten diese Mitglieder weitere {%config,createFancyTime=ap_inactive_time%} inaktiv bleiben, werden sie automatisch gelöscht! Hier alle inaktiven Mitglieder: -------------------------------- diff --git a/templates/de/html/admin/admin_config_register_row.tpl b/templates/de/html/admin/admin_config_register_row.tpl new file mode 100644 index 0000000000..0451c4ef50 --- /dev/null +++ b/templates/de/html/admin/admin_config_register_row.tpl @@ -0,0 +1,7 @@ + + $content[id] + $content[field_name] + + $content[selection] + + diff --git a/templates/de/html/admin/admin_del_transfer_row.tpl b/templates/de/html/admin/admin_del_transfer_row.tpl index d389a5bf11..90d342036a 100644 --- a/templates/de/html/admin/admin_del_transfer_row.tpl +++ b/templates/de/html/admin/admin_del_transfer_row.tpl @@ -6,15 +6,15 @@ $content[time_trans] - $content[userid_from] + {%pipe,generateUserProfileLink=$content[from_userid]%} - $content[userid_to] + {%pipe,generateUserProfileLink=$content[to_userid]%} $content[reason] - $content[points] + {%pipe,translateComma=$content[points]%} diff --git a/templates/de/html/admin/admin_email_archiv_row.tpl b/templates/de/html/admin/admin_email_archiv_row.tpl index ad04d22f2f..2bd5b2e67d 100644 --- a/templates/de/html/admin/admin_email_archiv_row.tpl +++ b/templates/de/html/admin/admin_email_archiv_row.tpl @@ -1,7 +1,7 @@ {--EMAIL_SENDER--}:
    - $content[u_link] + {%pipe,generateUserProfileLink=$content[sender]%} {--EMAIL_SUBJECT--}:
    @@ -15,18 +15,18 @@ {--EMAIL_PAYMENT--}:
    - {%pipe,translateComma=$content[pay]%} + {%pipe,getPaymentTitlePrice,translateComma=$content[payment_id]%} {--EMAIL_CATEGORY--}:
    - $content[cat] + {%pipe,getCategory=$content[cat_id]%} {--EMAIL_RECEIVERS--}:
    $content[sent] ({--EMAIL_RUIDS--}: - $content[ruserids]) + {%pipe,convertReceivers=$content[receivers]%}) {--USERS_LINKS--}:
    @@ -34,7 +34,7 @@ {--EMAIL_POOL_TYPE--}:
    - $content[type] + {%pipe,translatePoolType=$content[data_type]%} @@ -44,7 +44,7 @@ {--EMAIL_URL--}:
    - {--ADMIN_TEST_URL--} @@ -64,6 +64,6 @@ - {--ADMIN_DELETE_NORMAL_MAIL--} + {--ADMIN_DELETE_NORMAL_MAIL--} diff --git a/templates/de/html/admin/admin_list_beg_rows.tpl b/templates/de/html/admin/admin_list_beg_rows.tpl index 7c9b99c4fa..d680eb2bec 100644 --- a/templates/de/html/admin/admin_list_beg_rows.tpl +++ b/templates/de/html/admin/admin_list_beg_rows.tpl @@ -1,7 +1,7 @@ $content[win1]$content[cnt]$content[win2] $content[win1]$content[userid]$content[win2] - $content[win1]$content[gender] $content[surname] $content[family]$content[win2] - $content[turbo] {?POINTS?} + $content[win1]{%pipe,translateGender=$content[gender]%} $content[surname] $content[family]$content[win2] + {%pipe,translateComma=$content[beg_points]%} {?POINTS?} $content[last_online] diff --git a/templates/de/html/admin/admin_list_bonus_emails_row.tpl b/templates/de/html/admin/admin_list_bonus_emails_row.tpl index bdc73d3c89..7b283b95e4 100644 --- a/templates/de/html/admin/admin_list_bonus_emails_row.tpl +++ b/templates/de/html/admin/admin_list_bonus_emails_row.tpl @@ -11,22 +11,22 @@
    {--EMAIL_POINTS--}:
    -
    $content[points] {?POINTS?}
    +
    {%pipe,translateComma=$content[points]%} {?POINTS?}
    {--EMAIL_SECONDS--}:
    -
    $content[time]
    +
    {%pipe,createFancyTime=$content[time]%}
    {--EMAIL_CATEGORY--}:
    -
    $content[category]
    +
    {%pipe,getCategory=$content[cat_id]%}
    {--EMAIL_RECEIVERS--}:
    -
    $content[mails_sent] - ({--EMAIL_RUIDS--}: $content[receivers])
    +
    {%pipe,translateComma=$content[mails_sent]%} + ({--EMAIL_RUIDS--}: {%pipe,convertReceivers=$content[receivers]%})
    {--USERS_LINKS--}:
    @@ -34,7 +34,7 @@
    {--EMAIL_POOL_TYPE--}:
    -
    $content[type]
    +
    {%pipe,translatePoolType=$content[data_type]%}
    @@ -44,7 +44,7 @@
    {--EMAIL_URL--}:
    - +
    {--EMAIL_TIMESTAMP--}:
    diff --git a/templates/de/html/admin/admin_list_emails_row.tpl b/templates/de/html/admin/admin_list_emails_row.tpl index 7f1720fd1f..cc7fb364bb 100644 --- a/templates/de/html/admin/admin_list_emails_row.tpl +++ b/templates/de/html/admin/admin_list_emails_row.tpl @@ -1,7 +1,7 @@ {--EMAIL_SENDER--}:
    -
    $content[sender_link]
    +
    {%pipe,generateUserProfileLink=$content[sender]%}
    {--EMAIL_SUBJECT--}:
    @@ -12,23 +12,21 @@
    $content[text]
    - {--EMAIL_PAYMENT--}:
    -
    $content[payment] +
    {%pipe,getPaymentTitlePrice=$content[payment_id]%}
    {--EMAIL_CATEGORY--}:
    -
    $content[category] +
    {%pipe,getCategory=$content[cat_id]%}
    - {--EMAIL_RECEIVERS--}:
    -
    $content[sent_email]
    - ({--EMAIL_RUIDS--}:
    $content[receivers]
    ) +
    {%pipe,translateComma=$content[sent_email]%}
    + ({--EMAIL_RUIDS--}:
    {%pipe,convertReceivers=$content[receivers]%}
    ) {--USERS_LINKS--}:
    @@ -36,18 +34,17 @@ {--EMAIL_POOL_TYPE--}:
    -
    $content[type]
    +
    {%pipe,translatePoolType=$content[data_type]%}
    - {--EMAIL_TSEND--}:
    -
    $content[target_send]
    +
    {%pipe,translateComma=$content[target_send]%}
    {--EMAIL_URL--}:
    - + {--EMAIL_TIMESTAMP--}:
    diff --git a/templates/de/html/admin/admin_list_mods_row.tpl b/templates/de/html/admin/admin_list_mods_row.tpl index 6162158d4f..1b6f952cee 100644 --- a/templates/de/html/admin/admin_list_mods_row.tpl +++ b/templates/de/html/admin/admin_list_mods_row.tpl @@ -3,21 +3,21 @@ -  $content[mod] + $content[module] -  $content[title] + $content[title] - $content[locked] + {%pipe,translateYesNo=$content[locked]%} - $content[hidden] + {%pipe,translateYesNo=$content[hidden]%} - $content[admin] + {%pipe,translateYesNo=$content[admin_only]%} - $content[mem] + {%pipe,translateYesNo=$content[mem_only]%} diff --git a/templates/de/html/admin/admin_list_notify_emails_row.tpl b/templates/de/html/admin/admin_list_notify_emails_row.tpl index 7acc8d6368..23f3902d7f 100644 --- a/templates/de/html/admin/admin_list_notify_emails_row.tpl +++ b/templates/de/html/admin/admin_list_notify_emails_row.tpl @@ -11,40 +11,40 @@ {--EMAIL_POINTS--}:
    - $content[points] {?POINTS?} + {%pipe,translateComma=$content[points]%} {?POINTS?} {--EMAIL_SECONDS--}:
    - $content[time] + {%pipe,createFancyTime=$content[time]%} {--EMAIL_CATEGORY--}:
    - $content[category] + {%pipe,getCategory=$content[cat_id]%} {--EMAIL_RECEIVERS--}:
    - $content[mails_sent] - ({--EMAIL_RUIDS--}: $content[receivers]) + {%pipe,translateComma=$content[mails_sent]%} + ({--EMAIL_RUIDS--}: {%pipe,convertReceivers=$content[receivers]%}) {--USERS_LINKS--}:
    - $content[unconfirmed] + $content[unconfirmed_content] {--EMAIL_POOL_TYPE--}:
    - $content[type] + {%pipe,translatePoolType=$content[data_type]%} {--EMAIL_TSEND--}:
    - $content[target_send] + {%pipe,translateComma=$content[target_send]%} {--EMAIL_URL--}:
    - {--ADMIN_TEST_URL--} + {--ADMIN_TEST_URL--} {--EMAIL_TIMESTAMP--}:
    diff --git a/templates/de/html/admin/admin_list_transfer_row.tpl b/templates/de/html/admin/admin_list_transfer_row.tpl index eff3d910b0..4de9fd5ad6 100644 --- a/templates/de/html/admin/admin_list_transfer_row.tpl +++ b/templates/de/html/admin/admin_list_transfer_row.tpl @@ -1,8 +1,20 @@ - $content[trans_id] - $content[time_trans] - $content[from_link] - $content[to_link] - $content[reason] - $content[points] + + $content[trans_id] + + + $content[time_trans] + + + {%pipe,generateUserProfileLink=$content[from_userid]%} + + + {%pipe,generateUserProfileLink=$content[to_userid]%} + + + $content[reason] + + + {%pipe,translateComma=$content[points]%} + diff --git a/templates/de/html/admin/admin_list_user.tpl b/templates/de/html/admin/admin_list_user.tpl index 5eb3f45c28..d44e5acbb0 100644 --- a/templates/de/html/admin/admin_list_user.tpl +++ b/templates/de/html/admin/admin_list_user.tpl @@ -1,14 +1,14 @@
    - - {!__ALPHA_SORT!} - {!__SORT_LINKS!} - {!__PAGE_NAV!} + $content[alpha_sort] + $content[sort_links] + $content[page_nav] $content[rows] - {!__PAGE_NAV!} + $content[page_nav]
    + $content[title]:
    diff --git a/templates/de/html/admin/admin_list_user_alpha.tpl b/templates/de/html/admin/admin_list_user_alpha.tpl index de20a34be8..89082addca 100644 --- a/templates/de/html/admin/admin_list_user_alpha.tpl +++ b/templates/de/html/admin/admin_list_user_alpha.tpl @@ -1,9 +1,9 @@ - + + {--ADMIN_ALPHA_SELCTION--} [ $content[alpha_selection] ]
    - {--ADMIN_ALPHA_SELCTION--} [ $content ]
    diff --git a/templates/de/html/admin/admin_list_user_pagenav.tpl b/templates/de/html/admin/admin_list_user_pagenav.tpl index 59ca0fb01b..ef00578efe 100644 --- a/templates/de/html/admin/admin_list_user_pagenav.tpl +++ b/templates/de/html/admin/admin_list_user_pagenav.tpl @@ -1,5 +1,5 @@ - + -
    diff --git a/templates/de/html/admin/admin_list_user_sort.tpl b/templates/de/html/admin/admin_list_user_sort.tpl index d2a89e19df..b67e1b5a20 100644 --- a/templates/de/html/admin/admin_list_user_sort.tpl +++ b/templates/de/html/admin/admin_list_user_sort.tpl @@ -1,5 +1,5 @@
    + -
    + diff --git a/templates/de/html/member/member_bonus_turbo_row.tpl b/templates/de/html/member/member_bonus_turbo_row.tpl new file mode 100644 index 0000000000..9089642221 --- /dev/null +++ b/templates/de/html/member/member_bonus_turbo_row.tpl @@ -0,0 +1,5 @@ + + + + + diff --git a/templates/de/html/member/member_surfbar_list_row.tpl b/templates/de/html/member/member_surfbar_list_row.tpl index 189ae3227c..387766923e 100644 --- a/templates/de/html/member/member_surfbar_list_row.tpl +++ b/templates/de/html/member/member_surfbar_list_row.tpl @@ -1,6 +1,6 @@
    diff --git a/templates/de/html/admin/admin_mods_stats_row.tpl b/templates/de/html/admin/admin_mods_stats_row.tpl index 214a2a7c8f..23b68467c4 100644 --- a/templates/de/html/admin/admin_mods_stats_row.tpl +++ b/templates/de/html/admin/admin_mods_stats_row.tpl @@ -1,6 +1,6 @@
    -  $content[title] ($content[module]) +  $content[title] ($content[module]) $content[clicks] diff --git a/templates/de/html/admin/admin_theme_edit_row.tpl b/templates/de/html/admin/admin_theme_edit_row.tpl index 22dce6d40f..a6d7ae2048 100644 --- a/templates/de/html/admin/admin_theme_edit_row.tpl +++ b/templates/de/html/admin/admin_theme_edit_row.tpl @@ -1,16 +1,16 @@
    - + $content[link] - $content[name] + $content[theme_name] - $content[is_act] + {%pipe,translateYesNo=$content[theme_active]%} $content[email] @@ -19,6 +19,6 @@ $content[url_title] - v$content[ver] + v$content[theme_ver]
    {%pipe,translateComma=$rows[rank]%}.$rows[userid]{%pipe,translateComma=$rows[points]%}
    - {--MEMBER_SURFBAR_TEST_URL--} + {--MEMBER_SURFBAR_TEST_URL--} {%pipe,translateSurfbarUrlStatus=$content[url_status]%} -- 2.30.2