From: Roland Häder Date: Sat, 31 Oct 2009 16:49:56 +0000 (+0000) Subject: More fixes X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ab8f09f780b313fd4196ec6010ebc9e960e4da85;p=mailer.git More fixes --- diff --git a/inc/modules/member/what-unconfirmed.php b/inc/modules/member/what-unconfirmed.php index 100c4b027c..4ed7e8d9ce 100644 --- a/inc/modules/member/what-unconfirmed.php +++ b/inc/modules/member/what-unconfirmed.php @@ -49,12 +49,16 @@ if (!defined('__SECURITY')) { addMenuDescription('member', __FILE__); // Shall we display a mail? -if ((isGetRequestElementSet(('bonusid'))) && (isExtensionActive('bonus'))) { +if ((isGetRequestElementSet('bonusid')) && (isExtensionActive('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` -WHERE `id`=%s LIMIT 1", - array(bigintval(getRequestElement('bonusid'))), __FILE__, __LINE__); + $result_data = SQL_QUERY_ESC("SELECT + `id`, `subject`, `timestamp`, `cat_id`, `points`, `text`, `is_notify`, `data_type`, `time`, `url` +FROM + `{?_MYSQL_PREFIX?}_bonus` +WHERE + `id`=%s +LIMIT 1", + array(bigintval(getRequestElement('bonusid'))), __FILE__, __LINE__); // Load data $content = SQL_FETCHARRAY($result_data); @@ -70,7 +74,7 @@ WHERE `id`=%s LIMIT 1", // Get timestamp from insert $content['user_status'] = sprintf(getMessage('MEMBER_MAIL_BONUS_CONFIRMED_ON'), - generateDateTime(getTimestampFromUserStats('bonusid', $content['id']), 2) + generateDateTime(getTimestampFromUserStats('bonusid', $content['id']), 2) ); // Display it depending on mail (data) type @@ -80,14 +84,22 @@ WHERE `id`=%s LIMIT 1", SQL_FREERESULT($result_data); } elseif (isGetRequestElementSet(('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 -ON s.pool_id=p.id -LEFT JOIN `{?_MYSQL_PREFIX?}_payments` AS pay -ON p.payment_id=pay.id -WHERE s.id=%s LIMIT 1", - array(bigintval(getRequestElement('mailid'))), __FILE__, __LINE__); + $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 +ON + s.pool_id=p.id +LEFT JOIN + `{?_MYSQL_PREFIX?}_payments` AS pay +ON + p.payment_id=pay.id +WHERE + s.id=%s +LIMIT 1", + array(bigintval(getRequestElement('mailid'))), __FILE__, __LINE__); // Load data $content = SQL_FETCHARRAY($result_data); @@ -101,7 +113,7 @@ WHERE s.id=%s LIMIT 1", // Get timestamp from insert $content['user_status'] = sprintf(getMessage('MEMBER_MAIL_NORMAL_CONFIRMED_ON'), - generateDateTime(getTimestampFromUserStats('mailid', $content['id']), 2) + generateDateTime(getTimestampFromUserStats('mailid', $content['id']), 2) ); // Display it depending on mail (data) type @@ -113,12 +125,12 @@ WHERE s.id=%s LIMIT 1", if (isExtensionActive('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(getUserId()), __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(getUserId()), __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(getUserId()), __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(getUserId()), __FILE__, __LINE__); } // Mails left for confirmation? @@ -136,11 +148,16 @@ if (SQL_NUMROWS($result) > 0) { 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 -ON s.pool_id=p.id -WHERE s.id=%s + $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 +ON + s.pool_id=p.id +WHERE + s.id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); $type = 'mailid'; $DATA = $id; $PROBLEM = getMessage('NORMAL_MAIL_PROBLEM'); @@ -206,7 +223,7 @@ LIMIT 1", // Prepare data for template $content = array( 'sw' => $SW, - 'data' => $DATA, + 'data' => $content, 'probl' => $PROBLEM, );