more fixes for missing extensions
authorRoland Häder <roland@mxchange.org>
Sun, 3 Feb 2008 13:06:35 +0000 (13:06 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 3 Feb 2008 13:06:35 +0000 (13:06 +0000)
0.2.1/inc/extensions.php
0.2.1/inc/language/de.php
0.2.1/inc/modules/admin/what-list_links.php
0.2.1/inc/modules/admin/what-list_unconfirmed.php
0.2.1/inc/modules/admin/what-send_bonus.php
0.2.1/inc/modules/chk_login.php
0.2.1/inc/modules/index.php
0.2.1/inc/modules/login.php
0.2.1/mailid.php
0.2.1/templates/de/html/member/member_header.tpl

index 9e6bd17..893a5a1 100644 (file)
@@ -242,19 +242,19 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE)
        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();
index f4d2694..69cc058 100644 (file)
@@ -534,7 +534,7 @@ define('EMAIL_PERCENT', "Klickrate");
 define('MEMBER_NO_MAILS_TO_CONFIRM', "Keine Mails &uuml;brig zum Best&auml;tigen!");
 define('MEMBER_SID', "Mail-ID");
 define('CONFIRM_LINK', "Best&auml;tigungslink");
-define('MAIL_ALREADY_CONFIRMED', "Mail bereits verguetet oder Link ist nicht mehr gueltig!");
+define('MAIL_ALREADY_CONFIRMED', "Mail bereits verg&uuml;tet oder Link ist nicht mehr g&uuml;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");
index a72ee9b..1cb8786 100644 (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("mailid")) {
+       ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid"));
+       return;
 }
 
 // Add description as navigation point
@@ -43,38 +45,34 @@ ADD_DESCR("admin", basename(__FILE__));
 
 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__);
@@ -85,13 +83,10 @@ if (!empty($_GET['u_id']))
 
                                // 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)
@@ -111,8 +106,7 @@ if (!empty($_GET['u_id']))
                                                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);
@@ -129,14 +123,15 @@ if (!empty($_GET['u_id']))
 
                                                // 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;
                                }
@@ -155,25 +150,18 @@ if (!empty($_GET['u_id']))
                                // 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();
 
 //
 ?>
index 54ea343..a4cfc7b 100644 (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("mailid")) {
+       ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid"));
+       return;
 }
+
 // Add description as navigation point
 ADD_DESCR("admin", basename(__FILE__));
 
index 1e64c4d..fccbb06 100644 (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__));
 
@@ -45,7 +48,6 @@ if (is_admin()) $WHERE = "";
 $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
@@ -140,9 +142,7 @@ VALUES ('%s', '%s', '%s', '%s', '%s', 'NEW', UNIX_TIMESTAMP(), '%s', '%s', '%s',
                // 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)
        {
@@ -239,6 +239,6 @@ WHERE userid=%d AND status='CONFIRMED' AND receive_mails > 0".$MORE." LIMIT 1",
                OUTPUT_HTML ("<STRONG><SPAN class=\"member_failed\">".MEMBER_NO_CATS."</SPAN></STRONG>");
        }
 }
-CLOSE_TABLE();
+
 //
 ?>
index 9b4e6b8..9be4517 100644 (file)
@@ -55,8 +55,8 @@ if (!empty($GLOBALS['userid']) && !empty($_COOKIE['u_hash']) && !empty($_COOKIE[
        $_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()
index cb6ee90..afccd22 100644 (file)
@@ -68,7 +68,7 @@ if (!empty($_GET['msg']))
                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;
index 3f617f6..e7e2d35 100644 (file)
  ************************************************************************/
 
 // 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)
        {
index ca6a2a6..b268fa8 100644 (file)
@@ -51,18 +51,22 @@ if (defined('mxchange_installed') && (mxchange_installed))
        // 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))
        {
@@ -157,8 +161,7 @@ if (defined('mxchange_installed') && (mxchange_installed))
                                                {
                                                        // 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);
@@ -168,47 +171,34 @@ if (defined('mxchange_installed') && (mxchange_installed))
 
                                                                // 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);
        }
 
index 0cb3602..d469e34 100644 (file)
@@ -1,21 +1,22 @@
 <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>-&nbsp;-&nbsp;- <A title="{!MAIN_TITLE!}"
-                               style="cursor: default; background: none; text-decoration: none"
-                               class="member_header">{!MAIN_TITLE!}</A>&nbsp;-&nbsp;-&nbsp;-</BIG></STRONG>
-                       <BR>
-                       <TABLE border="0" cellspacing="0" cellpadding="0" width="100%">
-                               <TR>
-                                       <TD width="200"><FONT class="guest_header">&nbsp;&nbsp;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&nbsp;&nbsp;</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>-&nbsp;-&nbsp;- <A title="{!MAIN_TITLE!}"
+                                       style="cursor: default; background: none; text-decoration: none"
+                                       class="member_header">{!MAIN_TITLE!}</A>&nbsp;-&nbsp;-&nbsp;-</BIG></STRONG>
+                               <BR>
                        </TD>
-                       </TR>
\ No newline at end of file
+               </TR>
+               <TR>
+                       <TD width="200"><FONT class="guest_header">&nbsp;&nbsp;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&nbsp;&nbsp;</FONT></TD>
+               </TR>
+               </TABLE>
+       </TD>
+</TR>