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 1a02466916680cb5164309dca41ac9b6edbebc3e..4283e03a3de3e3f5dcf037435612ef53827ad0d4 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 b64e3937ec828ef647e2bec44dc6b9be87949201..95e409042d6c2421e031971dac3c5fa504521d0a 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 abad4d77ae24e30a68f3b0ad22cfe66616d0ced0..06b5fc827e5bad3847734a2ecff10b81484e4528 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 501d7af512db3c3fd2087c165c04016fc154a344..500f8d36eff54708eddf777da96837d59535fe36 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 4811010521816f357667b0b16c4aa7e0dacd2dee..381b1f982d931183948a40d5cd20e9bdfb05a83a 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 140f3c1ad0cff819479b8757874fb93e5dbfd305..b5b0838566881db28ddb00a2ecd6f333e193231e 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 984f25f6ac816ec9e4cc94dbe1c061c8ca090473..c68fa7661e70df027a667b615dc2c0fb66f07826 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 a4a1d738dda34ae5c66a0c4209d0bc74999d6979..9e4c6b28ee5b2db910b592cef6e49ff49444f71f 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 58d393c27fb762ea84d8a424d0ca47300c772630..16ca06e12121a7159beb3b105db9f7260585e66d 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 342f2b0fe11e5b65f106bb50e91b164dc0a93420..7a1950c4d8bd0487c55e2cc7aab90aca92f3c05c 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 6f553f0a32d96f666fac03c09e077d023763ddda..f4a7922f36f947961a45702e14bf15c9e28bab82 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 a2a221c90f03a1c68a67fae1e5517f2c139d4c73..1e28604ed305a843634e2b4f982f5c9bf3be2841 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 a9ee8cbb061d9451ecb2341617d7bf355b0a8cf9..f350201a79552ecbef74bd9317c9c697e74fd6b7 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 17a0d0d3159cfbd213b9799fb7bb6c691be8f8d5..9111fbd95ea03c088543a04e011def008e385eb3 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 b9e372ccad2e072b719dc5c2be5b8f2b86d6bfbd..7f28d820d7c9c3afd673749813c848042dc94075 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 a841ef6d326eb50e156db27d2023dea8732a270f..fcb23d131ddae7cb6562886c117b9fd9e6f6fb1e 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 1453b98473cfe86cdfc22fb854ee5d7eb1af10bd..1c8e8dd9a37fdb185593959cb7ab24e296ac8390 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 b6a7d366578062fb146f87654b9492e42d0292a1..fb79f0a38a53a1242f6f77c021084e1f1f643b55 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 ddc051d56eecb756aab1ab6cd3510d24fc689869..37eec82c610cf30b41c9734f7b24977230a408c1 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 a66a557a8d00a889bae1ea62041ff282d2391c93..a6daa40721cd307f0ec7313acc5ac36bd93642e9 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 6027284df27cbd8ab555f7517918e771378aa026..aedec8bacda7c243b9fb6d844df552d362798780 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 f220ec106d080b4bc69fc1b5ba601805e250035c..f4403897bc4cd450acf51c86995738d899b161af 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 c9cba3d7fa3b2a69848dd7111a59c9a4d99a4ad6..af8452c52940f6411af7e14417aa9ea237c90943 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 9635d3d515f199872130b4fdc2c707e7e1215101..a71d44fdc4b08f1fb7246325f0cfcdcf4cd2161e 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 f64f69be1d55430c86af0f5198e4f19a31d4ae0b..e51354e30e89598b5f833d2e416755d06795bd7f 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 0731b9b531d4de025c97dc1ce448598aa8b0dd1f..63e498998fc367d0ba8e7d83c00d8a512e251727 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 bd29b96d86deea1f10432dc521bf92a89b9ef20f..4ea079e30d4dab4ec34d2cb76419ad4aa908052a 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!