From 7b9f2d4c956e37c4c079c1e612ecd6a7947e7e05 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 23 Feb 2009 18:57:25 +0000 Subject: [PATCH] More language strings rewritten --- inc/functions.php | 8 +- inc/language/de.php | 9 +- inc/language/order_de.php | 4 +- inc/language/repair_de.php | 3 +- inc/language/sponsor_de.php | 52 +++++----- inc/libs/sponsor_functions.php | 43 +++------ inc/modules/admin/what-admin_add.php | 15 +-- inc/modules/admin/what-config_mods.php | 4 +- inc/modules/admin/what-config_points.php | 2 +- inc/modules/admin/what-edit_emails.php | 2 +- inc/modules/admin/what-guest_add.php | 19 +--- inc/modules/admin/what-payments.php | 2 +- inc/modules/admin/what-refbanner.php | 2 +- inc/modules/admin/what-repair_amenu.php | 9 +- inc/modules/admin/what-repair_cats.php | 6 +- inc/modules/admin/what-repair_gmenu.php | 9 +- inc/modules/admin/what-repair_mmenu.php | 9 +- inc/modules/guest/what-sponsor_login.php | 16 ++-- inc/modules/guest/what-sponsor_reg.php | 116 +++++++++++------------ inc/modules/member/what-order.php | 6 +- inc/modules/sponsor/account.php | 4 +- inc/modules/sponsor/settings.php | 2 +- 22 files changed, 154 insertions(+), 188 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 591a56c702..831e497a06 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2392,13 +2392,13 @@ function merge_array ($array1, $array2) { } // Both are not arrays - debug_report_bug(__FUNCTION__.":"); + debug_report_bug(__FUNCTION__.": No arrays provided!"); } // Debug message logger function DEBUG_LOG ($file, $line, $message, $force=true) { // Is debug mode enabled? - if ((isBooleanConstantAndTrue('DEBUG_MODE')) || ($force)) { + if ((isBooleanConstantAndTrue('DEBUG_MODE')) || ($force === true)) { // Log this message away $fp = fopen(PATH."inc/cache/debug.log", 'a') or mxchange_die("Cannot write logfile debug.log!"); fwrite($fp, date("d.m.Y|H:i:s", time())."|".basename($file)."|".$line."|".strip_tags($message)."\n"); @@ -2672,7 +2672,7 @@ function TRANSLATE_POOL_TYPE ($type) { // Does it exist? if (defined($constName)) { // Then use it - $translated = constant($constName); + $translated = getMessage($constName); } // END - if // Return "translation" @@ -3241,7 +3241,7 @@ function convertCodeToMessage ($code) { case constant('CODE_COOKIES_DISABLED') : $msg = getMessage('LOGIN_NO_COOKIES'); break; case constant('CODE_BEG_SAME_AS_OWN') : $msg = getMessage('BEG_SAME_UID_AS_OWN'); break; case constant('CODE_LOGIN_FAILED') : $msg = getMessage('LOGIN_FAILED_GENERAL'); break; - default : $msg = UNKNOWN_MAILID_CODE_1.$code.UNKNOWN_MAILID_CODE_2; break; + default : $msg = sprintf(getMessage('UNKNOWN_MAILID_CODE'), $code); break; } // END - switch // Return the message diff --git a/inc/language/de.php b/inc/language/de.php index fb49fbe18f..ec12cd0c2a 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -402,8 +402,7 @@ define('MEMBER_URL_TIME_LOCK', "Sie hatten bereits die selbe URL gebucht:"); define('MEMBER_LAST_TLOCK', "Ihre letzte Buchung war am"); define('CONFIG_URL_TLOCK', "Selbe URLs sind buchbar in"); define('_AND', "und"); -define('UNKNOWN_CODE_1', "Es ist während der Ausführung ein unbekannter Fehler-Code "); -define('UNKNOWN_CODE_2', " enstanden, für den Sie vermutlich nicht verantwortlich sind. Bitte informieren Sie uns über diese Meldung!"); +define('UNKNOWN_CODE', "Es ist während der Ausführung ein unbekannter Fehler-Code %s enstanden, für den Sie vermutlich nicht verantwortlich sind. Bitte informieren Sie uns über diese Meldung!"); define('MEMBER_TEXT_CONTAINS_URL', "Ihr Werbetext enthält eine URL, dies ist in unserem {!MT_WORD!} nicht zulässig. Bitte entfernen Sie diese aus Ihrem Text und versuchen Sie es erneut."); define('MEMBER_TEXT_OVERLENGTH', "Ihr Text hat die maximale Textlänge überschritten. Bitte fassen Sie ihn etwas kürzer."); define('MEMBER_SUBJ_CONTAINS_URL', "Ihre eingegebe Betreffzeile enthält eine URL, dies ist in unserem {!MT_WORD!} nicht zulässig. Bitte entfernen Sie diese aus Ihrer Betreffzeile und versuchen Sie es erneut."); @@ -947,8 +946,7 @@ define('CONFIRM_ACCOUNT', "Account bestätigen"); define('CONFIRMATION_LINK', "Hier bestätigen"); define('CLICK_NOW', "Klick!"); define('MAILID_LINK', "Best.-Link"); -define('UNKNOWN_MAILID_CODE_1', "Unbekannter Fehler-Code "); -define('UNKNOWN_MAILID_CODE_2', " erkannt!"); +define('UNKNOWN_MAILID_CODE', "Unbekannter Fehler-Code %s erkannt!"); define('CHANGE_GUEST_MENU', "Verdecken, anzeigen, deaktivieren, aktivieren des Gastmenüs"); define('IS_LOCKED', "Ist gesperrt"); define('ADMIN_REMOVE_STATS_ENTRY', "Hier klicken, um Mitgliederstatistik zu entfernen!"); @@ -958,8 +956,7 @@ define('MEMBER_ENTER_MORE_RECEIVERS', "Geben Sie mindestens ein Empfänger e define('MEMBER_NO_MORE_RECEIVERS_FOUND', "Es konnten nicht ausreichend genug empfangsbereite Mitglieder gefunden werden."); define('ADMIN_USER_PROFILE_TITLE', "Mitgliedsprofil aufrufen"); define('LIST_UNCONFIRMED_MEMBER_LINKS', "Unbestätigte Maillinks eines Mitgliedes auflisten"); -define('MEMBER_ENTER_MORE_MIN_RECEIVERS_1', "Geben Sie mehr als "); -define('MEMBER_ENTER_MORE_MIN_RECEIVERS_2', " Empfänger ein!"); +define('MEMBER_ENTER_MORE_MIN_RECEIVERS', "Geben Sie mehr als %s Empfänger ein!"); define('NO_TEMPLATE_SUPPLIED', "Keinen Template-Namen uebergeben! Fehler im Script erkannt. Bitte den Webmaster ({!WEBMASTER!}) verstaendigen!"); define('_OR', "oder"); define('GUEST_NEW_PASSWORD_SEND', "Neues Passwort ist zu Ihrem Postfach unterwegs!"); diff --git a/inc/language/order_de.php b/inc/language/order_de.php index f0b9521af3..2194f0680c 100644 --- a/inc/language/order_de.php +++ b/inc/language/order_de.php @@ -44,9 +44,7 @@ define('ORDER_MAX_ORDER_SELECT', "Wie viele Mailbuchungen sollen die Mitglieder define('ORDER_MIN_RECEIVER_PER_ORDER', "Minimale Empfänger pro Mailbuchung"); define('ADMIN_ORDER_MAX', "So viele wie möglich."); define('ADMIN_ORDER_ORDER', "So viele wie auf Empfang eingestellt."); -define('ORDER_ALLOWED_RECEIVE_1', "Sie können heute noch "); -define('ORDER_ALLOWED_RECEIVE_2', " von "); -define('ORDER_ALLOWED_RECEIVE_3', " Mailbuchungen aufgeben."); +define('ORDER_ALLOWED_RECEIVE', "Sie können heute noch %s von %s Mailbuchungen aufgeben."); define('ORDER_ALLOWED_MAX', "Sie können solange Mailbuchungen aufgeben, bis alle Mitglieder nicht mehr empfangsbereit sind."); define('ORDER_ALLOWED_UNKNOWN', "Fehler in Konfiguration erkannt! Bitte den Administrator benachrichtigen."); define('ADMIN_ORDER_SELECTION_COLUMN', "Tabellenspalte, nach der umsortiert werden soll"); diff --git a/inc/language/repair_de.php b/inc/language/repair_de.php index 9fb7e2d252..c8ebe8c236 100644 --- a/inc/language/repair_de.php +++ b/inc/language/repair_de.php @@ -39,8 +39,7 @@ if (!defined('__SECURITY')) { // Language definitions define('ADMIN_REPAIR_CATS_NOTHING', "Keine Kategorie-Auswahlenn gefunden! Vermutlich sind keine Mitglieder registriert?"); -define('ADMIN_REPAIR_ENTRIES_FIXED_1', "Es wurden "); -define('ADMIN_REPAIR_ENTRIES_FIXED_2', " Einträge repariert!"); +define('ADMIN_REPAIR_ENTRIES_FIXED', "Es wurden %s Einträge repariert!"); define('ADMIN_REPAIR_NOTHING_FIXED', "Es wurden keine Einträge repariert!"); // diff --git a/inc/language/sponsor_de.php b/inc/language/sponsor_de.php index 4ce1bc227b..694fe3742b 100644 --- a/inc/language/sponsor_de.php +++ b/inc/language/sponsor_de.php @@ -163,8 +163,7 @@ define('SPONSOR_DELETE_PAY_ENTRIES', "Buchungspakete löschen"); define('SPONSOR_PAY_ENTRIES_CHANGED', "Buchungspakete geändert."); define('SPONSOR_PAY_ENTRIES_REMOVED', "Buchungspakete gelöscht."); define('SPONSOR_PAYMENT_LIST_IS_EMPTY', "Noch keine Buchungspakete eingerichtet!"); -define('ADMIN_SPONSOR_UNKOWN_STATUS_1', "Unbekannter Status "); -define('ADMIN_SPONSOR_UNKOWN_STATUS_2', " wurde bei der Anmeldung zurückgeliefert!"); +define('ADMIN_SPONSOR_UNKNOWN_STATUS', "Unbekannter Status %s wurde bei der Anmeldung zurückgeliefert!"); define('SPONSOR_REFERRAL', "Sponsoren-Referal"); define('SPONSOR_REFID_WAS', "Sie wurden vom Sponsor geworben"); define('SPONSOR_ACCOUNT_IS_PENDING', "EMail-Adresse bestätigt! Sie haben soeben eine EMail mit weiteren Anweisungen erhalten."); @@ -200,24 +199,24 @@ define('ADMIN_SPONSOR_LOCK', "Sponsoren ent-/sperren"); define('ADMIN_LIST_SPONSOR_ORDERS', "Bestellungen bearbeiten"); // Subject lines -define('SPONSOR_UNLOCKED_SUBJ', "Freischaltung Ihres Sponsorenaccounts"); -define('ADMIN_SPONSOR_ADD_POINTS', "Gutschrift durch den Admin!"); -define('ADMIN_SPONSOR_SUB_POINTS', "Abzug durch den Admin!"); +define('SPONSOR_UNLOCKED_SUBJ', "HINWEIS: Freischaltung Ihres Sponsorenaccounts"); +define('ADMIN_SPONSOR_ADD_POINTS', "HINWEIS: Gutschrift durch den Admin!"); +define('ADMIN_SPONSOR_SUB_POINTS', "HINWEIS: Abzug durch den Admin!"); define('SPONSOR_SUBJECT_LOCKED', "HINWEIS: Sperrung Ihres Sponsorenaccounts!"); define('SPONSOR_SUBJECT_UNLOCKED', "HINWEIS: Freigabe Ihres Sponsorenaccounts!"); -define('ADMIN_SPONSOR_EDIT_SUBJECT', "HINWEIS: Sponsorenaccount geaendert durch Admin!"); +define('ADMIN_SPONSOR_EDIT_SUBJECT', "HINWEIS: Sponsorenaccount geändert durch Admin!"); define('ADMIN_SPONSOR_DEL_SUBJECT', "HINWEIS: Sponsorenaccount geloescht durch Admin!"); -define('SPONSOR_PLEASE_CONFIRM_SUBJ', "HINWEIS: Bitte bestaetigen Sie Ihren Account!"); -define('SPONSOR_ACCOUNT_PENDING_SUBJ', "HINWEIS: Ihr Account warten auf Freischaltung!"); +define('SPONSOR_PLEASE_CONFIRM_SUBJ', "HINWEIS: Bitte bestätigen Sie Ihren Account!"); +define('SPONSOR_ACCOUNT_PENDING_SUBJ', "HINWEIS: Ihr Account wartet auf Freischaltung!"); define('ADMIN_NEW_SPONSOR', "Neue Anmeldung eines Sponsors"); -define('SPONSOR_ACTIVATION_LINK_SUBJ', "HINWEIS: Erneute Aussendung Ihres Bestaetigunglinkes!"); +define('SPONSOR_ACTIVATION_LINK_SUBJ', "HINWEIS: Erneute Aussendung Ihres Bestätigunglinkes!"); define('SPONSOR_LOST_PASSWORD_SUBJ', "HINWEIS: Ihr neues Passwort"); -define('SPONSOR_ACC_DATA_SUBJ', "HINWEIS: Aenderung Ihrer Daten"); -define('SPONSOR_ACC_EMAIL_SUBJ', "HINWEIS: Bitte neue EMail-Adresse bestaetigen!"); -define('ADMIN_SPONSOR_ACC_EMAIL_SUBJ', "Sponsor hat seine EMail-Adresse geaendert!"); -define('ADMIN_SPONSOR_ACC_DATA_SUBJ', "Sponsor hat seine Daten geaendert!"); -define('ADMIN_SPONSOR_SETTINGS_SUBJ', "Sponsor hat seine Einstellungen geaendert!"); -define('SPONSOR_SETTINGS_SUBJ', "HINWEIS: Aenderung Ihrer Einstellungen"); +define('SPONSOR_ACC_DATA_SUBJ', "HINWEIS: Änderung Ihrer Daten"); +define('SPONSOR_ACC_EMAIL_SUBJ', "HINWEIS: Bitte neue EMail-Adresse bestätigen!"); +define('ADMIN_SPONSOR_ACC_EMAIL_SUBJ', "Sponsor hat seine EMail-Adresse geändert!"); +define('ADMIN_SPONSOR_ACC_DATA_SUBJ', "Sponsor hat seine Daten geändert!"); +define('ADMIN_SPONSOR_SETTINGS_SUBJ', "Sponsor hat seine Einstellungen geändert!"); +define('SPONSOR_SETTINGS_SUBJ', "HINWEIS: Änderung Ihrer Einstellungen"); // Sponsor registration errors define('SPONSOR_SURNAME_IS_EMPTY', "Sie haben keinen Vornamen eingegeben!"); @@ -243,20 +242,15 @@ define('SPONSOR_NO_PAYTYPE_SELECTED', "Bitte wählen Sie noch ein Buchungspa define('SPONSOR_NO_WARNING_INTERVAL_SELECTED', "Bitte wählen Sie noch den Zeitabstand zwischen zwei Sponsorenberichten aus!"); define('SPONSOR_NO_RECEIVE_WARNINGS_SELECTED', "Bitte wählen Sie noch aus, ob Sie bei jeder Aktion Bestätigungsmails empfangen wollen oder nicht!"); define('SPONSOR_EMAIL_IS_ALREADY_REGISTERED', "Die von Ihnen eingegebene Email-Adresse existiert bereits in unserer Datenbank!"); -define('SPONSOR_ALREADY_FOUND_1', "Ein Sponsor ist bereits mit der Email-Adresse "); -define('SPONSOR_ALREADY_FOUND_2', " bei uns angemeldet!"); +define('SPONSOR_ALREADY_FOUND', "Ein Sponsor ist bereits mit der Email-Adresse %s bei uns angemeldet!"); define('SPONSOR_REGISTRATION_FAILED', "Anmeldung ist fehlgeschlagen!"); define('SPONSOR_REGISTRATION_COMPLETED', "Anmeldung war erfolgreich! Es ist eine Mail zu Ihnen unterwegs, die weitere Anweisungen enthält, um die Anmeldung abzuschliessen."); -define('SPONSOR_UNKOWN_STATUS_1', "Bei der Anmeldung wurde ein unbekannter Rückgabewert "); -define('SPONSOR_UNKOWN_STATUS_2', " erkannt. Bitte melden Sie dies dem Betreiber dieses {!MT_WORD2!}!
Vielen Dank."); -define('SPONSOR_EMAIL_404_1', "Bei der Anmeldung ist uns ein Fehler unterlaufen: Ihr Sponsor-Account mit der EMail-Adresse "); -define('SPONSOR_EMAIL_404_2', " wurde nicht gefunden!"); -define('SPONSOR_ACCOUNT_404', "Sponsorenaccount nicht gefunden oder Link ist ungütig. Oder haben Sie bereits den Bestätigungslink angeklickt?"); +define('SPONSOR_UNKNOWN_STATUS', "Bei der Anmeldung wurde ein unbekannter Rückgabewert %s erkannt. Bitte melden Sie dies dem Betreiber dieses {!MT_WORD2!}!
Vielen Dank."); +define('SPONSOR_EMAIL_404', "Bei der Anmeldung ist uns ein Fehler unterlaufen: Ihr Sponsor-Account mit der EMail-Adresse %s wurde nicht gefunden!"); +define('SPONSOR_ACCOUNT_NOT_FOUND', "Es wurde keine Sponsor-Account gefunden."); define('SPONSOR_ACCOUNT_PENDING_FAILED', "Bei der Umschaltung Ihres Sponorenaccounts auf Wartend trat ein unerwarteter Fehler auf!"); -define('SPONSOR_ACCOUNT_404_1', "Sponsorenaccount "); -define('SPONSOR_ACCOUNT_404_2', " nicht gefunden!"); -define('SPONSOR_ACCOUNT_FAILED_1', "Sponsorenaccount konnte nicht geladen werden: "); -define('SPONSOR_ACCOUNT_FAILED_2', ""); +define('SPONSOR_ACCOUNT_404', "Sponsorenaccount %s nicht gefunden!"); +define('SPONSOR_ACCOUNT_FAILED', "Sponsorenaccount konnte nicht geladen werden: %s"); define('SPONSOR_ACCOUNT_EMAIL_FAILED', "Konnten Sponsorenaccount nicht freigeben! Bitte benachrichtigen Sie den Support!"); // Login form @@ -301,8 +295,7 @@ define('SPONSOR_CHANGE_PASSWORD', "Neues Passwort einstellen"); define('SPONSOR_ACCOUNT_DATA_SAVED', "Ihre Daten wurden gespeichert."); define('SPONSOR_ACCOUNT_EMAIL_CHANGED', "Sie haben Ihre EMail-Adresse geändert, Account wurde temporär gesperrt. Bitte [hier klicken], um in den Gastbereich zu gelangen."); define('SPONSOR_SETTINGS_HEADER', "Einstellungen Ihres Sponsorenaccounts"); -define('SPONSOR_UNKNOWN_WHAT_1', "Scripte-Fehler: Unbekannte Sponsor-Aktion "); -define('SPONSOR_UNKNOWN_WHAT_2', " erkannt!"); +define('SPONSOR_UNKNOWN_WHAT', "Scripte-Fehler: Unbekannte Sponsor-Aktion %s erkannt!"); define('SPONSOR_SETTINGS_SAVED', "Neue Einstellungen gespeichert."); // Error messages @@ -312,8 +305,7 @@ define('SPONSOR_CURRENT_PASSWORD_DIDNOT_MATCH_DB', "Das von Ihnen und das in der define('SPONSOR_BOTH_NEW_PASSWORDS_DIDNOT_MATCH', "Die von Ihnen eingegebenen neuen Passwörter stimmen nicht überein!"); define('SPONSOR_PASSWORD_ONE_EMPTY', "Erstes einzugebenes Passwort ist leer!"); define('SPONSOR_PASSWORD_TWO_EMPTY', "Zweites einzugebenes Passwort ist leer!"); -define('SPONSOR_PASSWORD_TOO_SHORT_1', "Eingegebenes Passwort entspricht nicht der Mindestlänge von "); -define('SPONSOR_PASSWORD_TOO_SHORT_2', " Zeichen!"); +define('SPONSOR_PASSWORD_TOO_SHORT_1', "Eingegebenes Passwort entspricht nicht der Mindestlänge von %s Zeichen!"); define('SPONSOR_ACCOUNT_DATA_NOT_SAVED', "Ihre Daten wurden nicht gespeichert!"); // diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index 5ef940265a..ec1b82dcb4 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -182,7 +182,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_S return; } else { // Already added! - $MSG = SPONSOR_ALREADY_FOUND_1.$POST['email'].SPONSOR_ALREADY_FOUND_2; + $MSG = sprintf(getMessage('SPONSOR_ALREADY_FOUND', $POST['email'])); $ret = "already"; } @@ -197,7 +197,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_S } } else { // Error found! - $MSG = SPONSOR_GET_MESSAGE(SPONSOR_DATA_NOT_SAVED, "failed", $MSGs); + $MSG = SPONSOR_GET_MESSAGE(getMessage('SPONSOR_DATA_NOT_SAVED'), "failed", $MSGs); LOAD_TEMPLATE("admin_settings_saved", false, $MSG); } @@ -205,33 +205,18 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_S if ($RET_STATUS) return $ret; } // -function SPONSOR_TRANSLATE_STATUS($status) { - switch ($status) - { - case "UNCONFIRMED": - $ret = ACCOUNT_UNCONFIRMED; - break; - - case "CONFIRMED": - $ret = ACCOUNT_CONFIRMED; - break; - - case "LOCKED": - $ret = ACCOUNT_LOCKED; - break; - - case "PENDING": - $ret = ACCOUNT_PENDING; - break; - - case "EMAIL": - $ret = ACCOUNT_EMAIL; - break; - - default: +function SPONSOR_TRANSLATE_STATUS ($status) { + // Construct constant name + $constantName = sprintf("ACCOUNT_%s", $status); + + // Is the constant there? + if (defined($constantName)) { + // Then use it + $ret = constant($constantName); + } else { + // Not found! DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown status %s detected.", $status)); - $ret = UNKNOWN_STATUS_1.$status.UNKNOWN_STATUS_2; - break; + $ret = sprintf(getMessage('UNKNOWN_STATUS'), $status); } return $ret; } @@ -479,7 +464,7 @@ function SPONSOR_SAVE_DATA ($POST, $content) { default: // Unknown sponsor what value! DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown sponsor module (what) %s detected.", $GLOBALS['what'])); - $MSG = SPONSOR_UNKNOWN_WHAT_1.$GLOBALS['what'].SPONSOR_UNKNOWN_WHAT_2; + $MSG = sprintf(getMessage('SPONSOR_UNKNOWN_WHAT'), $GLOBALS['what']); $templ = ""; $subj = ""; break; } diff --git a/inc/modules/admin/what-admin_add.php b/inc/modules/admin/what-admin_add.php index acc0bb2f82..89d00727ab 100644 --- a/inc/modules/admin/what-admin_add.php +++ b/inc/modules/admin/what-admin_add.php @@ -163,12 +163,9 @@ if (!isset($_POST['ok'])) // Display form LOAD_TEMPLATE("admin_admin_add"); -} - elseif (!IS_DEMO()) -{ +} elseif (!IS_DEMO()) { // Insert new menu entry - if (!empty($_POST['menu'])) - { + if (!empty($_POST['menu'])) { // Add sub menu SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('%s','%s','%s','%s','%s')", array( @@ -180,9 +177,7 @@ if (!isset($_POST['ok'])) ), __FILE__, __LINE__ ); CACHE_PURGE_ADMIN_MENU(0, $_POST['menu'], $_POST['name']); - } - else - { + } else { // Add main menu SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (action, title, descr, sort) VALUES ('%s','%s','%s','%s')", array( @@ -195,9 +190,7 @@ if (!isset($_POST['ok'])) CACHE_PURGE_ADMIN_MENU(0, $_POST['name']); } LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_SAVED')); -} - else -{ +} else { // Is demo login! LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_NOT_SAVED')); } diff --git a/inc/modules/admin/what-config_mods.php b/inc/modules/admin/what-config_mods.php index 6ae6c9b6a2..df25c63da7 100644 --- a/inc/modules/admin/what-config_mods.php +++ b/inc/modules/admin/what-config_mods.php @@ -77,7 +77,7 @@ if (isset($_POST['edit'])) { LOAD_TEMPLATE("admin_mods_edit"); } else { // Nothing selected - LOAD_TEMPLATE("admin_settings_saved", false, MODS_NOTHING_SELECTED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MODS_NOTHING_SELECTED')); // Remove maybe confusing data unset($_POST['edit']); @@ -100,7 +100,7 @@ if (isset($_POST['edit'])) { } // Entries updated - LOAD_TEMPLATE("admin_settings_saved", false, MODS_CHANGED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MODS_CHANGED')); } if ($SEL == 0) { diff --git a/inc/modules/admin/what-config_points.php b/inc/modules/admin/what-config_points.php index 07698bc9c0..9ea90fab8a 100644 --- a/inc/modules/admin/what-config_points.php +++ b/inc/modules/admin/what-config_points.php @@ -154,7 +154,7 @@ WHERE mails_confirmed < %s", $REF, $REF); REBUILD_CACHE("config", "config"); } else { // Prepare failed-message - $message = "".SETTINGS_NOT_SAVED.""; + $message = "{--SETTINGS_NOT_SAVED--}"; } // Remove SQL queries diff --git a/inc/modules/admin/what-edit_emails.php b/inc/modules/admin/what-edit_emails.php index a02228e75a..bb171d0de3 100644 --- a/inc/modules/admin/what-edit_emails.php +++ b/inc/modules/admin/what-edit_emails.php @@ -76,7 +76,7 @@ WHERE id=%s LIMIT 1", if (SQL_AFFECTEDROWS() == 1) { $content = SETTINGS_SAVED; } else { - $content = "".SETTINGS_NOT_SAVED.""; + $content = "{--SETTINGS_NOT_SAVED--}"; } // Display message diff --git a/inc/modules/admin/what-guest_add.php b/inc/modules/admin/what-guest_add.php index 3bd9a5c284..ecae91db22 100644 --- a/inc/modules/admin/what-guest_add.php +++ b/inc/modules/admin/what-guest_add.php @@ -152,9 +152,7 @@ WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", } $OUT .= "\n"; } - } - else - { + } else { $OUT .= " \n"; } } @@ -166,12 +164,9 @@ WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", // Display form LOAD_TEMPLATE("admin_guest_add"); -} - elseif (!IS_DEMO()) -{ +} elseif (!IS_DEMO()) { // Insert new menu entry - if (!empty($_POST['menu'])) - { + if (!empty($_POST['menu'])) { SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('%s','%s','%s','%s','%s','%s')", array( $_POST['menu'], @@ -181,9 +176,7 @@ WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", $_POST['visible'], $_POST['active'], ), __FILE__, __LINE__); - } - else - { + } else { SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (action, title, sort, visible, locked) VALUES ('%s','%s','%s','%s','%s')", array( $_POST['name'], @@ -194,9 +187,7 @@ WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", ), __FILE__, __LINE__); } LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_SAVED')); -} - else -{ +} else { // Demo mode! LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_NOT_SAVED')); } diff --git a/inc/modules/admin/what-payments.php b/inc/modules/admin/what-payments.php index b5c2d140f8..210812d708 100644 --- a/inc/modules/admin/what-payments.php +++ b/inc/modules/admin/what-payments.php @@ -80,7 +80,7 @@ if (isset($_POST['ok'])) { $content = "".SETTINGS_SAVED.""; } else { // Nothing has changed! - $content = "".SETTINGS_NOT_SAVED.""; + $content = "{--SETTINGS_NOT_SAVED--}"; } // Output template diff --git a/inc/modules/admin/what-refbanner.php b/inc/modules/admin/what-refbanner.php index 7b73f1148b..1866e42f98 100644 --- a/inc/modules/admin/what-refbanner.php +++ b/inc/modules/admin/what-refbanner.php @@ -87,7 +87,7 @@ VALUES ('%s','%s','%s')", if (SQL_AFFECTEDROWS() == 1) { $content = SETTINGS_SAVED; } else { - $content = "".SETTINGS_NOT_SAVED.""; + $content = "{--SETTINGS_NOT_SAVED--}"; } LOAD_TEMPLATE("admin_settings_saved", false, $content); } elseif (($SEL > 0) && (isset($_POST['edit']))) { diff --git a/inc/modules/admin/what-repair_amenu.php b/inc/modules/admin/what-repair_amenu.php index 803f11bd17..721aea9c1f 100644 --- a/inc/modules/admin/what-repair_amenu.php +++ b/inc/modules/admin/what-repair_amenu.php @@ -80,7 +80,14 @@ foreach ($ACTIONS as $act) { CACHE_PURGE_ADMIN_MENU(); // Repair finished -LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REPAIR_ENTRIES_FIXED_1.$REP.ADMIN_REPAIR_ENTRIES_FIXED_2); +if ($REP > 0) { + $MSG = sprintf(getMessage('ADMIN_REPAIR_ENTRIES_FIXED'), $REP); +} else { + $MSG = getMessage('ADMIN_REPAIR_NOTHING_FIXED'); +} + +// Output message +LOAD_TEMPLATE("admin_settings_saved", false, $MSG); // ?> diff --git a/inc/modules/admin/what-repair_cats.php b/inc/modules/admin/what-repair_cats.php index 1d21c495f2..038b4a2703 100644 --- a/inc/modules/admin/what-repair_cats.php +++ b/inc/modules/admin/what-repair_cats.php @@ -63,14 +63,14 @@ if (SQL_NUMROWS($result) > 0) { if ($REMOVED > 0) { // Entries repaired - $content = ADMIN_REPAIR_ENTRIES_FIXED_1.$REMOVED.ADMIN_REPAIR_ENTRIES_FIXED_2; + $content = sprintf(getMessage('ADMIN_REPAIR_ENTRIES_FIXED'), $REMOVED); } else { // Nothing repaired - $content = "
".ADMIN_REPAIR_NOTHING_FIXED."
"; + $content = "
{--ADMIN_REPAIR_NOTHING_FIXED--}
"; } } else { // No category selections found, no members registered? - $content = "
".ADMIN_REPAIR_CATS_NOTHING."
"; + $content = "
{--ADMIN_REPAIR_CATS_NOTHING--}
"; } // Load template diff --git a/inc/modules/admin/what-repair_gmenu.php b/inc/modules/admin/what-repair_gmenu.php index 5a42fcb2db..d62431b232 100644 --- a/inc/modules/admin/what-repair_gmenu.php +++ b/inc/modules/admin/what-repair_gmenu.php @@ -76,7 +76,14 @@ foreach ($ACTIONS as $act) { } // Repair finished -LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REPAIR_ENTRIES_FIXED_1.$REP.ADMIN_REPAIR_ENTRIES_FIXED_2); +if ($REP > 0) { + $MSG = sprintf(getMessage('ADMIN_REPAIR_ENTRIES_FIXED'), $REP); +} else { + $MSG = getMessage('ADMIN_REPAIR_NOTHING_FIXED'); +} + +// Output message +LOAD_TEMPLATE("admin_settings_saved", false, $MSG); // ?> diff --git a/inc/modules/admin/what-repair_mmenu.php b/inc/modules/admin/what-repair_mmenu.php index 83c4d9bbbf..566b219bee 100644 --- a/inc/modules/admin/what-repair_mmenu.php +++ b/inc/modules/admin/what-repair_mmenu.php @@ -76,7 +76,14 @@ foreach ($ACTIONS as $act) { } // Repair finished -LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REPAIR_ENTRIES_FIXED_1.$REP.ADMIN_REPAIR_ENTRIES_FIXED_2); +if ($REP > 0) { + $MSG = sprintf(getMessage('ADMIN_REPAIR_ENTRIES_FIXED'), $REP); +} else { + $MSG = getMessage('ADMIN_REPAIR_NOTHING_FIXED'); +} + +// Output message +LOAD_TEMPLATE("admin_settings_saved", false, $MSG); // ?> diff --git a/inc/modules/guest/what-sponsor_login.php b/inc/modules/guest/what-sponsor_login.php index a58b00eb72..bd05f92770 100644 --- a/inc/modules/guest/what-sponsor_login.php +++ b/inc/modules/guest/what-sponsor_login.php @@ -82,16 +82,16 @@ WHERE id='%s' AND hash='%s' AND `status`='UNCONFIRMED' LIMIT 1", if (SQL_AFFECTEDROWS() == 1) { // Prepare mail and send it to the sponsor $MSG = LOAD_EMAIL_TEMPLATE("sponsor_pending", $SPONSOR); - SEND_EMAIL($SPONSOR['email'], SPONSOR_ACCOUNT_PENDING_SUBJ, $MSG); + SEND_EMAIL($SPONSOR['email'], getMessage('SPONSOR_ACCOUNT_PENDING_SUBJ'), $MSG); // Send email to admin - SEND_ADMIN_NOTIFICATION(ADMIN_NEW_SPONSOR, "admin_sponsor_pending", $SPONSOR); + SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_SPONSOR'), "admin_sponsor_pending", $SPONSOR); // Sponsor account set to pending - LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_ACCOUNT_IS_PENDING); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SPONSOR_ACCOUNT_IS_PENDING')); } else { // Could not unlock account! - LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_ACCOUNT_PENDING_FAILED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SPONSOR_ACCOUNT_PENDING_FAILED')); } } elseif ($SPONSOR['status'] == "EMAIL") { // Changed email adress need to be confirmed @@ -102,18 +102,18 @@ WHERE id='%s' AND hash='%s' AND `status`='EMAIL' LIMIT 1", // Check on success if (SQL_AFFECTEDROWS() == 1) { // Sponsor account is unlocked again - LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_ACCOUNT_IS_CONFIRMED_AGAIN); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SPONSOR_ACCOUNT_IS_CONFIRMED_AGAIN')); } else { // Could not unlock account! - LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_ACCOUNT_EMAIL_FAILED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SPONSOR_ACCOUNT_EMAIL_FAILED')); } } else { /// ??? Other status? - LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_ACCOUNT_STATUS_FAILED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SPONSOR_ACCOUNT_STATUS_FAILED')); } } else { // No sponsor found - LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_ACCOUNT_404); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SPONSOR_ACCOUNT_NOT_FOUND')); } // Free memory diff --git a/inc/modules/guest/what-sponsor_reg.php b/inc/modules/guest/what-sponsor_reg.php index b40a7e1076..65afc5ef8b 100644 --- a/inc/modules/guest/what-sponsor_reg.php +++ b/inc/modules/guest/what-sponsor_reg.php @@ -52,17 +52,17 @@ if (isset($_POST['ok'])) { // 1. Salutation / Surname / family name if (empty($_POST['gender'])) { // Surname is empty - $FORM_ERRORS[] = SPONSOR_NO_GENDER_SELECTED; + $FORM_ERRORS[] = getMessage('SPONSOR_NO_GENDER_SELECTED'); } if (empty($_POST['surname'])) { // Surname is empty - $FORM_ERRORS[] = SPONSOR_SURNAME_IS_EMPTY; + $FORM_ERRORS[] = getMessage('SPONSOR_SURNAME_IS_EMPTY'); } if (empty($_POST['family'])) { // Surname is empty - $FORM_ERRORS[] = SPONSOR_FAMILY_IS_EMPTY; + $FORM_ERRORS[] = getMessage('SPONSOR_FAMILY_IS_EMPTY'); } // 2. Company name @@ -70,128 +70,121 @@ if (isset($_POST['ok'])) { if (((empty($_POST['company'])) && ((!empty($_POST['tax_ident'])) || (!empty($_POST['position'])))) || ((!empty($_POST['company'])) && (empty($_POST['tax_ident'])))) { if (empty($_POST['company'])) { // Company name is empty - $FORM_ERRORS[] = SPONSOR_COMPANY_IS_EMPTY; + $FORM_ERRORS[] = getMessage('SPONSOR_COMPANY_IS_EMPTY'); } elseif (empty($_POST['tax_ident'])) { // Tax ident number name is empty - $FORM_ERRORS[] = SPONSOR_TAX_IDENT_IS_EMPTY; + $FORM_ERRORS[] = getMessage('SPONSOR_TAX_IDENT_IS_EMPTY'); } if (empty($_POST['position'])) { // Not fatal but not nice: position in company is empty - $FORM_ERRORS[] = SPONSOR_POSITION_IS_EMPTY; + $FORM_ERRORS[] = getMessage('SPONSOR_POSITION_IS_EMPTY'); } } // 3. Street and number if (empty($_POST['street_nr1'])) { // Street name and house number are empty - $FORM_ERRORS[] = SPONSOR_STREET_NR1_IS_EMPTY; + $FORM_ERRORS[] = getMessage('SPONSOR_STREET_NR1_IS_EMPTY'); } elseif ((!empty($_POST['street_nr2'])) && (empty($_POST['street_nr1']))) { // 1st line for street is empty, but 2nd line not - $FORM_ERRORS[] = SPONSOR_STREET_NR1_IS_EMPTY_2_NOT; + $FORM_ERRORS[] = getMessage('SPONSOR_STREET_NR1_IS_EMPTY_2_NOT'); } // 4. Country code if (empty($_POST['country'])) { // Country code is empty - $FORM_ERRORS[] = SPONSOR_COUNTRY_IS_EMPTY; + $FORM_ERRORS[] = getMessage('SPONSOR_COUNTRY_IS_EMPTY'); } elseif (strlen($_POST['country']) != 2) { // Country code is invalid - $FORM_ERRORS[] = SPONSOR_COUNTRY_IS_INVALID; + $FORM_ERRORS[] = getMessage('SPONSOR_COUNTRY_IS_INVALID'); } // 3. ZIP code if (empty($_POST['zip'])) { // ZIP code is empty - $FORM_ERRORS[] = SPONSOR_ZIP_IS_EMPTY; + $FORM_ERRORS[] = getMessage('SPONSOR_ZIP_IS_EMPTY'); } elseif (bigintval($_POST['zip']) != $_POST['zip']) { // ZIP is invalid - $FORM_ERRORS[] = SPONSOR_ZIP_IS_INVALID; + $FORM_ERRORS[] = getMessage('SPONSOR_ZIP_IS_INVALID'); $_POST['zip'] = ""; } // 4. City if (empty($_POST['city'])) { // City is empty - $FORM_ERRORS[] = SPONSOR_CITY_IS_EMPTY; + $FORM_ERRORS[] = getMessage('SPONSOR_CITY_IS_EMPTY'); } // 5. Phone number if (empty($_POST['phone'])) { // City is empty - $FORM_ERRORS[] = SPONSOR_PHONE_IS_EMPTY; + $FORM_ERRORS[] = getMessage('SPONSOR_PHONE_IS_EMPTY'); } // 6. Homepage URL if (empty($_POST['url'])) { // Homepage URL is empty - $FORM_ERRORS[] = SPONSOR_URL_IS_EMPTY; + $FORM_ERRORS[] = getMessage('SPONSOR_URL_IS_EMPTY'); } elseif (!VALIDATE_URL($_POST['url'])) { // Homepage URL is invalid - $FORM_ERRORS[] = SPONSOR_URL_IS_INVALID; + $FORM_ERRORS[] = getMessage('SPONSOR_URL_IS_INVALID'); $_POST['url'] = ""; } // 7. Light validation of email address if ((empty($_POST['email'])) || ($_POST['email'] == "@")) { // Email is invalid/empty - $FORM_ERRORS[] = SPONSOR_EMAIL_IS_INVALID; + $FORM_ERRORS[] = getMessage('SPONSOR_EMAIL_IS_INVALID'); } elseif (SPONSOR_FOUND_EMAIL_DB($_POST['email'])) { // Email already found in database! - $FORM_ERRORS[] = SPONSOR_EMAIL_IS_ALREADY_REGISTERED; + $FORM_ERRORS[] = getMessage('SPONSOR_EMAIL_IS_ALREADY_REGISTERED'); $_POST['email'] = ""; } + // 8. Pay type selected? - if (empty($_POST['pay_type'])) - { + if (empty($_POST['pay_type'])) { // Not pay type selected - $FORM_ERRORS[] = SPONSOR_NO_PAYTYPE_SELECTED; + $FORM_ERRORS[] = getMessage('SPONSOR_NO_PAYTYPE_SELECTED'); } + // 9. Interval of mails - if (empty($_POST['warning_interval'])) - { + if (empty($_POST['warning_interval'])) { // No warning interval selected - $FORM_ERRORS[] = SPONSOR_NO_WARNING_INTERVAL_SELECTED; + $FORM_ERRORS[] = getMessage('SPONSOR_NO_WARNING_INTERVAL_SELECTED'); } + // 10. Mail notifications disabled/enabled - if (empty($_POST['receive_warnings'])) - { + if (empty($_POST['receive_warnings'])) { // Option not selected! - $FORM_ERRORS[] = SPONSOR_NO_RECEIVE_WARNINGS_SELECTED; + $FORM_ERRORS[] = getMessage('SPONSOR_NO_RECEIVE_WARNINGS_SELECTED'); } + // Did he enter his password twice? - if (((empty($_POST['pass1'])) || (empty($_POST['pass2']))) || (($_POST['pass1'] != $_POST['pass2']) && (!empty($_POST['pass1'])) && (!empty($_POST['pass2'])))) - { - if (($_POST['pass1'] != $_POST['pass2']) && (!empty($_POST['pass1'])) && (!empty($_POST['pass2']))) - { + if (((empty($_POST['pass1'])) || (empty($_POST['pass2']))) || (($_POST['pass1'] != $_POST['pass2']) && (!empty($_POST['pass1'])) && (!empty($_POST['pass2'])))) { + if (($_POST['pass1'] != $_POST['pass2']) && (!empty($_POST['pass1'])) && (!empty($_POST['pass2']))) { // Passwords missmatch - $FORM_ERRORS[] = SPONSOR_PASSWORDS_MISMATCH; - } - else - { - if (empty($_POST['pass1'])) - { + $FORM_ERRORS[] = getMessage('SPONSOR_PASSWORDS_MISMATCH'); + } else { + if (empty($_POST['pass1'])) { // Password 1 is empty - $FORM_ERRORS[] = SPONSOR_PASSWORD1_EMPTY; + $FORM_ERRORS[] = getMessage('SPONSOR_PASSWORD1_EMPTY'); } - if (empty($_POST['pass2'])) - { + + if (empty($_POST['pass2'])) { // Password 2 is empty - $FORM_ERRORS[] = SPONSOR_PASSWORD2_EMPTY; + $FORM_ERRORS[] = getMessage('SPONSOR_PASSWORD2_EMPTY'); } } - } - // Is the password long enough? - elseif (strlen($_POST['pass1']) < getConfig('pass_len')) - { - // Too short! - $FORM_ERRORS[] = SPONSOR_PASSWORD_TOO_SHORT; + } elseif (strlen($_POST['pass1']) < getConfig('pass_len')) { + // Password is to short! + $FORM_ERRORS[] = sprintf(getMessage('SPONSOR_PASSWORD_TOO_SHORT'), getConfig('pass_len')); } // Check if he has accepted the terms&conditions if (empty($_POST['terms'])) { // Homepage URL is empty - $FORM_ERRORS[] = SPONSOR_TERMS_NOT_ACCEPTED; + $FORM_ERRORS[] = getMessage('SPONSOR_TERMS_NOT_ACCEPTED'); } // If there is something wrong/missing stop registration @@ -201,8 +194,8 @@ if (isset($_POST['ok'])) { if ((isset($_POST['ok'])) && (count($FORM_ERRORS) == 0)) { // Generate message array $MSGs = array( - 'failed' => SPONSOR_REGISTRATION_FAILED, - 'added' => SPONSOR_REGISTRATION_COMPLETED, + 'failed' => getMessage('SPONSOR_REGISTRATION_FAILED'), + 'added' => getMessage('SPONSOR_REGISTRATION_COMPLETED'), ); // Calulate points @@ -229,9 +222,8 @@ WHERE id='%s' LIMIT 1", array($_POST['pay_type']), __FILE__, __LINE__); case "added": // Sponsor successfully added with account status = UNCONFIRMED! // Check for his ID number $result = SQL_QUERY_ESC("SELECT id, hash FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE email='%s' LIMIT 1", - array($_POST['email']), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) - { + array($_POST['email']), __FILE__, __LINE__); + if (SQL_NUMROWS($result) == 1) { // ID found so let's load it for the confirmation email list($id, $hash) = SQL_FETCHROW($result); @@ -247,18 +239,16 @@ WHERE id='%s' LIMIT 1", array($_POST['pay_type']), __FILE__, __LINE__); // Generate email and send it to the new sponsor $EMAIL_MSG = LOAD_EMAIL_TEMPLATE("sponsor_confirm", $hash); - SEND_EMAIL($_POST['email'], SPONSOR_PLEASE_CONFIRM_SUBJ, $EMAIL_MSG); + SEND_EMAIL($_POST['email'], getMessage('SPONSOR_PLEASE_CONFIRM_SUBJ'), $EMAIL_MSG); // Send mail to admin - SEND_ADMIN_NOTIFICATION(ADMIN_NEW_SPONSOR, "admin_sponsor_reg", $hash); + SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_SPONSOR'), "admin_sponsor_reg", $hash); // Output message: DONE $MSG = $MSGs['added']; - } - else - { + } else { // Sponsor account not found??? - $MSG = SPONSOR_EMAIL_404_1.$_POST['email'].SPONSOR_EMAIL_404_2; + $MSG = sprintf(getMessage('SPONSOR_EMAIL_404'), $_POST['email']); } // Free memory @@ -269,10 +259,10 @@ WHERE id='%s' LIMIT 1", array($_POST['pay_type']), __FILE__, __LINE__); DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected.", $STATUS)); if (!IS_ADMIN()) { // Message for testing admin - $MSG = ADMIN_SPONSOR_UNKOWN_STATUS_1.$STATUS.ADMIN_SPONSOR_UNKOWN_STATUS_2; + $MSG = sprintf(getMessage('ADMIN_SPONSOR_UNKNOWN_STATUS'), $STATUS); } else { // Message for the guest - $MSG = SPONSOR_UNKOWN_STATUS_1.$STATUS.SPONSOR_UNKOWN_STATUS_2; + $MSG = sprintf(getMessage('SPONSOR_UNKNOWN_STATUS'), $STATUS); } break; } @@ -286,10 +276,10 @@ FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` ORDER BY pay_name", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Load all types... + // @TODO Swap this HTML code to templates $OUT = "\n"; $SW = 2; - while (list($id, $name, $rate, $curr, $min) = SQL_FETCHROW($result)) - { + while (list($id, $name, $rate, $curr, $min) = SQL_FETCHROW($result)) { $OUT .= "
 ".$name."
diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index c255e92df9..bffe8c6baa 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -540,7 +540,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); break; case constant('CODE_MORE_RECEIVERS3'): - $MSG = "{--MEMBER_ENTER_MORE_MIN_RECEIVERS_1--}".getConfig('order_min')."{--MEMBER_ENTER_MORE_MIN_RECEIVERS_2--}"; + $MSG = sprintf(getMessage('MEMBER_ENTER_MORE_MIN_RECEIVERS'), getConfig('order_min')); break; case constant('CODE_INVALID_URL'): @@ -552,7 +552,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); default: DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown error code %s detected.", $_GET['msg'])); - $MSG = "{--UNKNOWN_CODE_1--}".$_GET['msg']."{--UNKNOWN_CODE_2--}"; + $MSG = sprintf(getMessage('UNKNOWN_CODE'), $_GET['msg']); break; } @@ -580,7 +580,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); break; case "ORDER": // He is allowed to send as much as he setup the receiving value - define('ORDER_MAX_VALUE', ORDER_ALLOWED_RECEIVE_1.$ALLOWED.ORDER_ALLOWED_RECEIVE_2.$MAXI.ORDER_ALLOWED_RECEIVE_3); + define('ORDER_MAX_VALUE', sprintf(getMessage('ORDER_ALLOWED_RECEIVE'), $ALLOWED, $MAXI)); break; default: // Unknown/invalid diff --git a/inc/modules/sponsor/account.php b/inc/modules/sponsor/account.php index de111014e4..b5f9a51493 100644 --- a/inc/modules/sponsor/account.php +++ b/inc/modules/sponsor/account.php @@ -77,7 +77,7 @@ if (SQL_NUMROWS($result) == 1) { $MSG = getMessage('SPONSOR_PASSWORD_TWO_EMPTY'); } elseif ((!empty($_POST['pass1'])) && (strlen($_POST['pass1']) < getConfig('pass_len'))) { // Too short password - $MSG = SPONSOR_PASSWORD_TOO_SHORT_1.getConfig('pass_len').SPONSOR_PASSWORD_TOO_SHORT_2; + $MSG = sprintf(getMessage('SPONSOR_PASSWORD_TOO_SHORT'), getConfig('pass_len')); } else { // Default is we don't want to change password! $PASS_AND = ""; $PASS_DATA = ""; @@ -144,7 +144,7 @@ if (SQL_NUMROWS($result) == 1) { } } else { // Sponsor account not found! - $OUT = LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_ACCOUNT_404_1.get_session('sponsorid').SPONSOR_ACCOUNT_404_2); + $OUT = LOAD_TEMPLATE("admin_settings_saved", true, sprintf(getMessage('SPONSOR_ACCOUNT_404'), get_session('sponsorid'))); } // Free memory diff --git a/inc/modules/sponsor/settings.php b/inc/modules/sponsor/settings.php index f2b9f84c0c..9667913cf0 100644 --- a/inc/modules/sponsor/settings.php +++ b/inc/modules/sponsor/settings.php @@ -113,7 +113,7 @@ if (SQL_NUMROWS($result) == 1) { } } else { // Sponsor account not found! - $OUT = LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_ACCOUNT_404_1.get_session('sponsorid').SPONSOR_ACCOUNT_404_2); + $OUT = LOAD_TEMPLATE("admin_settings_saved", true, sprintf(getMessage('SPONSOR_ACCOUNT_404'), get_session('sponsorid'))); } // Free memory -- 2.39.5