if ((isset($_GET['bonusid'])) && (EXT_IS_ACTIVE("bonus"))) {
// Display bonus mail by loading it's full data
$result_data = SQL_QUERY_ESC("SELECT id, subject, timestamp, cat_id, points, text, is_notify, data_type, time, url
-FROM "._MYSQL_PREFIX."_bonus
+FROM `{!_MYSQL_PREFIX!}_bonus`
WHERE id=%s LIMIT 1",
array(bigintval($_GET['bonusid'])), __FILE__, __LINE__);
} elseif (isset($_GET['mailid'])) {
// Display regular member mail by loading its full data
$result_data = SQL_QUERY_ESC("SELECT s.id, s.subject, p.text, s.timestamp_ordered AS `timestamp`, s.cat_id, pay.price AS points, p.sender, pay.time, p.data_type
-FROM "._MYSQL_PREFIX."_user_stats AS s
-LEFT JOIN "._MYSQL_PREFIX."_pool AS p
+FROM `{!_MYSQL_PREFIX!}_user_stats` AS s
+LEFT JOIN `{!_MYSQL_PREFIX!}_pool` AS p
ON s.pool_id=p.id
-LEFT JOIN "._MYSQL_PREFIX."_payments AS pay
+LEFT JOIN `{!_MYSQL_PREFIX!}_payments` AS pay
ON p.payment_id=pay.id
WHERE s.id=%s LIMIT 1",
array(bigintval($_GET['mailid'])), __FILE__, __LINE__);
if (EXT_IS_ACTIVE("bonus")) {
// Load bonus ID
- $result = SQL_QUERY_ESC("SELECT stats_id, bonus_id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s ORDER BY bonus_id DESC, stats_id DESC",
- array($GLOBALS['userid']), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT stats_id, bonus_id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE userid=%s ORDER BY bonus_id DESC, stats_id DESC",
+ array($GLOBALS['userid']), __FILE__, __LINE__);
} else {
// Don't load bonus ID
- $result = SQL_QUERY_ESC("SELECT stats_id, stats_id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s ORDER BY stats_id DESC",
- array($GLOBALS['userid']), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT stats_id, stats_id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE userid=%s ORDER BY stats_id DESC",
+ array($GLOBALS['userid']), __FILE__, __LINE__);
}
// Mails left for confirmation?
$sum = 0; $SW = 2; $OUT = "";
while (list($id, $id2, $type) = SQL_FETCHROW($result)) {
// Load data from stats table...
- $cat = "";
+ $cat = ""; $result_data = false;
switch ($type)
{
case "NORMAL":
$result_data = SQL_QUERY_ESC("SELECT s.subject, s.timestamp_ordered, s.cat_id, s.payment_id, p.sender
-FROM "._MYSQL_PREFIX."_user_stats AS s
-LEFT JOIN "._MYSQL_PREFIX."_pool AS p
+FROM `{!_MYSQL_PREFIX!}_user_stats` AS s
+LEFT JOIN `{!_MYSQL_PREFIX!}_pool` AS p
ON s.pool_id=p.id
WHERE s.id=%s
LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
+ array(bigintval($id)), __FILE__, __LINE__);
$type = "mailid"; $DATA = $id; $PROBLEM = NORMAL_MAIL_PROBLEM;
break;
case "BONUS":
- $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id, points, 0 FROM "._MYSQL_PREFIX."_bonus WHERE id=%s LIMIT 1",
+ $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id, points, 0 FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
array(bigintval($id2)), __FILE__, __LINE__);
$type = "bonusid"; $DATA = $id2; $PROBLEM = BONUS_MAIL_PROBLEM;
break;
+
+ default: // Unknown type detected!
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown mail type %s detected.", $type));
+ break;
}
// Data found to this mail?
} else {
LOAD_TEMPLATE("member_unconfirmed_table_nopoints");
}
-}
- else
-{
+} else {
// No mails left to confirm... :)
- LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_NO_MAILS_TO_CONFIRM);
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_NO_MAILS_TO_CONFIRM'));
}
//