Surfbar text updated, more masks applied, footer/timing removed in frametester module
authorRoland Häder <roland@mxchange.org>
Sun, 31 Aug 2008 23:06:08 +0000 (23:06 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 31 Aug 2008 23:06:08 +0000 (23:06 +0000)
31 files changed:
.gitattributes
inc/db/lib-mysql3.php
inc/extensions.php
inc/extensions/ext-surfbar.php
inc/footer.php
inc/language/de.php
inc/libs/surfbar_functions.php [new file with mode: 0644]
inc/modules/admin/action-
inc/modules/admin/action-admins.php
inc/modules/admin/action-bank.php
inc/modules/admin/action-country.php
inc/modules/admin/action-doubler.php
inc/modules/admin/action-email.php
inc/modules/admin/action-holiday.php
inc/modules/admin/action-login.php
inc/modules/admin/action-setup.php
inc/modules/admin/action-sponsor.php
inc/modules/admin/action-surfbar.php [new file with mode: 0644]
inc/modules/admin/what-config_order.php
inc/modules/admin/what-config_surfbar.php [new file with mode: 0644]
inc/modules/admin/what-extensions.php
inc/modules/admin/what-list_surfbar_urls.php [new file with mode: 0644]
inc/modules/admin/what-unlock_emails.php
inc/modules/frametester.php
inc/modules/guest/action-themes.php
inc/modules/login.php
inc/modules/member/action-themes.php
inc/modules/member/what-order.php
inc/modules/order.php
mailid_top.php
templates/de/html/ext/ext_surfbar.tpl

index 1a02466..4283e03 100644 (file)
@@ -198,6 +198,7 @@ inc/libs/register_functions.php -text
 inc/libs/rewrite_functions.php -text
 inc/libs/security_functions.php -text
 inc/libs/sponsor_functions.php -text
+inc/libs/surfbar_functions.php -text
 inc/libs/task_functions.php -text
 inc/libs/transfer_functions.php -text
 inc/libs/user_functions.php -text
@@ -231,6 +232,7 @@ inc/modules/admin/action-repair.php -text
 inc/modules/admin/action-setup.php -text
 inc/modules/admin/action-sponsor.php -text
 inc/modules/admin/action-stats.php -text
+inc/modules/admin/action-surfbar.php -text
 inc/modules/admin/action-task.php -text
 inc/modules/admin/action-theme.php -text
 inc/modules/admin/action-transfer.php -text
@@ -287,6 +289,7 @@ inc/modules/admin/what-config_rewrite.php -text
 inc/modules/admin/what-config_secure.php -text
 inc/modules/admin/what-config_sponsor.php -text
 inc/modules/admin/what-config_stats.php -text
+inc/modules/admin/what-config_surfbar.php -text
 inc/modules/admin/what-config_title.php -text
 inc/modules/admin/what-config_top10.php -text
 inc/modules/admin/what-config_transfer.php -text
@@ -326,6 +329,7 @@ inc/modules/admin/what-list_refs.php -text
 inc/modules/admin/what-list_sponsor.php -text
 inc/modules/admin/what-list_sponsor_pay.php -text
 inc/modules/admin/what-list_sponsor_pays.php -text
+inc/modules/admin/what-list_surfbar_urls.php -text
 inc/modules/admin/what-list_task.php -text
 inc/modules/admin/what-list_transfer.php -text
 inc/modules/admin/what-list_unconfirmed.php -text
index b64e393..95e4090 100644 (file)
@@ -236,10 +236,11 @@ function SQL_INSERTID() {
 // Escape a string for the database
 function SQL_ESCAPE($str) {
        global $link;
+
        if (!is_resource($link)) {
                // Fall-back to addslashes() when there is no link
                return addslashes($str);
-       }
+       } // END - if
 
        if (function_exists('mysql_real_escape_string')) {
                // The new and improved version
@@ -260,5 +261,30 @@ function SQL_RESULT_FROM_ARRAY ($table, $columns, $idRow, $id) {
        // Return the result
        return SQL_QUERY_ESC($SQL, array(bigintval($id)), __FILE__, __LINE__);
 }
+// ALTER TABLE wrapper function
+function SQL_ALTER_TABLE($sql, $F, $L) {
+       // Shall we add?
+       if (eregi("ADD", $sql) > 0) {
+               // Extract table name
+               $tableArray = explode(" ", $sql);
+               $tableName = str_replace("`", "", $tableArray[2]);
+
+               // And column name as well
+               $columnName = str_replace("`", "", $tableArray[4]);
+
+               // Get column information
+               $result = SQL_QUERY_ESC("SHOW COLUMNS FROM %s LIKE '%s'",
+                       array($tableName, $columnName), __FILE__, __LINE__);
+
+               // Do we have no entry?
+               if (SQL_NUMROWS($result) == 0) {
+                       // Do the query
+                       return SQL_QUERY($sql, $F, $L, false);
+               } // END - if
+       } else {
+               // Send it to the SQL_QUERY() function
+               return SQL_QUERY($sql, $F, $L, false);
+       }
+}
 //
 ?>
index abad4d7..06b5fc8 100644 (file)
@@ -165,8 +165,14 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false)
 
                                        // Is there still an SQL query?
                                        if (!empty($sql)) {
-                                               // Run SQL command
-                                               $result = SQL_QUERY($sql, __FILE__, __LINE__, false);
+                                               // Do we have an "ALTER TABLE" command?
+                                               if (substr(strtolower($sql), 0, 11) == "alter table") {
+                                                       // Analyse the alteration command
+                                                       SQL_ALTER_TABLE($sql, __FILE__, __LINE__);
+                                               } else {
+                                                       // Run regular SQL command
+                                                       $result = SQL_QUERY($sql, __FILE__, __LINE__, false);
+                                               }
                                        } // END - if
                                } // END - foreach
 
@@ -255,8 +261,14 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) {
 
                        // Is there still an SQL query?
                        if (!empty($sql)) {
-                               // Run SQL command
-                               $result = SQL_QUERY($sql, __FILE__, __LINE__, false);
+                               // Do we have an "ALTER TABLE" command?
+                               if (substr(strtolower($sql), 0, 11) == "alter table") {
+                                       // Analyse the alteration command
+                                       SQL_ALTER_TABLE($sql, __FILE__, __LINE__);
+                               } else {
+                                       // Run regular SQL command
+                                       $result = SQL_QUERY($sql, __FILE__, __LINE__, false);
+                               }
                        } // END - if
                } // END - foreach
 
@@ -431,8 +443,14 @@ function EXTENSION_UPDATE($file, $ext, $EXT_VER, $dry_run=false)
                                        $sql = trim($sql);
                                        if (!empty($sql))
                                        {
-                                               // Run SQL command...
-                                               $result = SQL_QUERY($sql, __FILE__, __LINE__, false);
+                                               // Do we have an "ALTER TABLE" command?
+                                               if (substr(strtolower($sql), 0, 11) == "alter table") {
+                                                       // Analyse the alteration command
+                                                       SQL_ALTER_TABLE($sql, __FILE__, __LINE__);
+                                               } else {
+                                                       // Run regular SQL command
+                                                       $result = SQL_QUERY($sql, __FILE__, __LINE__, false);
+                                               }
                                        }
                                }
                        } elseif (GET_EXT_VERSION("sql_patches") == "") {
@@ -482,14 +500,12 @@ function EXTENSION_UPDATE($file, $ext, $EXT_VER, $dry_run=false)
        }
 }
 //
-function EXTENSION_VERBOSE_TABLE($SQLs, $title=ADMIN_SQLS_EXECUTED_ON_REMOVAL, $dashed="", $switch=false, $WIDTH="480")
-{
+function EXTENSION_VERBOSE_TABLE($SQLs, $title = ADMIN_SQLS_EXECUTED_ON_REMOVAL, $dashed = "", $switch = false, $WIDTH = "480") {
        global $_CONFIG;
 
        $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")) && ($_CONFIG['verbose_sql'] == "Y")) {
                $OUT  = "<DIV align=\"center\">
 <TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"".$WIDTH."\" align=\"center\"".$dashed.">
 <TR>
@@ -497,11 +513,9 @@ function EXTENSION_VERBOSE_TABLE($SQLs, $title=ADMIN_SQLS_EXECUTED_ON_REMOVAL, $
     <STRONG>".$title.":</STRONG>
   </TD>
 </TR>\n";
-               foreach ($SQLs as $idx=>$sql)
-               {
+               foreach ($SQLs as $idx => $sql) {
                        $sql = trim($sql);
-                       if (!empty($sql))
-                       {
+                       if (!empty($sql)) {
                                $S = true;
                                $OUT .= "<TR>
   <TD class=\"switch_sw".(3 - $SW)." bottom2\" style=\"padding-left: 2px\" width=\"30\">".$i.".</TD>
@@ -515,8 +529,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")) && ($_CONFIG['verbose_sql'] == "Y")) {
                // No addional SQL commands to run
                $OUT .= "<TR>
   <TD colspan=\"2\" align=\"center\" class=\"switch_sw2 bottom2\" height=\"24\">
@@ -530,6 +543,8 @@ function EXTENSION_VERBOSE_TABLE($SQLs, $title=ADMIN_SQLS_EXECUTED_ON_REMOVAL, $
                $OUT .= "</TABLE>
 </DIV>\n";
        }
+
+       // Return output
        return $OUT;
 }
 //
index 501d7af..500f8d3 100644 (file)
@@ -49,7 +49,7 @@ $EXT_VER_HISTORY = array("0.0");
 switch ($EXT_LOAD_MODE)
 {
 case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
-       // SQL commands to run
+       // SQL commands to run (surfbar URLs)
        $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_urls`";
        $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_urls` (
 `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
@@ -64,6 +64,8 @@ case "register": // Do stuff when installtion is running (modules.php?module=adm
 PRIMARY KEY(`id`),
 UNIQUE KEY `userid_url` (`userid`, `url`)
 ) TYPE=MyISAM COMMENT='Surfbar URLs'";
+
+       // Reload locks
        $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_locks`";
        $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_locks` (
 `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
@@ -74,19 +76,42 @@ 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)";
+
+       // Reload locks
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_reflevels`";
+       $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_reflevels` (
+`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
+`level` SMALLINT(6) NOT NULL DEFAULT '0',
+`percent` FLOAT(10,5) NOT NULL DEFAULT '0.00000',
+PRIMARY KEY(`id`)
+) TYPE=MyISAM COMMENT='Surfbar referal levels'";
+
+       // Config entries
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_pay_mode` ENUM('STATIC','DYNAMIC') NOT NULL DEFAULT 'STATIC'";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_reward` FLOAT(20,5) NOT NULL DEFAULT '0.25000'";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_time` SMALLINT(6) NOT NULL DEFAULT '60'";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_lock` SMALLINT(6) NOT NULL DEFAULT '".(60*60)."'";
+
+       // Member menus
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar',NULL,'Surfbar','Y','Y',5)";
+       $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','Surfbar buchen','Y','Y',2)";
+
+       // Admin menus
+       $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','list_surfbar_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','unlock_surfbar_urls','Wartende 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','list_surfbar_reflvl','Referal-Ebenen einstellen','Stellen Sie hier die prozentuale Verg&uuml;tung f&uuml;r Refs ein. Es wird nur die Basisverg&uuml;tung zur Rechengrundlage der Referalverg&uuml;tung verwendet.',3)";
+       $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.',4)";
        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";
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_reflevels`";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_member_menu` WHERE `action`='surfbar' LIMIT 3";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE action='surfbar' LIMIT 5";
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 4811010..381b1f9 100644 (file)
@@ -48,12 +48,12 @@ if (($footer != "1") && ($footer != "2") && ($CSS != "1")) {
        }
 
        // Shall we display the copyright notice?
-       if ((empty($frame)) && (basename($_SERVER['PHP_SELF']) != "mailid_top.php") && (isBooleanConstantAndTrue('WRITE_FOOTER'))) {
+       if ((empty($frame)) && (!isset($_GET['frame'])) && (basename($_SERVER['PHP_SELF']) != "mailid_top.php") && (isBooleanConstantAndTrue('WRITE_FOOTER'))) {
                LOAD_TEMPLATE("copyright");
        }
 
        // Shall we display the parsing time and number of queries?
-       if ((isset($_CONFIG['show_timings'])) && ($_CONFIG['show_timings'] == "Y")) {
+       if ((isset($_CONFIG['show_timings'])) && ($_CONFIG['show_timings'] == "Y") && (!isset($_GET['frame']))) {
                // Then display it here
                DISPLAY_PARSING_TIME_FOOTER();
        }
index 140f3c1..b5b0838 100644 (file)
@@ -769,6 +769,7 @@ define('ADMIN_REG_FAILED_INVALID', "Registrierung fehlgeschlagen: Ung&uuml;tige
 define('ADMIN_REG_FAILED_ID_404', "Registrierung fehlgeschlagen: Erweiterung-ID nicht auffindbar!");
 define('ADMIN_REG_FAILED_404', "Registrierung fehlgeschlagen: Erweiterung nicht auffindbar!");
 define('ADMIN_REG_FAILED_ASSIGED', "Registrierung fehlgeschlagen: Sie sind nicht zugewiesen oder Task ist veraltet!");
+define('ADMIN_REG_FAILED_ALREADY', "Registrierung fehlgeschlagen: Erweiterun bereits installiert.");
 define('ADMIN_NO_EXTENSION_REGISTERED', "Derzeit haben Sie keine Erweiterung in Ihrem {!MT_WORD!} registriert.");
 define('ADMIN_EXTENSION_REGISTERED', "Erweiterung wurde in Ihrem {!MT_WORD!} registriert.");
 define('ADMIN_EXT_ALREADY_REGISTERED', "Erweiterung bereits registriert!");
diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php
new file mode 100644 (file)
index 0000000..9680740
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/31/2008 *
+ * ===============                              Last change: 08/31/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : surfbar_functions.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for surfbar                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer die Surfbar                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Admin has added an URL with given user id
+function SURFBAR_ADMIN_ADD_URL ($url, $uid, $reward) {
+       // Is this really an admin?
+       if (!IS_ADMIN()) {
+               // Then leave here
+               return false;
+       } // END - if
+
+       // Check if that URL does not exist
+       if (SURFBAR_LOOKUP_URL($url, $uid)) {
+               // Already found!
+               return false;
+       } // END - if
+
+       // Register the new URL
+       return SURFBAR_REGISTER_URL($url, $uid, $reward, "CONFIRMED");
+}
+//
+?>
index 984f25f..c68fa76 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // 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);
 }
@@ -42,15 +41,13 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
 ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
-$INC = sprintf(PATH."inc/modules/admin/what-%s.php", $GLOBALS['what']);
-if (file_exists($INC))
-{
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (file_exists($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index a4a1d73..9e4c6b2 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // 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);
 }
@@ -43,13 +42,10 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if ((file_exists($INC)) && (is_readable($INC))) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
 //
index 58d393c..16ca06e 100644 (file)
@@ -42,15 +42,13 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
 ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
-$INC = PATH."inc/modules/admin/what-".$GLOBALS['what'].".php";
-if (file_exists($INC))
-{
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if ((file_exists($INC)) && (is_readable($INC))) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index 342f2b0..7a1950c 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // 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);
 }
@@ -43,14 +42,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if ((file_exists($INC)) && (is_readable($INC))) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index 6f553f0..f4a7922 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // 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);
 }
@@ -43,14 +42,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf(."%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if ((file_exists($INC)) && (is_readable($INC))) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index a2a221c..1e28604 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // 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);
 }
@@ -43,14 +42,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if ((file_exists($INC)) && (is_readable($INC))) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index a9ee8cb..f350201 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // 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);
 }
@@ -43,14 +42,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if ((file_exists($INC)) && (is_readable($INC))) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index 17a0d0d..9111fbd 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // 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);
 }
@@ -43,14 +42,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if ((file_exists($INC)) && (is_readable($INC))) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index b9e372c..7f28d82 100644 (file)
@@ -43,7 +43,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC)) {
+if ((file_exists($INC)) && (is_readable($INC))) {
        // Ok, we finally load the admin action module
        include($INC);
 } else {
index a841ef6..fcb23d1 100644 (file)
@@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC)) {
+if ((file_exists($INC)) && (is_readable($INC))) {
        // Ok, we finally load the admin action module
        include($INC);
 } else {
diff --git a/inc/modules/admin/action-surfbar.php b/inc/modules/admin/action-surfbar.php
new file mode 100644 (file)
index 0000000..5ac0fe9
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/31/2008 *
+ * ===============                              Last change: 08/31/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-surfbar.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Main menu for surfbar extension                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Hauptmneue fuer surfbar-Erweiterun               *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (file_exists($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
index 1453b98..1c8e8dd 100644 (file)
@@ -45,7 +45,7 @@ if (isset($_POST['ok'])) {
        ADMIN_SAVE_SETTINGS($_POST);
 } else {
        // Prepare constants for the template
-       switch ($_CONFIG['order_max'])
+       switch ($_CONFIG['order_max_full'])
        {
        case "ORDER":
                define('__ORDER_DEFAULT', ' checked');
diff --git a/inc/modules/admin/what-config_surfbar.php b/inc/modules/admin/what-config_surfbar.php
new file mode 100644 (file)
index 0000000..e49887b
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/31/2008 *
+ * ================                             Last change: 08/31/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_surfbar.php                          *
+ * -------------------------------------------------------------------- *
+ * Short description : Configuration for surfbar                        *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Konfiguration fuer Surfbar                       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+die("<pre>".print_r($_CONFIG, true)."</pre>");
+
+//
+?>
index b6a7d36..fb79f0a 100644 (file)
@@ -315,6 +315,9 @@ case "register": // Register new extension
                                        if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
                                        if ($cacheInstance->cache_file("mod_reg"   , true)) $cacheInstance->cache_destroy();
                                }
+                       } elseif (GET_EXT_VERSION($ext_name) != "") {
+                               // Motify the admin that we have a problem here...
+                               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_ALREADY);
                        } else {
                                // Motify the admin that we have a problem here...
                                LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_404);
diff --git a/inc/modules/admin/what-list_surfbar_urls.php b/inc/modules/admin/what-list_surfbar_urls.php
new file mode 100644 (file)
index 0000000..49d6eb6
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/31/2008 *
+ * ================                             Last change: 08/31/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_surfbar_urls.php                       *
+ * -------------------------------------------------------------------- *
+ * Short description : List all URLs in surfbar and sync from mail pool *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle URLs in Surfbar auflisten und syncen        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// First list all booked URLs (no bonus!)
+
+//
+?>
index ddc051d..37eec82 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);
 }
+
 // Add description as navigation point
 ADD_DESCR("admin", basename(__FILE__));
 
@@ -47,43 +47,41 @@ global $DATA, $link;
 $result_main = SQL_QUERY("SELECT id, sender, subject, payment_id, timestamp, url, target_send, cat_id FROM "._MYSQL_PREFIX."_pool WHERE data_type='ADMIN' ORDER BY timestamp", __FILE__, __LINE__);
 
 OPEN_TABLE("100%", "admin_content admin_content_align", "");
-if ((SQL_NUMROWS($result_main) > 0) || (isset($_POST['lock'])))
-{
+if ((SQL_NUMROWS($result_main) > 0) || (isset($_POST['lock']))) {
        // Count checked checkboxes
        $SEL = 0;
-       if (isset($_POST['sel']))
-       {
+       if (isset($_POST['sel'])) {
                // Are there checked boxes?
-               if (count($_POST['sel']) > 0)
-               {
+               if (count($_POST['sel']) > 0) {
                        // Count now... We use an own function for now
                        $SEL = SELECTION_COUNT($_POST['sel']);
                }
        }
-       if (isset($_POST['accept']))
-       {
-               if ($SEL > 0)
-               {
+
+       if (isset($_POST['accept'])) {
+               if ($SEL > 0) {
                        // Accept mail orders
-                       foreach ($_POST['sel'] as $id=>$value)
-                       {
+                       foreach ($_POST['sel'] as $id => $value) {
                                // Secure ID number
                                $id = bigintval($id);
 
                                // Unlock selected email
-                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET data_type='NEW' WHERE id=%d AND data_type='ADMIN' LIMIT 1",
-                                array($id), __FILE__, __LINE__);
-                               if (SQL_AFFECTEDROWS($link, __FILE__, __LINE__) == 1)
-                               {
+                               //$result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET data_type='NEW' WHERE id=%d AND data_type='ADMIN' LIMIT 1",
+                               // array($id), __FILE__, __LINE__);
+                               if (SQL_AFFECTEDROWS($link, __FILE__, __LINE__) == 1) {
                                        // Order placed in queue...
-                                       $result = SQL_QUERY_ESC("SELECT url, subject, sender FROM "._MYSQL_PREFIX."_pool WHERE id=%d LIMIT 1",
+                                       $result = SQL_QUERY_ESC("SELECT po.url, po.subject, po.sender, pay.payment
+FROM "._MYSQL_PREFIX."_pool AS po
+INNER JOIN "._MYSQL_PREFIX."_payments AS pay
+ON po.payment_id=pay.id
+WHERE po.id=%d
+LIMIT 1",
                                         array($id), __FILE__, __LINE__);
                                        $DATA = SQL_FETCHROW($result);
                                        SQL_FREERESULT($result);
 
                                        // Check for bonus extension version >= 0.4.4 for the order bonus
-                                       if ((GET_EXT_VERSION("bonus") >= "0.4.4") && ($_CONFIG['bonus_active'] == "Y"))
-                                       {
+                                       if ((GET_EXT_VERSION("bonus") >= "0.4.4") && ($_CONFIG['bonus_active'] == "Y")) {
                                                // Add points directly
                                                $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET bonus_order=bonus_order+".$_CONFIG['bonus_order']." WHERE userid=%d LIMIT 1",
                                                 array(bigintval($DATA[2])), __FILE__, __LINE__);
@@ -92,6 +90,12 @@ if ((SQL_NUMROWS($result_main) > 0) || (isset($_POST['lock'])))
                                                BONUS_POINTS_HANDLER($_CONFIG['bonus_order']);
                                        }
 
+                                       // Check for surfbar extension
+                                       if (EXT_IS_ACTIVE("surfbar")) {
+                                               // Add the url
+                                               SURFBAR_ADMIN_ADD_URL($DATA[0], $DATA[2], $DATA[3]);
+                                       } // END - if
+
                                        // Load email template
                                        $msg_user = LOAD_EMAIL_TEMPLATE("order-accept", "", $DATA[2]);
 
@@ -102,24 +106,18 @@ if ((SQL_NUMROWS($result_main) > 0) || (isset($_POST['lock'])))
 
                        // Set message
                        $MSG = ADMIN_MAILS_ACTIVATED;
-               }
-                else
-               {
+               } else {
                        // Nothing checked!
                        $MSG = ADMIN_MAILS_NOTHING_CHECKED;
                }
 
                // Mails unlocked for mail delivery
                LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
-       }
-        elseif (isset($_POST['reject']))
-       {
-               if ($SEL > 0)
-               {
+       } elseif (isset($_POST['reject'])) {
+               if ($SEL > 0) {
                        // Reject mail orders
                        $SW = 2; $OUT = "";
-                       foreach ($_POST['sel'] as $id=>$value)
-                       {
+                       foreach ($_POST['sel'] as $id=>$value) {
                                // Secure ID number
                                $id = bigintval($id);
 
@@ -155,30 +153,22 @@ if ((SQL_NUMROWS($result_main) > 0) || (isset($_POST['lock'])))
 
                        // Load main template
                        LOAD_TEMPLATE("admin_unlock_emails_redir");
-               }
-                else
-               {
+               } else {
                        // Nothing selected
                        LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_MAILS_NOTHING_CHECKED);
                }
-       }
-        elseif ((isset($_POST['lock'])) || ($SEL > 0))
-       {
-               if ($SEL > 0)
-               {
+       } elseif ((isset($_POST['lock'])) || ($SEL > 0)) {
+               if ($SEL > 0) {
                        // Lock URLs
-                       foreach ($_POST['sel'] as $id=>$url)
-                       {
+                       foreach ($_POST['sel'] as $id=>$url) {
+                               // Lookup in blacklist
                                $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_url_blist WHERE url='%s' LIMIT 1",
                                 array($url), __FILE__, __LINE__);
-                               if (SQL_NUMROWS($result) == 0)
-                               {
+                               if (SQL_NUMROWS($result) == 0) {
                                        // Did not find a record so we can add it... :)
                                        $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_url_blist (url, timestamp) VALUES ('%s', UNIX_TIMESTAMP())",
                                         array($url), __FILE__, __LINE__);
-                               }
-                                else
-                               {
+                               } else {
                                        // Free memory
                                        SQL_FREERESULT($result);
                                }
@@ -186,16 +176,12 @@ if ((SQL_NUMROWS($result_main) > 0) || (isset($_POST['lock'])))
 
                        // Set message
                        $MSG = ADMIN_URLS_BLOCKED;
-               }
-                else
-               {
+               } else {
                        // Nothing selected
                        $MSG = ADMIN_MAILS_NOTHING_CHECKED;
                }
                LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
-       }
-        elseif ((empty($_POST['lock'])) && (empty($_POST['accept'])) && (empty($_POST['reject'])))
-       {
+       } elseif ((empty($_POST['lock'])) && (empty($_POST['accept'])) && (empty($_POST['reject']))) {
                // Mail orders are in pool so we can display them
                $SW = 2; $OUT = "";
                while (list($id, $sender, $subj, $pay, $time, $url, $tsend, $cat) = SQL_FETCHROW($result_main))
@@ -233,15 +219,11 @@ if ((SQL_NUMROWS($result_main) > 0) || (isset($_POST['lock'])))
 
                // Load main template
                LOAD_TEMPLATE("admin_unlock_emails");
-       }
-        else
-       {
+       } else {
                // Wrong call!
                LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_WRONG_CALL);
        }
-}
- else
-{
+} else {
        // No mail orders fond
        LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_MAILS_IN_POOL);
 }
index a66a557..a6daa40 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);
 }
 
 $MODE = "guest";
 
-if (!empty($_GET['order']))
-{
+if (!empty($_GET['order'])) {
        // Order number placed, is he also logged in?
-       if(IS_LOGGED_IN())
-       {
+       if(IS_LOGGED_IN()) {
                // Ok, test passed... :)
                $result = SQL_QUERY_ESC("SELECT subject, url FROM "._MYSQL_PREFIX."_pool WHERE id=%d AND sender=%d AND data_type='TEMP' LIMIT 1",
                 array(bigintval($_GET['order']), $GLOBALS['userid']), __FILE__, __LINE__);
 
                // Finally is the entry valid?
-               if (SQL_NUMROWS($result) == 1)
-               {
+               if (SQL_NUMROWS($result) == 1) {
                        // Load subject and URL (but forwhat do we need the subject line here???
                        list($sub, $url) = SQL_FETCHROW($result);
 
@@ -61,25 +57,20 @@ if (!empty($_GET['order']))
                        // Update his login data
                        UPDATE_LOGIN_DATA();
                        $MODE = "member";
-               }
-                else
-               {
+               } else {
                        // Matching line not found!
                        LOAD_URL("modules.php?module=index&amp;what=login");
                }
 
                // Free memory
                SQL_FREERESULT($result);
-       }
-        else
-       {
+       } else {
                // He is no longer logged in
                LOAD_URL("modules.php?module=index&amp;what=login");
        }
 }
 
-if ((!empty($_POST['url'])) || (!empty($_GET['url'])) || (!empty($_GET['frame'])))
-{
+if ((!empty($_POST['url'])) || (!empty($_GET['url'])) || (!empty($_GET['frame']))) {
        $url = URL;
        if (!empty($_POST['url'])) $url = $_POST['url'];
        if (!empty($_GET['url']))  $url = base64_decode(urldecode(COMPILE_CODE($_GET['url'])));
@@ -114,9 +105,7 @@ if ((!empty($_POST['url'])) || (!empty($_GET['url'])) || (!empty($_GET['frame'])
                LOAD_TEMPLATE("member_order_send", false, $_GET['order']);
                break;
        }
-}
- else
-{
+} else {
        // Go away...
        LOAD_URL("modules.php?module=login");
 }
index 6027284..aedec8b 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);
 }
 
+// Already loaded?
+if (defined('__THEME_SELECTION_CONTENT')) return false;
+
 // Load all active designs (or all if admin)
 $whereStatement = ""; $OUT = "";
 if (!IS_ADMIN()) $whereStatement = " WHERE theme_active='Y'";
 $result_themes = SQL_QUERY("SELECT theme_path FROM "._MYSQL_PREFIX."_themes".$whereStatement, __FILE__, __LINE__);
 $num_themes = SQL_NUMROWS($result_themes);
 
-if ($num_themes > 1)
-{
+if ($num_themes > 1) {
        // If more than 1 is installed output selection box
        $act = "";
        if (!empty($GLOBALS['action'])) $act = SQL_ESCAPE($GLOBALS['action']);
        $OUT = THEME_SELECTION_BOX("index", $act, $GLOBALS['what'], $result_themes);
-}
- elseif (($num_themes == 1) || ((!IS_ADMIN()) && ($num_themes == 0)))
-{
+} elseif (($num_themes == 1) || ((!IS_ADMIN()) && ($num_themes == 0))) {
        // If there's only one just print it's name
        global $THEME_NAME;
        define('__THEME_NAME', $THEME_NAME);
        $OUT = LOAD_TEMPLATE("theme_one", true);
-}
- elseif (IS_ADMIN())
-{
+} elseif (IS_ADMIN()) {
        // If there is no theme installed and there's an admin notify him!
        $OUT = LOAD_TEMPLATE("admin_settings_saved", true, "<FONT class=\"admin_note\">".ADMIN_NO_THEME_INSTALLED_WARNING."</FONT>");
 }
index f220ec1..f440389 100644 (file)
@@ -100,7 +100,7 @@ if (($_CONFIG['member_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true)))
 OUTPUT_HTML("   </TD>
   <TD valign=\"top\" align=\"center\" rowspan=\"3\" class=\"member_content\">");
 
-$INC_ACTION = sprintf(."%sinc/modules/member/action-%s.php", PATH, $act);
+$INC_ACTION = sprintf("%sinc/modules/member/action-%s.php", PATH, $act);
 if ((file_exists($INC_ACTION)) && (is_readable($INC_ACTION)) && (VALIDATE_MENU_ACTION("member", GET_ACTION("member", $GLOBALS['what']), $GLOBALS['what'])))
 {
        // Requested module is available so we load it
index c9cba3d..af8452c 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()) {
        LOAD_URL("modules.php?module=index");
 }
 
+// Already defined?
+if (defined('__THEME_SELECTION_CONTENT')) return false;
+
 // Load all active designs (or all if admin)
 $whereStatement = ""; $OUT = "";
 if (!IS_ADMIN()) $whereStatement = " WHERE theme_active='Y'";
 $result_themes = SQL_QUERY("SELECT theme_path FROM "._MYSQL_PREFIX."_themes".$whereStatement, __FILE__, __LINE__);
 $num_themes = SQL_NUMROWS($result_themes);
 
-if ($num_themes > 1)
-{
+if ($num_themes > 1) {
        // If more than 1 is installed output selection box
        $act = ""; $wht = "";
        if (!empty($GLOBALS['action'])) $act = SQL_ESCAPE($GLOBALS['action']);
        if (!empty($GLOBALS['what']))   $wht = SQL_ESCAPE($GLOBALS['what']);
        $OUT = THEME_SELECTION_BOX("login", $act, $wht, $result_themes);
-}
- elseif (($num_themes == 1) || ((!IS_ADMIN()) && ($num_themes == 0)))
-{
+} elseif (($num_themes == 1) || ((!IS_ADMIN()) && ($num_themes == 0))) {
        // If there's only one just print it's name
        global $THEME_NAME;
        define('__THEME_NAME', $THEME_NAME);
        $OUT = LOAD_TEMPLATE("theme_one", true);
-}
- elseif (IS_ADMIN())
-{
+} elseif (IS_ADMIN()) {
        // If there is no theme installed and there's an admin notify him!
        $OUT = LOAD_TEMPLATE("admin_settings_saved", true, "<FONT class=\"admin_note\">".ADMIN_NO_THEME_INSTALLED_WARNING."</FONT>");
 }
index 9635d3d..a71d44f 100644 (file)
@@ -95,7 +95,7 @@ SQL_FREERESULT($result_mmails);
 if ($HOLIDAY == $DMY) $HOLIDAY='N';
 
 $ALLOWED = $MAXI - $ORDERS;
-if ($_CONFIG['order_max'] == "MAX") $ALLOWED = $MAXI;
+if ($_CONFIG['order_max_full'] == "MAX") $ALLOWED = $MAXI;
 
 // Check HTML extension
 $HTML_EXT = EXT_IS_ACTIVE("html_mail");
@@ -446,7 +446,7 @@ array(
        // Not enougth receivers selected
        $URL = URL."/modules.php?module=login&amp;what=order&amp;msg=".CODE_MORE_RECEIVERS1;
 }
- elseif (($ALLOWED == 0) && ($_CONFIG['order_max'] == "ORDER"))
+ elseif (($ALLOWED == 0) && ($_CONFIG['order_max_full'] == "ORDER"))
 {
        // No more mail orders allowed
        LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_ORDER_ALLOWED_EXHAUSTED);
@@ -648,7 +648,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
                                $TOTAL = TRANSLATE_COMMA($TOTAL);
 
                                // Check how many mail orders he has placed today and how many he's allowed to send
-                               switch ($_CONFIG['order_max'])
+                               switch ($_CONFIG['order_max_full'])
                                {
                                case "MAX": // He is allowed to send as much as possible
                                        define('ORDER_MAX_VALUE', ORDER_ALLOED_MAX);
index f64f69b..e51354e 100644 (file)
 
 // Some security stuff...
 $URL = "";
-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 ((!EXT_IS_ACTIVE("order")) && (!IS_ADMIN()))
-{
+} elseif ((!EXT_IS_ACTIVE("order")) && (!IS_ADMIN())) {
        ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "order");
        return;
-}
- elseif (!IS_LOGGED_IN())
-{
+} elseif (!IS_LOGGED_IN()) {
        // Sorry, no guest access!
        $URL = URL."/modules.php?module=index";
-}
- elseif (empty($_GET['order']))
-{
+} elseif (empty($_GET['order'])) {
        // You cannot call this module directly!
        $URL = URL."/modules.php?module=login&amp;what=order";
 }
 
 // When URL is empty nothing bad happend here
-if (empty($URL))
-{
+if (empty($URL)) {
        // Is the auto-send mechanism active or inactive?
-       if ($_CONFIG['autosend_active'] == "Y")
-       {
+       if ($_CONFIG['autosend_active'] == "Y") {
                // Auto-send is active
                define('ADMIN_AUTOSEND',  COMPILE_CODE(ADMIN_AUTOSEND_ACTIVE));
                define('MEMBER_AUTOSEND', COMPILE_CODE(MEMBER_AUTOSEND_ACTIVE));
                $type = "NEW";
-       }
-        else
-       {
+       } else {
                // Auto-send is inactive
                define('ADMIN_AUTOSEND',  COMPILE_CODE(ADMIN_AUTOSEND_INACTIVE));
                define('MEMBER_AUTOSEND', COMPILE_CODE(MEMBER_AUTOSEND_INACTIVE));
@@ -78,8 +67,7 @@ if (empty($URL))
         array($type, bigintval($_GET['order']), $GLOBALS['userid']), __FILE__, __LINE__);
 
        // Finally is the entry valid?
-       if (SQL_AFFECTEDROWS($link) == 1)
-       {
+       if (SQL_AFFECTEDROWS($link) == 1) {
                // Update his login data
                UPDATE_LOGIN_DATA();
 
@@ -101,13 +89,12 @@ if (empty($URL))
 
                // Update used points
                $ADD = "";
-               if ($_CONFIG['order_max'] == "ORDER") $ADD = ", mail_orders=mail_orders+1";
+               if ($_CONFIG['order_max_full'] == "ORDER") $ADD = ", mail_orders=mail_orders+1";
                $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET used_points=used_points+%s".$ADD." WHERE userid=%d LIMIT 1",
                 array($USED, $GLOBALS['userid']), __FILE__, __LINE__);
 
                // Update mediadata as well
-               if (GET_EXT_VERSION("mediadata") >= "0.0.4")
-               {
+               if (GET_EXT_VERSION("mediadata") >= "0.0.4") {
                        // Update database
                        MEDIA_UPDATE_ENTRY(array("total_points"), "sub", $USED);
                }
@@ -117,28 +104,21 @@ if (empty($URL))
                SEND_EMAIL($email, MEMBER_NEW_QUEUE, $msg_mem);
 
                // Notify admins about this
-               if (GET_EXT_VERSION("admins") >= "0.4.1")
-               {
+               if (GET_EXT_VERSION("admins") >= "0.4.1") {
                        SEND_ADMIN_EMAILS_PRO(ADMIN_NEW_QUEUE, "order-admin", "", $GLOBALS['userid']);
-               }
-                else
-               {
+               } else {
                        $msg_admin = LOAD_EMAIL_TEMPLATE("order-admin", "", $GLOBALS['userid']);
                        SEND_ADMIN_EMAILS(ADMIN_NEW_QUEUE, $msg_admin);
                }
 
                // Output back bottom
                LOAD_TEMPLATE("member_order-back", false);
-       }
-        else
-       {
+       } else {
                // Matching line not found or already "placed" in send queue
                $URL = URL."/modules.php?module=login";
                LOAD_URL($URL);
        }
-}
- else
-{
+} else {
        // Redirect...
        LOAD_URL($URL);
 }
index 0731b9b..63e4989 100644 (file)
@@ -156,7 +156,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
                                                }
                                                if ($VALID)
                                                {
-                                                       if (($time == "0") && ($payment >0)) $time = "1";
+                                                       if (($time == "0") && ($payment > 0)) $time = "1";
                                                        if (($time > 0) && ($payment > 0))
                                                        {
                                                                if (!empty($code))
index bd29b96..4ea079e 100644 (file)
@@ -15,6 +15,11 @@ Basisverg&uuml;tung gutgeschrieben. Die prozentuale Ref-Verg&uuml;tung wird
 jedoch nur von der Basisverg&uuml;tung berechnet.<br />
 <br />
 Es k&ouml;nnen auch URLs direkt und nur in die Surfbar gebucht werden. Hier
-gilt jedoch ein einstellbarer Festpreis und die Fix-Verg&uuml;tung.<br />
+gilt jedoch ein einstellbarer Festpreis.<br />
+<br />
+Die Wartezeit ist ebenfalls entweder statisch einstellbar, wenn Sie statische
+Verg&uuml;tung eingestellt haben oder dynamisch. Dabei richtet sich ebenfalls
+die Basiswartezeit nach der Verweildauer aus der gebuchten Mails. Bei direkt
+in der Surbar gebuchten URLs gilt eine eingestellte Festzeit und Festpreis.<br />
 <br />
 Das Mitglied kann nicht seine eigenen Seiten besuchen!