From 07ec113b187228ba74b4b08966602c4a2c161d2c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 30 Aug 2010 11:56:44 +0000 Subject: [PATCH] Naming convention applied, new API function introduced: - Even more templates renamed to naming convention - New (cached) API function ifUserPointsLocked() introduced - The above function has needed in mailid_top.php, there was an uninitialized variable used which was a relict from older days - TODOs.txt updated --- .gitattributes | 7 +++++ DOCS/TODOs.txt | 23 +++++++++------ inc/language/de.php | 22 ++++----------- inc/language/maintenance_de.php | 5 +++- inc/libs/register_functions.php | 19 +++++-------- inc/modules/admin/what-config_mods.php | 21 ++++++-------- inc/modules/admin/what-maintenance.php | 6 ++-- inc/modules/admin/what-theme_edit.php | 18 ++++-------- inc/modules/admin/what-theme_import.php | 8 +++--- inc/mysql-manager.php | 4 +-- inc/wrapper-functions.php | 12 ++++++++ mailid_top.php | 22 +++++++++------ templates/de/html/admin/admin_config_cats.tpl | 2 +- templates/de/html/admin/admin_edit_mods.tpl | 22 +++++++++++++++ .../de/html/admin/admin_edit_mods_row.tpl | 20 +++++++++++++ templates/de/html/admin/admin_edit_theme.tpl | 27 ++++++++++++++++++ .../de/html/admin/admin_edit_theme_row.tpl | 24 ++++++++++++++++ .../de/html/admin/admin_import_theme.tpl | 18 ++++++++++++ .../de/html/admin/admin_import_theme_none.tpl | 5 ++++ .../de/html/admin/admin_import_theme_row.tpl | 14 ++++++++++ .../de/html/admin/admin_menu_status_row.tpl | 4 +-- templates/de/html/admin/admin_mods_edit.tpl | 21 +------------- .../de/html/admin/admin_mods_edit_row.tpl | 21 +------------- templates/de/html/admin/admin_theme_edit.tpl | 28 +------------------ .../de/html/admin/admin_theme_edit_row.tpl | 25 +---------------- .../de/html/admin/admin_theme_import.tpl | 19 +------------ .../de/html/admin/admin_theme_import_none.tpl | 6 +--- .../de/html/admin/admin_theme_import_row.tpl | 15 +--------- 28 files changed, 226 insertions(+), 212 deletions(-) create mode 100644 templates/de/html/admin/admin_edit_mods.tpl create mode 100644 templates/de/html/admin/admin_edit_mods_row.tpl create mode 100644 templates/de/html/admin/admin_edit_theme.tpl create mode 100644 templates/de/html/admin/admin_edit_theme_row.tpl create mode 100644 templates/de/html/admin/admin_import_theme.tpl create mode 100644 templates/de/html/admin/admin_import_theme_none.tpl create mode 100644 templates/de/html/admin/admin_import_theme_row.tpl diff --git a/.gitattributes b/.gitattributes index f4dc8022d1..615c672e60 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1067,6 +1067,8 @@ templates/de/html/admin/admin_edit_guest_menu_form.tpl -text svneol=unset#text/p templates/de/html/admin/admin_edit_guest_menu_row.tpl -text svneol=unset#text/plain templates/de/html/admin/admin_edit_member_menu.tpl -text svneol=unset#text/plain templates/de/html/admin/admin_edit_member_menu_row.tpl -text svneol=unset#text/plain +templates/de/html/admin/admin_edit_mods.tpl -text svneol=unset#text/plain +templates/de/html/admin/admin_edit_mods_row.tpl -text svneol=unset#text/plain templates/de/html/admin/admin_edit_network_params.tpl -text svneol=unset#text/plain templates/de/html/admin/admin_edit_network_params_row.tpl -text svneol=unset#text/plain templates/de/html/admin/admin_edit_network_types.tpl -text svneol=unset#text/plain @@ -1086,6 +1088,8 @@ templates/de/html/admin/admin_edit_sponsor_edit.tpl -text svneol=unset#text/plai templates/de/html/admin/admin_edit_sponsor_sub_points.tpl -text svneol=unset#text/plain templates/de/html/admin/admin_edit_surfbar_urls.tpl -text svneol=unset#text/plain templates/de/html/admin/admin_edit_surfbar_urls_row.tpl -text svneol=unset#text/plain +templates/de/html/admin/admin_edit_theme.tpl -text svneol=unset#text/plain +templates/de/html/admin/admin_edit_theme_row.tpl -text svneol=unset#text/plain templates/de/html/admin/admin_edit_user.tpl -text svneol=unset#text/plain templates/de/html/admin/admin_email_archiv.tpl -text svneol=unset#text/plain templates/de/html/admin/admin_email_archiv_row.tpl -text svneol=unset#text/plain @@ -1105,6 +1109,9 @@ templates/de/html/admin/admin_extensions_row.tpl -text svneol=unset#text/plain templates/de/html/admin/admin_extensions_text.tpl -text svneol=unset#text/plain templates/de/html/admin/admin_footer.tpl -text svneol=unset#text/plain templates/de/html/admin/admin_guest_menu_status.tpl -text svneol=unset#text/plain +templates/de/html/admin/admin_import_theme.tpl -text svneol=unset#text/plain +templates/de/html/admin/admin_import_theme_none.tpl svneol=native#text/plain +templates/de/html/admin/admin_import_theme_row.tpl -text svneol=unset#text/plain templates/de/html/admin/admin_list_admins.tpl -text svneol=unset#text/plain templates/de/html/admin/admin_list_admins_row.tpl -text svneol=unset#text/plain templates/de/html/admin/admin_list_autopurge.tpl -text svneol=unset#text/plain diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 1ae53b9adc..57dfcf1dea 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -49,10 +49,10 @@ ./inc/functions.php:2261: // @TODO This is still very static, rewrite it somehow ./inc/gen_sql_patches.php:96:// @TODO Rewrite this to a filter ./inc/install-functions.php:59: // @TODO DEACTIVATED: changeDataInFile(getCachePath() . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0); -./inc/language/de.php:1101:// @TODO Rewrite these two constants -./inc/language/de.php:1116:// @TODO Rewrite these three constants -./inc/language/de.php:300: // @TODO Following two are unused? -./inc/language/de.php:801:// @TODO Are these constants longer used? +./inc/language/de.php:1089:// @TODO Rewrite these two constants +./inc/language/de.php:1104:// @TODO Rewrite these three constants +./inc/language/de.php:288: // @TODO Following two are unused? +./inc/language/de.php:789:// @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/newsletter_de.php:13: * @TODO This language file is completely out-dated, please do no * @@ -71,9 +71,9 @@ ./inc/libs/rallye_functions.php:855:// @TODO Please document this function ./inc/libs/rallye_functions.php:911: // Load count @TODO Can't we rewrite this to our API? ./inc/libs/refback_functions.php:61: // @TODO Try to rewrite the following unset() -./inc/libs/register_functions.php:292: // @TODO Rewrite these all to a single filter -./inc/libs/register_functions.php:362: // @TODO Rewrite this to a filter -./inc/libs/register_functions.php:369: // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable +./inc/libs/register_functions.php:287: // @TODO Rewrite these all to a single filter +./inc/libs/register_functions.php:357: // @TODO Rewrite this to a filter +./inc/libs/register_functions.php:364: // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable ./inc/libs/sponsor_functions.php:162: // @TODO Rewrite this to API function ./inc/libs/sponsor_functions.php:433: // @TODO Rewrite this to API function ./inc/libs/surfbar_functions.php:1540: // @TODO This can be somehow rewritten @@ -210,6 +210,7 @@ ./templates/de/html/admin/admin_admins_contct_form.tpl:4: ./templates/de/html/admin/admin_config_other.tpl:67: ./templates/de/html/admin/admin_edit_admin_menu.tpl:4: +./templates/de/html/admin/admin_edit_mods.tpl:4: ./templates/de/html/admin/admin_list_autopurge.tpl:2: ./templates/de/html/admin/admin_list_beg.tpl:3: ./templates/de/html/admin/admin_list_bonus.tpl:3: @@ -220,7 +221,6 @@ ./templates/de/html/admin/admin_list_wernis_main.tpl:2: ./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. @@ -231,6 +231,13 @@ ### ### DEPRECATION FOLLOWS: ### ### ./inc/modules/admin/admin-inc.php:439:// @DEPRECATED ./templates/de/emails/profile-updte.tpl:1:@DEPRECATED +./templates/de/html/admin/admin_mods_edit_row.tpl:1: +./templates/de/html/admin/admin_mods_edit.tpl:1: +./templates/de/html/admin/admin_theme_edit_row.tpl:1: +./templates/de/html/admin/admin_theme_edit.tpl:1: +./templates/de/html/admin/admin_theme_import_none.tpl:1: +./templates/de/html/admin/admin_theme_import_row.tpl:1: +./templates/de/html/admin/admin_theme_import.tpl:1: ### ### template-warnings.log follows: ### ### Warning: Not parsing JavaScript templates/de/html/js/js_order_send.tpl. Warning: Not parsing JavaScript templates/de/html/js/js_cookies_disabled.tpl. diff --git a/inc/language/de.php b/inc/language/de.php index 21f6321240..bc67d504cf 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -45,18 +45,6 @@ if (!defined('__SECURITY')) { // Installation/setup addMessages(array( // Language constants - '_TABLE' => "Tabelle", - '_SIZE' => "Größe", - '_STATUS' => "Status", - '_SPACESAVED' => "Freigegeben", - '_ORESULT' => "Optimization Resultat", - '_OJETZT' => "Jetzt freigegeben", - '_ONR' => "Sie haben bereits ", - '_ONRR' => "mal die Tabellen optimiert", - '_OGESAMT' => "KiloByte Gesamt optimiert", - '_WOPT' => "wurde bereits optimiert", - '_OKOPT' => "Optimiert.", - 'MAILER_DOWN_FOR_MAINTENANCE' => "System wegen Wartungsarbeiten geschlossen.", 'MODULE_REGISTRY_404' => "Modul %s existiert nicht.", 'MODULE_ERROR_404' => "Fehler: Modul nicht gefunden", 'UNKNOWN_MODULE_DETECTED' => "Unbekanntes Modul %s", @@ -68,13 +56,13 @@ addMessages(array( 'FATAL_CANNOT_WRITE_CONFIG' => "Kann Konfigurationsdaten nicht speichern, da ich keinen Schreibzugriff auf {?CACHE_PATH?}/config-local.php habe.", 'FATAL_CANNOT_CREATE_TMP' => "Kann eine temporäre Datei nicht erzeugen! Bitte setzen Sie CHMOD 777 auf Verzeichnis inc.", 'FATAL_ERROR' => "Fataler Fehler", - 'NO_RENDER_DIRECT' => "Sie haben weder 'render' noch 'direct' als Ausgabe-Modus eingestellt.", + 'NO_RENDER_DIRECT' => "Sie haben weder 'render' noch 'direct' als Ausgabe-Modus eingestellt.", 'FATAL_NO' => "Fataler Fehler Nr. #", 'FATAL_CORRECT_ERRORS' => "Kann nicht fortsetzen! Bitte korregieren Sie erst die obrigen Probleme und versuchen Sie es dann erneut.", 'YES' => "Ja", 'NO' => "Nein", 'RUNTIME_PROBLEMS_DETECTED' => "Laufzeit-Problem erkannt.", - 'FATAL_INC_WRITABLE' => "Das Verzeichnis inc ist beschreibbar! Bitte setzen Sie die Zugriffsrechte auf 755 oder 555.", + 'FATAL_INC_WRITABLE' => "Das Verzeichnis inc ist beschreibbar! Bitte setzen Sie die Zugriffsrechte auf 755 oder 555.", 'MYSQL_ERRORS' => "Es sind MySQL-Fehler aufgetreten! Bitte korregieren Sie diese.", 'UNKNOWN_MODULE_STATUS' => "Der Return-Code %s ist unbekannt.", 'MODULE_IS_LOCKED' => "Das Modul %s wurde gesperrt.", @@ -662,8 +650,8 @@ addMessages(array( 'ADMIN_CHANGE_MENUS' => "Ändern", 'ADMIN_CHANGE_MEMBER_MENU' => "Verdecken, anzeigen, deaktivieren, aktivieren des Mitgliedsmenüs", 'ADMIN_CHANGE_MENU' => "Ändern von %s Menüeinträgen", - 'IS_VISIBLE' => "Wird angezeigt", - 'IS_ACTIVE' => "Aktiviert", + 'ADMIN_IS_VISIBLE' => "Wird angezeigt", + 'ADMIN_IS_ACTIVE' => "Aktiviert", 'ADMIN_CHANGE_ENTRIES' => "Änderungen durchführen", 'BASE_URL_NOTE' => "Ohne abschliessendem /.", 'ADMIN_WRONG_CALL' => "Falscher Aufruf einer Aktion oder des Scriptes. Bitte navigieren Sie links weiter.", @@ -870,7 +858,7 @@ addMessages(array( 'MAILID_LINK' => "Best.-Link", 'UNKNOWN_MAILID_CODE' => "Unbekannter Fehler-Code %s erkannt.", 'ADMIN_CHANGE_GUEST_MENU_TITLE' => "Verdecken, anzeigen, deaktivieren, aktivieren des Gastmenüs", - 'IS_LOCKED' => "Ist gesperrt", + 'ADMIN_MENU_IS_LOCKED' => "Ist gesperrt", 'ADMIN_REMOVE_STATS_ENTRY' => "Hier klicken, um Mitgliederstatistik zu entfernen.", 'ADMIN_USER_STATS_REMOVED' => "Mitgliederstatistiken entfernt.", 'MAIL_WILL_NEVER_EXPIRE' => "Bestätigungslink verfällt nicht.", diff --git a/inc/language/maintenance_de.php b/inc/language/maintenance_de.php index 1adc52dcd1..dfcc1a83bc 100644 --- a/inc/language/maintenance_de.php +++ b/inc/language/maintenance_de.php @@ -4,7 +4,7 @@ * =================== Last change: 08/13/2004 * * * * -------------------------------------------------------------------- * - * File : de.php * + * File : maintenance_de.php * * -------------------------------------------------------------------- * * Short description : German langugage support * * -------------------------------------------------------------------- * @@ -44,6 +44,9 @@ if (!defined('__SECURITY')) { // Language constans addMessages(array( + // General messages + 'MAILER_DOWN_FOR_MAINTENANCE' => "System wegen Wartungsarbeiten geschlossen.", + // Admin messages 'ADMIN_CHANGE_MAINTENANCE_MODE' => "Wartungsmodus ändern", 'ADMIN_MAINTENANCE_MODE_INTRO' => "Wartungsmodus Ihrer Webseite", 'ADMIN_MAINTENANCE_MODE_IS_INACTIVE' => "Der Wartungsmodus ist derzeit ausgeschaltet. Wenn Sie ihn jetzt aktivieren, wird Ihre Webseite gesperrt. Nur Administratoren können diese dann besuchen.", diff --git a/inc/libs/register_functions.php b/inc/libs/register_functions.php index 6ff22480a4..2cb0bfd1c2 100644 --- a/inc/libs/register_functions.php +++ b/inc/libs/register_functions.php @@ -260,19 +260,14 @@ function doRegistration () { if (strlen(postRequestParameter('day')) == 1) setPostRequestParameter('day' , '0' . postRequestParameter('day')); if (strlen(postRequestParameter('month')) == 1) setPostRequestParameter('month', '0' . postRequestParameter('month')); - // Get total ... - // ... confirmed, ... - $confirmedUsers = getTotalConfirmedUser(); - // ... unconfirmed ... - $unconfirmedUsers = getTotalUnconfirmedUser(); - // ... and locked users! - $lockedUsers = getTotalLockedUser(); - // Generate hash which will be inserted into confirmation mail $hash = generateHash(sha1( - $confirmedUsers . getEncryptSeperator() . - $unconfirmedUsers . getEncryptSeperator() . - $lockedUsers . getEncryptSeperator() . + // Get total confirmed, ... + getTotalConfirmedUser() . getEncryptSeperator() . + // ... unconfirmed ... + getTotalUnconfirmedUser() . getEncryptSeperator() . + // ... and locked users! + getTotalLockedUser() . getEncryptSeperator() . postRequestParameter('month') . '-' . postRequestParameter('day') . '-' . postRequestParameter('year') . getEncryptSeperator() . @@ -381,7 +376,7 @@ function doRegistration () { } // END - if // ... rewrite a zero referal id to the main title - if (postRequestParameter('refid') == '0') setPostRequestParameter('refid', getMainTitle()); + if (!isValidUserId(postRequestParameter('refid'))) setPostRequestParameter('refid', getMainTitle()); // Is ZIP code set? if (isPostRequestParameterSet('zip')) { diff --git a/inc/modules/admin/what-config_mods.php b/inc/modules/admin/what-config_mods.php index 809f4be165..15ab8cad65 100644 --- a/inc/modules/admin/what-config_mods.php +++ b/inc/modules/admin/what-config_mods.php @@ -55,32 +55,27 @@ if (isFormSent('edit')) { foreach (postRequestParameter('sel') as $id => $sel) { // Load module data // @TODO This can be moved into mysql-function.php, see checkModulePermissions() function - $result = SQL_QUERY_ESC("SELECT `module`, `title`, `locked`, `hidden`, `admin_only`, `mem_only` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `id`=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT `id`, `module`, `title`, `locked`, `hidden`, `admin_only`, `mem_only` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `id`=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); // Load data - $data = SQL_FETCHARRAY($result); + $content = SQL_FETCHARRAY($result); // Free result SQL_FREERESULT($result); // Prepare array for the template - $content = array( - 'mod' => $data['module'], - 'id' => $id, - 'title' => $data['title'], - 'locked' => addSelectionBox('yn', $data['locked'] , 'locked', $id), - 'hidden' => addSelectionBox('yn', $data['hidden'] , 'hidden', $id), - 'admin' => addSelectionBox('yn', $data['admin_only'], 'admin' , $id), - 'mem' => addSelectionBox('yn', $data['mem_only'] , 'member', $id), - ); + $content['locked'] => addSelectionBox('yn', $content['locked'] , 'locked', $id); + $content['hidden'] => addSelectionBox('yn', $content['hidden'] , 'hidden', $id); + $content['admin_only'] => addSelectionBox('yn', $content['admin_only'], 'admin' , $id); + $content['mem_only'] => addSelectionBox('yn', $content['mem_only'] , 'member', $id); // Load row template - $OUT .= loadTemplate('admin_mods_edit_row', true, $content); + $OUT .= loadTemplate('admin_edit_mods_row', true, $content } // END - foreach // Load main template - loadTemplate('admin_mods_edit', false, $OUT); + loadTemplate('admin_edit_mods', false, $OUT); } else { // Nothing selected loadTemplate('admin_settings_saved', false, '{--ADMIN_MODS_NOTHING_SELECTED--}'); diff --git a/inc/modules/admin/what-maintenance.php b/inc/modules/admin/what-maintenance.php index 5f3154dcea..d1abaa24d8 100644 --- a/inc/modules/admin/what-maintenance.php +++ b/inc/modules/admin/what-maintenance.php @@ -50,12 +50,12 @@ if (isFormSent()) { switch (getConfig('maintenance')) { case 'Y': $target_mode = 'N'; - $out = '{--ADMIN_MAINTENANCE_DEACTIVATED--}'; + $message = '{--ADMIN_MAINTENANCE_DEACTIVATED--}'; break; case 'N': $target_mode = 'Y'; - $out = '{--ADMIN_MAINTENANCE_ACTIVATED--}'; + $message = '{--ADMIN_MAINTENANCE_ACTIVATED--}'; break; } @@ -63,7 +63,7 @@ if (isFormSent()) { updateConfiguration('maintenance', $target_mode); // Load template - loadTemplate('admin_settings_saved', false, $out); + loadTemplate('admin_settings_saved', false, $message); } else { switch (getConfig('maintenance')) { case 'Y': // Maintenance mode is active diff --git a/inc/modules/admin/what-theme_edit.php b/inc/modules/admin/what-theme_edit.php index 4b84e04989..96f936afc0 100644 --- a/inc/modules/admin/what-theme_edit.php +++ b/inc/modules/admin/what-theme_edit.php @@ -122,22 +122,14 @@ if (!SQL_HASZERONUMS($result)) { loadInclude($inc); // Is the loaded theme name != current theme name? - $LINK = $content['theme_path']; - if ($content['theme_path'] != getCurrentTheme()) $LINK = '' . $content['theme_path'] . ''; + $content['link'] = $content['theme_path']; + if ($content['theme_path'] != getCurrentTheme()) $content['link'] = '' . $content['theme_path'] . ''; // Prepare data for the row template - $content = array( - 'id' => $content['id'], - 'link' => $LINK, - 'theme_name' => $content['theme_name'], - 'theme_active' => $content['theme_active'], - 'email' => '' . $GLOBALS['theme_data']['author'] . ''; // Load row template and switch color - $OUT .= loadTemplate('admin_theme_edit_row', true, $content); + $OUT .= loadTemplate('admin_edit_theme_row', true, $content); } // END - while // Free memory @@ -152,7 +144,7 @@ if (!SQL_HASZERONUMS($result)) { } // Load template -loadTemplate('admin_theme_edit', false, $OUT); +loadTemplate('admin_edit_theme', false, $OUT); // [EOF] ?> diff --git a/inc/modules/admin/what-theme_import.php b/inc/modules/admin/what-theme_import.php index 372159f331..103e92c37a 100644 --- a/inc/modules/admin/what-theme_import.php +++ b/inc/modules/admin/what-theme_import.php @@ -134,7 +134,7 @@ foreach ($THEMES['theme_unix'] as $key => $unix) { // Check if current theme is already imported or not if (!ifThemeExists($unix)) { // Theme not installed - $formContent = loadTemplate('admin_theme_import_form', true, $unix); + $formContent = loadTemplate('admin_import_theme_form', true, $unix); } // END - if // Prepare content @@ -149,16 +149,16 @@ foreach ($THEMES['theme_unix'] as $key => $unix) { ); // Add row template - $OUT .= loadTemplate('admin_theme_import_row', true, $content); + $OUT .= loadTemplate('admin_import_theme_row', true, $content); } // END - foreach if (empty($OUT)) { // No themes found??? - $OUT .= loadTemplate('admin_theme_import_none', true, loadTemplate('admin_settings_saved', true, '{--ADMIN_NO_THEMES_FOUND--}')); + $OUT .= loadTemplate('admin_import_theme_none', true, loadTemplate('admin_settings_saved', true, '{--ADMIN_NO_THEMES_FOUND--}')); } // END - if // Load template -loadTemplate('admin_theme_import', false, $OUT); +loadTemplate('admin_import_theme', false, $OUT); // [EOF] ?> diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 460145e7bb..874884fd88 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -1023,7 +1023,7 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify //* DEBUG: */ debugOutput(__FUNCTION__ . '(' . __LINE__ . '):userid='.$userid.',points='.$points); if (fetchUserData($userid)) { // Determine wether the user has some mails to click before he/she gets the points - $locked = ((getUserData('ref_payout') > 0) && (!isDirectPaymentEnabled())); + $locked = ifUserPointsLocked($userid); // Default is 'normal' points $data = 'points'; @@ -1095,7 +1095,7 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify // Send email sendEmail($userid, '{--THANX_REFERAL_ONE_SUBJECT--}', $message); - } elseif (($sendNotify === true) && (getUserData('refid') == '0') && ($locked === false) && ($add_mode == 'direct')) { + } elseif (($sendNotify === true) && (!isValidUserId(getUserData('refid'))) && ($locked === false) && ($add_mode == 'direct')) { // Prepare content $content = array( 'reason' => '{--REASON_DIRECT_PAYMENT--}', diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index da04d5ddcc..f5b412e696 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -1950,5 +1950,17 @@ function generateWrappedUserEmailLink ($email) { return generateEmailLink($email, 'user_data'); } +// Wrapper to check if user points are locked +function ifUserPointsLocked ($userid) { + // Do we have cache? + if (!isset($GLOBALS[__FUNCTION__][$userid])) { + // Determine it + $GLOBALS[__FUNCTION__][$userid] = ((getFetchedUserData('userid', $userid, 'ref_payout') > 0) && (!isDirectPaymentEnabled())); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__][$userid]; +} + // [EOF] ?> diff --git a/mailid_top.php b/mailid_top.php index f5b64e0866..7f1639a085 100644 --- a/mailid_top.php +++ b/mailid_top.php @@ -67,13 +67,13 @@ $code = '0'; $mode = ''; // Secure all data -if (isGetRequestParameterSet('userid')) $userId = bigintval(getRequestParameter('userid')); -if (isGetRequestParameterSet('mailid')) $mailId = bigintval(getRequestParameter('mailid')); -if (isGetRequestParameterSet('bonusid')) $bonusId = bigintval(getRequestParameter('bonusid')); -if (isGetRequestParameterSet('code')) $code = bigintval(getRequestParameter('code')); -if (isGetRequestParameterSet('mode')) $mode = getRequestParameter('mode'); +if (isGetRequestParameterSet('userid')) $userId = bigintval(getRequestParameter('userid')); +if (isGetRequestParameterSet('mailid')) $mailId = bigintval(getRequestParameter('mailid')); +if (isGetRequestParameterSet('bonusid')) $bonusId = bigintval(getRequestParameter('bonusid')); +if (isGetRequestParameterSet('code')) $code = bigintval(getRequestParameter('code')); +if (isGetRequestParameterSet('mode')) $mode = getRequestParameter('mode'); -// 01 1 12 2 2 21 1 22 10 +// 01 2 21 12 2 2 21 1 2210 if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalErrorsDetected())) { // No image? Then output header if ($mode != 'img') loadIncludeOnce('inc/header.php'); @@ -243,7 +243,7 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr $template = 'mailid_points_done'; // Right code entered add points and remove entry - if ((getUserData('ref_payout') > 0) && (!isDirectPaymentEnabled())) { + if (ifUserPointsLocked($userId)) { // Don't add points over the referal system $template = 'mailid_points_locked'; } // END - if @@ -268,7 +268,13 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr // Set template to mailid_points_done2 which contains a link to the ranking list $template = 'mailid_points_done2'; - if ($locked) $template = 'mailid_points_locked2'; + + // Different template if user has some mails to confirm + if (ifUserPointsLocked($userId)) { + $template = 'mailid_points_locked2'; + } // END - if + + // Assign more data for the template $content['userid'] = $userId; $content['type'] = $type; $content['data'] = $urlId; diff --git a/templates/de/html/admin/admin_config_cats.tpl b/templates/de/html/admin/admin_config_cats.tpl index 376311d5c6..a3d17c7d78 100644 --- a/templates/de/html/admin/admin_config_cats.tpl +++ b/templates/de/html/admin/admin_config_cats.tpl @@ -9,7 +9,7 @@ {--ID_SELECT--} {--CATEGORY_NAME--} - {--IS_VISIBLE--} + {--ADMIN_IS_VISIBLE--} {--SORTING_KEY--} $content diff --git a/templates/de/html/admin/admin_edit_mods.tpl b/templates/de/html/admin/admin_edit_mods.tpl new file mode 100644 index 0000000000..c730b6ed19 --- /dev/null +++ b/templates/de/html/admin/admin_edit_mods.tpl @@ -0,0 +1,22 @@ +
+
+ + + + + + + + + + + $content + + + +
{--ADMIN_MODS_NAME--}{--ADMIN_MODS_TITLE--}{--ADMIN_MODS_IS_LOCKED--}{--ADMIN_MODS_IS_HIDDEN--}{--ADMIN_MODS_IS_ADMIN--}{--ADMIN_MODS_IS_MEMBER--}
+
+
diff --git a/templates/de/html/admin/admin_edit_mods_row.tpl b/templates/de/html/admin/admin_edit_mods_row.tpl new file mode 100644 index 0000000000..d870a05a04 --- /dev/null +++ b/templates/de/html/admin/admin_edit_mods_row.tpl @@ -0,0 +1,20 @@ + + +  $content[module] + + + + + + $content[locked] + + + $content[hidden] + + + $content[admin_only] + + + $content[mem_only] + + diff --git a/templates/de/html/admin/admin_edit_theme.tpl b/templates/de/html/admin/admin_edit_theme.tpl new file mode 100644 index 0000000000..fe42e1487d --- /dev/null +++ b/templates/de/html/admin/admin_edit_theme.tpl @@ -0,0 +1,27 @@ +
+
+ + + + + + + + + + $content + + + +
{--ID_SELECT--}{--THEME_UNIX--}{--THEME_NAME--}{--THEME_ACTIVE--}{--THEME_AUTHOR--}{--THEME_VERSION--}
+
+ +
+ {--ADMIN_THEME_NEW_DEFAULT_THEME--} +
+ +
diff --git a/templates/de/html/admin/admin_edit_theme_row.tpl b/templates/de/html/admin/admin_edit_theme_row.tpl new file mode 100644 index 0000000000..03ff0c656d --- /dev/null +++ b/templates/de/html/admin/admin_edit_theme_row.tpl @@ -0,0 +1,24 @@ + + + + + + + $content[link] + + + $content[theme_name] + + + {%pipe,translateYesNo=$content[theme_active]%} + + + $content[email] + + + $content[url] + + + v$content[theme_version] + + diff --git a/templates/de/html/admin/admin_import_theme.tpl b/templates/de/html/admin/admin_import_theme.tpl new file mode 100644 index 0000000000..5babe98489 --- /dev/null +++ b/templates/de/html/admin/admin_import_theme.tpl @@ -0,0 +1,18 @@ +
+ + + + + + + + + + $content + + + +
{--THEME_UNIX--}{--THEME_NAME--}{--THEME_AUTHOR--}{--THEME_URL--}{--THEME_VERSION--}{--THEME_INSTALL--}
+
diff --git a/templates/de/html/admin/admin_import_theme_none.tpl b/templates/de/html/admin/admin_import_theme_none.tpl new file mode 100644 index 0000000000..92248b71e2 --- /dev/null +++ b/templates/de/html/admin/admin_import_theme_none.tpl @@ -0,0 +1,5 @@ + + + $content + + diff --git a/templates/de/html/admin/admin_import_theme_row.tpl b/templates/de/html/admin/admin_import_theme_row.tpl new file mode 100644 index 0000000000..74dd228267 --- /dev/null +++ b/templates/de/html/admin/admin_import_theme_row.tpl @@ -0,0 +1,14 @@ + + $content[unix] + $content[theme_name] + + $content[theme_author] + + + $content[theme_url] + + v$content[theme_version] + + $content[form_content] + + diff --git a/templates/de/html/admin/admin_menu_status_row.tpl b/templates/de/html/admin/admin_menu_status_row.tpl index f9d2d5d02b..ad2aaf11d2 100644 --- a/templates/de/html/admin/admin_menu_status_row.tpl +++ b/templates/de/html/admin/admin_menu_status_row.tpl @@ -7,11 +7,11 @@ - {--IS_VISIBLE--}: + {--ADMIN_IS_VISIBLE--}: $content[visible] - {--IS_LOCKED--}: + {--ADMIN_MENU_IS_LOCKED--}: $content[locked] diff --git a/templates/de/html/admin/admin_mods_edit.tpl b/templates/de/html/admin/admin_mods_edit.tpl index 5ded225a4a..11f5d85d80 100644 --- a/templates/de/html/admin/admin_mods_edit.tpl +++ b/templates/de/html/admin/admin_mods_edit.tpl @@ -1,20 +1 @@ -
- - - - - - - - - - - $content - - - -
{--ADMIN_MODS_NAME--}{--ADMIN_MODS_TITLE--}{--ADMIN_MODS_IS_LOCKED--}{--ADMIN_MODS_IS_HIDDEN--}{--ADMIN_MODS_IS_ADMIN--}{--ADMIN_MODS_IS_MEMBER--}
-
+ diff --git a/templates/de/html/admin/admin_mods_edit_row.tpl b/templates/de/html/admin/admin_mods_edit_row.tpl index 4a81d102c4..11f5d85d80 100644 --- a/templates/de/html/admin/admin_mods_edit_row.tpl +++ b/templates/de/html/admin/admin_mods_edit_row.tpl @@ -1,20 +1 @@ - - -  $content[mod] - - - - - - $content[locked] - - - $content[hidden] - - - $content[admin] - - - $content[mem] - - + diff --git a/templates/de/html/admin/admin_theme_edit.tpl b/templates/de/html/admin/admin_theme_edit.tpl index fe42e1487d..11f5d85d80 100644 --- a/templates/de/html/admin/admin_theme_edit.tpl +++ b/templates/de/html/admin/admin_theme_edit.tpl @@ -1,27 +1 @@ -
-
- - - - - - - - - - $content - - - -
{--ID_SELECT--}{--THEME_UNIX--}{--THEME_NAME--}{--THEME_ACTIVE--}{--THEME_AUTHOR--}{--THEME_VERSION--}
-
- -
- {--ADMIN_THEME_NEW_DEFAULT_THEME--} -
- -
+ diff --git a/templates/de/html/admin/admin_theme_edit_row.tpl b/templates/de/html/admin/admin_theme_edit_row.tpl index 03ff0c656d..11f5d85d80 100644 --- a/templates/de/html/admin/admin_theme_edit_row.tpl +++ b/templates/de/html/admin/admin_theme_edit_row.tpl @@ -1,24 +1 @@ - - - - - - - $content[link] - - - $content[theme_name] - - - {%pipe,translateYesNo=$content[theme_active]%} - - - $content[email] - - - $content[url] - - - v$content[theme_version] - - + diff --git a/templates/de/html/admin/admin_theme_import.tpl b/templates/de/html/admin/admin_theme_import.tpl index 5babe98489..11f5d85d80 100644 --- a/templates/de/html/admin/admin_theme_import.tpl +++ b/templates/de/html/admin/admin_theme_import.tpl @@ -1,18 +1 @@ -
- - - - - - - - - - $content - - - -
{--THEME_UNIX--}{--THEME_NAME--}{--THEME_AUTHOR--}{--THEME_URL--}{--THEME_VERSION--}{--THEME_INSTALL--}
-
+ diff --git a/templates/de/html/admin/admin_theme_import_none.tpl b/templates/de/html/admin/admin_theme_import_none.tpl index 7eca612f21..11f5d85d80 100644 --- a/templates/de/html/admin/admin_theme_import_none.tpl +++ b/templates/de/html/admin/admin_theme_import_none.tpl @@ -1,5 +1 @@ - - - $content - - + diff --git a/templates/de/html/admin/admin_theme_import_row.tpl b/templates/de/html/admin/admin_theme_import_row.tpl index 74dd228267..11f5d85d80 100644 --- a/templates/de/html/admin/admin_theme_import_row.tpl +++ b/templates/de/html/admin/admin_theme_import_row.tpl @@ -1,14 +1 @@ - - $content[unix] - $content[theme_name] - - $content[theme_author] - - - $content[theme_url] - - v$content[theme_version] - - $content[form_content] - - + -- 2.39.5