2 /************************************************************************
3 * MXChange v0.2.1 Start: 10/19/2003 *
4 * =============== Last change: 07/13/2004 *
6 * -------------------------------------------------------------------- *
7 * File : what-unconfirmed.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Unconfirmed mails *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Unbestaetigte Mails *
12 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
18 * This program is free software; you can redistribute it and/or modify *
19 * it under the terms of the GNU General Public License as published by *
20 * the Free Software Foundation; either version 2 of the License, or *
21 * (at your option) any later version. *
23 * This program is distributed in the hope that it will be useful, *
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
26 * GNU General Public License for more details. *
28 * You should have received a copy of the GNU General Public License *
29 * along with this program; if not, write to the Free Software *
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
32 ************************************************************************/
34 // Some security stuff...
35 if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
36 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
38 } elseif ((!IS_LOGGED_IN()) || (!EXT_IS_ACTIVE("mailid"))) {
39 LOAD_URL("modules.php?module=index");
42 // Add description as navigation point
43 ADD_DESCR("member", basename(__FILE__));
45 if (EXT_IS_ACTIVE("bonus")) {
47 $result = SQL_QUERY_ESC("SELECT stats_id, bonus_id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s ORDER BY bonus_id DESC",
48 array($GLOBALS['userid']), __FILE__, __LINE__);
50 // Don't load bonus ID
51 $result = SQL_QUERY_ESC("SELECT stats_id, stats_id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s ORDER BY stats_id DESC",
52 array($GLOBALS['userid']), __FILE__, __LINE__);
55 if (SQL_NUMROWS($result) > 0)
57 // Please confirm these mails!
58 $sum = "0"; $SW = 2; $OUT = "";
59 while (list($id, $id2, $type) = SQL_FETCHROW($result))
61 // Load data from stats table...
66 $result_data = SQL_QUERY_ESC("SELECT subject, subject, timestamp_ordered, cat_id, payment_id, pool_id FROM "._MYSQL_PREFIX."_user_stats WHERE id=%s LIMIT 1",
67 array(bigintval($id)), __FILE__, __LINE__);
68 $type = "mailid"; $DATA = $id; $PROBLEM = NORMAL_MAIL_PROBLEM;
72 $result_data = SQL_QUERY_ESC("SELECT subject, text, timestamp, cat_id, points, id FROM "._MYSQL_PREFIX."_bonus WHERE id=%s LIMIT 1",
73 array(bigintval($id2)), __FILE__, __LINE__);
74 $type = "bonusid"; $DATA = $id2; $PROBLEM = BONUS_MAIL_PROBLEM;
78 if (SQL_NUMROWS($result_data) == 1)
81 list($subject, $text, $timestamp, $cat, $pay, $pool) = SQL_FETCHROW($result_data);
82 SQL_FREERESULT($result_data);
83 if ($type == "NORMAL")
85 $pay = GET_PAY_POINTS($pay, "payment");
86 $result_text = SQL_QUERY_ESC("SELECT text FROM "._MYSQL_PREFIX."_pool WHERE id=%s LIMIT 1",
87 array(bigintval($pool)), __FILE__, __LINE__);
88 list($text) = SQL_FETCHROW($result_text);
89 SQL_FREERESULT($result_text);
91 if (empty($subject)) $subject = DEFAULT_SUBJECT_LINE;
92 if (empty($text)) $text = "---";
93 $subject = COMPILE_CODE($subject);
95 // Prepare data for template
98 'uid' => $GLOBALS['userid'],
102 'text' => COMPILE_CODE($text),
103 'stamp' => MAKE_DATETIME($timestamp, "0"),
104 'cat' => GET_CATEGORY($cat),
105 'points' => TRANSLATE_COMMA($pay),
108 // Load row template and count points
109 $OUT .= LOAD_TEMPLATE("member_unconfirmed_row", true, $content);
114 // Prepare data for template
121 // Problem with mail detected
122 $OUT .= LOAD_TEMPLATE("member_unconfirmed_404", true, $content);
128 SQL_FREERESULT($result);
130 // Remember total points
131 define('__TOTAL_POINTS', TRANSLATE_COMMA($sum));
133 // Remember all generated rows in constant for the template
134 define('__UNCONFIRMED_ROWS', $OUT);
136 // Load main template
137 LOAD_TEMPLATE("member_unconfirmed_table");
141 // No mails left to confirm... :)
142 LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_NO_MAILS_TO_CONFIRM);