From af7e2ca186ae88d343f90bcb753645ab4847f227 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 12 Jul 2011 21:55:23 +0000 Subject: [PATCH] Wrapper introduced, renaming to the naming convention: - Wrapper function getTotalUnconfirmedMails() introduced to shorten things - But don't shortcut array elements or variables, cnt->count renamed - TODOs.txt updated --- DOCS/TODOs.txt | 2 +- inc/language/de.php | 8 +- inc/modules/admin/what-adminedit.php | 60 +++++++------- inc/modules/admin/what-guestedit.php | 82 +++++++++---------- inc/modules/admin/what-list_user.php | 36 ++++---- inc/modules/admin/what-memedit.php | 62 +++++++------- inc/modules/guest/what-stats.php | 6 +- inc/modules/guest/what-top10.php | 6 +- inc/modules/member/what-beg2.php | 4 +- inc/modules/member/what-bonus.php | 4 +- inc/modules/member/what-order.php | 2 +- inc/referal-functions.php | 2 +- inc/wrapper-functions.php | 12 +++ .../de/html/admin/admin_delete_admin_menu.tpl | 2 +- .../admin/admin_delete_admin_menu_row.tpl | 2 +- .../de/html/admin/admin_delete_guest_menu.tpl | 2 +- .../admin/admin_delete_guest_menu_row.tpl | 2 +- .../html/admin/admin_delete_member_menu.tpl | 2 +- .../admin/admin_delete_member_menu_row.tpl | 2 +- .../html/admin/admin_edit_admin_menu_form.tpl | 2 +- .../html/admin/admin_edit_admin_menu_row.tpl | 2 +- .../html/admin/admin_edit_guest_menu_form.tpl | 2 +- .../html/admin/admin_edit_guest_menu_row.tpl | 2 +- .../de/html/admin/admin_edit_member_menu.tpl | 2 +- .../html/admin/admin_edit_member_menu_row.tpl | 2 +- .../de/html/admin/admin_guest_menu_status.tpl | 2 +- .../de/html/admin/admin_list_user_row.tpl | 2 +- .../html/admin/admin_member_menu_status.tpl | 2 +- .../de/html/admin/admin_menu_status_row.tpl | 2 +- .../de/html/guest/guest_stats_cats_row.tpl | 2 +- .../de/html/guest/guest_stats_member.tpl | 16 ++-- .../de/html/guest/guest_stats_month_row.tpl | 8 +- templates/de/html/guest/guest_stats_row.tpl | 2 +- .../de/html/guest/guest_top10_row_earner.tpl | 2 +- .../de/html/guest/guest_top10_row_login.tpl | 2 +- .../de/html/guest/guest_top10_row_refs.tpl | 2 +- templates/de/html/member/member_bonus_row.tpl | 2 +- .../de/html/member/member_list_beg_row.tpl | 2 +- .../de/html/member/member_receive_table.tpl | 4 +- 39 files changed, 188 insertions(+), 172 deletions(-) diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index d12268f137..6a46df3961 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -51,7 +51,7 @@ ./inc/functions.php:156:// @TODO Rewrite this to an extension 'smtp' ./inc/functions.php:1921: // @TODO Find a way to cache this ./inc/functions.php:2022: // @TODO This is still very static, rewrite it somehow -./inc/functions.php:2202: // @TODO Rename column data_type to e.g. mail_status +./inc/functions.php:2214: // @TODO Rename column data_type to e.g. mail_status ./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter ./inc/install-functions.php:57: // @TODO DEACTIVATED: changeDataInLocalConfigurationFile('OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0); ./inc/language/de.php:1063: // @TODO Rewrite these two constants diff --git a/inc/language/de.php b/inc/language/de.php index 34d638cffb..ab4fa93f0d 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -183,7 +183,7 @@ addMessages(array( 'ADMIN_MAX_VALUE' => "Maximal zu empfangene Mails", 'ADMIN_MAX_COMMENT' => "Hinweis zum Maximal-Wert", 'NO_MAX_VALUES' => "Derzeit klappt die Anmeldung nicht, da Sie keine maximal zu empfangenen Mails einstellen können.", - 'MAX_PER_DAY' => "Maximale Mitgliedermails/Tag", + 'MAX_PER_DAY' => "Maximale Anzahl an Klick-Mails pro Tag", 'PER_DAY' => "Mails", 'REFID_BY' => "Sie wurden geworben von", 'TERMS_OF_USAGE' => "AGBs zustimmen und absenden", @@ -1057,11 +1057,11 @@ addMessages(array( 'MEMBER_MAIL_BONUS_CONFIRMED_ON' => "Sie haben diese Bonusmail %s bestätigt.", 'MEMBER_MAIL_BONUS_CONFIRMED_UNKNOWN' => "Es konnte nicht festgestellt werden, wann Sie die Bonus-Mail %s bestätigt hatten.", - 'MEMBER_MAIL_NORMAL_CONFIRMED_ON' => "Sie haben diese Klickmail %s bestätigt.", - 'MEMBER_MAIL_NORMAL_CONFIRMED_UNKNOWN' => "Es konnte nicht festgestellt werden, wann Sie die Klickmail %s bestätigt hatten.", + 'MEMBER_MAIL_NORMAL_CONFIRMED_ON' => "Sie haben diese Klick-Mail %s bestätigt.", + 'MEMBER_MAIL_NORMAL_CONFIRMED_UNKNOWN' => "Es konnte nicht festgestellt werden, wann Sie die Klick-Mail %s bestätigt hatten.", // @TODO Rewrite these two constants - 'MEMBER_MAIL_NORMAL_DETAILS_TITLE' => "Details zur Klickmail %s:", + 'MEMBER_MAIL_NORMAL_DETAILS_TITLE' => "Details zur Klick-Mail %s:", // Email status 'EMAIL_STATUS_ACTIVE' => "Wird gerade versendet", diff --git a/inc/modules/admin/what-adminedit.php b/inc/modules/admin/what-adminedit.php index b1fb3347d8..4d9c2e34f8 100644 --- a/inc/modules/admin/what-adminedit.php +++ b/inc/modules/admin/what-adminedit.php @@ -64,28 +64,28 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() array(bigintval($sel)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Entry found so we load the stuff... - $data = SQL_FETCHARRAY($result); + $content = SQL_FETCHARRAY($result); // Prepare data for the row template - $data = array( - 'action' => adminAddMenuSelectionBox('admin', 'action', 'sel_action[' . $sel . ']', $data['action']), - 'what' => adminAddMenuSelectionBox('admin', 'what' , 'sel_what[' . $sel . ']', $data['what']), + $content = array( + 'action' => adminAddMenuSelectionBox('admin', 'action', 'sel_action[' . $sel . ']', $content['action']), + 'what' => adminAddMenuSelectionBox('admin', 'what' , 'sel_what[' . $sel . ']', $content['what']), 'sel' => $sel, - 'menu' => $data['title'], - 'descr' => $data['descr'], - 'cnt' => $count, + 'menu' => $content['title'], + 'descr' => $content['descr'], + 'count' => $count, ); // Load row template - $OUT .= loadTemplate('admin_edit_admin_menu_row', true, $data); + $OUT .= loadTemplate('admin_edit_admin_menu_row', true, $content); } else { // Entry not found? - $data = array( + $content = array( 'sel' => $sel ); // Load row template - $OUT .= loadTemplate('admin_menu_404_row', true, $data); + $OUT .= loadTemplate('admin_menu_404_row', true, $content); } // Free result and switch color @@ -94,7 +94,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() } // END - foreach $content['rows'] = $OUT; - $content['cnt'] = $count; + $content['count'] = $count; // Load template loadTemplate('admin_edit_admin_menu_form', false, $content); @@ -112,27 +112,27 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() array(bigintval($sel)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Entry found so we load the stuff... - $data = SQL_FETCHARRAY($result); + $content = SQL_FETCHARRAY($result); // Prepare data for the row template - $data = array( - 'menu' => $data['title'], - 'cnt' => $count, - 'sel' => $sel, + $content = array( + 'menu' => $content['title'], + 'count' => $count, + 'sel' => $sel, ); - $OUT .= loadTemplate('admin_delete_admin_menu_row', true, $data); + $OUT .= loadTemplate('admin_delete_admin_menu_row', true, $content); } else { // Entry not found? - $data = array( + $content = array( 'sel' => $sel ); - $OUT .= loadTemplate('admin_menu_404_row', true, $data); + $OUT .= loadTemplate('admin_menu_404_row', true, $content); } SQL_FREERESULT($result); } // END - if } // END - switch $content['rows'] = $OUT; - $content['cnt'] = $count; + $content['count'] = $count; // Load template loadTemplate('admin_delete_admin_menu', false, $content); @@ -201,28 +201,28 @@ LIMIT 1", $count = '0'; // Process all entries - while ($data = SQL_FETCHARRAY($result)) { + while ($content = SQL_FETCHARRAY($result)) { // Count this entry $count++; // Init navigation variable - $data['navi'] = ''; - if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) { + $content['navi'] = ''; + if (($content['sort'] == '0') || (($content['sort'] == 1) && (!empty($SUB)))) { // Is highest position - $data['navi'] = '{--LOWER--}'; + $content['navi'] = '{--LOWER--}'; } elseif ($count == SQL_NUMROWS($result)) { // Is lowest position - $data['navi'] = '{--HIGHER--}'; - } elseif ($data['sort'] > 0) { + $content['navi'] = '{--HIGHER--}'; + } elseif ($content['sort'] > 0) { // Anything else between highest and lowest - $data['navi'] = '{--HIGHER--}|{--LOWER--}'; + $content['navi'] = '{--HIGHER--}|{--LOWER--}'; } - // Add more data to $data - $data['mode'] = 'admin'; + // Add more data to $content + $content['mode'] = 'admin'; // Load row template and switch colors - $OUT .= loadTemplate('admin_menu_overview_row', true, $data); + $OUT .= loadTemplate('admin_menu_overview_row', true, $content); } // END - switch // Remember all rows diff --git a/inc/modules/admin/what-guestedit.php b/inc/modules/admin/what-guestedit.php index 4587458acb..3e92946f10 100644 --- a/inc/modules/admin/what-guestedit.php +++ b/inc/modules/admin/what-guestedit.php @@ -65,25 +65,25 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() array(bigintval($sel)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Entry found so we load the stuff... - $DATA = SQL_FETCHARRAY($result); + $content = SQL_FETCHARRAY($result); // Prepapre content - $DATA = array( - 'cnt' => $count, + $content = array( + 'count' => $count, 'sel' => $sel, - 'action' => adminAddMenuSelectionBox('guest', 'action', 'sel_action[' . $sel . ']', $DATA['action']), - 'what' => adminAddMenuSelectionBox('guest', 'what' , 'sel_what[' . $sel . ']', $DATA['what']), - 'menu' => $DATA['title'], + 'action' => adminAddMenuSelectionBox('guest', 'action', 'sel_action[' . $sel . ']', $content['action']), + 'what' => adminAddMenuSelectionBox('guest', 'what' , 'sel_what[' . $sel . ']', $content['what']), + 'menu' => $content['title'], ); // Load row template - $OUT .= loadTemplate('admin_edit_guest_menu_row', true, $DATA); + $OUT .= loadTemplate('admin_edit_guest_menu_row', true, $content); } else { // Entry not found - $DATA = array( + $content = array( 'sel' => $sel ); - $OUT .= loadTemplate('admin_menu_404_row', true, $DATA); + $OUT .= loadTemplate('admin_menu_404_row', true, $content); } // Free result and switch color @@ -92,7 +92,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() } // END - foreach $content['rows'] = $OUT; - $content['cnt'] = $count; + $content['count'] = $count; // Load template loadTemplate('admin_edit_guest_menu_form', false, $content); @@ -111,25 +111,25 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() array(bigintval($sel)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Entry found so we load the stuff... - $DATA = SQL_FETCHARRAY($result); - $DATA = array( - 'cnt' => $count, - 'menu' => $DATA['title'], - 'sel' => $sel, + $content = SQL_FETCHARRAY($result); + $content = array( + 'count' => $count, + 'menu' => $content['title'], + 'sel' => $sel, ); - $OUT .= loadTemplate('admin_delete_guest_menu_row', true, $DATA); + $OUT .= loadTemplate('admin_delete_guest_menu_row', true, $content); } else { // Entry not found? - $DATA = array( + $content = array( 'sel' => $sel ); - $OUT .= loadTemplate('admin_menu_404_row', true, $DATA); + $OUT .= loadTemplate('admin_menu_404_row', true, $content); } SQL_FREERESULT($result); } // END - if } // END - foreach $content['rows'] = $OUT; - $content['cnt'] = $count; + $content['count'] = $count; // Load template loadTemplate('admin_delete_guest_menu', false, $content); @@ -147,29 +147,29 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() array(bigintval($sel)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Entry found so we load the stuff... - $data = SQL_FETCHARRAY($result); - $data = array( - 'cnt' => $count, - 'menu' => $data['title'], + $content = SQL_FETCHARRAY($result); + $content = array( + 'count' => $count, + 'menu' => $content['title'], 'sel' => $sel, - 'visible' => addSelectionBox('yn', $data['visible'], 'visible', $sel), - 'locked' => addSelectionBox('yn', $data['locked'] , 'locked' , $sel), + 'visible' => addSelectionBox('yn', $content['visible'], 'visible', $sel), + 'locked' => addSelectionBox('yn', $content['locked'] , 'locked' , $sel), ); // Load template - $OUT .= loadTemplate('admin_menu_status_row', true, $data); + $OUT .= loadTemplate('admin_menu_status_row', true, $content); } else { // Entry not found? - $data = array( + $content = array( 'sel' => $sel ); - $OUT .= loadTemplate('admin_menu_404_row', true, $data); + $OUT .= loadTemplate('admin_menu_404_row', true, $content); } SQL_FREERESULT($result); } // END - if } // END - foreach - $content['cnt'] = $count; + $content['count'] = $count; $content['rows'] = $OUT; // Load template @@ -201,31 +201,31 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() $OUT = ''; // Process all menu entries - while ($data = SQL_FETCHARRAY($result)) { + while ($content = SQL_FETCHARRAY($result)) { $count++; - if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($subMenu)))) { + if (($content['sort'] == '0') || (($content['sort'] == 1) && (!empty($subMenu)))) { // Is highest position - $NAVI = '{--LOWER--}'; + $NAVI = '{--LOWER--}'; } elseif ($count == SQL_NUMROWS($result)) { // Is lowest position - $NAVI = '{--HIGHER--}'; - } elseif ($data['sort'] > 0) { + $NAVI = '{--HIGHER--}'; + } elseif ($content['sort'] > 0) { // Anything else between highest and lowest - $NAVI = '{--HIGHER--}|{--LOWER--}'; + $NAVI = '{--HIGHER--}|{--LOWER--}'; } // Prepapre content - $row = array( - 'id' => $data['id'], - 'action' => $data['action'], - 'what' => $data['what'], - 'title' => $data['title'], + $content = array( + 'id' => $content['id'], + 'action' => $content['action'], + 'what' => $content['what'], + 'title' => $content['title'], 'navi' => $NAVI, 'mode' => 'guest' ); // Load row template - $OUT .= loadTemplate('admin_menu_overview_row', true, $row); + $OUT .= loadTemplate('admin_menu_overview_row', true, $content); } // END - while // Add rows diff --git a/inc/modules/admin/what-list_user.php b/inc/modules/admin/what-list_user.php index 4295891afb..b330b66c25 100644 --- a/inc/modules/admin/what-list_user.php +++ b/inc/modules/admin/what-list_user.php @@ -50,16 +50,16 @@ $colspan = 4; // Add lock reason? if (isExtensionInstalledAndNewer('user', '0.3.5')) { // Add them... - $MORE .= ", UNIX_TIMESTAMP(`lock_timestamp`) AS `lock_timestamp`"; + $MORE .= ', UNIX_TIMESTAMP(`lock_timestamp`) AS `lock_timestamp`'; } // END - if // Is the extension 'country' installed? if (isExtensionActive('country')) { // Add country code - $MORE .= ", `country_code`"; + $MORE .= ', `country_code`'; } else { // Add direct value - $MORE .= ", `country`"; + $MORE .= ', `country`'; } // Init unset data @@ -90,9 +90,9 @@ LIMIT 1", $content = SQL_FETCHARRAY($result_user); // Get count/sum of refs, selected categories, unconfirmed mails - $content['refs'] = countSumTotalData($userid, 'refsystem' , 'counter'); - $content['cats'] = countSumTotalData($userid, 'user_cats' , 'id', 'userid', true); - $content['links'] = countSumTotalData($userid, 'user_links', 'id', 'userid', true); + $content['refs'] = countSumTotalData($userid, 'refsystem', 'counter'); + $content['cats'] = countSumTotalData($userid, 'user_cats', 'id', 'userid', true); + $content['links'] = getTotalUnconfirmedMails($userid); // Add links to the numbers if ($content['links'] > 0) $content['links'] = $base . '&what=list_links&userid=' . $userid . '%}">' . $content['links'] . ']'; @@ -105,18 +105,18 @@ LIMIT 1", // Is this above zero? if ($stamp > 0) { // Then use it - $content['birthday'] = generateDateTime($stamp, 3); + $content['birthday'] = generateDateTime($stamp, '3'); } else { // Zero or below so set zero! - $content['birthday'] = generateDateTime(0, 3); + $content['birthday'] = generateDateTime(0, '3'); } // Prepare data for template $content['email_link'] = generateEmailLink($content['email'], 'user_data'); - $content['last_online'] = generateDateTime($content['last_online'], 0); - $content['joined'] = generateDateTime($content['joined'], 0); - $content['last_update'] = generateDateTime($content['last_update'], 0); - $content['last_profile_sent'] = generateDateTime($content['last_profile_sent'], 0); + $content['last_online'] = generateDateTime($content['last_online'], '0'); + $content['joined'] = generateDateTime($content['joined'], '0'); + $content['last_update'] = generateDateTime($content['last_update'], '0'); + $content['last_profile_sent'] = generateDateTime($content['last_profile_sent'], '0'); $content['total_points'] = getTotalPoints($content['userid']); $content['locked_points'] = countSumTotalData($content['userid'], 'user_points', 'locked_points') + countSumTotalData($content['userid'], 'user_points', 'locked_order_points'); @@ -130,8 +130,8 @@ LIMIT 1", $data = runFilterChain('get_own_points', $data); // Add more data - $content['own_points'] = $data['points']; - $content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], 2); + $content['own_points'] = $data['points']; + $content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], 2); // Link to email_details if some are sent if ($content['emails_sent'] > 0) { @@ -265,7 +265,7 @@ LIMIT 1", $content = merge_array($content, $templateContent); // Get number of unconfirmed mails - $content['links'] = countSumTotalData($content['userid'], 'user_links', 'id', 'userid', true); + $content['links'] = getTotalUnconfirmedMails($content['userid']); if ($content['links'] > 0) { $content['links'] = $base . '&what=list_links&userid=' . $content['userid'] . '%}">{%pipe,translateComma=' . $content['links'] . '%}]'; } // END - if @@ -275,10 +275,10 @@ LIMIT 1", $content['emails_sent'] = $base . '&what=email_details&userid=' . $content['userid'] . '%}">{%pipe,translateComma=' . $content['emails_sent'] . '%}]'; } // END - if - // Clickrate - $content['rate'] = '0'; + // Click rate + $content['click_rate'] = '0'; if ($content['emails_received'] > 0) { - $content['rate'] = $content['mails_confirmed'] / $content['emails_received'] * 100; + $content['click_rate'] = $content['mails_confirmed'] / $content['emails_received'] * 100; } // END - if // Transfer data to array diff --git a/inc/modules/admin/what-memedit.php b/inc/modules/admin/what-memedit.php index d0d08009fa..eb62f05dcd 100644 --- a/inc/modules/admin/what-memedit.php +++ b/inc/modules/admin/what-memedit.php @@ -64,25 +64,25 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() array(bigintval($sel)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Entry found so we load the stuff... - $data = SQL_FETCHARRAY($result); - $data = array( - 'cnt' => $count, + $content = SQL_FETCHARRAY($result); + $content = array( + 'count' => $count, 'sel' => $sel, - 'menu' => $data['title'], - 'action' => adminAddMenuSelectionBox('member', 'action', 'sel_action[' . $sel . ']', $data['action']), - 'what' => adminAddMenuSelectionBox('member', 'what' , 'sel_what[' . $sel . ']', $data['what']), + 'menu' => $content['title'], + 'action' => adminAddMenuSelectionBox('member', 'action', 'sel_action[' . $sel . ']', $content['action']), + 'what' => adminAddMenuSelectionBox('member', 'what' , 'sel_what[' . $sel . ']', $content['what']), ); // Load template - $OUT .= loadTemplate('admin_edit_member_menu_row', true, $data); + $OUT .= loadTemplate('admin_edit_member_menu_row', true, $content); } else { // Entry not found? - $data = array( + $content = array( 'sel' => $sel ); // Load template - $OUT .= loadTemplate('admin_menu_404_row', true, $data); + $OUT .= loadTemplate('admin_menu_404_row', true, $content); } SQL_FREERESULT($result); } // END - if @@ -90,7 +90,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() // Add row content and current counter $content['rows'] = $OUT; - $content['cnt'] = $count; + $content['count'] = $count; // Load template loadTemplate('admin_edit_member_menu', false, $content); @@ -108,7 +108,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() // Entry found so we load the stuff... list($title) = SQL_FETCHROW($result); $content = array( - 'cnt' => $count, + 'count' => $count, 'sel' => $sel, 'title' => $title ); @@ -128,7 +128,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() } // END - if } // END - foreach $content['rows'] = $OUT; - $content['cnt'] = $count; + $content['count'] = $count; // Load template loadTemplate('admin_delete_member_menu', false, $content); @@ -144,31 +144,31 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() array(bigintval($sel)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Entry found so we load the stuff... - $data = SQL_FETCHARRAY($result); - $data = array( - 'cnt' => $count, - 'menu' => $data['title'], + $content = SQL_FETCHARRAY($result); + $content = array( + 'count' => $count, + 'menu' => $content['title'], 'sel' => $sel, - 'visible' => addSelectionBox('yn', $data['visible'], 'visible', $sel), - 'locked' => addSelectionBox('yn', $data['locked'] , 'locked' , $sel), + 'visible' => addSelectionBox('yn', $content['visible'], 'visible', $sel), + 'locked' => addSelectionBox('yn', $content['locked'] , 'locked' , $sel), ); // Load template - $OUT .= loadTemplate('admin_menu_status_row', true, $data); + $OUT .= loadTemplate('admin_menu_status_row', true, $content); } else { // Entry not found? - $data = array( + $content = array( 'sel' => $sel ); // Load template - $OUT .= loadTemplate('admin_menu_404_row', true, $data); + $OUT .= loadTemplate('admin_menu_404_row', true, $content); } SQL_FREERESULT($result); } // END - if } // END - foreach $content['rows'] = $OUT; - $content['cnt'] = $count; + $content['count'] = $count; // Load template loadTemplate('admin_member_menu_status', false, $content); @@ -193,26 +193,26 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() $content['sub'] = $subMenu; $count = '0'; $OUT = ''; - while ($data = SQL_FETCHARRAY($result)) { + while ($content = SQL_FETCHARRAY($result)) { // Init navigation - $data['navi'] = ''; + $content['navi'] = ''; $count++; - if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($subMenu)))) { + if (($content['sort'] == '0') || (($content['sort'] == 1) && (!empty($subMenu)))) { // Is highest position - $data['navi'] = '{--LOWER--}'; + $content['navi'] = '{--LOWER--}'; } elseif ($count == SQL_NUMROWS($result)) { // Is lowest position - $data['navi'] = '{--HIGHER--}'; - } elseif ($data['sort'] > 0) { + $content['navi'] = '{--HIGHER--}'; + } elseif ($content['sort'] > 0) { // Anything else between highest and lowest - $data['navi'] = '{--HIGHER--}|{--LOWER--}'; + $content['navi'] = '{--HIGHER--}|{--LOWER--}'; } // Add more entries - $data['mode'] = 'mem'; + $content['mode'] = 'mem'; // Load row template and switch color - $OUT .= loadTemplate('admin_menu_overview_row', true, $data); + $OUT .= loadTemplate('admin_menu_overview_row', true, $content); } // END - while // Free memory diff --git a/inc/modules/guest/what-stats.php b/inc/modules/guest/what-stats.php index 77e54c93bd..c5c6b87db6 100644 --- a/inc/modules/guest/what-stats.php +++ b/inc/modules/guest/what-stats.php @@ -140,7 +140,7 @@ switch (getConfig('guest_stats')) { 'm_descr' => $GLOBALS['month_descr'][$month], 'r_class' => $r, 'r2_class' => $r2, - 'cnt' => $count + 'count' => $count ); // Load row template @@ -163,8 +163,8 @@ switch (getConfig('guest_stats')) { foreach ($cat_cnt as $id => $count) { // Prepare data for the template $data = array( - 'cat' => $cats[$id], - 'cnt' => $count, + 'cat' => $cats[$id], + 'count' => $count, ); // Load row template and switch colors diff --git a/inc/modules/guest/what-top10.php b/inc/modules/guest/what-top10.php index 3435584416..ee437a3b59 100644 --- a/inc/modules/guest/what-top10.php +++ b/inc/modules/guest/what-top10.php @@ -67,7 +67,7 @@ $OUT = ''; $count = 1; while ($content = SQL_FETCHARRAY($result)) { // Prepare data for template $content = array( - 'cnt' => $count, + 'count' => $count, 'userid' => $content['userid'], 'last_online' => generateDateTime($content['last_online'], '3'), ); @@ -122,7 +122,7 @@ LIMIT {?top10_max?}", __FILE__, __LINE__); $OUT = ''; $count = 1; while ($content = SQL_FETCHARRAY($result)) { // Prepare data for template - $content['cnt'] = $count; + $content['count'] = $count; $content['last_online'] = generateDateTime($content['last_online'], '3'); // Load row template @@ -176,7 +176,7 @@ $OUT = ''; $count = 1; while ($content = SQL_FETCHARRAY($result)) { // Prepare data for template $content = array( - 'cnt' => $count, + 'count' => $count, 'userid' => $content['userid'], 'refs' => $content['refs'], 'last_online' => generateDateTime($content['last_online'], '3') diff --git a/inc/modules/member/what-beg2.php b/inc/modules/member/what-beg2.php index d41f5964f5..9f265539f9 100644 --- a/inc/modules/member/what-beg2.php +++ b/inc/modules/member/what-beg2.php @@ -84,8 +84,8 @@ if (!SQL_HASZERONUMS($result)) { $count = 1; while ($content = SQL_FETCHARRAY($result)) { // Prepare data for the template - $content['cnt'] = $count; - $content['last_online'] = generateDateTime($content['last_online'], 2); + $content['count'] = $count; + $content['last_online'] = generateDateTime($content['last_online'], '2'); // Load row template $OUT .= loadTemplate('member_list_beg_row', true, $content); diff --git a/inc/modules/member/what-bonus.php b/inc/modules/member/what-bonus.php index 21c07396ff..afd5af2f32 100644 --- a/inc/modules/member/what-bonus.php +++ b/inc/modules/member/what-bonus.php @@ -100,8 +100,8 @@ if (!SQL_HASZERONUMS($result)) { $count = 1; while ($content = SQL_FETCHARRAY($result)) { // Prepare data for the template - $content['cnt'] = $count; - $content['last_online'] = generateDateTime($content['last_online'], 2); + $content['count'] = $count; + $content['last_online'] = generateDateTime($content['last_online'], '2'); // Load row template $OUT .= loadTemplate('member_bonus_row', true, $content); diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index bcaece4fec..95a1e0d9e5 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -51,7 +51,7 @@ if ((!isExtensionActive('order')) && (!isAdmin())) { $url = ''; $id = '0'; // Count unconfirmed mails -$links = countSumTotalData(getMemberId(), 'user_links', 'id', 'userid', true); +$links = getTotalUnconfirmedMails(getMemberId()); $ALLOWED = getUserData('receive_mails') - getUserData('mail_orders'); if (getConfig('order_max_full') == 'MAX') $ALLOWED = getUserData('receive_mails'); diff --git a/inc/referal-functions.php b/inc/referal-functions.php index 5b26ebfab5..cec12c40a7 100644 --- a/inc/referal-functions.php +++ b/inc/referal-functions.php @@ -372,7 +372,7 @@ ORDER BY $row['points'] = getTotalPoints($row['refid']); // Get unconfirmed mails - $row['unconfirmed'] = countSumTotalData($row['refid'], 'user_links', 'id', 'userid', true); + $row['unconfirmed'] = getTotalUnconfirmedMails($row['refid']); // Init click rate with zero $row['click_rate'] = '0'; diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 84e126ca9f..a826c3d69b 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -2581,6 +2581,18 @@ function getTotalReceivers ($mode = 'normal') { return $numRows; } +// Wrapper "getter" to get total unconfirmed mails for given userid +function getTotalUnconfirmedMails ($userid) { + // Do we have cache? + if (!isset($GLOBALS[__FUNCTION__][$userid])) { + // Determine it + $GLOBALS[__FUNCTION__][$userid] = countSumTotalData($userid, 'user_links', 'id', 'userid', true); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__][$userid]; +} + //----------------------------------------------------------------------------- // Configuration wrapper //----------------------------------------------------------------------------- diff --git a/templates/de/html/admin/admin_delete_admin_menu.tpl b/templates/de/html/admin/admin_delete_admin_menu.tpl index 5d95461c72..2d42e33c10 100644 --- a/templates/de/html/admin/admin_delete_admin_menu.tpl +++ b/templates/de/html/admin/admin_delete_admin_menu.tpl @@ -15,7 +15,7 @@ - + diff --git a/templates/de/html/admin/admin_delete_admin_menu_row.tpl b/templates/de/html/admin/admin_delete_admin_menu_row.tpl index 3d74ed714d..ce509e83c3 100644 --- a/templates/de/html/admin/admin_delete_admin_menu_row.tpl +++ b/templates/de/html/admin/admin_delete_admin_menu_row.tpl @@ -1,6 +1,6 @@ - $content[cnt]. {--ADMIN_ENTRY_DELETE--}: + {%pipe,translateComma=$content[count]%}. {--ADMIN_ENTRY_DELETE--}: $content[menu] diff --git a/templates/de/html/admin/admin_delete_guest_menu.tpl b/templates/de/html/admin/admin_delete_guest_menu.tpl index ea16a559ec..ff36442709 100644 --- a/templates/de/html/admin/admin_delete_guest_menu.tpl +++ b/templates/de/html/admin/admin_delete_guest_menu.tpl @@ -15,7 +15,7 @@ - + diff --git a/templates/de/html/admin/admin_delete_guest_menu_row.tpl b/templates/de/html/admin/admin_delete_guest_menu_row.tpl index f1a6105abc..079606b843 100644 --- a/templates/de/html/admin/admin_delete_guest_menu_row.tpl +++ b/templates/de/html/admin/admin_delete_guest_menu_row.tpl @@ -1,6 +1,6 @@ - $content[cnt]. {--ADMIN_ENTRY_DELETE--}: + {%pipe,translateComma=$content[count]%}. {--ADMIN_ENTRY_DELETE--}: $content[menu] diff --git a/templates/de/html/admin/admin_delete_member_menu.tpl b/templates/de/html/admin/admin_delete_member_menu.tpl index e4308aae4b..31a1910a9f 100644 --- a/templates/de/html/admin/admin_delete_member_menu.tpl +++ b/templates/de/html/admin/admin_delete_member_menu.tpl @@ -15,7 +15,7 @@ - + diff --git a/templates/de/html/admin/admin_delete_member_menu_row.tpl b/templates/de/html/admin/admin_delete_member_menu_row.tpl index a647a25fc0..2e00bcb807 100644 --- a/templates/de/html/admin/admin_delete_member_menu_row.tpl +++ b/templates/de/html/admin/admin_delete_member_menu_row.tpl @@ -1,6 +1,6 @@ - $content[cnt]. {--ADMIN_ENTRY_DELETE--}: + {%pipe,translateComma=$content[count]%}. {--ADMIN_ENTRY_DELETE--}: $content[title] diff --git a/templates/de/html/admin/admin_edit_admin_menu_form.tpl b/templates/de/html/admin/admin_edit_admin_menu_form.tpl index 79e00d68a0..a1e1907348 100644 --- a/templates/de/html/admin/admin_edit_admin_menu_form.tpl +++ b/templates/de/html/admin/admin_edit_admin_menu_form.tpl @@ -15,7 +15,7 @@ - + diff --git a/templates/de/html/admin/admin_edit_admin_menu_row.tpl b/templates/de/html/admin/admin_edit_admin_menu_row.tpl index 644a375f60..e14739f936 100644 --- a/templates/de/html/admin/admin_edit_admin_menu_row.tpl +++ b/templates/de/html/admin/admin_edit_admin_menu_row.tpl @@ -1,6 +1,6 @@ - $content[cnt]. {--ADMIN_ENTRY_MODIFY--}: + {%pipe,translateComma=$content[count]%}. {--ADMIN_ENTRY_MODIFY--}: diff --git a/templates/de/html/admin/admin_edit_guest_menu_form.tpl b/templates/de/html/admin/admin_edit_guest_menu_form.tpl index 3df5c79be1..0ada43ee60 100644 --- a/templates/de/html/admin/admin_edit_guest_menu_form.tpl +++ b/templates/de/html/admin/admin_edit_guest_menu_form.tpl @@ -15,7 +15,7 @@ - + diff --git a/templates/de/html/admin/admin_edit_guest_menu_row.tpl b/templates/de/html/admin/admin_edit_guest_menu_row.tpl index d74d78d990..2b509282f8 100644 --- a/templates/de/html/admin/admin_edit_guest_menu_row.tpl +++ b/templates/de/html/admin/admin_edit_guest_menu_row.tpl @@ -1,6 +1,6 @@ - $content[cnt]. {--ADMIN_ENTRY_MODIFY--}: + {%pipe,translateComma=$content[count]%}. {--ADMIN_ENTRY_MODIFY--}: diff --git a/templates/de/html/admin/admin_edit_member_menu.tpl b/templates/de/html/admin/admin_edit_member_menu.tpl index 72e67ac061..d927b1cc8c 100644 --- a/templates/de/html/admin/admin_edit_member_menu.tpl +++ b/templates/de/html/admin/admin_edit_member_menu.tpl @@ -15,7 +15,7 @@ - + diff --git a/templates/de/html/admin/admin_edit_member_menu_row.tpl b/templates/de/html/admin/admin_edit_member_menu_row.tpl index 2d8e75dcf5..4143664503 100644 --- a/templates/de/html/admin/admin_edit_member_menu_row.tpl +++ b/templates/de/html/admin/admin_edit_member_menu_row.tpl @@ -1,6 +1,6 @@ - $content[cnt]. {--ADMIN_ENTRY_MODIFY--}: + {%pipe,translateComma=$content[count]%}. {--ADMIN_ENTRY_MODIFY--}: diff --git a/templates/de/html/admin/admin_guest_menu_status.tpl b/templates/de/html/admin/admin_guest_menu_status.tpl index 82267d2ded..5d091e2bf4 100644 --- a/templates/de/html/admin/admin_guest_menu_status.tpl +++ b/templates/de/html/admin/admin_guest_menu_status.tpl @@ -15,7 +15,7 @@ - + diff --git a/templates/de/html/admin/admin_list_user_row.tpl b/templates/de/html/admin/admin_list_user_row.tpl index f76f79190b..cddfa98097 100644 --- a/templates/de/html/admin/admin_list_user_row.tpl +++ b/templates/de/html/admin/admin_list_user_row.tpl @@ -36,7 +36,7 @@ {%pipe,getTotalPoints,translateComma=$content[userid]%} {?POINTS?} $content[emails_sent] - {%pipe,translateComma=$content[rate]%}% + {%pipe,translateComma=$content[click_rate]%}% {%pipe,translateComma=$content[locked_points]%} {?POINTS?} $content[refs] diff --git a/templates/de/html/admin/admin_member_menu_status.tpl b/templates/de/html/admin/admin_member_menu_status.tpl index 57d29af522..722ef9ad4b 100644 --- a/templates/de/html/admin/admin_member_menu_status.tpl +++ b/templates/de/html/admin/admin_member_menu_status.tpl @@ -12,7 +12,7 @@ - + diff --git a/templates/de/html/admin/admin_menu_status_row.tpl b/templates/de/html/admin/admin_menu_status_row.tpl index 8397481a29..f4bf065cb7 100644 --- a/templates/de/html/admin/admin_menu_status_row.tpl +++ b/templates/de/html/admin/admin_menu_status_row.tpl @@ -1,6 +1,6 @@ - $content[cnt]. {--ADMIN_ENTRY_MODIFY--}: + {%pipe,translateComma=$content[count]%}. {--ADMIN_ENTRY_MODIFY--}: $content[menu] diff --git a/templates/de/html/guest/guest_stats_cats_row.tpl b/templates/de/html/guest/guest_stats_cats_row.tpl index bccf6eab94..80691265f5 100644 --- a/templates/de/html/guest/guest_stats_cats_row.tpl +++ b/templates/de/html/guest/guest_stats_cats_row.tpl @@ -1,4 +1,4 @@ $content[cat] - $content[cnt] + {%pipe,translateComma=$content[count]%} diff --git a/templates/de/html/guest/guest_stats_member.tpl b/templates/de/html/guest/guest_stats_member.tpl index 6ef77e3bb6..8601cbaf95 100644 --- a/templates/de/html/guest/guest_stats_member.tpl +++ b/templates/de/html/guest/guest_stats_member.tpl @@ -7,30 +7,30 @@ {--USERS_TOTAL--}: - $content[total_users] + {%pipe,translateComma=$content[total_users]%} {--UNCONFIRMED_USERIDS--}: - $content[unconfirmed] + {%pipe,translateComma=$content[unconfirmed]%} {--GUEST_STATS_MALES--}: - $content[total_males] + {%pipe,translateComma=$content[total_males]%} {--GUEST_STATS_FEMALES--}: - $content[total_females] + {%pipe,translateComma=$content[total_females]%} {--GUEST_STATS_TREGISTER--}: - $content[treg_count] + {%pipe,translateComma=$content[treg_count]%} {--GUEST_STATS_YREGISTER--}: - $content[yreg_count] + {%pipe,translateComma=$content[yreg_count]%} diff --git a/templates/de/html/guest/guest_stats_month_row.tpl b/templates/de/html/guest/guest_stats_month_row.tpl index acc86a79c1..5e12902a10 100644 --- a/templates/de/html/guest/guest_stats_month_row.tpl +++ b/templates/de/html/guest/guest_stats_month_row.tpl @@ -1,3 +1,7 @@ -$content[m_descr]: -$content[cnt] + + $content[m_descr]: + + + {%pipe,translateComma=$content[count]%} + diff --git a/templates/de/html/guest/guest_stats_row.tpl b/templates/de/html/guest/guest_stats_row.tpl index 4ae195dcd3..ad2f1f157c 100644 --- a/templates/de/html/guest/guest_stats_row.tpl +++ b/templates/de/html/guest/guest_stats_row.tpl @@ -1,4 +1,4 @@ $content[title] - $content[counter] + {%pipe,translateComma=$content[counter]%} diff --git a/templates/de/html/guest/guest_top10_row_earner.tpl b/templates/de/html/guest/guest_top10_row_earner.tpl index 5f2b0ed38f..f1a7600d35 100644 --- a/templates/de/html/guest/guest_top10_row_earner.tpl +++ b/templates/de/html/guest/guest_top10_row_earner.tpl @@ -1,5 +1,5 @@ - $content[cnt] + {%pipe,translateComma=$content[count]%} $content[userid] ({%user,nickname,fixEmptyContentToDashes=$content[userid]%}) {%pipe,translateComma=$content[points]%} $content[last_online] diff --git a/templates/de/html/guest/guest_top10_row_login.tpl b/templates/de/html/guest/guest_top10_row_login.tpl index fc17f05219..e2ba4d604e 100644 --- a/templates/de/html/guest/guest_top10_row_login.tpl +++ b/templates/de/html/guest/guest_top10_row_login.tpl @@ -1,5 +1,5 @@ - $content[cnt] + {%pipe,translateComma=$content[count]%} $content[userid] ({%user,nickname,fixEmptyContentToDashes=$content[userid]%}) {%user,total_logins,translateComma=$content[userid]%} {%pipe,getTotalPoints,translateComma=$content[userid]%} diff --git a/templates/de/html/guest/guest_top10_row_refs.tpl b/templates/de/html/guest/guest_top10_row_refs.tpl index d37ec997a0..0eba04a28a 100644 --- a/templates/de/html/guest/guest_top10_row_refs.tpl +++ b/templates/de/html/guest/guest_top10_row_refs.tpl @@ -1,5 +1,5 @@ - $content[cnt] + {%pipe,translateComma=$content[count]%} $content[userid] ({%user,nickname,fixEmptyContentToDashes=$content[userid]%}) {%pipe,translateComma=$content[refs]%} {%pipe,getTotalPoints,translateComma=$content[userid]%} diff --git a/templates/de/html/member/member_bonus_row.tpl b/templates/de/html/member/member_bonus_row.tpl index 6812612af1..08dbc27649 100644 --- a/templates/de/html/member/member_bonus_row.tpl +++ b/templates/de/html/member/member_bonus_row.tpl @@ -1,5 +1,5 @@ - $content[cnt] + {%pipe,translateComma=$content[count]%} $content[userid] {%pipe,translateComma=$content[points]%} $content[last_online] diff --git a/templates/de/html/member/member_list_beg_row.tpl b/templates/de/html/member/member_list_beg_row.tpl index fc6c2c0674..e2cc36a432 100644 --- a/templates/de/html/member/member_list_beg_row.tpl +++ b/templates/de/html/member/member_list_beg_row.tpl @@ -1,6 +1,6 @@ - $content[cnt] + {%pipe,translateComma=$content[count]%} $content[userid] diff --git a/templates/de/html/member/member_receive_table.tpl b/templates/de/html/member/member_receive_table.tpl index 83e7ee24b0..71afe46129 100644 --- a/templates/de/html/member/member_receive_table.tpl +++ b/templates/de/html/member/member_receive_table.tpl @@ -1,8 +1,8 @@
-
- {--MAX_PER_DAY--}:   + + {--MAX_PER_DAY--}: