if ((is_array($SQLs) && (sizeof($SQLs) > 0)))
{
// Run SQL commands...
- foreach ($SQLs as $sql)
- {
+ foreach ($SQLs as $sql) {
+ // Trim spaces away which we don't need
$sql = trim($sql);
- if (!empty($sql))
- {
+
+ // Is there still an SQL query?
+ if (!empty($sql)) {
// Run SQL command
$result = SQL_QUERY($sql, __FILE__, __LINE__, false);
}
}
// Remove cache file(s) if extension is active
- if (EXT_IS_ACTIVE("cache"))
- {
+ if (EXT_IS_ACTIVE("cache")) {
// Remove cache filer
if ($CACHE->cache_file("extensions", true)) $CACHE->cache_destroy();
if ($CACHE->cache_file("mod_reg", true)) $CACHE->cache_destroy();
define('MEMBER_NO_MAILS_TO_CONFIRM', "Keine Mails übrig zum Bestätigen!");
define('MEMBER_SID', "Mail-ID");
define('CONFIRM_LINK', "Bestätigungslink");
-define('MAIL_ALREADY_CONFIRMED', "Mail bereits verguetet oder Link ist nicht mehr gueltig!");
+define('MAIL_ALREADY_CONFIRMED', "Mail bereits vergütet oder Link ist nicht mehr gültig!");
define('MAIL_STATS_404', "Konnte Daten aus der Statistik-Tabelle nicht laden!");
define('USER_NOT_FOUND', "Mitgliedsdaten nicht gefunden! Sind Sie noch angemeldet?");
define('UNKNOWN_STATUS', "Unbekannter Account-Status");
************************************************************************/
// Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
-{
+if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
+} elseif (!EXT_IS_ACTIVE("mailid")) {
+ ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid"));
+ return;
}
// Add description as navigation point
if (empty($_GET['del'])) $_GET['del'] = "";
-OPEN_TABLE("100%", "admin_content admin_content_align", "");
-if (!empty($_GET['u_id']))
-{
+if (!empty($_GET['u_id'])) {
// Check if the user already exists
$result = SQL_QUERY_ESC("SELECT surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1",
array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1)
- {
+
+ // Is there an entry?
+ if (SQL_NUMROWS($result) == 1) {
// Loads surname, family's name and the email address
list($sname, $fname, $email) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
// Grab user's all unconfirmed mails
- if (EXT_IS_ACTIVE("bonus"))
- {
+ 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 id",
array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
- }
- else
- {
+ } else {
// Load stats ID (2nd will be ignored later! But it is needed for the same fetchrow command)
$result = SQL_QUERY_ESC("SELECT stats_id, stats_id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE userid=%d ORDER BY id",
array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
}
- $nums = bigintval(SQL_NUMROWS($result));
- if ($nums > 0)
- {
+ // Get number of rows from the query
+ $nums = SQL_NUMROWS($result);
+
+ if ($nums > 0) {
// Some unconfirmed mails left
- if ($_GET['del'] == "all")
- {
+ if ($_GET['del'] == "all") {
// Delete all unconfirmed mails by this user
$result_del = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_links WHERE userid=%d LIMIT %s",
array(bigintval($_GET['u_id']), $nums), __FILE__, __LINE__);
// Display message
LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_LINKS_DELETED);
- }
- else
- {
+ } else {
// List all unconfirmed mails
$SW = 2; $OUT = "";
- while (list($id, $id2, $type) = SQL_FETCHROW($result))
- {
+ while (list($id, $id2, $type) = SQL_FETCHROW($result)) {
// Load data from stats table...
$cat = "";
switch ($type)
break;
}
- if (SQL_NUMROWS($result_data) == 1)
- {
+ if (SQL_NUMROWS($result_data) == 1) {
// Mail was found!
list($subject, $timestamp, $cat) = SQL_FETCHROW($result_data);
SQL_FREERESULT($result_data);
// Load row template
$OUT .= LOAD_TEMPLATE("admin_list_links_row", true, $content);
- }
- else
- {
- $OUT .= "<TR>
- <TD align=\"center\" class=\"switch_sw".$SW." bottom2\" colspan=\"4\">
- <STRONG class=\"member_failed large\">".$PROBLEM.":</STRONG> ".$DATA."
- </TD>
-</TR>\n";
+ } else {
+ // Load template for error
+ $OUT .= LOAD_TEMPLATE("admin_list_links_problem",
+ array(
+ 'sw' => $SW,
+ 'problem' => $PROBLEM,
+ 'data' => $DATA
+ )
+ );
}
$SW = 3 - $SW;
}
// Load final template
LOAD_TEMPLATE("admin_list_links");
}
- }
- else
- {
+ } else {
// No mails left to confirm
LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_MEMBER_LINKS_1.$_GET['u_id'].ADMIN_MEMBER_LINKS_2);
}
- }
- else
- {
+ } else {
// User not found
LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_MEMBER_404_1.$_GET['u_id'].ADMIN_MEMBER_404_2);
}
-}
- else
-{
+} else {
// Output selection form with all confirmed user accounts listed
ADD_MEMBER_SELECTION_BOX();
}
-CLOSE_TABLE();
//
?>
************************************************************************/
// Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
-{
+if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
+} elseif (!EXT_IS_ACTIVE("mailid")) {
+ ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid"));
+ return;
}
+
// Add description as navigation point
ADD_DESCR("admin", basename(__FILE__));
************************************************************************/
// Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
-{
+if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
+} elseif (!EXT_IS_ACTIVE("order")) {
+ ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "order"));
+ return;
}
+
// Add description as navigation point
ADD_DESCR("admin", basename(__FILE__));
$EXT_HTML = EXT_IS_ACTIVE("html_mail");
if (empty($_GET['mode'])) $_GET['mode'] = "select";
-OPEN_TABLE("100%", "admin_content admin_content_align", "");
if (isset($_POST['ok']))
{
// Check if category and number of receivers is okay
// Redirect to requested URL
LOAD_URL($URL);
}
-}
- else
-{
+} else {
$result = SQL_QUERY("SELECT id, cat FROM "._MYSQL_PREFIX."_cats".$WHERE." ORDER BY sort", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0)
{
OUTPUT_HTML ("<STRONG><SPAN class=\"member_failed\">".MEMBER_NO_CATS."</SPAN></STRONG>");
}
}
-CLOSE_TABLE();
+
//
?>
$_COOKIE['mxchange_theme'] = $NewTheme;
$bonus = false;
- if ((GET_EXT_VERSION("sql_patches") >= "0.2.8") && (GET_EXT_VERSION("bonus") >= "0.2.1"))
- {
+ die("<pre>".print_r($CONFIG, true)."</pre>");
+ if ((GET_EXT_VERSION("sql_patches") >= "0.2.8") && (GET_EXT_VERSION("bonus") >= "0.2.1")) {
// Update last login
$result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data
SET last_login=UNIX_TIMESTAMP()
case CODE_USER_404 : $msg = USER_NOT_FOUND; break;
case CODE_STATS_404 : $msg = MAIL_STATS_404; break;
case CODE_ALREADY_CONFIRMED: $msg = MAIL_ALREADY_CONFIRMED; break;
- case CODE_ERROR_MAILID : $msg = ERROR_CONFIRMING_MAIL; break;
+ case CODE_ERROR_MAILID : if (EXT_IS_ACTIVE("mailid", true)) { $msg = ERROR_CONFIRMING_MAIL; } else { $msg = sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid"); } break;
case CODE_EXTENSION_PROBLEM: $msg = sprintf(EXTENSION_PROBLEM_EXT_INACTIVE, "mailid"); break;
case CODE_COOKIES_DISABLED : $msg = LOGIN_NO_COOKIES; break;
case CODE_BEG_SAME_AS_OWN : $msg = BEG_SAME_UID_AS_OWN; break;
************************************************************************/
// Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+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())
-{
+} elseif (!IS_LOGGED_IN()) {
$URL = URL."/modules.php?module=index";
if ($check == "mem_only") $URL .= "&msg=".urlencode(LANG_MEM_ONLY_1.$GLOBALS['module'].LANG_MEM_ONLY_2);
LOAD_URL($URL);
}
-if ($status != "CONFIRMED")
-{
+if ($status != "CONFIRMED") {
// If the status is different than confirmed move the user away from here
switch ($status)
{
// Is the extension active
if (!EXT_IS_ACTIVE("mailid", true)) {
// Is not activated/installed yet!
- ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "register"));
+ ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid"));
}
// Add header
require_once(PATH."inc/header.php");
+ // Init
+ $url_uid = 0; $url_bid = 0; $url_mid = 0;
+
// Secure all data
- $url_uid = "0"; $url_bid = "0"; $url_mid = "0";
if (!empty($_GET['uid'])) $url_uid = bigintval($_GET['uid']);
if (!empty($_GET['mailid'])) $url_mid = bigintval($_GET['mailid']);
if (!empty($_GET['bonusid'])) $url_bid = bigintval($_GET['bonusid']);
+ //* DEBUG: */ die("*".$url_uid."/".$url_bid."/".$url_mid."*<pre>".print_r($FATAL, true)."</pre>");
+
// 01 1 12 3 32 21 1 2 2 10
if (($url_uid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (count($FATAL) == 0))
{
{
// If time is zero seconds we have a sponsor mail. 1 Second shall be set to avoid problems
if (($time == "0") && ($payment > 0)) { $URL = URL; $time = "1"; }
- if (($time > 0) && (($payment > 0) || ($points > 0)))
- {
+ if (($time > 0) && (($payment > 0) || ($points > 0))) {
// He can confirm this mail!
// Export data into constants for the template
define('_UID_VALUE' , $url_uid);
// Load template
LOAD_TEMPLATE("mailid_frames");
- }
- else
- {
+ } else {
$msg = CODE_DATA_INVALID;
}
- }
- else
- {
+ } else {
$msg = CODE_POSSIBLE_INVALID;
}
- }
- else
- {
+ } else {
$msg = CODE_ACCOUNT_LOCKED;
}
- }
- else
- {
+ } else {
SQL_FREERESULT($result);
$msg = CODE_USER_404;
}
- }
- else
- {
+ } else {
SQL_FREERESULT($result);
$msg = CODE_STATS_404;
}
- }
- else
- {
+ } else {
SQL_FREERESULT($result);
$msg = CODE_ALREADY_CONFIRMED;
}
- }
- else
- {
+ } else {
// Nothing entered
$msg = CODE_ERROR_MAILID;
}
- if (!empty($msg))
- {
+
+ // Error code is set?
+ if (!empty($msg)) {
LOAD_URL(URL."/modules.php?module=index&msg=".$msg);
}
<A name="TOP"></A>
-<TABLE border="0" cellspacing="0" cellpadding="0" width="100%"
- class="member_main">
- <TR>
- <TD colspan="2" align="center" valign="top" class="member_title">
- <TABLE border="0" cellspacing="0" cellpadding="0" width="100%"
- class="guest">
- <STRONG><BIG>- - - <A title="{!MAIN_TITLE!}"
- style="cursor: default; background: none; text-decoration: none"
- class="member_header">{!MAIN_TITLE!}</A> - - -</BIG></STRONG>
- <BR>
- <TABLE border="0" cellspacing="0" cellpadding="0" width="100%">
- <TR>
- <TD width="200"><FONT class="guest_header"> Hallo
- $username!</FONT></TD>
- <TD align="center"><FONT class="guest_header">{!SLOGAN!}</FONT></TD>
- <TD width="200" align="right"><FONT class="guest_header">$date_time </FONT></TD>
- </TR>
- </TABLE>
+<TABLE border="0" cellspacing="0" cellpadding="0" width="100%" class="member_main">
+<TR>
+ <TD colspan="2" align="center" valign="top" class="member_title">
+ <TABLE border="0" cellspacing="0" cellpadding="0" width="100%" class="guest">
+ <TR>
+ <TD colspan="3" align="center">
+ <STRONG><BIG>- - - <A title="{!MAIN_TITLE!}"
+ style="cursor: default; background: none; text-decoration: none"
+ class="member_header">{!MAIN_TITLE!}</A> - - -</BIG></STRONG>
+ <BR>
</TD>
- </TR>
\ No newline at end of file
+ </TR>
+ <TR>
+ <TD width="200"><FONT class="guest_header"> Hallo
+ $username!</FONT></TD>
+ <TD align="center"><FONT class="guest_header">{!SLOGAN!}</FONT></TD>
+ <TD width="200" align="right"><FONT class="guest_header">$date_time </FONT></TD>
+ </TR>
+ </TABLE>
+ </TD>
+</TR>