From c72c89ffa5f7f5444d7fd47021db520b77738d9e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 31 Aug 2008 23:06:08 +0000 Subject: [PATCH] Surfbar text updated, more masks applied, footer/timing removed in frametester module --- .gitattributes | 4 + inc/db/lib-mysql3.php | 28 +++++- inc/extensions.php | 47 ++++++---- inc/extensions/ext-surfbar.php | 41 ++++++-- inc/footer.php | 4 +- inc/language/de.php | 1 + inc/libs/surfbar_functions.php | 58 ++++++++++++ inc/modules/admin/action- | 13 +-- inc/modules/admin/action-admins.php | 10 +- inc/modules/admin/action-bank.php | 10 +- inc/modules/admin/action-country.php | 11 +-- inc/modules/admin/action-doubler.php | 11 +-- inc/modules/admin/action-email.php | 11 +-- inc/modules/admin/action-holiday.php | 11 +-- inc/modules/admin/action-login.php | 11 +-- inc/modules/admin/action-setup.php | 2 +- inc/modules/admin/action-sponsor.php | 2 +- inc/modules/admin/action-surfbar.php | 53 +++++++++++ inc/modules/admin/what-config_order.php | 2 +- inc/modules/admin/what-config_surfbar.php | 46 +++++++++ inc/modules/admin/what-extensions.php | 3 + inc/modules/admin/what-list_surfbar_urls.php | 46 +++++++++ inc/modules/admin/what-unlock_emails.php | 98 ++++++++------------ inc/modules/frametester.php | 27 ++---- inc/modules/guest/action-themes.php | 17 ++-- inc/modules/login.php | 2 +- inc/modules/member/action-themes.php | 21 ++--- inc/modules/member/what-order.php | 6 +- inc/modules/order.php | 48 +++------- mailid_top.php | 2 +- templates/de/html/ext/ext_surfbar.tpl | 7 +- 31 files changed, 427 insertions(+), 226 deletions(-) create mode 100644 inc/libs/surfbar_functions.php create mode 100644 inc/modules/admin/action-surfbar.php create mode 100644 inc/modules/admin/what-config_surfbar.php create mode 100644 inc/modules/admin/what-list_surfbar_urls.php diff --git a/.gitattributes b/.gitattributes index 1a02466916..4283e03a3d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index b64e3937ec..95e409042d 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -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); + } +} // ?> diff --git a/inc/extensions.php b/inc/extensions.php index abad4d77ae..06b5fc827e 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -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 = "
@@ -497,11 +513,9 @@ function EXTENSION_VERBOSE_TABLE($SQLs, $title=ADMIN_SQLS_EXECUTED_ON_REMOVAL, $ ".$title.":\n"; - foreach ($SQLs as $idx=>$sql) - { + foreach ($SQLs as $idx => $sql) { $sql = trim($sql); - if (!empty($sql)) - { + if (!empty($sql)) { $S = true; $OUT .= " @@ -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 .= "
".$i.".
@@ -530,6 +543,8 @@ function EXTENSION_VERBOSE_TABLE($SQLs, $title=ADMIN_SQLS_EXECUTED_ON_REMOVAL, $ $OUT .= "
\n"; } + + // Return output return $OUT; } // diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index 501d7af512..500f8d36ef 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -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 ä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 ändern, wie Festvergütung, prozentuale Ref-Vergü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 ä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ütung für Refs ein. Es wird nur die Basisvergütung zur Rechengrundlage der Referalvergütung verwendet.',3)"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','config_surfbar','Einstellungen','Einstellungen an der Surfbar ändern, wie Festvergütung, prozentuale Ref-Vergü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 diff --git a/inc/footer.php b/inc/footer.php index 4811010521..381b1f982d 100644 --- a/inc/footer.php +++ b/inc/footer.php @@ -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(); } diff --git a/inc/language/de.php b/inc/language/de.php index 140f3c1ad0..b5b0838566 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -769,6 +769,7 @@ define('ADMIN_REG_FAILED_INVALID', "Registrierung fehlgeschlagen: Ungü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 index 0000000000..9680740da2 --- /dev/null +++ b/inc/libs/surfbar_functions.php @@ -0,0 +1,58 @@ + diff --git a/inc/modules/admin/action- b/inc/modules/admin/action- index 984f25f6ac..c68fa7661e 100644 --- a/inc/modules/admin/action- +++ b/inc/modules/admin/action- @@ -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); } + // ?> diff --git a/inc/modules/admin/action-admins.php b/inc/modules/admin/action-admins.php index a4a1d738dd..9e4c6b28ee 100644 --- a/inc/modules/admin/action-admins.php +++ b/inc/modules/admin/action-admins.php @@ -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); } // diff --git a/inc/modules/admin/action-bank.php b/inc/modules/admin/action-bank.php index 58d393c27f..16ca06e121 100644 --- a/inc/modules/admin/action-bank.php +++ b/inc/modules/admin/action-bank.php @@ -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); } + // ?> diff --git a/inc/modules/admin/action-country.php b/inc/modules/admin/action-country.php index 342f2b0fe1..7a1950c4d8 100644 --- a/inc/modules/admin/action-country.php +++ b/inc/modules/admin/action-country.php @@ -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); } + // ?> diff --git a/inc/modules/admin/action-doubler.php b/inc/modules/admin/action-doubler.php index 6f553f0a32..f4a7922f36 100644 --- a/inc/modules/admin/action-doubler.php +++ b/inc/modules/admin/action-doubler.php @@ -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); } + // ?> diff --git a/inc/modules/admin/action-email.php b/inc/modules/admin/action-email.php index a2a221c90f..1e28604ed3 100644 --- a/inc/modules/admin/action-email.php +++ b/inc/modules/admin/action-email.php @@ -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); } + // ?> diff --git a/inc/modules/admin/action-holiday.php b/inc/modules/admin/action-holiday.php index a9ee8cbb06..f350201a79 100644 --- a/inc/modules/admin/action-holiday.php +++ b/inc/modules/admin/action-holiday.php @@ -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); } + // ?> diff --git a/inc/modules/admin/action-login.php b/inc/modules/admin/action-login.php index 17a0d0d315..9111fbd95e 100644 --- a/inc/modules/admin/action-login.php +++ b/inc/modules/admin/action-login.php @@ -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); } + // ?> diff --git a/inc/modules/admin/action-setup.php b/inc/modules/admin/action-setup.php index b9e372ccad..7f28d820d7 100644 --- a/inc/modules/admin/action-setup.php +++ b/inc/modules/admin/action-setup.php @@ -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 { diff --git a/inc/modules/admin/action-sponsor.php b/inc/modules/admin/action-sponsor.php index a841ef6d32..fcb23d131d 100644 --- a/inc/modules/admin/action-sponsor.php +++ b/inc/modules/admin/action-sponsor.php @@ -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 index 0000000000..5ac0fe9348 --- /dev/null +++ b/inc/modules/admin/action-surfbar.php @@ -0,0 +1,53 @@ + diff --git a/inc/modules/admin/what-config_order.php b/inc/modules/admin/what-config_order.php index 1453b98473..1c8e8dd9a3 100644 --- a/inc/modules/admin/what-config_order.php +++ b/inc/modules/admin/what-config_order.php @@ -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 index 0000000000..e49887b351 --- /dev/null +++ b/inc/modules/admin/what-config_surfbar.php @@ -0,0 +1,46 @@ +".print_r($_CONFIG, true).""); + +// +?> diff --git a/inc/modules/admin/what-extensions.php b/inc/modules/admin/what-extensions.php index b6a7d36657..fb79f0a38a 100644 --- a/inc/modules/admin/what-extensions.php +++ b/inc/modules/admin/what-extensions.php @@ -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 index 0000000000..49d6eb6914 --- /dev/null +++ b/inc/modules/admin/what-list_surfbar_urls.php @@ -0,0 +1,46 @@ + diff --git a/inc/modules/admin/what-unlock_emails.php b/inc/modules/admin/what-unlock_emails.php index ddc051d56e..37eec82c61 100644 --- a/inc/modules/admin/what-unlock_emails.php +++ b/inc/modules/admin/what-unlock_emails.php @@ -32,11 +32,11 @@ ************************************************************************/ // 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); } diff --git a/inc/modules/frametester.php b/inc/modules/frametester.php index a66a557a8d..a6daa40721 100644 --- a/inc/modules/frametester.php +++ b/inc/modules/frametester.php @@ -32,26 +32,22 @@ ************************************************************************/ // 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&what=login"); } // Free memory SQL_FREERESULT($result); - } - else - { + } else { // He is no longer logged in LOAD_URL("modules.php?module=index&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"); } diff --git a/inc/modules/guest/action-themes.php b/inc/modules/guest/action-themes.php index 6027284df2..aedec8bacd 100644 --- a/inc/modules/guest/action-themes.php +++ b/inc/modules/guest/action-themes.php @@ -32,34 +32,31 @@ ************************************************************************/ // 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, "".ADMIN_NO_THEME_INSTALLED_WARNING.""); } diff --git a/inc/modules/login.php b/inc/modules/login.php index f220ec106d..f4403897bc 100644 --- a/inc/modules/login.php +++ b/inc/modules/login.php @@ -100,7 +100,7 @@ if (($_CONFIG['member_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) OUTPUT_HTML(" "); -$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 diff --git a/inc/modules/member/action-themes.php b/inc/modules/member/action-themes.php index c9cba3d7fa..af8452c529 100644 --- a/inc/modules/member/action-themes.php +++ b/inc/modules/member/action-themes.php @@ -32,39 +32,34 @@ ************************************************************************/ // 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, "".ADMIN_NO_THEME_INSTALLED_WARNING.""); } diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index 9635d3d515..a71d44fdc4 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -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&what=order&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); diff --git a/inc/modules/order.php b/inc/modules/order.php index f64f69be1d..e51354e30e 100644 --- a/inc/modules/order.php +++ b/inc/modules/order.php @@ -33,40 +33,29 @@ // 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&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); } diff --git a/mailid_top.php b/mailid_top.php index 0731b9b531..63e498998f 100644 --- a/mailid_top.php +++ b/mailid_top.php @@ -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)) diff --git a/templates/de/html/ext/ext_surfbar.tpl b/templates/de/html/ext/ext_surfbar.tpl index bd29b96d86..4ea079e30d 100644 --- a/templates/de/html/ext/ext_surfbar.tpl +++ b/templates/de/html/ext/ext_surfbar.tpl @@ -15,6 +15,11 @@ Basisvergütung gutgeschrieben. Die prozentuale Ref-Vergütung wird jedoch nur von der Basisvergütung berechnet.

Es können auch URLs direkt und nur in die Surfbar gebucht werden. Hier -gilt jedoch ein einstellbarer Festpreis und die Fix-Vergütung.
+gilt jedoch ein einstellbarer Festpreis.
+
+Die Wartezeit ist ebenfalls entweder statisch einstellbar, wenn Sie statische +Vergü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.

Das Mitglied kann nicht seine eigenen Seiten besuchen! -- 2.39.5