]> git.mxchange.org Git - mailer.git/commitdiff
Fixed a comparison problem like string1 < string2
authorRoland Häder <roland@mxchange.org>
Wed, 17 Sep 2008 20:53:34 +0000 (20:53 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 17 Sep 2008 20:53:34 +0000 (20:53 +0000)
13 files changed:
.gitattributes
inc/check-reset.php
inc/databases.php
inc/extensions.php
inc/extensions/ext-surfbar.php
inc/functions.php
inc/gen_sql_patches.php
inc/libs/surfbar_functions.php
inc/modules/admin/admin-inc.php
inc/modules/member/what-points.php
inc/modules/member/what-surfbar_list.php [new file with mode: 0644]
inc/modules/member/what-surfbar_stats.php
inc/mysql-manager.php

index 5211aa362c6127ebe7c1b29a95d4c907a0864f02..a046419f20d92776c6c063984fc10b4885b921c0 100644 (file)
@@ -463,6 +463,7 @@ inc/modules/member/what-sponsor.php -text
 inc/modules/member/what-stats.php -text
 inc/modules/member/what-support.php -text
 inc/modules/member/what-surfbar_book.php -text
+inc/modules/member/what-surfbar_list.php -text
 inc/modules/member/what-surfbar_start.php -text
 inc/modules/member/what-surfbar_stats.php -text
 inc/modules/member/what-themes.php -text
index 65a01d2998e414b43de7c296680369beb4a5055e..ebda4415d7753a96ad75b29e5a03945e48b137d1 100644 (file)
@@ -46,6 +46,15 @@ if ((date("d", $_CONFIG['last_update']) != date("d", time())) && (!isBooleanCons
        // Add more includes
        $INC_POOL = RESET_ADD_INCLUDES();
 
+       // Is this not an array?
+       if (!is_array($INC_POOL)) {
+               // Log the error
+               DEBUG_LOG(basename(__FILE__).":INC_POOL is no array!");
+
+               // Skip further executions
+               return;
+       } // END - if
+
        // Run the full reset scripts
        foreach ($INC_POOL as $incFile) {
                require_once($incFile);
index 4c69af42b8711be05bf8bcb86adab74937c53165..3c2480c132c885aa6cb1488507fffa1f470fc987 100644 (file)
@@ -113,7 +113,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "354");
+define('CURR_SVN_REVISION', "355");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 50820f59487c26cde3fe1cd6b96fba6b129bcdbe..c6721cc0100bb50e4e4f16f94f0bbed1d8ed967d 100644 (file)
@@ -65,21 +65,16 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false)
                foreach ($EXT_VER_HISTORY as $EXT_VER)
                {
                        require($file);
-                       if (((GET_EXT_VERSION("sql_patches") != '') && ($_CONFIG['verbose_sql'] == "Y")) || (!EXT_IS_ACTIVE("sql_patches")))
-                       {
-                               if (!empty($UPDATE_NOTES))
-                               {
+                       if (((GET_EXT_VERSION("sql_patches") != "") && ($_CONFIG['verbose_sql'] == "Y")) || (!EXT_IS_ACTIVE("sql_patches"))) {
+                               if (!empty($UPDATE_NOTES)) {
                                        // Update notes found
                                        $NOTES .= "<STRONG>v".$EXT_VER.":</STRONG><br />".$UPDATE_NOTES."<br /><br />\n";
                                        $UPDATE_NOTES = "";
-                               }
-                                elseif (($EXT_VER == "0.0") || ($EXT_VER == "0.0.0"))
-                               {
+                               } elseif (($EXT_VER == "0.0") || ($EXT_VER == "0.0.0")) {
                                        // Initial release
                                        $NOTES .= "<STRONG>v".$EXT_VER.":</STRONG><br />".INITIAL_RELEASE."<br /><br />\n";
-                               }
-                                else
-                               {
+                               } else {
+                                       // No update notes found!
                                        $NOTES .= "<STRONG>v".$EXT_VER.":</STRONG><br /><I>".NO_UPDATE_NOTES."</I><br /><br />\n";
                                }
                        }
@@ -513,7 +508,7 @@ function EXTENSION_VERBOSE_TABLE($SQLs, $title = ADMIN_SQLS_EXECUTED_ON_REMOVAL,
 
        $S = false; $SW = 2; $i = 1;
        $OUT = "";
-       if ((is_array($SQLs)) && (GET_EXT_VERSION("sql_patches")) && ($_CONFIG['verbose_sql'] == "Y")) {
+       if ((is_array($SQLs)) && (GET_EXT_VERSION("sql_patches") >= "0.0.7") && ($_CONFIG['verbose_sql'] == "Y")) {
                $OUT  = "<DIV align=\"center\">
 <TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"".$WIDTH."\" align=\"center\"".$dashed.">
 <TR>
@@ -537,7 +532,7 @@ function EXTENSION_VERBOSE_TABLE($SQLs, $title = ADMIN_SQLS_EXECUTED_ON_REMOVAL,
                }
        }
 
-       if ((!$S) && (GET_EXT_VERSION("sql_patches")) && ($_CONFIG['verbose_sql'] == "Y")) {
+       if ((!$S) && (GET_EXT_VERSION("sql_patches") >= "0.0.7") && ($_CONFIG['verbose_sql'] == "Y")) {
                // No addional SQL commands to run
                $OUT .= "<TR>
   <TD colspan=\"2\" align=\"center\" class=\"switch_sw2 bottom2\" height=\"24\">
@@ -607,5 +602,17 @@ function ACTIVATE_EXTENSION($ext_name) {
                EXTENSION_RUN_SQLS(GET_EXT_ID($ext_name), "activate");
        } // END - if
 }
+// Checks wether the extension is older than given
+function EXT_VERSION_IS_OLDER ($ext_name, $ext_ver) {
+       // Get current extension version
+       $currVersion = GET_EXT_VERSION($ext_name);
+
+       // Remove all dots from both versions
+       $currVersion = str_replace(".", "", $currVersion);
+       $ext_ver = str_replace(".", "", $ext_ver);
+
+       // Now compare both and return the result
+       return ($currVersion < $ext_ver);
+}
 //
 ?>
index 61d463146bb68b6e08d824cd129b7a3f64f117c5..95ab6a8f3c60e752dd89c6b79f4f31809b918c3d 100644 (file)
@@ -124,7 +124,8 @@ INDEX (`userid`,`url_id`)
        $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar',NULL,'Surfbar','Y','Y',4)";
        $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_start','Surfbar starten','Y','Y',1)";
        $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_book','URL buchen','Y','Y',2)";
-       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_stats','URL-Statistiken','Y','Y',3)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_list','URL-Verwaltung','Y','Y',3)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_stats','URL-Statistiken','Y','Y',4)";
 
        // Admin menus
        $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar',NULL,'Surfbar','URLs in der Surfbar verwalten, Einstellungen &auml;ndern und vieles mehr.',7)";
@@ -144,7 +145,7 @@ case "remove": // Do stuff when removing extension
        $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_locks`";
        $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_salts`";
        $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_stats`";
-       $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_member_menu` WHERE `action`='surfbar' LIMIT 4";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_member_menu` WHERE `action`='surfbar' LIMIT 5";
        $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE action='surfbar' LIMIT 6";
        break;
 
index 75a0e572404de27cf50eede508b1a08e1caec5da..be503dcc6c07c68da41bb4350e490d889ec366d5 100644 (file)
@@ -1478,10 +1478,10 @@ function SEND_ADMIN_EMAILS_PRO($subj, $template, $content, $UID) {
        // Load email template
        $msg = LOAD_EMAIL_TEMPLATE($template, $content, $UID);
 
-       if (GET_EXT_VERSION("admins") < "0.4.0") {
+       if (EXT_VERSION_IS_OLDER("admins", "0.4.0")) {
                // Older version detected!
                return SEND_ADMIN_EMAILS($subj, $msg);
-       }
+       } // END - if
 
        // Check which admin shall receive this mail
        $result = SQL_QUERY_ESC("SELECT DISTINCT admin_id FROM "._MYSQL_PREFIX."_admins_mails WHERE mail_template='%s' ORDER BY admin_id",
@@ -1916,7 +1916,7 @@ function generateHash ($plainText, $salt = "") {
        global $_CONFIG, $_SERVER;
 
        // Is the required extension "sql_patches" there and a salt is not given?
-       if (((GET_EXT_VERSION("sql_patches") < "0.3.6") || (GET_EXT_VERSION("sql_patches") == "")) && (empty($salt))) {
+       if (((EXT_VERSION_IS_OLDER("sql_patches", "0.3.6")) || (GET_EXT_VERSION("sql_patches") == "")) && (empty($salt))) {
                // Extension sql_patches is missing/outdated so we return the plain text
                return $plainText;
        } // END - if
@@ -2348,9 +2348,9 @@ function RESET_ADD_INCLUDES () {
        global $_CONFIG;
 
        // Is the reset set or old sql_patches?
-       if ((!isBooleanConstantAndTrue('__DAILY_RESET')) || (GET_EXT_VERSION("sql_patches") < "0.4.5")) {
+       if ((!isBooleanConstantAndTrue('__DAILY_RESET')) || (EXT_VERSION_IS_OLDER("sql_patches", "0.4.5"))) {
                // Then abort here
-               return;
+               return array();
        } // END - if
 
        // Get more daily reset scripts
index 0903d68470947c1253782fe39a7ee8a4119bfc3b..467e4b4ecb735cc4cfe693174516a5cd2fb8b8bf 100644 (file)
@@ -38,7 +38,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Check for version of sql_patches
-if (GET_EXT_VERSION("sql_patches") < "0.3.6") return false;
+if (EXT_VERSION_IS_OLDER("sql_patches", "0.3.6")) return false;
 
 // Check if there is no scrambling string
 if (empty($_CONFIG['pass_scramble'])) {
index f2b006ccda75b3f62ad88b5531924acaabd9249c..a7471a6a537c8e172776dadab981157091ba32eb 100644 (file)
@@ -298,29 +298,39 @@ function SURFBAR_TRANSLATE_STATUS ($status) {
 function SURFBAR_DETERMINE_REWARD () {
        global $_CONFIG;
 
+       // Static values are default
+       $reward = $_CONFIG['surfbar_static_reward'];
+
        // Do we have static or dynamic?
-       if ($_CONFIG['surfbar_pay_model'] == "STATIC") {
-               // Static model, so choose static values
-               $reward = $_CONFIG['surfbar_static_reward'];
-       } else {
-               // Dynamic model, so calculate values
-               die("DYNAMIC payment model not yet supported!");
-       }
+       if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
+               // "Calculate" dynamic reward
+               $reward += SURFBAR_CALCULATE_DYNAMIC_ADD();
+       } // END - if
 
        // Return reward
        return $reward;
 }
+// "Calculate" dynamic add
+function SURFBAR_CALCULATE_DYNAMIC_ADD () {
+       // Get min/max values
+       $min = SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE();
+       $max = SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE();
+
+       // "Calculate" dynamic part and return it
+       return mt_rand($min, $max);
+}
 // Determine costs
 function SURFBAR_DETERMINE_COSTS () {
        global $_CONFIG;
 
+       // Static costs is default
+       $costs  = $_CONFIG['surfbar_static_costs'];
+
        // Do we have static or dynamic?
-       if ($_CONFIG['surfbar_pay_model'] == "STATIC") {
-               $costs  = $_CONFIG['surfbar_static_costs'];
-       } else {
-               // Dynamic model, so calculate values
-               die("DYNAMIC payment model not yet supported!");
-       }
+       if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
+               // "Calculate" dynamic costs
+               $costs += SURFBAR_CALCULATE_DYNAMIC_ADD();
+       } // END - if
 
        // Return costs
        return $costs;
@@ -349,50 +359,56 @@ function SURFBAR_CHECK_RELOAD_FULL() {
        // Default is full!
        $isFull = true;
 
-       // Do we have static or dynamic mode?
-       if ($_CONFIG['surfbar_pay_model'] == "STATIC") {
-               // Cache static reload lock
-               $SURFBAR_CACHE['surf_lock'] = $_CONFIG['surfbar_static_lock'];
-               //DEBUG_LOG(__FUNCTION__.":Fixed surf lock is ".$_CONFIG['surfbar_static_lock']."");
+       // Cache static reload lock
+       $SURFBAR_CACHE['surf_lock'] = $_CONFIG['surfbar_static_lock'];
+       //DEBUG_LOG(__FUNCTION__.":Fixed surf lock is ".$_CONFIG['surfbar_static_lock']."");
+
+       // Do we have dynamic model?
+       if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
+               // "Calculate" dynamic lock
+               $SURFBAR_CACHE['surf_lock'] += SURFBAR_CALCULATE_DYNAMIC_ADD();
+       } // END - if
 
-               // Ask the database
-               $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt FROM "._MYSQL_PREFIX."_surfbar_locks
+       // Ask the database
+       $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt FROM "._MYSQL_PREFIX."_surfbar_locks
 WHERE userid=%s AND (UNIX_TIMESTAMP() - ".SURFBAR_GET_DATA('surf_lock').") < UNIX_TIMESTAMP(last_surfed)
 LIMIT 1",
-                       array($GLOBALS['userid']), __FILE__, __LINE__
-               );
+               array($GLOBALS['userid']), __FILE__, __LINE__
+       );
 
-               // Fetch row
-               list($SURFBAR_CACHE['user_locks']) = SQL_FETCHROW($result);
+       // Fetch row
+       list($SURFBAR_CACHE['user_locks']) = SQL_FETCHROW($result);
 
-               // Is it null?
-               if (is_null($SURFBAR_CACHE['user_locks'])) {
-                       // Then fix it to zero!
-                       $SURFBAR_CACHE['user_locks'] = 0;
-               } // END - if
+       // Is it null?
+       if (is_null($SURFBAR_CACHE['user_locks'])) {
+               // Then fix it to zero!
+               $SURFBAR_CACHE['user_locks'] = 0;
+       } // END - if
 
-               // Free result
-               SQL_FREERESULT($result);
+       // Free result
+       SQL_FREERESULT($result);
 
-               // Get total URLs
-               $total = SURFBAR_GET_TOTAL_URLS();
+       // Get total URLs
+       $total = SURFBAR_GET_TOTAL_URLS();
 
-               // Do we have some URLs in lock? Admins can always surf on own URLs!
-               //DEBUG_LOG(__FUNCTION__.":userLocks=".SURFBAR_GET_DATA('user_locks').",total={$total}");
-               $isFull = ((SURFBAR_GET_DATA('user_locks') == $total) && ($total > 0));
-       } else {
-               // Dynamic model...
-               die("DYNAMIC not yet implemented!");
-       }
+       // Do we have some URLs in lock? Admins can always surf on own URLs!
+       //DEBUG_LOG(__FUNCTION__.":userLocks=".SURFBAR_GET_DATA('user_locks').",total={$total}");
+       $isFull = ((SURFBAR_GET_DATA('user_locks') == $total) && ($total > 0));
 
        // Return result
        return $isFull;
 }
 // Get total amount of URLs of given status for current user or of CONFIRMED URLs by default
-function SURFBAR_GET_TOTAL_URLS ($status="CONFIRMED") {
+function SURFBAR_GET_TOTAL_URLS ($status="CONFIRMED", $excludeUserId="") {
        // Determine depleted user account
        $UIDs = SURFBAR_DETERMINE_DEPLETED_USERIDS();
 
+       // Is the exlude userid set?
+       if ($excludeUserId !== "") {
+               // Then add it
+               $UIDs[] = $excludeUserId;
+       } // END - if
+
        // Get amount from database
        $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt
 FROM "._MYSQL_PREFIX."_surfbar_urls
@@ -417,7 +433,7 @@ function SURFBAR_IF_USER_BOOK_MORE_URLS ($uid=0) {
        return ((($uid == 0) && (IS_ADMIN())) || (SURFBAR_GET_TOTAL_USER_URLS($uid) < $_CONFIG['surfbar_max_order']));
 }
 // Get total amount of URLs of given status for current user
-function SURFBAR_GET_TOTAL_USER_URLS ($uid=0) {
+function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status="") {
        global $_CONFIG;
 
        // Is the user 0 and user is logged in?
@@ -429,10 +445,18 @@ function SURFBAR_GET_TOTAL_USER_URLS ($uid=0) {
                return ($_CONFIG['surfbar_max_order'] + 1);
        }
 
+       // Default is all URLs
+       $ADD = "";
+
+       // Is the status set?
+       if (!empty($status)) {
+               $ADD = sprintf(" AND status='%s'", $status);
+       } // END - if
+
        // Get amount from database
        $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt
 FROM "._MYSQL_PREFIX."_surfbar_urls
-WHERE userid=%s
+WHERE userid=%s".$ADD."
 LIMIT %s",
                array($uid, $_CONFIG['surfbar_max_order']), __FILE__, __LINE__
        );
@@ -671,17 +695,14 @@ GROUP BY userid",
 function SURFBAR_DETERMINE_WAIT_TIME () {
        global $_CONFIG;
 
-       // Init time
-       $time = 0;
+       // Static time is default
+       $time = $_CONFIG['surfbar_static_time'];
 
        // Which payment model do we have?
-       if ($_CONFIG['surfbar_pay_model'] == "STATIC") {
-               // Static model
-               $time = $_CONFIG['surfbar_static_time'];
-       } else {
-               // Dynamic
-               die("DYNAMIC payment model not yet finished!");
-       }
+       if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
+               // "Calculate" dynamic time
+               $time += SURFBAR_CALCULATE_DYNAMIC_ADD();
+       } // END - if
 
        // Return value
        return $time;
@@ -745,13 +766,17 @@ function SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE () {
        $addon += abs(log($onlineUsers / $totalUsers + 1) * $percent * $totalUsers);
 
        // Get total URLs
-       $totalUrls = SURFBAR_GET_TOTAL_URLS();
+       $totalUrls = SURFBAR_GET_TOTAL_URLS("CONFIRMED", "0");
 
        // Get user's total URLs
-       $userUrls = SURFBAR_GET_TOTAL_USER_URLS();
+       $userUrls = SURFBAR_GET_TOTAL_USER_URLS(0, "CONFIRMED");
 
        // Calculate addon
-       $addon += abs(log($userUrls / $totalUrls + 1) * $percent * $totalUrls);
+       if ($totalUrls > 0) {
+               $addon += abs(log($userUrls / $totalUrls + 1) * $percent * $totalUrls);
+       } else {
+               $addon += abs(log($userUrls / 1 + 1) * $percent * $totalUrls);
+       }
 
        // Return addon
        return $addon;
@@ -776,7 +801,7 @@ function SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE () {
        $addon += abs($max * $percent * $totalUsers);
 
        // Get total URLs
-       $totalUrls = SURFBAR_GET_TOTAL_URLS();
+       $totalUrls = SURFBAR_GET_TOTAL_URLS("CONFIRMED", "0");
 
        // Calculate addon
        $addon += abs($max * $percent * $totalUrls);
@@ -795,7 +820,7 @@ function SURFBAR_CALCULATE_DYNAMIC_LOCK () {
        $onlineUsers = SURFBAR_DETERMINE_TOTAL_ONLINE();
 
        // Calculate lock
-       $addon = abs(log($onlineUsers / $addon +1));
+       $addon = abs(log($onlineUsers / $addon + 1));
 
        // Return value
        return $addon;
@@ -979,8 +1004,8 @@ LIMIT 1",
                // Only in dynamic model add the dynamic bonus!
                if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
                        // Calculate dynamic reward/costs and add it
-                       $SURFBAR_CACHE['reward'] += SURFBAR_CALCULATE_DYNAMIC_REWARD_ADD();
-                       $SURFBAR_CACHE['costs']  += SURFBAR_CALCULATE_DYNAMIC_COSTS_ADD();
+                       $SURFBAR_CACHE['reward'] += SURFBAR_CALCULATE_DYNAMIC_ADD();
+                       $SURFBAR_CACHE['costs']  += SURFBAR_CALCULATE_DYNAMIC_ADD();
                        //DEBUG_LOG(__FUNCTION__.":DYNAMIC+ - reward=".SURFBAR_GET_REWARD()."|costs=".SURFBAR_GET_COSTS()."");
                } // END - if
 
index e386039365eb9ed0c5e48518ed605dfd6657e1b7..ee90ca6bc94f638cd7b0789528b825d66b091e23 100644 (file)
@@ -107,8 +107,8 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password)
                $data['password'] = generateHash($password);
 
                // Is the sql_patches not installed, than we cannot have a valid hashed password here!
-               if (($ret == "pass") && ((GET_EXT_VERSION("sql_patches") < "0.3.6") || (GET_EXT_VERSION("sql_patches") == ""))) $ret = "done";
-       } elseif ((GET_EXT_VERSION("sql_patches") < "0.3.6") || (GET_EXT_VERSION("sql_patches") == "")) {
+               if (($ret == "pass") && ((EXT_VERSION_IS_OLDER("sql_patches", "0.3.6")) || (GET_EXT_VERSION("sql_patches") == ""))) $ret = "done";
+       } elseif ((EXT_VERSION_IS_OLDER("sql_patches", "0.3.6")) || (GET_EXT_VERSION("sql_patches") == "")) {
                // Old hashing way
                return $ret;
        } elseif (!isset($data['password'])) {
@@ -180,7 +180,7 @@ function LOGIN_ADMIN ($adminLogin, $passHash) {
        global $cacheInstance;
 
        // Reset failture counter on matching admins version
-       if ((GET_EXT_VERSION("admins") >= "0.7.0") && ((GET_EXT_VERSION("sql_patches") < "0.3.6") || (GET_EXT_VERSION("sql_patches") == ""))) {
+       if ((GET_EXT_VERSION("admins") >= "0.7.0") && ((EXT_VERSION_IS_OLDER("sql_patches", "0.3.6")) || (GET_EXT_VERSION("sql_patches") == ""))) {
                // Reset counter on out-dated sql_patches version
                SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins SET login_failtures=0,last_failture='0000-00-00 00:00:00' WHERE login='%s' LIMIT 1",
                        array($adminLogin), __FILE__, __LINE__);
index 11a8db0a0e12904f10b9ab8acfa35e66de1fccc7..d146a2c7d687c3ad0dbee4361d899e1fd3bef33e 100644 (file)
@@ -136,7 +136,7 @@ define('__TREF_VALUE' , $TREF);
 define('__TLOCK_VALUE', TRANSLATE_COMMA($TLOCK));
 
 // Fixes a bug when there is no bonus extension installed
-if (GET_EXT_VERSION("bonus") < "0.4.4") $_CONFIG['bonus_active'] = "X";
+if (EXT_VERSION_IS_OLDER("bonus", "0.4.4")) $_CONFIG['bonus_active'] = "X";
 
 // Display login bonus and turbo-click bonus
 if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (EXT_IS_ACTIVE("bonus")) && ($_CONFIG['bonus_active'] == "Y")) {
@@ -170,7 +170,7 @@ if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (EXT_IS_ACTIVE("bonus")) && ($_CONF
 } elseif ($_CONFIG['bonus_active'] == "N") {
        // Bonus active rallye deactivated
        define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_bonus_disabled", true));
-} elseif ((IS_ADMIN()) && (GET_EXT_VERSION("bonus") < "0.2.2") && (EXT_IS_ACTIVE("bonus"))) {
+} elseif ((IS_ADMIN()) && (EXT_VERSION_IS_OLDER("bonus", "0.2.2")) && (EXT_IS_ACTIVE("bonus"))) {
        // Please upgrade your bonus extension to v0.2.2 or newer!
        define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_upgrade"));
 } else {
diff --git a/inc/modules/member/what-surfbar_list.php b/inc/modules/member/what-surfbar_list.php
new file mode 100644 (file)
index 0000000..aa07ac6
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/17/2008 *
+ * ================                             Last change: 09/17/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-surfbar_list.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Surfbar URL statistics                           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Surfbar-Statistiken                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * 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 (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL(URL."/modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+//
+?>
index 5fd1677b64ad247570da4a813d5a836a14e9f4be..41110ed24bf6a854b3064fc683900d9cb591b9b0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 09/10/2004 *
+ * MXChange v0.2.1                                    Start: 09/10/2008 *
  * ================                             Last change: 09/10/2008 *
  *                                                                      *
  * -------------------------------------------------------------------- *
index c4803ae00bd7d0d40acc5bb3457978d65a50a505..83c8f1cf38cba223d7013978453e8cb9605cc206 100644 (file)
@@ -926,20 +926,15 @@ function GET_ACTION ($MODE, &$wht)
        } elseif (!empty($GLOBALS['action'])) {
                // Get it directly from URL
                return $GLOBALS['action'];
-       } else {
-               // Everything else will be touched after checking the module has a menu assigned
        }
        //* DEBUG: */ echo __LINE__."*".$ret."*<br />\n";
 
-       if (MODULE_HAS_MENU($MODE))
-       {
+       if (MODULE_HAS_MENU($MODE)) {
                // Rewriting modules to menu
-               switch ($MODE)
-               {
+               switch ($MODE) {
                        case "index": $MODE = "guest";  break;
                        case "login": $MODE = "member"; break;
-                               break;
-               }
+               } // END - switch
 
                // Guest and member menu is "main" as the default
                if (empty($ret)) $ret = "main";
@@ -950,11 +945,11 @@ function GET_ACTION ($MODE, &$wht)
                if (SQL_NUMROWS($result) == 1) {
                        // Load action value and pray that this one is the right you want... ;-)
                        list($ret) = SQL_FETCHROW($result);
-               }
+               } // END - if
 
                // Free memory
                SQL_FREERESULT($result);
-       }
+       } // END - if
 
        // Return action value
        return $ret;
@@ -966,8 +961,7 @@ function GET_CATEGORY ($cid) {
 
        // Is the category id set?
        if (!empty($cid)) {
-
-               // Lookup the category
+               // Lookup the category in database
                $result = SQL_QUERY_ESC("SELECT cat FROM "._MYSQL_PREFIX."_cats WHERE id=%s LIMIT 1",
                        array(bigintval($cid)), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {