}
// 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");
// Does it exist?
if (defined($constName)) {
// Then use it
- $translated = constant($constName);
+ $translated = getMessage($constName);
} // END - if
// Return "translation"
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
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 <strong>");
-define('UNKNOWN_CODE_2', "</strong> 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 <strong>%s</strong> 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.");
define('CONFIRMATION_LINK', "Hier bestä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üs");
define('IS_LOCKED', "Ist gesperrt");
define('ADMIN_REMOVE_STATS_ENTRY', "Hier klicken, um Mitgliederstatistik zu entfernen!");
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 <u>");
-define('MEMBER_ENTER_MORE_MIN_RECEIVERS_2', "</u> Empfänger ein!");
+define('MEMBER_ENTER_MORE_MIN_RECEIVERS', "Geben Sie mehr als <u>%s</u> 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!");
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 <strong>");
-define('ORDER_ALLOWED_RECEIVE_2', "</strong> von <strong>");
-define('ORDER_ALLOWED_RECEIVE_3', "</strong> Mailbuchungen aufgeben.");
+define('ORDER_ALLOWED_RECEIVE', "Sie können heute noch <strong>%s</strong> von <strong>%s</strong> 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");
// 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äge repariert!");
+define('ADMIN_REPAIR_ENTRIES_FIXED', "Es wurden <strong>%s</strong> Einträge repariert!");
define('ADMIN_REPAIR_NOTHING_FIXED', "Es wurden keine Einträge repariert!");
//
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 <u>");
-define('ADMIN_SPONSOR_UNKOWN_STATUS_2', "</u> wurde bei der Anmeldung zurückgeliefert!");
+define('ADMIN_SPONSOR_UNKNOWN_STATUS', "Unbekannter Status <u>%s</u> 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.");
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!");
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 <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ält, um die Anmeldung abzuschliessen.");
-define('SPONSOR_UNKOWN_STATUS_1', "Bei der Anmeldung wurde ein unbekannter Rü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ütig. Oder haben Sie bereits den Bestätigungslink angeklickt?");
+define('SPONSOR_UNKNOWN_STATUS', "Bei der Anmeldung wurde ein unbekannter Rü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
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 [<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
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 <u>");
-define('SPONSOR_PASSWORD_TOO_SHORT_2', "</u> Zeichen!");
+define('SPONSOR_PASSWORD_TOO_SHORT_1', "Eingegebenes Passwort entspricht nicht der Mindestlänge von <u>%s</u> Zeichen!");
define('SPONSOR_ACCOUNT_DATA_NOT_SAVED', "Ihre Daten wurden <u>nicht</u> gespeichert!");
//
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";
}
}
} 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);
}
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;
}
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;
}
// 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(
), __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(
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'));
}
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']);
}
// Entries updated
- LOAD_TEMPLATE("admin_settings_saved", false, MODS_CHANGED);
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MODS_CHANGED'));
}
if ($SEL == 0) {
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
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
}
$OUT .= "</option>\n";
}
- }
- else
- {
+ } else {
$OUT .= " <option value=\"".$m."\">".$titles[$key]."</option>\n";
}
}
// 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'],
$_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'],
), __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'));
}
$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
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']))) {
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);
//
?>
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
}
// 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);
//
?>
}
// 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);
//
?>
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
// 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
// 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
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
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
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);
// 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
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;
}
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)."\" /> ".$name."<br />
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'):
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;
}
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
$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 = "";
}
} 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
}
} 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