-<?php\r
-/************************************************************************\r
- * MXChange v0.2.1 Start: 10/19/2003 *\r
- * =============== Last change: 07/13/2004 *\r
- * *\r
- * -------------------------------------------------------------------- *\r
- * File : what-unconfirmed.php *\r
- * -------------------------------------------------------------------- *\r
- * Short description : Unconfirmed mails *\r
- * -------------------------------------------------------------------- *\r
- * Kurzbeschreibung : Unbest�tigte Mails *\r
- * -------------------------------------------------------------------- *\r
- * *\r
- * -------------------------------------------------------------------- *\r
- * Copyright (c) 2003 - 2008 by Roland Haeder *\r
- * For more information visit: http://www.mxchange.org *\r
- * *\r
- * This program is free software; you can redistribute it and/or modify *\r
- * it under the terms of the GNU General Public License as published by *\r
- * the Free Software Foundation; either version 2 of the License, or *\r
- * (at your option) any later version. *\r
- * *\r
- * This program is distributed in the hope that it will be useful, *\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *\r
- * GNU General Public License for more details. *\r
- * *\r
- * You should have received a copy of the GNU General Public License *\r
- * along with this program; if not, write to the Free Software *\r
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *\r
- * MA 02110-1301 USA *\r
- ************************************************************************/\r
-\r
-// Some security stuff...\r
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))\r
-{\r
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";\r
- require($INC);\r
-}\r
- elseif (!IS_LOGGED_IN())\r
-{\r
- LOAD_URL(URL."/modules.php?module=index");\r
-}\r
-\r
-// Add description as navigation point\r
-ADD_DESCR("member", basename(__FILE__));\r
-\r
-OPEN_TABLE("100%", "member_content member_content_align", "");\r
-if (EXT_IS_ACTIVE("bonus"))\r
-{\r
- // Load bonus ID\r
- $result = SQL_QUERY_ESC("SELECT stats_id, bonus_id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE userid=%d ORDER BY bonus_id DESC",\r
- array($GLOBALS['userid']), __FILE__, __LINE__);\r
-}\r
- else\r
-{\r
- // Don't load bonus ID\r
- $result = SQL_QUERY_ESC("SELECT stats_id, stats_id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE userid=%d ORDER BY stats_id DESC",\r
- array($GLOBALS['userid']), __FILE__, __LINE__);\r
-}\r
-\r
-if (SQL_NUMROWS($result) > 0)\r
-{\r
- // Please confirm these mails!\r
- $sum = "0"; $SW = 2; $OUT = "";\r
- while (list($id, $id2, $type) = SQL_FETCHROW($result))\r
- {\r
- // Load data from stats table...\r
- $cat = "";\r
- switch ($type)\r
- {\r
- case "NORMAL":\r
- $result_data = SQL_QUERY_ESC("SELECT subject, subject, timestamp_ordered, cat_id, payment_id, pool_id FROM "._MYSQL_PREFIX."_user_stats WHERE id=%d LIMIT 1",\r
- array(bigintval($id)), __FILE__, __LINE__);\r
- $TYPE = "mailid"; $DATA = $id; $PROBLEM = NORMAL_MAIL_PROBLEM;\r
- break;\r
-\r
- case "BONUS":\r
- $result_data = SQL_QUERY_ESC("SELECT subject, text, timestamp, cat_id, points, id FROM "._MYSQL_PREFIX."_bonus WHERE id=%d LIMIT 1",\r
- array(bigintval($id2)), __FILE__, __LINE__);\r
- $TYPE = "bonusid"; $DATA = $id2; $PROBLEM = BONUS_MAIL_PROBLEM;\r
- break;\r
- }\r
-\r
- if (SQL_NUMROWS($result_data) == 1)\r
- {\r
- // Mail was found!\r
- list($subject, $text, $timestamp, $cat, $pay, $pool) = SQL_FETCHROW($result_data);\r
- SQL_FREERESULT($result_data);\r
- if ($type == "NORMAL")\r
- {\r
- $pay = GET_PAY_POINTS($pay, "payment");\r
- $result_text = SQL_QUERY_ESC("SELECT text FROM "._MYSQL_PREFIX."_pool WHERE id=%d LIMIT 1",\r
- array(bigintval($pool)), __FILE__, __LINE__);\r
- list($text) = SQL_FETCHROW($result_text);\r
- SQL_FREERESULT($result_text);\r
- }\r
- if (empty($subject)) $subject = DEFAULT_SUBJECT_LINE;\r
- if (empty($text)) $text = "---";\r
- $subject = COMPILE_CODE($subject);\r
-\r
- // Prepare data for template\r
- $content = array(\r
- 'sw' => $SW,\r
- 'uid' => $GLOBALS['userid'],\r
- 'data' => $DATA,\r
- 'type' => $TYPE,\r
- 'subj' => $subject,\r
- 'text' => COMPILE_CODE($text),\r
- 'stamp' => MAKE_DATETIME($timestamp, "0"),\r
- 'cat' => GET_CATEGORY($cat),\r
- 'points' => TRANSLATE_COMMA($pay),\r
- );\r
-\r
- // Load row template and count points\r
- $OUT .= LOAD_TEMPLATE("member_unconfirmed_row", true, $content);\r
- $sum += $pay;\r
- }\r
- else\r
- {\r
- // Prepare data for template\r
- $content = array(\r
- 'sw' => $SW,\r
- 'data' => $DATA,\r
- 'probl' => $PROBLEM,\r
- );\r
-\r
- // Problem with mail detected\r
- $OUT .= LOAD_TEMPLATE("member_unconfirmed_404", true, $content);\r
- }\r
- $SW = 3 - $SW;\r
- }\r
-\r
- // Free memory\r
- SQL_FREERESULT($result);\r
-\r
- // Remember total points\r
- define('__TOTAL_POINTS', TRANSLATE_COMMA($sum));\r
-\r
- // Remember all generated rows in constant for the template\r
- define('__UNCONFIRMED_ROWS', $OUT);\r
-\r
- // Load main template\r
- LOAD_TEMPLATE("member_unconfirmed_table");\r
-}\r
- else\r
-{\r
- // No mails left to confirm... :)\r
- LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_NO_MAILS_TO_CONFIRM);\r
-}\r
-CLOSE_TABLE();\r
-//\r
-?>\r
+<?php
+/************************************************************************
+ * MXChange v0.2.1 Start: 10/19/2003 *
+ * =============== Last change: 07/13/2004 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : what-unconfirmed.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Unconfirmed mails *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Unbestaetigte Mails *
+ * -------------------------------------------------------------------- *
+ * *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
+{
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+ require($INC);
+}
+ elseif (!IS_LOGGED_IN())
+{
+ LOAD_URL(URL."/modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+OPEN_TABLE("100%", "member_content member_content_align", "");
+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=%d ORDER BY bonus_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=%d ORDER BY stats_id DESC",
+ array($GLOBALS['userid']), __FILE__, __LINE__);
+}
+
+if (SQL_NUMROWS($result) > 0)
+{
+ // Please confirm these mails!
+ $sum = "0"; $SW = 2; $OUT = "";
+ while (list($id, $id2, $type) = SQL_FETCHROW($result))
+ {
+ // Load data from stats table...
+ $cat = "";
+ switch ($type)
+ {
+ case "NORMAL":
+ $result_data = SQL_QUERY_ESC("SELECT subject, subject, timestamp_ordered, cat_id, payment_id, pool_id FROM "._MYSQL_PREFIX."_user_stats WHERE id=%d LIMIT 1",
+ array(bigintval($id)), __FILE__, __LINE__);
+ $TYPE = "mailid"; $DATA = $id; $PROBLEM = NORMAL_MAIL_PROBLEM;
+ break;
+
+ case "BONUS":
+ $result_data = SQL_QUERY_ESC("SELECT subject, text, timestamp, cat_id, points, id FROM "._MYSQL_PREFIX."_bonus WHERE id=%d LIMIT 1",
+ array(bigintval($id2)), __FILE__, __LINE__);
+ $TYPE = "bonusid"; $DATA = $id2; $PROBLEM = BONUS_MAIL_PROBLEM;
+ break;
+ }
+
+ if (SQL_NUMROWS($result_data) == 1)
+ {
+ // Mail was found!
+ list($subject, $text, $timestamp, $cat, $pay, $pool) = SQL_FETCHROW($result_data);
+ SQL_FREERESULT($result_data);
+ if ($type == "NORMAL")
+ {
+ $pay = GET_PAY_POINTS($pay, "payment");
+ $result_text = SQL_QUERY_ESC("SELECT text FROM "._MYSQL_PREFIX."_pool WHERE id=%d LIMIT 1",
+ array(bigintval($pool)), __FILE__, __LINE__);
+ list($text) = SQL_FETCHROW($result_text);
+ SQL_FREERESULT($result_text);
+ }
+ if (empty($subject)) $subject = DEFAULT_SUBJECT_LINE;
+ if (empty($text)) $text = "---";
+ $subject = COMPILE_CODE($subject);
+
+ // Prepare data for template
+ $content = array(
+ 'sw' => $SW,
+ 'uid' => $GLOBALS['userid'],
+ 'data' => $DATA,
+ 'type' => $TYPE,
+ 'subj' => $subject,
+ 'text' => COMPILE_CODE($text),
+ 'stamp' => MAKE_DATETIME($timestamp, "0"),
+ 'cat' => GET_CATEGORY($cat),
+ 'points' => TRANSLATE_COMMA($pay),
+ );
+
+ // Load row template and count points
+ $OUT .= LOAD_TEMPLATE("member_unconfirmed_row", true, $content);
+ $sum += $pay;
+ }
+ else
+ {
+ // Prepare data for template
+ $content = array(
+ 'sw' => $SW,
+ 'data' => $DATA,
+ 'probl' => $PROBLEM,
+ );
+
+ // Problem with mail detected
+ $OUT .= LOAD_TEMPLATE("member_unconfirmed_404", true, $content);
+ }
+ $SW = 3 - $SW;
+ }
+
+ // Free memory
+ SQL_FREERESULT($result);
+
+ // Remember total points
+ define('__TOTAL_POINTS', TRANSLATE_COMMA($sum));
+
+ // Remember all generated rows in constant for the template
+ define('__UNCONFIRMED_ROWS', $OUT);
+
+ // Load main template
+ LOAD_TEMPLATE("member_unconfirmed_table");
+}
+ else
+{
+ // No mails left to confirm... :)
+ LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_NO_MAILS_TO_CONFIRM);
+}
+CLOSE_TABLE();
+//
+?>