} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("order")) && (!IS_ADMIN())) {
- addFatalMessage(EXTENSION_PROBLEM_EXT_INACTIVE, "order");
+ addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "order");
return;
}
// 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
// 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
$_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
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
// 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
$_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']));
}
} 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?
$result = SQL_QUERY_ESC("SELECT DISTINCT c.userid FROM `{!_MYSQL_PREFIX!}_user_cats` AS c
LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d
ON c.userid=d.userid
-WHERE c.cat_id=%s AND c.userid != '%s' AND d.status='CONFIRMED' AND d.receive_mails > 0".$ADD."
+WHERE c.cat_id=%s AND c.userid != '%s' AND d.`status`='CONFIRMED' AND d.receive_mails > 0".$ADD."
ORDER BY d.%s %s",
array(
bigintval($_POST['cat']),
$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'));
// 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)) {
$result_holiday = SQL_QUERY_ESC("SELECT DISTINCT d.userid FROM `{!_MYSQL_PREFIX!}_user_data` AS d
LEFT JOIN `{!_MYSQL_PREFIX!}_user_holidays` AS h
ON d.userid=h.userid
-WHERE d.userid=%s AND d.receive_mails > 0 AND d.status='CONFIRMED' AND d.holiday_active='Y'
+WHERE d.userid=%s AND d.receive_mails > 0 AND d.`status`='CONFIRMED' AND d.holiday_active='Y'
AND h.holiday_start < UNIX_TIMESTAMP() AND h.holiday_end > UNIX_TIMESTAMP()
LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
if (SQL_NUMROWS($result_holiday) == 1) {
if (!$HOL_ACTIVE) {
// Check if the user want's to receive mails?
- $result_ver = SQL_QUERY_ESC("SELECT zip FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s".$HTML." AND receive_mails > 0 AND status='CONFIRMED' LIMIT 1",
+ $result_ver = SQL_QUERY_ESC("SELECT zip FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s".$HTML." AND receive_mails > 0 AND `status`='CONFIRMED' LIMIT 1",
array(bigintval($ucat)), __FILE__, __LINE__);
if ((SQL_NUMROWS($result_ver) == 1) && (!empty($_POST['zip'])) && (getConfig('order_multi_page') == "Y")) {
$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__);
$SEC = getConfig('url_tlock') - $STD * 60 * 60 - $MIN * 60;
// Finally contruct the message
- $MSG = MEMBER_URL_TIME_LOCK."<br />".CONFIG_URL_TLOCK." ".$STD." ".
- _HOURS.", ".$MIN." "._MINUTES." "._AND." ".$SEC." "._SECONDS."<br />".
- MEMBER_LAST_TLOCK.": ".$LORDER;
+ // @TODO Rewrite this old lost code to a template
+ $MSG = "{--MEMBER_URL_TIME_LOCK--}<br />{--CONFIG_URL_TLOCK--} ".$STD."
+ {--_HOURS--}, ".$MIN." {--_MINUTES--} {--_AND--} ".$SEC." {--_SECONDS--}<br />
+ {--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."<br />\n".MEMBER_BLIST_TIME.": ".MAKE_DATETIME($_GET['blist'], "0");
+ case constant('CODE_BLIST_URL'):
+ $MSG = "{--MEMBER_URL_BLACK_LISTED--}<br />\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 = sprintf(getMessage('MEMBER_ENTER_MORE_MIN_RECEIVERS'), getConfig('order_min'));
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...
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;
}
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
- 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
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;
}
// Free result
SQL_FREERESULT($result);
- // 01 2 21 12 2 23 443 3 3210
- if ((!empty($_POST['data'])) || ((getConfig('order_multi_page') == "N") && ((!IS_ADMIN()) && (!EXT_IS_ACTIVE("html_mail"))))) {
+ // 01 2 21 12 2 23 443 3 3210
+ if ((!empty($_POST['data'])) || ((getConfig('order_multi_page') != "Y") && ((!IS_ADMIN()) && (!EXT_IS_ACTIVE("html_mail"))))) {
// Pre-output categories
$CAT = "";
foreach ($CATS['id'] as $key => $value) {
$CAT .= " <option value=\"".$value."\"";
if (($OLD_ORDER) && ($cat == $value)) $CAT .= " selected=\"selected\"";
- $CAT .= ">".$CATS['name'][$key]." (".$CATS['uids'][$key]." ".USER_IN_CAT.")</option>\n";
+ $CAT .= ">".$CATS['name'][$key]." (".$CATS['uids'][$key]." {--USER_IN_CAT--})</option>\n";
} // END - foreach
// Mail type
// Output option line
$type .= " <option value=\"".$typeS[$key][0]."\"";
if (($OLD_ORDER) && ($payment == $typeS[$key][0])) $type .= " selected=\"selected\"";
- $type .= ">".$P." ".PER_MAIL." - ".$typeS[$key][3]." - ".round($typeS[$key][2])." ".PAYMENT."</option>\n";
+ $type .= ">".$P." {--PER_MAIL--} - ".$typeS[$key][3]." - ".round($typeS[$key][2])." {--PAYMENT--}</option>\n";
} // END - if
} // END - foreach
}
} else {
// No mail types defined
- LOAD_TEMPLATE("admin_settings_saved", false, "<span class=\"member_failed\">{!MEMBER_NO_PAYMENTS!}</span>");
+ LOAD_TEMPLATE("admin_settings_saved", false, "<span class=\"member_failed\">{--MEMBER_NO_PAYMENTS--}</span>");
}
} else {
- // No points left!
- LOAD_TEMPLATE("admin_settings_saved", false, "<span class=\"member_failed\">{!MEMBER_NO_POINTS!}</span>");
+ // No points left
+ LOAD_TEMPLATE("admin_settings_saved", false, "<span class=\"member_failed\">{--MEMBER_NO_POINTS--}</span>");
}
} else {
// No cateogries are defined yet
- LOAD_TEMPLATE("admin_settings_saved", false, "<span class=\"member_failed\">{!MEMBER_NO_CATS!}</span>");
+ LOAD_TEMPLATE("admin_settings_saved", false, "<span class=\"member_failed\">{--MEMBER_NO_CATS--}</span>");
}
} elseif ($mmails == "0") {
- // Please set more than 0 mails per day!
+ // Please set more than 0 mails per day
LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_HAS_ZERO_MMAILS'));
} else {
- // Please confirm some mails first!
- LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_LINKS_LEFT_1.$links.MEMBER_LINKS_LEFT_2.getConfig('unconfirmed').MEMBER_LINKS_LEFT_3);
+ // Please confirm some mails first
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(getMessage('MEMBER_LINKS_LEFT'), $links, getConfig('unconfirmed')));
}
if (!empty($URL)) {