More language strings rewritten
authorRoland Häder <roland@mxchange.org>
Mon, 23 Feb 2009 18:57:25 +0000 (18:57 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 23 Feb 2009 18:57:25 +0000 (18:57 +0000)
22 files changed:
inc/functions.php
inc/language/de.php
inc/language/order_de.php
inc/language/repair_de.php
inc/language/sponsor_de.php
inc/libs/sponsor_functions.php
inc/modules/admin/what-admin_add.php
inc/modules/admin/what-config_mods.php
inc/modules/admin/what-config_points.php
inc/modules/admin/what-edit_emails.php
inc/modules/admin/what-guest_add.php
inc/modules/admin/what-payments.php
inc/modules/admin/what-refbanner.php
inc/modules/admin/what-repair_amenu.php
inc/modules/admin/what-repair_cats.php
inc/modules/admin/what-repair_gmenu.php
inc/modules/admin/what-repair_mmenu.php
inc/modules/guest/what-sponsor_login.php
inc/modules/guest/what-sponsor_reg.php
inc/modules/member/what-order.php
inc/modules/sponsor/account.php
inc/modules/sponsor/settings.php

index 591a56c..831e497 100644 (file)
@@ -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
index fb49fbe..ec12cd0 100644 (file)
@@ -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&auml;hrend der Ausf&uuml;hrung ein unbekannter Fehler-Code <strong>");
-define('UNKNOWN_CODE_2', "</strong> enstanden, f&uuml;r den Sie vermutlich nicht verantwortlich sind. Bitte informieren Sie uns &uuml;ber diese Meldung!");
+define('UNKNOWN_CODE', "Es ist w&auml;hrend der Ausf&uuml;hrung ein unbekannter Fehler-Code <strong>%s</strong> enstanden, f&uuml;r den Sie vermutlich nicht verantwortlich sind. Bitte informieren Sie uns &uuml;ber diese Meldung!");
 define('MEMBER_TEXT_CONTAINS_URL', "Ihr Werbetext enth&auml;lt eine URL, dies ist in unserem {!MT_WORD!} nicht zul&auml;ssig. Bitte entfernen Sie diese aus Ihrem Text und versuchen Sie es erneut.");
 define('MEMBER_TEXT_OVERLENGTH', "Ihr Text hat die maximale Textl&auml;nge &uuml;berschritten. Bitte fassen Sie ihn etwas k&uuml;rzer.");
 define('MEMBER_SUBJ_CONTAINS_URL', "Ihre eingegebe Betreffzeile enth&auml;lt eine URL,  dies ist in unserem {!MT_WORD!} nicht zul&auml;ssig. Bitte entfernen Sie diese aus Ihrer Betreffzeile und versuchen Sie es erneut.");
@@ -947,8 +946,7 @@ define('CONFIRM_ACCOUNT', "Account best&auml;tigen");
 define('CONFIRMATION_LINK', "Hier best&auml;tigen");
 define('CLICK_NOW', "Klick!");
 define('MAILID_LINK', "Best.-Link");
-define('UNKNOWN_MAILID_CODE_1', "Unbekannter Fehler-Code <strong>");
-define('UNKNOWN_MAILID_CODE_2', "</strong> erkannt!");
+define('UNKNOWN_MAILID_CODE', "Unbekannter Fehler-Code <strong>%s</strong> erkannt!");
 define('CHANGE_GUEST_MENU', "Verdecken, anzeigen, deaktivieren, aktivieren des Gastmen&uuml;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&auml;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&auml;tigte Maillinks eines Mitgliedes auflisten");
-define('MEMBER_ENTER_MORE_MIN_RECEIVERS_1', "Geben Sie mehr als <u>");
-define('MEMBER_ENTER_MORE_MIN_RECEIVERS_2', "</u> Empf&auml;nger ein!");
+define('MEMBER_ENTER_MORE_MIN_RECEIVERS', "Geben Sie mehr als <u>%s</u> Empf&auml;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!");
index f0b9521..2194f06 100644 (file)
@@ -44,9 +44,7 @@ define('ORDER_MAX_ORDER_SELECT', "Wie viele Mailbuchungen sollen die Mitglieder
 define('ORDER_MIN_RECEIVER_PER_ORDER', "Minimale Empf&auml;nger pro Mailbuchung");
 define('ADMIN_ORDER_MAX', "So viele wie m&ouml;glich.");
 define('ADMIN_ORDER_ORDER', "So viele wie auf Empfang eingestellt.");
-define('ORDER_ALLOWED_RECEIVE_1', "Sie k&ouml;nnen heute noch <strong>");
-define('ORDER_ALLOWED_RECEIVE_2', "</strong> von <strong>");
-define('ORDER_ALLOWED_RECEIVE_3', "</strong> Mailbuchungen aufgeben.");
+define('ORDER_ALLOWED_RECEIVE', "Sie k&ouml;nnen heute noch <strong>%s</strong> von <strong>%s</strong> Mailbuchungen aufgeben.");
 define('ORDER_ALLOWED_MAX', "Sie k&ouml;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");
index 9fb7e2d..c8ebe8c 100644 (file)
@@ -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 <strong>");
-define('ADMIN_REPAIR_ENTRIES_FIXED_2', "</strong> Eintr&auml;ge repariert!");
+define('ADMIN_REPAIR_ENTRIES_FIXED', "Es wurden <strong>%s</strong> Eintr&auml;ge repariert!");
 define('ADMIN_REPAIR_NOTHING_FIXED', "Es wurden keine Eintr&auml;ge repariert!");
 
 //
index 4ce1bc2..694fe37 100644 (file)
@@ -163,8 +163,7 @@ define('SPONSOR_DELETE_PAY_ENTRIES', "Buchungspakete l&ouml;schen");
 define('SPONSOR_PAY_ENTRIES_CHANGED', "Buchungspakete ge&auml;ndert.");
 define('SPONSOR_PAY_ENTRIES_REMOVED', "Buchungspakete gel&ouml;scht.");
 define('SPONSOR_PAYMENT_LIST_IS_EMPTY', "Noch keine Buchungspakete eingerichtet!");
-define('ADMIN_SPONSOR_UNKOWN_STATUS_1', "Unbekannter Status <u>");
-define('ADMIN_SPONSOR_UNKOWN_STATUS_2', "</u> wurde bei der Anmeldung zur&uuml;ckgeliefert!");
+define('ADMIN_SPONSOR_UNKNOWN_STATUS', "Unbekannter Status <u>%s</u> wurde bei der Anmeldung zur&uuml;ckgeliefert!");
 define('SPONSOR_REFERRAL', "Sponsoren-Referal");
 define('SPONSOR_REFID_WAS', "Sie wurden vom Sponsor geworben");
 define('SPONSOR_ACCOUNT_IS_PENDING', "EMail-Adresse best&auml;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&auml;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&auml;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&auml;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: &Auml;nderung Ihrer Daten");
+define('SPONSOR_ACC_EMAIL_SUBJ', "HINWEIS: Bitte neue EMail-Adresse best&auml;tigen!");
+define('ADMIN_SPONSOR_ACC_EMAIL_SUBJ', "Sponsor hat seine EMail-Adresse ge&auml;ndert!");
+define('ADMIN_SPONSOR_ACC_DATA_SUBJ', "Sponsor hat seine Daten ge&auml;ndert!");
+define('ADMIN_SPONSOR_SETTINGS_SUBJ', "Sponsor hat seine Einstellungen ge&auml;ndert!");
+define('SPONSOR_SETTINGS_SUBJ', "HINWEIS: &Auml;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&auml;hlen Sie noch ein Buchungspa
 define('SPONSOR_NO_WARNING_INTERVAL_SELECTED', "Bitte w&auml;hlen Sie noch den Zeitabstand zwischen zwei Sponsorenberichten aus!");
 define('SPONSOR_NO_RECEIVE_WARNINGS_SELECTED', "Bitte w&auml;hlen Sie noch aus, ob Sie bei jeder Aktion Best&auml;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 <u>");
-define('SPONSOR_ALREADY_FOUND_2', "</u> bei uns angemeldet!");
+define('SPONSOR_ALREADY_FOUND', "Ein Sponsor ist bereits mit der Email-Adresse <u>%s</u> 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&auml;lt, um die Anmeldung abzuschliessen.");
-define('SPONSOR_UNKOWN_STATUS_1', "Bei der Anmeldung wurde ein unbekannter R&uuml;ckgabewert <u>");
-define('SPONSOR_UNKOWN_STATUS_2', "</u> erkannt. Bitte melden Sie dies dem Betreiber dieses {!MT_WORD2!}!<br />Vielen Dank.");
-define('SPONSOR_EMAIL_404_1', "Bei der Anmeldung ist uns ein Fehler unterlaufen: Ihr Sponsor-Account mit der EMail-Adresse <u>");
-define('SPONSOR_EMAIL_404_2', "</u> wurde nicht gefunden!");
-define('SPONSOR_ACCOUNT_404', "Sponsorenaccount nicht gefunden oder Link ist ung&uuml;tig. Oder haben Sie bereits den Best&auml;tigungslink angeklickt?");
+define('SPONSOR_UNKNOWN_STATUS', "Bei der Anmeldung wurde ein unbekannter R&uuml;ckgabewert <u>%s</u> erkannt. Bitte melden Sie dies dem Betreiber dieses {!MT_WORD2!}!<br />Vielen Dank.");
+define('SPONSOR_EMAIL_404', "Bei der Anmeldung ist uns ein Fehler unterlaufen: Ihr Sponsor-Account mit der EMail-Adresse <u>%s</u> 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 <em>Wartend</em> trat ein unerwarteter Fehler auf!");
-define('SPONSOR_ACCOUNT_404_1', "Sponsorenaccount <u>");
-define('SPONSOR_ACCOUNT_404_2', "</u> nicht gefunden!");
-define('SPONSOR_ACCOUNT_FAILED_1', "Sponsorenaccount konnte nicht geladen werden: <u>");
-define('SPONSOR_ACCOUNT_FAILED_2', "</u>");
+define('SPONSOR_ACCOUNT_404', "Sponsorenaccount <u>%s</u> nicht gefunden!");
+define('SPONSOR_ACCOUNT_FAILED', "Sponsorenaccount konnte nicht geladen werden: <u>%s</u>");
 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&auml;ndert, Account wurde tempor&auml;r gesperrt. Bitte [<a href=\"{!URL!}/index.php\">hier klicken</a>], um in den Gastbereich zu gelangen.");
 define('SPONSOR_SETTINGS_HEADER', "Einstellungen Ihres Sponsorenaccounts");
-define('SPONSOR_UNKNOWN_WHAT_1', "Scripte-Fehler: Unbekannte Sponsor-Aktion <u>");
-define('SPONSOR_UNKNOWN_WHAT_2', "</u> erkannt!");
+define('SPONSOR_UNKNOWN_WHAT', "Scripte-Fehler: Unbekannte Sponsor-Aktion <u>%s</u> 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&ouml;rter stimmen nicht &uuml;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&auml;nge von <u>");
-define('SPONSOR_PASSWORD_TOO_SHORT_2', "</u> Zeichen!");
+define('SPONSOR_PASSWORD_TOO_SHORT_1', "Eingegebenes Passwort entspricht nicht der Mindestl&auml;nge von <u>%s</u> Zeichen!");
 define('SPONSOR_ACCOUNT_DATA_NOT_SAVED', "Ihre Daten wurden <u>nicht</u> gespeichert!");
 
 //
index 5ef9402..ec1b82d 100644 (file)
@@ -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;
        }
index acc0bb2..89d0072 100644 (file)
@@ -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'));
 }
index 6ae6c9b..df25c63 100644 (file)
@@ -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) {
index 07698bc..9ea90fa 100644 (file)
@@ -154,7 +154,7 @@ WHERE mails_confirmed < %s", $REF, $REF);
                        REBUILD_CACHE("config", "config");
                } else {
                        // Prepare failed-message
-                       $message = "<span class=\"admin_failed\">".SETTINGS_NOT_SAVED."</span>";
+                       $message = "<span class=\"admin_failed\">{--SETTINGS_NOT_SAVED--}</span>";
                }
 
                // Remove SQL queries
index a02228e..bb171d0 100644 (file)
@@ -76,7 +76,7 @@ WHERE id=%s LIMIT 1",
                if (SQL_AFFECTEDROWS() == 1) {
                        $content = SETTINGS_SAVED;
                } else {
-                       $content = "<span class=\"admin_failed\">".SETTINGS_NOT_SAVED."</span>";
+                       $content = "<span class=\"admin_failed\">{--SETTINGS_NOT_SAVED--}</span>";
                }
 
                // Display message
index 3bd9a5c..ecae91d 100644 (file)
@@ -152,9 +152,7 @@ WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
                                }
                                $OUT .= "</option>\n";
                        }
-               }
-                else
-               {
+               } else {
                        $OUT .= "      <option value=\"".$m."\">".$titles[$key]."</option>\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'));
 }
index b5c2d14..210812d 100644 (file)
@@ -80,7 +80,7 @@ if (isset($_POST['ok'])) {
                $content = "<span class=\"admin_failed\">".SETTINGS_SAVED."</span>";
        } else {
                // Nothing has changed!
-               $content = "<span class=\"admin_failed\">".SETTINGS_NOT_SAVED."</span>";
+               $content = "<span class=\"admin_failed\">{--SETTINGS_NOT_SAVED--}</span>";
        }
 
        // Output template
index 7b73f11..1866e42 100644 (file)
@@ -87,7 +87,7 @@ VALUES ('%s','%s','%s')",
        if (SQL_AFFECTEDROWS() == 1) {
                $content = SETTINGS_SAVED;
        } else {
-               $content = "<span class=\"admin_failed\">".SETTINGS_NOT_SAVED."</span>";
+               $content = "<span class=\"admin_failed\">{--SETTINGS_NOT_SAVED--}</span>";
        }
        LOAD_TEMPLATE("admin_settings_saved", false, $content);
 } elseif (($SEL > 0) && (isset($_POST['edit']))) {
index 803f11b..721aea9 100644 (file)
@@ -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);
 
 //
 ?>
index 1d21c49..038b4a2 100644 (file)
@@ -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 = "<div class=\"admin_failed\">".ADMIN_REPAIR_NOTHING_FIXED."</div>";
+               $content = "<div class=\"admin_failed\">{--ADMIN_REPAIR_NOTHING_FIXED--}</div>";
        }
 } else {
        // No category selections found, no members registered?
-       $content = "<div class=\'admin_failed\">".ADMIN_REPAIR_CATS_NOTHING."</div>";
+       $content = "<div class=\'admin_failed\">{--ADMIN_REPAIR_CATS_NOTHING--}</div>";
 }
 
 // Load template
index 5a42fcb..d62431b 100644 (file)
@@ -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);
 
 //
 ?>
index 83c4d9b..566b219 100644 (file)
@@ -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);
 
 //
 ?>
index a58b00e..bd05f92 100644 (file)
@@ -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
index b40a7e1..65afc5e 100644 (file)
@@ -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 = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"300\" class=\"left2 right2 top2\">\n";
                $SW = 2;
-               while (list($id, $name, $rate, $curr, $min) = SQL_FETCHROW($result))
-               {
+               while (list($id, $name, $rate, $curr, $min) = SQL_FETCHROW($result)) {
                        $OUT .= "<tr>
   <td class=\"bottom2 switch_sw".$SW."\" height=\"50\" style=\"padding-left: 2px; padding-right: 2px\">
     <input type=\"radio\" name=\"pay_type\" class=\"guest_normal\" value=\"".bigintval($id)."\" />&nbsp;".$name."<br />
index c255e92..bffe8c6 100644 (file)
@@ -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
index de11101..b5f9a51 100644 (file)
@@ -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
index f2b9f84..9667913 100644 (file)
@@ -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