Surfbar now has admin menu (dummy extension!), menu system rebuilded for unique key...
authorRoland Häder <roland@mxchange.org>
Thu, 28 Aug 2008 23:32:16 +0000 (23:32 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 28 Aug 2008 23:32:16 +0000 (23:32 +0000)
29 files changed:
inc/extensions/ext-
inc/extensions/ext-admins.php
inc/extensions/ext-holiday.php
inc/extensions/ext-mods.php
inc/extensions/ext-payout.php
inc/extensions/ext-sponsor.php
inc/extensions/ext-sql_patches.php
inc/extensions/ext-surfbar.php
inc/extensions/ext-user.php
inc/extensions/ext-yoomedia.php
inc/functions.php
inc/header.php
inc/libs/sponsor_functions.php
inc/load_extensions.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-admin_add.php
inc/modules/admin/what-adminedit.php
inc/modules/admin/what-guest_add.php
inc/modules/admin/what-guestedit.php
inc/modules/admin/what-mem_add.php
inc/modules/admin/what-memedit.php
inc/modules/admin/what-repair_amenu.php
inc/modules/admin/what-repair_amnu.php
inc/modules/admin/what-repair_gmenu.php
inc/modules/admin/what-repair_gmnu.php
inc/modules/admin/what-repair_mmenu.php
inc/modules/admin/what-repair_mmnu.php
inc/mysql-connect.php
inc/mysql-manager.php

index d714a3e593dcdf800e8531e226832036bfe2764c..ca956b8af3ee00747f3beb5e98e6909fe2b16751 100644 (file)
@@ -81,8 +81,8 @@ case "update": // Update an extension
        break;
 
 default: // Do stuff when extension is loaded
        break;
 
 default: // Do stuff when extension is loaded
-       $DUMMY = LOAD_CONFIG("0");
-       unset($DUMMY);
+       $dummy = LOAD_CONFIG();
+       unset($dummy);
        break;
 }
 
        break;
 }
 
index 35886053752691d72d5b56888d1e781bb7940e9a..b721f0b8dbd67b9d44b19018592817ac2fd3cd40 100644 (file)
@@ -271,7 +271,7 @@ PRIMARY KEY (id)
                break;
 
        case "0.6.9": // SQL queries for v0.6.9
                break;
 
        case "0.6.9": // SQL queries for v0.6.9
-               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Admin-Management' WHERE action = 'admins' AND what='' LIMIT 1";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Admin-Management' WHERE action = 'admins' AND (what='' OR what IS NULL) LIMIT 1";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Verwaltung nach Management umbenannt.";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Verwaltung nach Management umbenannt.";
index 8e121a3e08b9a7a250693baa23a743970ca03c91..454c67a062717f07dc04fada7aad840f516bee66 100644 (file)
@@ -210,7 +210,7 @@ case "update": // Update an extension
                break;
 
        case "0.2.0": // SQL queries for v0.2.0
                break;
 
        case "0.2.0": // SQL queries for v0.2.0
-               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Urlaubsmanagement' WHERE action = 'holiday' AND what='' LIMIT 1";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Urlaubsmanagement' WHERE action = 'holiday' AND (what='' OR what IS NULL) LIMIT 1";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Mitgliedsmen&uuml; komplett umgebaut.";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Mitgliedsmen&uuml; komplett umgebaut.";
index 676eaef3f7f15e0cc7d557f375600a6294b70b98..6911f805b0ea1cdbe333d249664e8f9d37ce58a3 100644 (file)
@@ -105,7 +105,7 @@ case "update": // Update an extension
                break;
 
        case "0.0.8": // SQL queries for v0.0.8
                break;
 
        case "0.0.8": // SQL queries for v0.0.8
-               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Modul-Management' WHERE action = 'mods' AND what='' LIMIT 1";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Modul-Management' WHERE action = 'mods' AND (what='' OR what IS NULL) LIMIT 1";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Verwaltung auf Management umgestellt.";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Verwaltung auf Management umgestellt.";
index f3fad501545aa997235547ac475d2047aa112667..a63a63332bf432b2819119275be428e6238e0967 100644 (file)
@@ -226,7 +226,7 @@ case "update": // Update an extension
                break;
 
        case "0.3.7": // SQL queries for v0.3.7
                break;
 
        case "0.3.7": // SQL queries for v0.3.7
-               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Auszahlungsmanagement' WHERE action = 'payouts' AND what='' LIMIT 1";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Auszahlungsmanagement' WHERE action = 'payouts' AND (what='' OR what IS NULL) LIMIT 1";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Verwaltung nach Management umgestellt.";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Verwaltung nach Management umgestellt.";
index cec77cc1da4740275c169e83171bc979defc159b..bfdc4542c5bbbd13bdf054085329e2aea75b9a45 100644 (file)
@@ -427,11 +427,9 @@ case "update": // Update an extension
        break;
 
 default: // Do stuff when extension is loaded
        break;
 
 default: // Do stuff when extension is loaded
-       $result_user = SQL_QUERY("SELECT * FROM "._MYSQL_PREFIX."_config WHERE config='0' LIMIT 1", __FILE__, __LINE__);
-       $DUMMY = SQL_FETCHARRAY($result_user);
-       $CONFIG['sponsor_min_points'] = $DUMMY['sponsor_min_points']; // Minimum points to order
-       $CONFIG['sponsor_ref_points'] = $DUMMY['sponsor_ref_points']; // Additional points when a sponsor brings you another sponsor
-       unset($DUMMY);
+       $dummy = LOAD_CONFIG();
+       $_CONFIG = array_merge($_CONFIG, $dummy);
+       unset($dummy);
        break;
 }
 
        break;
 }
 
index 471300b250885254195ac2c197658f05a7dd9125..6f7696923a5565b283597786ec52bf3d7632ef0d 100644 (file)
@@ -38,13 +38,13 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) {
 }
 
 // Version number
 }
 
 // Version number
-$EXT_VERSION = "0.4.3";
+$EXT_VERSION = "0.4.4";
 
 // Auto-set extension version
 if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION;
 
 // Version history array (add more with , "0.1" and so on)
 
 // Auto-set extension version
 if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION;
 
 // Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3");
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4");
 
 switch ($EXT_LOAD_MODE)
 {
 
 switch ($EXT_LOAD_MODE)
 {
@@ -72,10 +72,10 @@ LIMIT 13";
        $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE
 action='themes' OR
 what='themes' OR
        $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE
 action='themes' OR
 what='themes' OR
-(action='stats' AND what='') OR
-(action='extras' AND what='') OR
-(action='rals' AND what='') OR
-(action='account' AND what='') LIMIT 7";
+(action='stats' AND (what='' OR what IS NULL)) OR
+(action='extras' AND (what='' OR what IS NULL)) OR
+(action='rals' AND (what='' OR what IS NULL)) OR
+(action='account' AND (what='' OR what IS NULL)) LIMIT 7";
        $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='main' WHERE
 action='stats' OR
 action='extras' OR
        $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='main' WHERE
 action='stats' OR
 action='extras' OR
@@ -509,7 +509,7 @@ PRIMARY KEY (id)
                break;
 
        case "0.4.0": // SQL queries for v0.4.0
                break;
 
        case "0.4.0": // SQL queries for v0.4.0
-               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Email-Management' WHERE action = 'email' AND what='' LIMIT 1";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Email-Management' WHERE action = 'email' AND (what='' OR what IS NULL) LIMIT 1";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Email-Verwaltung nach Email-Management umbenannt.";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Email-Verwaltung nach Email-Management umbenannt.";
@@ -525,6 +525,9 @@ PRIMARY KEY (id)
 
        case "0.4.2": // SQL queries for v0.4.2
                $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_online` ADD INDEX `admin_member` (`is_admin`, `is_member`)";
 
        case "0.4.2": // SQL queries for v0.4.2
                $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_online` ADD INDEX `admin_member` (`is_admin`, `is_member`)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Neuen Schl&uuml;ssel zur Online-Tabelle hinzugef&uuml;gt.";
                break;
 
        case "0.4.3": // SQL queries for v0.4.3
                break;
 
        case "0.4.3": // SQL queries for v0.4.3
@@ -533,6 +536,25 @@ PRIMARY KEY (id)
                $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_username` VARCHAR(255) NOT NULL DEFAULT ''";
                $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_password` VARCHAR(255) NOT NULL DEFAULT ''";
                $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES ('setup', 'config_proxy', 'Proxy-Einstellungen', 'Sollte Ihr Webserver sich hinter einem Proxy befinden, so k&ouml;nnen Sie hier MXChange so konfigurieren, dass es Updates durch diesen hindurch sucht!', 15)";
                $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_username` VARCHAR(255) NOT NULL DEFAULT ''";
                $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_password` VARCHAR(255) NOT NULL DEFAULT ''";
                $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES ('setup', 'config_proxy', 'Proxy-Einstellungen', 'Sollte Ihr Webserver sich hinter einem Proxy befinden, so k&ouml;nnen Sie hier MXChange so konfigurieren, dass es Updates durch diesen hindurch sucht!', 15)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Proxy-Einstellungen hinzugef&uuml;gt.";
+               break;
+
+       case "0.4.4": // SQL queries for v0.4.4
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what=NULL WHERE what=''";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET what=NULL WHERE what=''";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET what=NULL WHERE what=''";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` ADD INDEX `action` (`action`)";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Schl&uuml;ssel in Admin-, Gast- und Mitgliedsmen&uuml; verbessert.";
                break;
        }
        break;
                break;
        }
        break;
index 8274e3d821039fac714b90c4d7fd2812336d752a..b3df4d9002948891cf88b394826ef99102df3c26 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
  ************************************************************************/
 
 // 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);
 }
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
@@ -51,21 +50,56 @@ switch ($EXT_LOAD_MODE)
 {
 case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
        // SQL commands to run
 {
 case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
        // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_urls`";
+       $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_urls` (
+`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) NOT NULL DEFAULT '0',
+`url` VARCHAR(255) NOT NULL DEFAULT '',
+`reward` double(20,5) NOT NULL DEFAULT '0.00000',
+`views_total` BIGINT(20) NOT NULL DEFAULT '0',
+`status` ENUM('PENDING','CONFIRMED', 'LOCKED') NOT NULL DEFAULT 'CONFIRMED',
+`registered` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+`last_locked` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
+`lock_reason` VARCHAR(255) NOT NULL DEFAULT '',
+PRIMARY KEY(`id`),
+UNIQUE KEY `userid_url` (`userid`, `url`)
+) TYPE=MyISAM COMMENT='Surfbar URLs'";
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_locks`";
+       $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_locks` (
+`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) NOT NULL DEFAULT '0',
+`url_id` BIGINT(20) NOT NULL DEFAULT '0',
+`last_surfed` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+PRIMARY KEY(`id`),
+INDEX(`userid`),
+INDEX(`url_id`)
+) TYPE=MyISAM COMMENT='Surfbar reload locks'";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('extras','surfbar','Surfbar starten','Y','Y',5)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES('surfbar','','Surfbar','URLs in der Surfbar verwalten, Einstellungen &auml;ndern und vieles mehr.',7)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES('surfbar','surfbar_list_urls','URLs verwalten','Verwalten Sie hier alle in der Surfbar befindlichen URLs mit nur wenigen Klicks.',1)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES('surfbar','surfbar_unlock_urls','Surfbar URLs freigeben','Geben Sie hier nur direkt in der Surfbar gebuchte URLs frei.',2)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES('surfbar','config_surfbar','Einstellungen','Einstellungen an der Surfbar &auml;ndern, wie Festverg&uuml;tung, prozentuale Ref-Verg&uuml;tung und vieles mehr.',3)";
 
        // Load CSS file?
 
        // Load CSS file?
-       $EXT_CSS = 'Y';
+       $EXT_CSS = "Y";
        break;
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
        break;
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_urls`";
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_locks`";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_member_menu` WHERE `what` = 'surfbar' LIMIT 1";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE action='surfbar' LIMIT 4";
        break;
 
 case "activate": // Do stuff when admin activates this extension
        // SQL commands to run
        break;
 
 case "activate": // Do stuff when admin activates this extension
        // SQL commands to run
+       $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET `visible` = 'Y'`, `locked` = 'N' WHERE `what` = 'surfbar' LIMIT 1";
        break;
 
 case "deactivate": // Do stuff when admin deactivates this extension
        // SQL commands to run
        break;
 
 case "deactivate": // Do stuff when admin deactivates this extension
        // SQL commands to run
+       $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET `locked` = 'Y' WHERE `what` = 'surfbar' LIMIT 1";
        break;
 
 case "update": // Update an extension
        break;
 
 case "update": // Update an extension
@@ -81,8 +115,9 @@ case "update": // Update an extension
        break;
 
 default: // Do stuff when extension is loaded
        break;
 
 default: // Do stuff when extension is loaded
-       $DUMMY = LOAD_CONFIG("0");
-       unset($DUMMY);
+       $dummy = LOAD_CONFIG();
+       $_CONFIG = array_merge($_CONFIG, $dummy);
+       unset($dummy);
        break;
 }
 
        break;
 }
 
index f96acbf5a7d212150a10bf44ecbf0d7673a3dbdf..17142d78a025daac04d2ed9d90ca08c4800c85f5 100644 (file)
@@ -195,7 +195,7 @@ case "update": // Update an extension
                break;
 
        case "0.3.1": // SQL queries for v0.3.1
                break;
 
        case "0.3.1": // SQL queries for v0.3.1
-               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Mitglieder-Management' WHERE action = 'user' AND what='' LIMIT 1";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Mitglieder-Management' WHERE action = 'user' AND (what='' OR what IS NULL) LIMIT 1";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Verwaltung auf Management umgestellt";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Verwaltung auf Management umgestellt";
index b34984bea3e7d698f6de991edb5f2ca896c529a3..0df74774293936a86b5e7ae9fa8314f397166f9d 100644 (file)
@@ -83,8 +83,8 @@ case "update": // Update an extension
        break;
 
 default: // Do stuff when extension is loaded
        break;
 
 default: // Do stuff when extension is loaded
-       $DUMMY = LOAD_CONFIG("0");
-       unset($DUMMY);
+       $dummy = LOAD_CONFIG();
+       unset($dummy);
        break;
 }
 
        break;
 }
 
index 7462021a9d7bae989751a6eaee7f8b8ec45c0d61..25ae3c78fcf6b8b0d8802f7b8e76672512ffb727 100644 (file)
@@ -1187,15 +1187,21 @@ function TRANSLATE_YESNO($yn)
 // Deprecated : $length
 // Optional   : $DATA
 //
 // Deprecated : $length
 // Optional   : $DATA
 //
-function GEN_RANDOM_CODE($length, $code, $uid, $DATA="")
-{
+function GEN_RANDOM_CODE($length, $code, $uid, $DATA="") {
        global $_CONFIG;
 
        global $_CONFIG;
 
+       // Fix missing _MAX constant
+       if (!defined('_MAX')) define('_MAX', 15235);
+
        // Build server string
        $server = $_SERVER['PHP_SELF'].":".getenv('HTTP_USER_AGENT').":".getenv('SERVER_SOFTWARE').":".getenv('REMOTE_ADDR').":".":".filemtime(PATH."inc/databases.php");
 
        // Build key string
        // Build server string
        $server = $_SERVER['PHP_SELF'].":".getenv('HTTP_USER_AGENT').":".getenv('SERVER_SOFTWARE').":".getenv('REMOTE_ADDR').":".":".filemtime(PATH."inc/databases.php");
 
        // Build key string
-       $keys   = SITE_KEY.":".DATE_KEY.":".$_CONFIG['secret_key'].":".$_CONFIG['file_hash'].":".date("d-m-Y (l-F-T)", $_CONFIG['patch_ctime']).":".$_CONFIG['master_salt'];
+       $keys   = SITE_KEY.":".DATE_KEY;
+       if (isset($_CONFIG['secret_key']))  $keys .= ":".$_CONFIG['secret_key'];
+       if (isset($_CONFIG['file_hash']))   $keys .= ":".$_CONFIG['file_hash'];
+       $keys .= ":".date("d-m-Y (l-F-T)", $_CONFIG['patch_ctime']);
+       if (isset($_CONFIG['master_salt'])) $keys .= ":".$_CONFIG['master_salt'];
 
        // Build string from misc data
        $data   = $code.":".$uid.":".$DATA;
 
        // Build string from misc data
        $data   = $code.":".$uid.":".$DATA;
@@ -1211,11 +1217,19 @@ function GEN_RANDOM_CODE($length, $code, $uid, $DATA="")
        // Calculate number for generating the code
        $a = $code + _ADD - 1;
 
        // Calculate number for generating the code
        $a = $code + _ADD - 1;
 
-       // Generate hash with master salt from modula of number with the prime number and other data
-       $saltedHash = generateHash(($a % _PRIME).":".$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a, $_CONFIG['master_salt']);
+       if (isset($_CONFIG['master_hash'])) {
+               // Generate hash with master salt from modula of number with the prime number and other data
+               $saltedHash = generateHash(($a % _PRIME).":".$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a, $_CONFIG['master_salt']);
 
 
-       // Create number from hash
-       $rcode = hexdec(substr($saltedHash, strlen($_CONFIG['master_salt']), 9)) / abs(_MAX - $a + sqrt(_ADD)) / pi();
+               // Create number from hash
+               $rcode = hexdec(substr($saltedHash, strlen($_CONFIG['master_salt']), 9)) / abs(_MAX - $a + sqrt(_ADD)) / pi();
+       } else {
+               // Generate hash with "hash of site key" from modula of number with the prime number and other data
+               $saltedHash = generateHash(($a % _PRIME).":".$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a, substr(sha1(SITE_KEY), 0, 8));
+
+               // Create number from hash
+               $rcode = hexdec(substr($saltedHash, 8, 9)) / abs(_MAX - $a + sqrt(_ADD)) / pi();
+       }
 
        // At least 10 numbers shall be secure enought!
        $len = $_CONFIG['code_length'];
 
        // At least 10 numbers shall be secure enought!
        $len = $_CONFIG['code_length'];
index 704ffd2cff6da6418f266085c34ddab7f9e1b7e7..aa9f78a6b7d9994a39f8c55aa04e1539bab01997 100644 (file)
@@ -55,7 +55,9 @@ if (($header != "1") && ($header != "2")) {
                                $TITLE .= MAIN_TITLE;
 
                                // Add title of module? (middle decoration will also be added!)
                                $TITLE .= MAIN_TITLE;
 
                                // Add title of module? (middle decoration will also be added!)
-                               if (($_CONFIG['enable_mod_title'] == 'Y') || ((empty($GLOBALS['what'])) && (empty($GLOBALS['action']))) || ($GLOBALS['module'] == "admin")) $TITLE .= " ".trim($_CONFIG['title_middle'])." ".ADD_MODULE_TITLE($GLOBALS['module']);
+                               if (isset($_CONFIG['enable_mod_title'])) {
+                                       if (($_CONFIG['enable_mod_title'] == 'Y') || ((empty($GLOBALS['what'])) && (empty($GLOBALS['action']))) || ($GLOBALS['module'] == "admin")) $TITLE .= " ".trim($_CONFIG['title_middle'])." ".ADD_MODULE_TITLE($GLOBALS['module']);
+                               } // END - if
 
                                // Add title from what file
                                $MODE = "";
 
                                // Add title from what file
                                $MODE = "";
index e0c63d5316edbbd00164ae6d7fe890aefe552253..6f43da5bb6f92b86db3eed27f3b3683915f865df 100644 (file)
@@ -356,7 +356,7 @@ function GENERATE_SPONSOR_MENU($current)
 
        // Load main menu entries
        $result_main = SQL_QUERY("SELECT action, title FROM "._MYSQL_PREFIX."_sponsor_menu
 
        // Load main menu entries
        $result_main = SQL_QUERY("SELECT action, title FROM "._MYSQL_PREFIX."_sponsor_menu
-WHERE what='' ".$WHERE."
+WHERE (what='' OR what IS NULL) ".$WHERE."
 ORDER BY sort", __FILE__, __LINE__);
        if (SQL_NUMROWS($result_main) > 0)
        {
 ORDER BY sort", __FILE__, __LINE__);
        if (SQL_NUMROWS($result_main) > 0)
        {
index 82337575ee6fa11e6853dcb71b8ff1245beefaa1..75b0c422be5d182e635be63fed865f1b59125be8 100644 (file)
@@ -59,14 +59,12 @@ if (file_exists(PATH."inc/extensions/ext-sql_patches.php") && is_readable(PATH."
 //
 // Load extensions
 //
 //
 // Load extensions
 //
-if (EXT_IS_ACTIVE("cache"))
-{
+if (EXT_IS_ACTIVE("cache")) {
        // Load cache extension alone
        include_once(PATH."inc/libs/cache_functions.php");
        $cacheMode = "";
        include_once(PATH."inc/extensions/ext-cache.php");
        // Load cache extension alone
        include_once(PATH."inc/libs/cache_functions.php");
        $cacheMode = "";
        include_once(PATH."inc/extensions/ext-cache.php");
-       switch($cacheInstance->cache_file("extensions", true))
-       {
+       switch($cacheInstance->cache_file("extensions", true)) {
                case true : $cacheMode = "load"; break;
                case false: $cacheMode = "init"; break;
        }
                case true : $cacheMode = "load"; break;
                case false: $cacheMode = "init"; break;
        }
@@ -80,8 +78,7 @@ if (EXT_IS_ACTIVE("cache"))
        $cacheMode = "no";
 }
 
        $cacheMode = "no";
 }
 
-if ($cacheMode == "load")
-{
+if ($cacheMode == "load") {
        // Load more cache files (like admins)
        require_once(PATH."inc/load_cache.php");
 
        // Load more cache files (like admins)
        require_once(PATH."inc/load_cache.php");
 
@@ -90,14 +87,12 @@ if ($cacheMode == "load")
 
        // Load extension data from cache file
        $EXT_DUMMY = $cacheInstance->cache_load();
 
        // Load extension data from cache file
        $EXT_DUMMY = $cacheInstance->cache_load();
-       foreach ($EXT_DUMMY['ext_name'] as $k=>$name)
-       {
+       foreach ($EXT_DUMMY['ext_name'] as $k=>$name) {
                // Load functions file
                if ($EXT_DUMMY['ext_funcs'][$k] == 'Y') require_once(PATH."inc/libs/".$name."_functions.php");
 
                // Load Language file
                // Load functions file
                if ($EXT_DUMMY['ext_funcs'][$k] == 'Y') require_once(PATH."inc/libs/".$name."_functions.php");
 
                // Load Language file
-               if ($EXT_DUMMY['ext_lang'][$k] == 'Y')
-               {
+               if ($EXT_DUMMY['ext_lang'][$k] == 'Y') {
                        $INC = sprintf(PATH."inc/language/%s_%s.php", $name, GET_LANGUAGE());
                        if (file_exists($INC)) require_once($INC);
                }
                        $INC = sprintf(PATH."inc/language/%s_%s.php", $name, GET_LANGUAGE());
                        if (file_exists($INC)) require_once($INC);
                }
@@ -106,8 +101,7 @@ if ($cacheMode == "load")
                if ($EXT_DUMMY['ext_css'][$k] == 'Y') $EXT_CSS_FILES[] = "".$name.".css";
 
                // Load extension file itself
                if ($EXT_DUMMY['ext_css'][$k] == 'Y') $EXT_CSS_FILES[] = "".$name.".css";
 
                // Load extension file itself
-               if (($EXT_DUMMY['ext_active'][$k] == 'Y') || ($EXT_DUMMY['ext_keep'][$k] == 'Y') || (IS_ADMIN()))
-               {
+               if (($EXT_DUMMY['ext_active'][$k] == 'Y') || ($EXT_DUMMY['ext_keep'][$k] == 'Y') || (IS_ADMIN())) {
                        require_once(PATH."inc/extensions/ext-".$name.".php");
                }
 
                        require_once(PATH."inc/extensions/ext-".$name.".php");
                }
 
@@ -143,22 +137,17 @@ if ($cacheMode == "load")
 
        // No database load needed
        $res_ext_crt = false;
 
        // No database load needed
        $res_ext_crt = false;
-}
- else
-{
+} else {
        // If current user is not admin load only activated extensions
        // The admin shall use every available extension for testing purposes
        if ((!IS_ADMIN()) && ($cacheMode != "init")) $ADD = " WHERE ext_active='Y'";
 
        // If current user is not admin load only activated extensions
        // The admin shall use every available extension for testing purposes
        if ((!IS_ADMIN()) && ($cacheMode != "init")) $ADD = " WHERE ext_active='Y'";
 
-       if (GET_EXT_VERSION("sql_patches") >= "0.0.6")
-       {
+       if (GET_EXT_VERSION("sql_patches") >= "0.0.6") {
                // Query with CSS file from DB
                $res_ext_crt = SQL_QUERY("SELECT id, ext_name, ext_lang_file, ext_has_css, ext_active, ext_version
 FROM "._MYSQL_PREFIX."_extensions".$ADD."
 ORDER BY ext_name", __FILE__, __LINE__);
                // Query with CSS file from DB
                $res_ext_crt = SQL_QUERY("SELECT id, ext_name, ext_lang_file, ext_has_css, ext_active, ext_version
 FROM "._MYSQL_PREFIX."_extensions".$ADD."
 ORDER BY ext_name", __FILE__, __LINE__);
-       }
-        else
-       {
+       } else {
                // Old obsulete query string
                $res_ext_crt = SQL_QUERY("SELECT id, ext_name, ext_lang_file, ext_name, ext_active, ext_version
 FROM "._MYSQL_PREFIX."_extensions".$ADD."
                // Old obsulete query string
                $res_ext_crt = SQL_QUERY("SELECT id, ext_name, ext_lang_file, ext_name, ext_active, ext_version
 FROM "._MYSQL_PREFIX."_extensions".$ADD."
index 2fc9b17210f64f4a2e8239b30a437c47fc30c500..a56c7a10f131cd5d7387b1ec97c0c73453b96966 100644 (file)
@@ -300,7 +300,7 @@ function ADMIN_DO_ACTION($wht)
 
        // Check if action/what pair is valid
        $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu
 
        // Check if action/what pair is valid
        $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu
-WHERE action='%s' AND ((what='%s' AND what != 'overview') OR (what='' AND '%s'='overview'))
+WHERE action='%s' AND ((what='%s' AND what != 'overview') OR ((what='' OR what IS NULL) AND '%s'='overview'))
 LIMIT 1", array($act, $wht, $wht), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 1)
        {
 LIMIT 1", array($act, $wht, $wht), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 1)
        {
@@ -346,7 +346,7 @@ function ADD_ADMIN_MENU($act, $wht,$return=false)
        $menuTitle = array();
 
        // Build main menu
        $menuTitle = array();
 
        // Build main menu
-       $result_main = SQL_QUERY("SELECT action, title, descr FROM "._MYSQL_PREFIX."_admin_menu WHERE what='' ORDER BY sort, id DESC", __FILE__, __LINE__);
+       $result_main = SQL_QUERY("SELECT action, title, descr FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) ORDER BY sort, id DESC", __FILE__, __LINE__);
        $OUT = "";
        if (SQL_NUMROWS($result_main) > 0)
        {
        $OUT = "";
        if (SQL_NUMROWS($result_main) > 0)
        {
@@ -522,7 +522,7 @@ function ADD_MEMBER_SELECTION_BOX($add_all = false, $return = false, $none = fal
 //
 function ADMIN_MENU_SELECTION($MODE, $default="", $defid="") {
        $wht = "what != ''";
 //
 function ADMIN_MENU_SELECTION($MODE, $default="", $defid="") {
        $wht = "what != ''";
-       if ($MODE == "action") $wht = "what='' AND action !='login'";
+       if ($MODE == "action") $wht = "(what='' OR what IS NULL) AND action !='login'";
        $result = SQL_QUERY_ESC("SELECT %s, title FROM "._MYSQL_PREFIX."_admin_menu WHERE ".$wht." ORDER BY sort",
         array($MODE), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0)
        $result = SQL_QUERY_ESC("SELECT %s, title FROM "._MYSQL_PREFIX."_admin_menu WHERE ".$wht." ORDER BY sort",
         array($MODE), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0)
index bd2d9f1b33f75a91a7cdbb7e5305b2019a48bee5..7c938cb84f7c52be384d0d775cab76f9eeca8616 100644 (file)
@@ -54,7 +54,7 @@ if (!isset($_POST['ok']))
        $menus = array(); $titles = array(); $below = array();
 
        // Get all available main menus
        $menus = array(); $titles = array(); $below = array();
 
        // Get all available main menus
-       $result = SQL_QUERY("SELECT action, title, sort FROM "._MYSQL_PREFIX."_admin_menu WHERE what='' ORDER BY sort", __FILE__, __LINE__);
+       $result = SQL_QUERY("SELECT action, title, sort FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) ORDER BY sort", __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0)
        {
                // Read menu structure
        if (SQL_NUMROWS($result) > 0)
        {
                // Read menu structure
index ab9fa33a99fb3628b877247bf4a0d51399efa588..4b4970f406756fce00dc613107437203e843e233 100644 (file)
@@ -216,11 +216,11 @@ WHERE ".$AND." AND id=%d LIMIT 1",
                 else
                {
                        // Main menu selected
                 else
                {
                        // Main menu selected
-                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu WHERE what='' AND sort='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1",
                         array(bigintval($_GET['tid'])), __FILE__, __LINE__);
                        list($tid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
                         array(bigintval($_GET['tid'])), __FILE__, __LINE__);
                        list($tid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
-                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu WHERE what='' AND sort='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1",
                         array(bigintval($_GET['fid'])), __FILE__, __LINE__);
                        list($fid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
                         array(bigintval($_GET['fid'])), __FILE__, __LINE__);
                        list($fid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
@@ -246,7 +246,7 @@ WHERE ".$AND." AND id=%d LIMIT 1",
         else
        {
                // Main menus
         else
        {
                // Main menus
-               $result = SQL_QUERY("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_admin_menu WHERE what='' ORDER BY sort ASC", __FILE__, __LINE__);
+               $result = SQL_QUERY("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) ORDER BY sort ASC", __FILE__, __LINE__);
        }
        $max = SQL_NUMROWS($result);
        if ($max > 0)
        }
        $max = SQL_NUMROWS($result);
        if ($max > 0)
index 414d847ce009b7547e1c7996a7f2c393b7399b67..de1be885ddf4a9b27c3bd35a42214a79a99886e9 100644 (file)
@@ -55,7 +55,7 @@ if (!isset($_POST['ok']))
        $menus = array(); $titles = array(); $below = array();
 
        // Get all available main menus
        $menus = array(); $titles = array(); $below = array();
 
        // Get all available main menus
-       $result = SQL_QUERY("SELECT action, title, sort FROM "._MYSQL_PREFIX."_guest_menu WHERE what='' ORDER BY sort", __FILE__, __LINE__);
+       $result = SQL_QUERY("SELECT action, title, sort FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) ORDER BY sort", __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0)
        {
                // Read menu structure
        if (SQL_NUMROWS($result) > 0)
        {
                // Read menu structure
index a6565aead787d06c9651e913013f00dc4f103ffc..ea87d80141b940fe37690ec949fe96ba1656bbfc 100644 (file)
@@ -266,11 +266,11 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO()))
                 else
                {
                        // Main menu selected
                 else
                {
                        // Main menu selected
-                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_guest_menu WHERE what='' AND sort='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1",
                         array(bigintval($_GET['tid'])), __FILE__, __LINE__);
                        list($tid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
                         array(bigintval($_GET['tid'])), __FILE__, __LINE__);
                        list($tid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
-                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_guest_menu WHERE what='' AND sort='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1",
                         array(bigintval($_GET['fid'])), __FILE__, __LINE__);
                        list($fid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
                         array(bigintval($_GET['fid'])), __FILE__, __LINE__);
                        list($fid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
@@ -290,7 +290,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO()))
        if (empty($SUB))
        {
                // List only main menus
        if (empty($SUB))
        {
                // List only main menus
-               $query = SQL_QUERY("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_guest_menu WHERE what='' ORDER BY sort ASC", __FILE__, __LINE__);
+               $query = SQL_QUERY("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) ORDER BY sort ASC", __FILE__, __LINE__);
        }
         else
        {
        }
         else
        {
index d420e0b8d4354b07a09101a29fbcb577645c7957..eaef1cdfdb0c442220e104825b4b6d148e8a4984 100644 (file)
@@ -56,7 +56,7 @@ if (!isset($_POST['ok']))
        $menus = array(); $titles = array(); $below = array();
 
        // Get all available main menus
        $menus = array(); $titles = array(); $below = array();
 
        // Get all available main menus
-       $result = SQL_QUERY("SELECT action, title, sort FROM "._MYSQL_PREFIX."_member_menu WHERE what='' ORDER BY sort", __FILE__, __LINE__);
+       $result = SQL_QUERY("SELECT action, title, sort FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) ORDER BY sort", __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0)
        {
                // Read menu structure
        if (SQL_NUMROWS($result) > 0)
        {
                // Read menu structure
index e8e635dbbf15f091d4553240b3b96cdc79a30be9..d240fc7d6349596bb412307850310f1f7cbeebcd 100644 (file)
@@ -244,10 +244,10 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO()))
                 else
                {
                        // Main menu selected
                 else
                {
                        // Main menu selected
-                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_member_menu WHERE what='' AND sort='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1",
                         array(bigintval($_GET['tid'])), __FILE__, __LINE__);
                        list($tid) = SQL_FETCHROW($result);
                         array(bigintval($_GET['tid'])), __FILE__, __LINE__);
                        list($tid) = SQL_FETCHROW($result);
-                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_member_menu WHERE what='' AND sort='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1",
                         array(bigintval($_GET['fid'])), __FILE__, __LINE__);
                        list($fid) = SQL_FETCHROW($result);
                }
                         array(bigintval($_GET['fid'])), __FILE__, __LINE__);
                        list($fid) = SQL_FETCHROW($result);
                }
@@ -270,7 +270,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO()))
         else
        {
                // Edit main menus
         else
        {
                // Edit main menus
-               $result = SQL_QUERY("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_member_menu WHERE what='' ORDER BY sort ASC", __FILE__, __LINE__);
+               $result = SQL_QUERY("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) ORDER BY sort ASC", __FILE__, __LINE__);
        }
        $max = SQL_NUMROWS($result);
        if ($max > 0)
        }
        $max = SQL_NUMROWS($result);
        if ($max > 0)
index 5cc0294ff5cc99d2322c21b581e602961e1ab989..b3a769dfddf14457778011eeb91927b9257bd481 100644 (file)
@@ -43,7 +43,7 @@ ADD_DESCR("admin", basename(__FILE__));
 global $link;
 $ACTIONS = array();
 // First fix all main menus (what="")...
 global $link;
 $ACTIONS = array();
 // First fix all main menus (what="")...
-$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_admin_menu WHERE what='' AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
+$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
 $cnt = 0; $REP = 0;
 while(list($id, $act) = SQL_FETCHROW($result_fix))
 {
 $cnt = 0; $REP = 0;
 while(list($id, $act) = SQL_FETCHROW($result_fix))
 {
@@ -58,7 +58,7 @@ while(list($id, $act) = SQL_FETCHROW($result_fix))
        $cnt++;
 }
 // Set logout weight to 999
        $cnt++;
 }
 // Set logout weight to 999
-$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort='999' WHERE act='logout' AND what='' LIMIT 1", __FILE__, __LINE__);
+$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort='999' WHERE act='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__);
 
 // Now sort every each menu
 foreach ($ACTIONS as $act)
 
 // Now sort every each menu
 foreach ($ACTIONS as $act)
index a9b1844ca1f20ae35bdc09486705da476efd43c2..35f926b828e8b51ed2e69102e6daf58c9fbc8bdc 100644 (file)
@@ -43,7 +43,7 @@ ADD_DESCR("admin", basename(__FILE__));
 global $link;
 $ACTIONs = array();
 // First fix all main menus (what="")...
 global $link;
 $ACTIONs = array();
 // First fix all main menus (what="")...
-$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_admin_menu WHERE what='' AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
+$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
 $cnt = 0; $REP = 0;
 while(list($id, $act) = SQL_FETCHROW($result_fix))
 {
 $cnt = 0; $REP = 0;
 while(list($id, $act) = SQL_FETCHROW($result_fix))
 {
@@ -63,7 +63,7 @@ while(list($id, $act) = SQL_FETCHROW($result_fix))
 SQL_FREERESULT($result_fix);
 
 // Set logout weight to 999
 SQL_FREERESULT($result_fix);
 
 // Set logout weight to 999
-$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort='999' WHERE action='logout' AND what='' LIMIT 1", __FILE__, __LINE__);
+$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort='999' WHERE action='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__);
 
 // Now sort every each menu
 foreach ($ACTIONs as $act)
 
 // Now sort every each menu
 foreach ($ACTIONs as $act)
index b3dc3b729386984c0572d4b12d673c87438c64f4..6859336b8cdfa7a888173bb9fde6af0034ea2c7a 100644 (file)
@@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 $ACTIONS = array();
 // First fix all main menus (what="")...
 
 $ACTIONS = array();
 // First fix all main menus (what="")...
-$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_guest_menu WHERE what='' AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
+$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
 $cnt = 0; $REP = 0;
 while(list($id, $act) = SQL_FETCHROW($result_fix))
 {
 $cnt = 0; $REP = 0;
 while(list($id, $act) = SQL_FETCHROW($result_fix))
 {
@@ -57,7 +57,7 @@ while(list($id, $act) = SQL_FETCHROW($result_fix))
        $cnt++;
 }
 // Set logout weight to 999
        $cnt++;
 }
 // Set logout weight to 999
-$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_guest_menu SET sort='999' WHERE act='logout' AND what='' LIMIT 1", __FILE__, __LINE__);
+$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_guest_menu SET sort='999' WHERE act='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__);
 
 // Now sort every each menu
 foreach ($ACTIONS as $act)
 
 // Now sort every each menu
 foreach ($ACTIONS as $act)
index 905e16d5a257d0983fbb1c3e1adbb34a0d25edf5..85e635484a5a0f6e927a59a4f74cb378dddb369a 100644 (file)
@@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 $ACTIONS = array();
 // First fix all main menus (what="")...
 
 $ACTIONS = array();
 // First fix all main menus (what="")...
-$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_guest_menu WHERE what='' AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
+$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
 $cnt = 0; $REP = 0;
 while(list($id, $act) = SQL_FETCHROW($result_fix))
 {
 $cnt = 0; $REP = 0;
 while(list($id, $act) = SQL_FETCHROW($result_fix))
 {
@@ -62,7 +62,7 @@ while(list($id, $act) = SQL_FETCHROW($result_fix))
 SQL_FREERESULT($result_fix);
 
 // Set logout weight to 999
 SQL_FREERESULT($result_fix);
 
 // Set logout weight to 999
-$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_guest_menu SET sort='999' WHERE action='logout' AND what='' LIMIT 1", __FILE__, __LINE__);
+$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_guest_menu SET sort='999' WHERE action='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__);
 
 // Now sort every each menu
 foreach ($ACTIONS as $act)
 
 // Now sort every each menu
 foreach ($ACTIONS as $act)
index 0bb45740ece012887e79a5f5db3bac82dfec6165..23d67de7f28577cb32e28f75ea0c88c8bd1f2ede 100644 (file)
@@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 $ACTIONS = array();
 // First fix all main menus (what="")...
 
 $ACTIONS = array();
 // First fix all main menus (what="")...
-$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_member_menu WHERE what='' AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
+$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
 $cnt = 0; $REP = 0;
 while(list($id, $act) = SQL_FETCHROW($result_fix))
 {
 $cnt = 0; $REP = 0;
 while(list($id, $act) = SQL_FETCHROW($result_fix))
 {
@@ -57,7 +57,7 @@ while(list($id, $act) = SQL_FETCHROW($result_fix))
        $cnt++;
 }
 // Set logout weight to 999
        $cnt++;
 }
 // Set logout weight to 999
-$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_member_menu SET sort='999' WHERE action='logout' AND what='' LIMIT 1", __FILE__, __LINE__);
+$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_member_menu SET sort='999' WHERE action='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__);
 
 // Now sort every each menu
 foreach ($ACTIONS as $act)
 
 // Now sort every each menu
 foreach ($ACTIONS as $act)
index e2eb30b1bd82c4f491020739c27320f1f2a04e25..0eeb00cd14c519f4f96063a9ef3b84baddb24f62 100644 (file)
@@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 $ACTIONS = array();
 // First fix all main menus (what="")...
 
 $ACTIONS = array();
 // First fix all main menus (what="")...
-$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_member_menu WHERE what='' AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
+$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
 $cnt = 0; $REP = 0;
 while(list($id, $act) = SQL_FETCHROW($result_fix))
 {
 $cnt = 0; $REP = 0;
 while(list($id, $act) = SQL_FETCHROW($result_fix))
 {
@@ -62,7 +62,7 @@ while(list($id, $act) = SQL_FETCHROW($result_fix))
 SQL_FREERESULT($result_fix);
 
 // Set logout weight to 999
 SQL_FREERESULT($result_fix);
 
 // Set logout weight to 999
-$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_member_menu SET sort='999' WHERE action='logout' AND what='' LIMIT 1", __FILE__, __LINE__);
+$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_member_menu SET sort='999' WHERE action='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__);
 
 // Now sort every each menu
 foreach ($ACTIONS as $act)
 
 // Now sort every each menu
 foreach ($ACTIONS as $act)
index bdfc0cd94aada47832ce84a84ef7d4da1d62c8a5..20f4233310d567c28386d0cce369264da24c1bf6 100644 (file)
@@ -119,9 +119,6 @@ LIMIT 1", __FILE__, __LINE__);
                                                define('__DAILY_RESET', "1");
                                        }
 
                                                define('__DAILY_RESET', "1");
                                        }
 
-                                       // Load all extensions
-                                       require_once(PATH."inc/load_extensions.php");
-
                                        // Load "databases" aka static arrays
                                        require_once(PATH."inc/databases.php");
 
                                        // Load "databases" aka static arrays
                                        require_once(PATH."inc/databases.php");
 
@@ -233,7 +230,6 @@ LIMIT 1", __FILE__, __LINE__);
        // Include required files
        require_once(PATH."inc/databases.php");
        require_once(PATH."inc/theme-manager.php");
        // Include required files
        require_once(PATH."inc/databases.php");
        require_once(PATH."inc/theme-manager.php");
-       require_once(PATH."inc/load_extensions.php");
 
        // Check if we are in installation routine
        $installPhp = basename($_SERVER['PHP_SELF']);
 
        // Check if we are in installation routine
        $installPhp = basename($_SERVER['PHP_SELF']);
index 637424ef9dcd6b05d1ae0d09ca2f1b4fbd6fb10f..757c19a1fc3585dbe92d470a3ee02b5866500d9a 100644 (file)
@@ -209,7 +209,7 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) {
                        $MOD_CHECK = $GLOBALS['module'];
                        break;
                }
                        $MOD_CHECK = $GLOBALS['module'];
                        break;
                }
-               $AND = " AND what=''";
+               $AND = " AND (what='' OR what IS NULL)";
        } elseif (ereg("what-", $file)) {
                // This is an admin what file!
                $type = "what";
        } elseif (ereg("what-", $file)) {
                // This is an admin what file!
                $type = "what";
@@ -306,7 +306,7 @@ function ADD_MENU($MODE, $act, $wht) {
        }
 
        // Load SQL data and add the menu to the output stream...
        }
 
        // Load SQL data and add the menu to the output stream...
-       $result_main = SQL_QUERY_ESC("SELECT title, action FROM "._MYSQL_PREFIX."_%s_menu WHERE what='' ".$AND." ORDER BY sort",
+       $result_main = SQL_QUERY_ESC("SELECT title, action FROM "._MYSQL_PREFIX."_%s_menu WHERE (what='' OR what IS NULL) ".$AND." ORDER BY sort",
         array($MODE), __FILE__, __LINE__);
        //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
        if (SQL_NUMROWS($result_main) > 0) {
         array($MODE), __FILE__, __LINE__);
        //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
        if (SQL_NUMROWS($result_main) > 0) {
@@ -679,7 +679,7 @@ function VALIDATE_MENU_ACTION ($MODE, $act, $wht, $UPDATE=false)
         else
        {
                // Admin login overview
         else
        {
                // Admin login overview
-               $SQL = SQL_QUERY_ESC("SELECT id, what FROM "._MYSQL_PREFIX."_%s_menu WHERE action='%s' AND what=''".$ADD." ORDER BY action DESC LIMIT 1",
+               $SQL = SQL_QUERY_ESC("SELECT id, what FROM "._MYSQL_PREFIX."_%s_menu WHERE action='%s' AND (what='' OR what IS NULL)".$ADD." ORDER BY action DESC LIMIT 1",
                 array($MODE, $act), __FILE__, __LINE__, false);
        }
 
                 array($MODE, $act), __FILE__, __LINE__, false);
        }