X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-order.php;h=ae81c826143ee0476456f42a2ae8b8dd3e791e49;hp=3f39d1517ebb246835eff61b529c4a110ac20d6b;hb=ba973321465edf4c1239d3b499b6de1e4be1f10c;hpb=c47144dd555bbab4acdf9085e4623900dedb0e7c diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index 3f39d1517e..ae81c82614 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -113,7 +113,7 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", // Test submitted text against some filters (length, URLs in text etc.) if ((strpos(strtolower($_POST['text']), "https://") > -1) || (strpos(strtolower($_POST['text']), "http://") > -1) || (strpos(strtolower($_POST['text']), "www") > -1)) { // URL found! - $URL = "modules.php?module=login&what=order&msg=".CODE_URL_FOUND; + $URL = "modules.php?module=login&what=order&msg=".constant('CODE_URL_FOUND'); } // END - if // Remove new-line and carriage-return characters @@ -122,7 +122,7 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", // Text length within allowed length? if (strlen($TEST) > getConfig('max_tlength')) { // Text is too long! - $URL = "modules.php?module=login&what=order&msg=".CODE_OVERLENGTH; + $URL = "modules.php?module=login&what=order&msg=".constant('CODE_OVERLENGTH'); } // END - if } // END - if @@ -132,7 +132,7 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", $_POST['subject'] = str_replace("\\", "[nl]", substr($_POST['subject'], 0, 200)); if ((strpos(strtolower($_POST['subject']), "http://") > -1) || (strpos(strtolower($_POST['subject']), "www") > -1)) { // URL in subject found - $URL = "modules.php?module=login&what=order&msg=".CODE_SUBJ_URL; + $URL = "modules.php?module=login&what=order&msg=".constant('CODE_SUBJ_URL'); } // END - if } // END - if @@ -147,7 +147,7 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", list($blist) = SQL_FETCHROW($result); // Create redirect-URL - $URL = "modules.php?module=login&what=order&msg=".CODE_BLIST_URL."&blist=".$blist; + $URL = "modules.php?module=login&what=order&msg=".constant('CODE_BLIST_URL')."&blist=".$blist; } // END - if // Free result @@ -157,13 +157,13 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", // Enougth receivers entered? if (($_POST['receiver'] < getConfig('order_min')) && (!IS_ADMIN())) { // Less than allowed receivers entered! - $URL = "modules.php?module=login&what=order&msg=".CODE_MORE_RECEIVERS3; + $URL = "modules.php?module=login&what=order&msg=".constant('CODE_MORE_RECEIVERS3'); } // END - if // Validate URL if (!VALIDATE_URL($_POST['url'])) { // URL is invalid! - $URL = "modules.php?module=login&what=order&msg=".CODE_INVALID_URL; + $URL = "modules.php?module=login&what=order&msg=".constant('CODE_INVALID_URL'); } // END - if // Probe for HTML extension @@ -174,7 +174,7 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", $_POST['text'] = HTML_CHECK_TAGS($_POST['text']); // Maybe invalid tags found? - if (empty($_POST['text'])) $URL = "modules.php?module=login&what=order&msg=".CODE_INVALID_TAGS."&id=".$id; + if (empty($_POST['text'])) $URL = "modules.php?module=login&what=order&msg=".constant('CODE_INVALID_TAGS')."&id=".$id; } else { // Remove any HTML code $_POST['text'] = str_replace("<", "{OPEN_HTML}", str_replace(">", "{CLOSE_HTML}", $_POST['text'])); @@ -182,7 +182,7 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", } } elseif (!IS_ADMIN()) { // He has already sent a mail within a specific time - $URL = "modules.php?module=login&what=order&msg=".CODE_URL_TLOCK."&id=".$id; + $URL = "modules.php?module=login&what=order&msg=".constant('CODE_URL_TLOCK')."&id=".$id; } // Still no error? @@ -374,19 +374,19 @@ array( $URL = "modules.php?module=frametester&order=".$id.""; } elseif ($MAX_SEND == 0) { // Not enougth receivers found which can receive mails - $URL = "modules.php?module=login&what=order&msg=".CODE_MORE_RECEIVERS2; + $URL = "modules.php?module=login&what=order&msg=".constant('CODE_MORE_RECEIVERS2'); } else { // No enougth points left! - $URL = "modules.php?module=login&what=order&msg=".CODE_MORE_POINTS; + $URL = "modules.php?module=login&what=order&msg=".constant('CODE_MORE_POINTS'); } } else { // Ordered more mails than he can send in this category - $URL = "modules.php?module=login&what=order&msg=".CODE_NO_RECS_LEFT; + $URL = "modules.php?module=login&what=order&msg=".constant('CODE_NO_RECS_LEFT'); } } } elseif ($_POST['receiver'] == "0") { // Not enougth receivers selected - $URL = "modules.php?module=login&what=order&msg=".CODE_MORE_RECEIVERS1; + $URL = "modules.php?module=login&what=order&msg=".constant('CODE_MORE_RECEIVERS1'); } elseif (($ALLOWED == 0) && (getConfig('order_max_full') == "ORDER")) { // No more mail orders allowed LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_ORDER_ALLOWED_EXHAUSTED')); @@ -417,7 +417,7 @@ array( // Select users in current category $result_uids = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE cat_id=%s AND userid != '%s' ORDER BY userid", - array(bigintval($id), $GLOBALS['userid']), __FILE__, __LINE__); + array(bigintval($id), $GLOBALS['userid']), __FILE__, __LINE__); $uid_cnt = 0; while (list($ucat) = SQL_FETCHROW($result_uids)) { @@ -476,7 +476,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); $MSG = ""; switch ($_GET['msg']) { - case CODE_URL_TLOCK: + case constant('CODE_URL_TLOCK'): $result = SQL_QUERY_ESC("SELECT timestamp FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1", array(bigintval($_GET['id'])), __FILE__, __LINE__); @@ -497,53 +497,54 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); $SEC = getConfig('url_tlock') - $STD * 60 * 60 - $MIN * 60; // Finally contruct the message - $MSG = MEMBER_URL_TIME_LOCK."
".CONFIG_URL_TLOCK." ".$STD." ". - _HOURS.", ".$MIN." "._MINUTES." "._AND." ".$SEC." "._SECONDS."
". - MEMBER_LAST_TLOCK.": ".$LORDER; + // @TODO Rewrite this old lost code to a template + $MSG = "{!MEMBER_URL_TIME_LOCK!}
{!CONFIG_URL_TLOCK!} ".$STD." + {!_HOURS!}, ".$MIN." {!_MINUTES!} {!_AND!} ".$SEC." {!_SECONDS!}
+ {!MEMBER_LAST_TLOCK!}: ".$LORDER; break; - case CODE_OVERLENGTH: - $MSG = MEMBER_TEXT_OVERLENGTH; + case constant('CODE_OVERLENGTH'): + $MSG = getMessage('MEMBER_TEXT_OVERLENGTH'); break; - case CODE_URL_FOUND: - $MSG = MEMBER_TEXT_CONTAINS_URL; + case constant('CODE_URL_FOUND'): + $MSG = getMessage('MEMBER_TEXT_CONTAINS_URL'); break; - case CODE_SUBJ_URL: - $MSG = MEMBER_SUBJ_CONTAINS_URL; + case constant('CODE_SUBJ_URL'): + $MSG = getMessage('MEMBER_SUBJ_CONTAINS_URL'); break; - case CODE_BLIST_URL: - $MSG = MEMBER_URL_BLACK_LISTED."
\n".MEMBER_BLIST_TIME.": ".MAKE_DATETIME($_GET['blist'], "0"); + case constant('CODE_BLIST_URL'): + $MSG = "{!MEMBER_URL_BLACK_LISTED!}
\n{!MEMBER_BLIST_TIME!}: ".MAKE_DATETIME($_GET['blist'], "0"); break; - case CODE_NO_RECS_LEFT: - $MSG = MEMBER_SELECTED_MORE_RECS; + case constant('CODE_NO_RECS_LEFT'): + $MSG = getMessage('MEMBER_SELECTED_MORE_RECS'); break; - case CODE_INVALID_TAGS: - $MSG = MEMBER_HTML_INVALID_TAGS; + case constant('CODE_INVALID_TAGS'): + $MSG = getMessage('MEMBER_HTML_INVALID_TAGS'); break; - case CODE_MORE_POINTS: - $MSG = MEMBER_MORE_POINTS_NEEDED; + case constant('CODE_MORE_POINTS'): + $MSG = getMessage('MEMBER_MORE_POINTS_NEEDED'); break; - case CODE_MORE_RECEIVERS1: - $MSG = MEMBER_ENTER_MORE_RECEIVERS; + case constant('CODE_MORE_RECEIVERS1'): + $MSG = getMessage('MEMBER_ENTER_MORE_RECEIVERS'); break; - case CODE_MORE_RECEIVERS2: - $MSG = MEMBER_NO_MORE_RECEIVERS_FOUND; + case constant('CODE_MORE_RECEIVERS2'): + $MSG = getMessage('MEMBER_NO_MORE_RECEIVERS_FOUND'); break; - case CODE_MORE_RECEIVERS3: - $MSG = MEMBER_ENTER_MORE_MIN_RECEIVERS_1.getConfig('order_min').MEMBER_ENTER_MORE_MIN_RECEIVERS_2; + case constant('CODE_MORE_RECEIVERS3'): + $MSG = "{!MEMBER_ENTER_MORE_MIN_RECEIVERS_1!}".getConfig('order_min')."{!MEMBER_ENTER_MORE_MIN_RECEIVERS_2!}"; break; - case CODE_INVALID_URL: - $MSG = MEMBER_ENTER_INVALID_URL; + case constant('CODE_INVALID_URL'): + $MSG = getMessage('MEMBER_ENTER_INVALID_URL'); break; case "": // When no error code is included in the URL we do not need to output an error message as well... @@ -551,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 = "{!UNKNOWN_CODE_1!}".$_GET['msg']."{!UNKNOWN_CODE_2!}"; break; } @@ -575,7 +576,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); switch (getConfig('order_max_full')) { case "MAX": // He is allowed to send as much as possible - define('ORDER_MAX_VALUE', ORDER_ALLOED_MAX); + define('ORDER_MAX_VALUE', getMessage('ORDER_ALLOWED_MAX')); break; case "ORDER": // He is allowed to send as much as he setup the receiving value @@ -584,7 +585,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); default: // Unknown/invalid DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown order_mas_full config detected.", getConfig('order_max_full'))); - define('ORDER_MAX_VALUE', ORDER_ALLOED_UNKNOWN); + define('ORDER_MAX_VALUE', getMessage('ORDER_ALLOWED_UNKNOWN')); break; } @@ -622,7 +623,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); foreach ($CATS['id'] as $key => $value) { $CAT .= " \n"; } // END - foreach // Mail type @@ -633,7 +634,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); // Output option line $type .= " \n"; } // END - if } // END - foreach