From: Roland Häder Date: Sat, 7 Mar 2009 06:24:11 +0000 (+0000) Subject: Final fixes for SQL_ALTER_TABLE() wrapper, INSERT INTO queries are still not wrapped... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8a73ce89f88fb09523fce05eb2aff80665e65827;p=mailer.git Final fixes for SQL_ALTER_TABLE() wrapper, INSERT INTO queries are still not wrapped -> Need TODO here --- diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 45c32b2da6..6d47a5c562 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -1,8 +1,8 @@ ### WARNING: THIS FILE IS AUTO-GENERATED BY DOCS/todo-builder.sh ### ### DO NOT EDIT THIS FILE. ### ./beg.php:196: // @TODO Opps, what is missing here??? -./inc/extensions/ext-sql_patches.php:749: // @TODO Rewrite this to a filter! -./inc/extensions/ext-sql_patches.php:787: // @TODO Can we remove this? setConfigEntry('verbose_sql' , "N"); +./inc/extensions/ext-sql_patches.php:754: // @TODO Rewrite this to a filter! +./inc/extensions/ext-sql_patches.php:792: // @TODO Can we remove this? setConfigEntry('verbose_sql' , "N"); ./inc/extensions.php:275:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) ) ./inc/functions.php:1242: // @TODO Rewrite this unnice code ./inc/functions.php:1303: // @TODO Remove this if() block if all is working fine @@ -178,5 +178,6 @@ ./inc/mysql-manager.php:2120: // @TODO This can be somehow rewritten ./inc/mysql-manager.php:617: // @TODO Why is this global??? #100 ./inc/mysql-manager.php:945: // @TODO Why does this lead into an endless loop but we still need it??? +./inc/mysql-manager.php:946: // @TODO Commented out LOAD_URL("admin.php"); ./mailid_top.php:211: // @TODO Rewrite these blocks to filter ./surfbar.php:65: // @TODO Display quick login form here or redirect as configured diff --git a/admin.php b/admin.php index d48c611292..abad82df30 100644 --- a/admin.php +++ b/admin.php @@ -52,8 +52,14 @@ require("inc/config.php"); // Is the script installed? if (isInstalled()) { - // Simply redirect... :-) - LOAD_URL("modules.php?module=admin"); + // Is the admin logged-in and no sql_patches installed? + if ((IS_ADMIN()) && (!EXT_IS_ACTIVE("sql_patches"))) { + // Extension 'sql_patches' is missing! + LOAD_URL("modules.php?module=admin&sql_patches=1"); + } else { + // Default redirect + LOAD_URL("modules.php?module=admin"); + } } else { // You have to install first! LOAD_URL("install.php"); diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index 512bdf43d9..d7f8aa6c58 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -179,7 +179,11 @@ function SQL_FETCHARRAY($res, $nr=0, $remove_numerical=true) { } // SQL result -function SQL_RESULT ($res, $row, $field) { +function SQL_RESULT ($res, $row, $field = 0) { + // Is $res valid? + if (!is_resource($res)) return false; + + // Run the result command and return the result $result = mysql_result($res, $row, $field); return $result; } @@ -327,7 +331,7 @@ function SQL_RESULT_FROM_ARRAY ($table, $columns, $idRow, $id, $F, $L) { } // END - if // Prepare the SQL statement - $sql = "SELECT `".implode("`, `", $columns)."` FROM `{!_MYSQL_PREFIX!}_%s` WHERE ``='%s' LIMIT 1"; + $sql = "SELECT `".implode("`,`", $columns)."` FROM `{!_MYSQL_PREFIX!}_%s` WHERE ``='%s' LIMIT 1"; // Return the result return SQL_QUERY_ESC($sql, @@ -344,30 +348,83 @@ function SQL_ALTER_TABLE ($sql, $F, $L) { $result = false; // Determine index/fulltext/unique word - // 12 3 3 2 2 3 3 2 2 3 3 21 - $noIndex = ((eregi("INDEX", $sql) == false) && (eregi("FULLTEXT", $sql) == false) && (eregi("UNIQUE", $sql) == false)); + // 12 3 3 2 2 3 3 2 2 3 3 21 + $noIndex = ((ereg("INDEX", $sql) == false) && (ereg("FULLTEXT", $sql) == false) && (ereg("UNIQUE", $sql) == false)); - // Shall we add/drop? - if (((eregi("ADD", $sql) > 0) || (eregi("DROP", $sql) > 0)) && ($noIndex)) { - // Extract table name - $tableArray = explode(" ", $sql); - $tableName = str_replace("`", "", $tableArray[2]); + // Extract table name + $tableArray = explode(" ", $sql); + $tableName = str_replace("`", "", $tableArray[2]); + // Shall we add/drop? + if (((ereg("ADD", $sql)) || (ereg("DROP", $sql))) && ($noIndex)) { // 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), $F, $L); + array($tableName, $columnName), __FILE__, __LINE__); // Do we have no entry on ADD or an entry on DROP? - // 123 4 4 3 3 4 4 32 23 4 4 3 3 4 4 321 - if (((SQL_NUMROWS($result) == 0) && (eregi("ADD", $sql) > 0)) || ((SQL_NUMROWS($result) == 1) && (eregi("DROP", $sql) > 0))) { + // 123 4 4 3 3 4 432 23 4 4 3 3 4 4321 + if (((SQL_NUMROWS($result) == 0) && (ereg("ADD", $sql))) || ((SQL_NUMROWS($result) == 1) && (ereg("DROP", $sql)))) { // Do the query + //* DEBUG: */ print __LINE__.":".$sql."
\n"; + $result = SQL_QUERY($sql, $F, $L, false); + } // END - if + } elseif ((constant('_TABLE_TYPE') == "InnoDB") && (ereg("FULLTEXT", $sql))) { + // Skip this query silently + //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Skipped FULLTEXT: sql=%s,file=%s,line=%s", $sql, $F, $L)); + } elseif (!$noIndex) { + // And column name as well + $columnName = str_replace("`", "", $tableArray[4]); + + // Is this "UNIQUE" or so? FULLTEXT has been handled the elseif() block above + if (in_array(strtoupper($columnName), array("INDEX", "UNIQUE", "KEY", "FULLTEXT"))) { + // Init loop + $begin = 1; $columnName = ","; + while (strpos($columnName, ",") !== false) { + // Use last + $columnName = str_replace("`", "", $tableArray[count($tableArray) - $begin]); + //* DEBUG: */ print __LINE__.":".$columnName."----------------".$begin."
\n"; + + // Remove brackes + $columnName = str_replace("(", "", str_replace(")", "", $columnName)); + //* DEBUG: */ print __LINE__.":".$columnName."----------------".$begin."
\n"; + + // Continue + $begin++; + } // END while + } // END - if + + // Show indexes + $result = SQL_QUERY_ESC("SHOW INDEX FROM %s", + array($tableName), __FILE__, __LINE__); + + // Walk through all + $skip = false; + while ($content = SQL_FETCHARRAY($result)) { + // Is it found? + //* DEBUG: */ print "
".print_r($content, true)."
"; + if (($content['Column_name'] == $columnName) || ($content['Key_name'] == $columnName)) { + // Skip this query! + //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Skiped: %s", $sql)); + $skip = true; + break; + } // END - if + } // END - while + + // Free result + SQL_FREERESULT($result); + + // Shall we run it? + if (!$skip) { + // Send it to the SQL_QUERY() function + /* DEBUG: */ print __LINE__.":".$sql."
\n"; $result = SQL_QUERY($sql, $F, $L, false); } // END - if } else { - // Send it to the SQL_QUERY() function + // Other ALTER TABLE query + /* DEBUG: */ print __LINE__.":".$sql."
\n"; $result = SQL_QUERY($sql, $F, $L, false); } diff --git a/inc/extensions.php b/inc/extensions.php index 1fd297707c..56739fe0b5 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -222,8 +222,8 @@ function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = tr runFilterChain('pre_extension_installed', array('dry_run' => $dry_run)); // Register extension - SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_extensions` (ext_name, ext_active, ext_version) VALUES ('%s','%s','%s')", - array($ext_name, EXT_GET_ALWAYS_ACTIVE(), EXT_GET_VERSION()), __FILE__, __LINE__); + //SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_extensions` (ext_name, ext_active, ext_version) VALUES ('%s','%s','%s')", + // array($ext_name, EXT_GET_ALWAYS_ACTIVE(), EXT_GET_VERSION()), __FILE__, __LINE__); // Remove cache file(s) if extension is active runFilterChain('post_extension_installed', array('ext_name' => $ext_name, 'task_id' => $task_id, 'inc_pool' => $INC_POOL)); diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index 0e04449040..17ec62a7a0 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -53,7 +53,7 @@ switch ($EXT_LOAD_MODE) case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('email','send_bonus','Bonusmail senden',5,'Versenden Sie hier Bonus-Mails an alle Mitglieder oder nur an alle aus einer Kategorie. Es spielt keine Rolle, wie viele Mails bereits versendet worden, Sie können hier immer senden.')"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`, `what`, `title`, `sort`, `visible`, `locked`, `counter`) VALUES ('main','bonus','Bonuspunkte',7,'Y','Y', 0)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`,`counter`) VALUES ('main','bonus','Bonuspunkte',7,'Y','Y', 0)"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bonus`"); ADD_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_bonus` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, @@ -161,7 +161,7 @@ KEY userid (userid) case "0.2.3": // SQL queries for v0.2.3 ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='bonus' LIMIT 1"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`, `what`, `title`, `sort`, `visible`, `locked`, `counter`) VALUES ('main','bonus','Aktiv-Rallye',7,'Y','Y', 0)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`,`counter`) VALUES ('main','bonus','Aktiv-Rallye',7,'Y','Y', 0)"); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Aktiv-Rallye mit Klick-Vergütung hinzugefügt."); diff --git a/inc/extensions/ext-holiday.php b/inc/extensions/ext-holiday.php index 68ca92fe32..dfcb6c718b 100644 --- a/inc/extensions/ext-holiday.php +++ b/inc/extensions/ext-holiday.php @@ -70,10 +70,10 @@ PRIMARY KEY(id) ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','holiday','Urlaubsschaltung','4','Y','Y')"); // Add admin menus - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('holiday', NULL, 'Urlaubsmanagement','4','Hier können Sie Urlaubsschaltungen Ihrer Mitglieder auflisten oder auch wieder aufheben.')"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('holiday','list_holiday','Auflisten','1','Alle Urlaubsschaltungen auflisten.')"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('holiday','del_holiday','Urlaub beenden','2','Urlaubsschaltungen aufheben. Geben Sie bitte mehr als nur "Verstoss gegen unsere AGBs" ein!')"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('holiday','config_holiday','Einstellungen','3','Maximale Tage für Urlaub usw. einstellen.')"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('holiday', NULL, 'Urlaubsmanagement','4','Hier können Sie Urlaubsschaltungen Ihrer Mitglieder auflisten oder auch wieder aufheben.')"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('holiday','list_holiday','Auflisten','1','Alle Urlaubsschaltungen auflisten.')"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('holiday','del_holiday','Urlaub beenden','2','Urlaubsschaltungen aufheben. Geben Sie bitte mehr als nur "Verstoss gegen unsere AGBs" ein!')"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('holiday','config_holiday','Einstellungen','3','Maximale Tage für Urlaub usw. einstellen.')"); // Remove 0 max mails per day ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE value='0' LIMIT 1"); diff --git a/inc/extensions/ext-iso3166.php b/inc/extensions/ext-iso3166.php index e367e6c2ea..909c6a0589 100644 --- a/inc/extensions/ext-iso3166.php +++ b/inc/extensions/ext-iso3166.php @@ -77,7 +77,7 @@ case "update": // Update an extension { case "0.0.1": // SQL queries for v0.0.2 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_countries` ADD `provider` ENUM( 'user', 'ext-iso3166' ) NOT NULL DEFAULT 'user';"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_countries` (`code` , `descr`, `provider`) + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_countries` (`code`,`descr`,`provider`) VALUES ('AD', 'Andorra', 'ext-iso3166'), ('AE', 'Vereinigte Arabische Emirate', 'ext-iso3166'), ('AF', 'Afghanistan', 'ext-iso3166'), diff --git a/inc/extensions/ext-order.php b/inc/extensions/ext-order.php index c265fd070b..9dca71ddce 100644 --- a/inc/extensions/ext-order.php +++ b/inc/extensions/ext-order.php @@ -77,7 +77,7 @@ case "update": // Update an extension { case "0.1": // SQL queries for v0.1 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD order_max_full ENUM('ORDER','MAX') NOT NULL DEFAULT 'MAX'"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')"); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Maximale Mailbuchungen sind nun vom maximalen Empfang abhägig."); @@ -85,7 +85,7 @@ case "update": // Update an extension case "0.1.1": // SQL queries for v0.1.1 ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_order' LIMIT 1"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')"); ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD mail_orders BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); // Update notes (these will be set as task text!) diff --git a/inc/extensions/ext-repair.php b/inc/extensions/ext-repair.php index d84bd6fed2..8a48615bd4 100644 --- a/inc/extensions/ext-repair.php +++ b/inc/extensions/ext-repair.php @@ -52,8 +52,8 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair', NULL, 'Reperaturen','7','Repariert u.a. die Kategorie-Auswahlen der Mitglieder usw.')"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair','repair_cats','Kategorieauswahlen','1','Repariert die Kategorieauswahlen Ihrer Mitglieder.')"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('repair', NULL, 'Reperaturen','7','Repariert u.a. die Kategorie-Auswahlen der Mitglieder usw.')"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('repair','repair_cats','Kategorieauswahlen','1','Repariert die Kategorieauswahlen Ihrer Mitglieder.')"); break; case "remove": // Do stuff when removing extension @@ -75,9 +75,9 @@ case "update": // Update an extension switch ($EXT_VER) { case "0.1": // SQL queries for v0.1 - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair','repair_amenu','Admin-Menü', 2, 'Repariert die Gewichtung des Admin-Menü-Systems')"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair','repair_gmenu','Gast-Menü', 3, 'Repariert die Gewichtung des Gäste-Menü-Systems')"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair','repair_mmenu','Mitglied-Menü', 4, 'Repariert die Gewichtung des Mitglieder-Menü-Systems')"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('repair','repair_amenu','Admin-Menü', 2, 'Repariert die Gewichtung des Admin-Menü-Systems')"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('repair','repair_gmenu','Gast-Menü', 3, 'Repariert die Gewichtung des Gäste-Menü-Systems')"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('repair','repair_mmenu','Mitglied-Menü', 4, 'Repariert die Gewichtung des Mitglieder-Menü-Systems')"); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Fügt ein Menüpunkt zur Reperatur der Gewichtung des Admin-Menüs hinzu."); diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php index 6a8da3c463..a3eca42a99 100644 --- a/inc/extensions/ext-sponsor.php +++ b/inc/extensions/ext-sponsor.php @@ -332,36 +332,36 @@ PRIMARY KEY(id) // // Guest menu // - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor', NULL, 'Sponsoren', 2)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor','sponsor_reg','Anmeldung', 1)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor','sponsor_login','Einloggen', 2)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor','sponsor_infos','Infos/Preise', 3)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor','sponsor_agb','AGBs', 4)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`) VALUES ('sponsor', NULL, 'Sponsoren', 2)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`) VALUES ('sponsor','sponsor_reg','Anmeldung', 1)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`) VALUES ('sponsor','sponsor_login','Einloggen', 2)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`) VALUES ('sponsor','sponsor_infos','Infos/Preise', 3)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`) VALUES ('sponsor','sponsor_agb','AGBs', 4)"); // // Member menu // - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`, `what`, `title`, `sort`) VALUES ('main','sponsor','Unsere Sponsoren', 8)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`) VALUES ('main','sponsor','Unsere Sponsoren', 8)"); // // Add default menus to sponsor menu // - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main', NULL, 'Hauptauswahl','N', 1)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','welcome','Willkommen','N', 1)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','account','Ihr Account','N', 2)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','campaigns','Kampagnen','N', 3)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','list_urls','URL-Verwaltung','N', 4)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','list_banner','Banner-Verwaltung','N', 5)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','settings','Einstellungen','N', 6)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','fillup','Konto auffüllen','N', 7)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','stats','Statistiken','N', 8)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','inquiry','Kontaktanfrage','N', 9)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','refid','Referal-Link','N', 10)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('actions', NULL, 'Sponsorenaktionen','N', 2)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('actions','mail','Sponsor-Mail','N', 1)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('actions','banner','Banner buchen','N', 2)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('actions','text','Textlink buchen','N', 3)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('logout', NULL, 'Ausloggen','N', 3)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('logout','logout','Ausloggen','N', 1)"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('logout','guest','Zum Gastbereich','N', 2)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('main', NULL, 'Hauptauswahl','N', 1)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('main','welcome','Willkommen','N', 1)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('main','account','Ihr Account','N', 2)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('main','campaigns','Kampagnen','N', 3)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('main','list_urls','URL-Verwaltung','N', 4)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('main','list_banner','Banner-Verwaltung','N', 5)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('main','settings','Einstellungen','N', 6)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('main','fillup','Konto auffüllen','N', 7)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('main','stats','Statistiken','N', 8)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('main','inquiry','Kontaktanfrage','N', 9)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('main','refid','Referal-Link','N', 10)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('actions', NULL, 'Sponsorenaktionen','N', 2)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('actions','mail','Sponsor-Mail','N', 1)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('actions','banner','Banner buchen','N', 2)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('actions','text','Textlink buchen','N', 3)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('logout', NULL, 'Ausloggen','N', 3)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('logout','logout','Ausloggen','N', 1)"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES ('logout','guest','Zum Gastbereich','N', 2)"); // // General configuration stuff // diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index 0ebaad03a2..e6b870aa4d 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -213,7 +213,7 @@ case "update": // Update an extension case "0.1.1": // SQL queries for v0.1.1 ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `title`='Home-/Eingangsseite', descr='Stellen Sie hier ein, welcher Menüpunkt (what-welcome ist Standart) als Einstiegspunkt in das Menüsystem genutzt werden soll und wie die automatische Weiterleitung in der Eingangsseite funktionieren soll.' WHERE `what`='config_home' LIMIT 1"); - ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD index_delay TINYINT(3) UNSIGNED NOT NULL DEFAULT '-1'"); + ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD index_delay TINYINT(3) UNSIGNED NOT NULL DEFAULT 0"); ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD index_cookie BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*365).""); // Update notes (these will be set as task text!) @@ -530,7 +530,8 @@ PRIMARY KEY (id) break; case "0.4.1": // SQL queries for v0.4.1 - ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP INDEX `status` , ADD INDEX `status` ( `status` , `max_mails` )"); + ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP INDEX `status`"); + ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD INDEX `status_mails` (`status`,`max_mails`)"); ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `show_timings` ENUM ('Y','N') NOT NULL DEFAULT 'Y'"); // Update notes (these will be set as task text!) @@ -560,10 +561,13 @@ PRIMARY KEY (id) ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `what`=NULL WHERE `what`=''"); ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `what`=NULL WHERE `what`=''"); ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `what`=NULL WHERE `what`=''"); - ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admin_menu` DROP INDEX `what`, ADD UNIQUE (`what`)"); - ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` DROP INDEX `what`, ADD UNIQUE (`what`)"); + ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admin_menu` DROP INDEX `what`"); + ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admin_menu` ADD UNIQUE (`what`)"); + ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` DROP INDEX `what`"); + ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` ADD UNIQUE (`what`)"); ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` ADD INDEX `action` (`action`)"); - ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` DROP INDEX `what`, ADD UNIQUE (`what`)"); + ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` DROP INDEX `what`"); + ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` ADD UNIQUE (`what`)"); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Schlüssel in Admin-, Gast- und Mitgliedsmenü verbessert."); @@ -609,7 +613,8 @@ PRIMARY KEY (id) case "0.5.0": // SQL queries for v0.5.0 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_refsystem` DROP INDEX `level`"); - ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_refsystem` DROP INDEX `userid`, ADD UNIQUE `userid_level` (`userid`,`level`)"); + ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_refsystem` DROP INDEX `userid`"); + ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_refsystem` ADD UNIQUE `userid_level` (`userid`,`level`)"); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Referal-System unterstützt nun detailierte Referal-Übersicht und vieles mehr."); @@ -692,6 +697,7 @@ INDEX (`stats_type`) `filter_name` VARCHAR(255) NOT NULL DEFAULT '', `filter_function` VARCHAR(255) NOT NULL DEFAULT '', `filter_active` ENUM('N','Y') NOT NULL DEFAULT 'Y', +`filter_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`filter_id`) ) TYPE={!_TABLE_TYPE!} COMMENT='Filter system'"); ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','list_filter','Filter-Management', 'Zeigt alle im System registrierten Filter an und lässt diese de- bzw. wieder aktivieren.', 17)"); @@ -701,7 +707,6 @@ PRIMARY KEY (`filter_id`) break; case "0.6.0": // SQL queries for v0.6.0 - ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_filters` ADD `filter_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `update_filter_usage` ENUM('N','Y') NOT NULL DEFAULT 'N'"); // Update notes (these will be set as task text!) diff --git a/inc/extensions/ext-task.php b/inc/extensions/ext-task.php index 43e19e1bb8..ced2cc5ac1 100644 --- a/inc/extensions/ext-task.php +++ b/inc/extensions/ext-task.php @@ -52,8 +52,8 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('task', NULL, 'Aufgaben-Management','1','Erweitertes Aufgaben-Management zur leichten verwaltung der vom System erzeugten Aufgaben.')"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('task','list_task','Aufgaben auflisten','1','Alle Ihnen zugewiesenen Aufgaben auflisten (keine Updates).')"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('task', NULL, 'Aufgaben-Management','1','Erweitertes Aufgaben-Management zur leichten verwaltung der vom System erzeugten Aufgaben.')"); + ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('task','list_task','Aufgaben auflisten','1','Alle Ihnen zugewiesenen Aufgaben auflisten (keine Updates).')"); ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET `status`='SOLVED' WHERE `status`='CLOSED'"); break; diff --git a/inc/filters.php b/inc/filters.php index b34c8376a7..9f137a4e04 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -72,7 +72,7 @@ function INIT_FILTER_SYSTEM () { if (GET_EXT_VERSION("sql_patches") >= "0.6.0") $ADD = ", `filter_counter`"; // Load all active filers - $result = SQL_QUERY("SELECT `filter_name`, `filter_function`, `filter_active`".$ADD." + $result = SQL_QUERY("SELECT `filter_name`,`filter_function`,`filter_active`".$ADD." FROM `{!_MYSQL_PREFIX!}_filters` ORDER BY `filter_id` ASC", __FUNCTION__, __LINE__); diff --git a/inc/functions.php b/inc/functions.php index dceab6c671..43ad387361 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -3079,6 +3079,9 @@ function merge_array ($array1, $array2) { function DEBUG_LOG ($funcFile, $line, $message, $force=true) { // Is debug mode enabled? if ((isDebugModeEnabled()) || ($force === true)) { + // Remove CRLF + $message = str_replace("\r", "", str_replace("\n", "", $message)); + // Log this message away $fp = fopen(constant('PATH')."inc/cache/debug.log", 'a') or mxchange_die("Cannot write logfile debug.log!"); fwrite($fp, date("d.m.Y|H:i:s", time())."|".basename($funcFile)."|".$line."|".strip_tags($message)."\n"); diff --git a/inc/gen_refback.php b/inc/gen_refback.php index fd6d4c2b6e..81c0e2345e 100644 --- a/inc/gen_refback.php +++ b/inc/gen_refback.php @@ -55,7 +55,7 @@ if (SQL_NUMROWS($result) > 0) { SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_refsystem` SET level=level+1", __FILE__, __LINE__); // Add it again - SQL_ALTER_TABLE("ALTER TABLE `{!_MYSQL_PREFIX!}_refsystem` ADD UNIQUE `userid_level` ( `userid` , `level` )", __FILE__, __LINE__); + SQL_ALTER_TABLE("ALTER TABLE `{!_MYSQL_PREFIX!}_refsystem` ADD UNIQUE `userid_level` ( `userid`,`level` )", __FILE__, __LINE__); // Rebuild cache rebuildCacheFiles("refsystem", "refsystem"); diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index 86254d81a5..61d12747ef 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -326,7 +326,7 @@ function WERNIS_TRANSFER_STATUS ($status) { // Log the transfer function WERNIS_LOG_TRANSFER ($wdsId, $amount, $type = 'FAILED', $message = "", $status = "") { // Register this wernis movement - SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_wernis` (`userid`, `wernis_account`, `wernis_amount`, `wernis_timestamp`, `wernis_type`, `wernis_api_message`, `wernis_api_status`) VALUES (%d, %d, %d, UNIX_TIMESTAMP(), '%s', '%s', '%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_wernis` (`userid`,`wernis_account`,`wernis_amount`,`wernis_timestamp`,`wernis_type`,`wernis_api_message`,`wernis_api_status`) VALUES (%d, %d, %d, UNIX_TIMESTAMP(), '%s', '%s', '%s')", array(getUserId(), bigintval($wdsId), bigintval($amount), $type, $message, $status), __FUNCTION__, __LINE__); } diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 64e281dc60..38764db505 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -226,7 +226,7 @@ if (!isAdminRegistered()) { // Add data to URL if (!empty($GLOBALS['what'])) $URL .= "what=".$GLOBALS['what']; elseif (!empty($GLOBALS['action'])) $URL .= "action=".$GLOBALS['action']; - elseif (REQUEST_ISSET_GET(('area'))) $URL .= "area=".REQUEST_GET('area'); + elseif (REQUEST_ISSET_GET('area')) $URL .= "area=".REQUEST_GET('area'); // Load URL LOAD_URL($URL); @@ -301,7 +301,7 @@ if (!isAdminRegistered()) { // Set default values $content = array('target' => "action", 'value' => "login"); } - } elseif (REQUEST_ISSET_GET(('area'))) { + } elseif (REQUEST_ISSET_GET('area')) { // Restore old area value $content = array('target' => "area", 'value' => REQUEST_GET('area')); } else { @@ -357,7 +357,7 @@ if (!isAdminRegistered()) { $area = "entrance"; // Check for similar URL variable - if (REQUEST_ISSET_GET(('area'))) $area = REQUEST_GET(('area')); + if (REQUEST_ISSET_GET('area')) $area = REQUEST_GET('area'); // Load "logical-area menu-system" file LOAD_INC_ONCE("inc/modules/admin/lasys-inc.php"); @@ -366,7 +366,7 @@ if (!isAdminRegistered()) { ADMIN_LOGICAL_AREA_SYSTEM($area, $act, $GLOBALS['what']); } else { // This little call constructs the whole default old and lacky menu system - // on left side + // on left side. It also renders the content on right side ADMIN_DO_ACTION($GLOBALS['what']); } break; diff --git a/inc/modules/admin/what-guestedit.php b/inc/modules/admin/what-guestedit.php index 89ad0b85ba..463d73a724 100644 --- a/inc/modules/admin/what-guestedit.php +++ b/inc/modules/admin/what-guestedit.php @@ -270,10 +270,10 @@ if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO())) // By default list menus if (empty($SUB)) { // List only main menus - $result = SQL_QUERY("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT `id`,`action`,`what`,`title`,`sort` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__); } else { // List sub menus - $result = SQL_QUERY_ESC("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC", + $result = SQL_QUERY_ESC("SELECT `id`,`action`,`what`,`title`,`sort` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC", array($SUB), __FILE__, __LINE__); } diff --git a/inc/modules/admin/what-list_surfbar_actions.php b/inc/modules/admin/what-list_surfbar_actions.php index 10cc3ccf8d..4e8a2835ab 100644 --- a/inc/modules/admin/what-list_surfbar_actions.php +++ b/inc/modules/admin/what-list_surfbar_actions.php @@ -46,7 +46,7 @@ if ((!defined('__SECURITY')) || (!is_admin())) { ADD_DESCR("admin", __FILE__); // Load all actions -$result = SQL_QUERY("SELECT `id`, `status`, `action`, `new_status` +$result = SQL_QUERY("SELECT `id`,`status`,`action`,`new_status` FROM `{!_MYSQL_PREFIX!}_surfbar_actions` ORDER BY `status` ASC, `action` ASC", __FILE__, __LINE__); diff --git a/inc/modules/admin/what-surfbar_stats.php b/inc/modules/admin/what-surfbar_stats.php index ebac93670d..cd6d292a49 100644 --- a/inc/modules/admin/what-surfbar_stats.php +++ b/inc/modules/admin/what-surfbar_stats.php @@ -48,7 +48,7 @@ ADD_DESCR("admin", __FILE__); // Is the 'url_id' set? if (REQUEST_ISSET_GET(('url_id'))) { // Generate general statistics - $result = SQL_QUERY_ESC("SELECT `userid`, `count` AS `total_visits`, UNIX_TIMESTAMP(`last_online`) AS `last_online` + $result = SQL_QUERY_ESC("SELECT `userid`,`count` AS `total_visits`, UNIX_TIMESTAMP(`last_online`) AS `last_online` FROM `{!_MYSQL_PREFIX!}_surfbar_stats` WHERE `url_id`=%s ORDER BY `userid` ASC", diff --git a/inc/modules/admin/what-theme_import.php b/inc/modules/admin/what-theme_import.php index 70701a7115..7648ba936b 100644 --- a/inc/modules/admin/what-theme_import.php +++ b/inc/modules/admin/what-theme_import.php @@ -62,7 +62,7 @@ if (REQUEST_ISSET_POST(('theme'))) { LOAD_INC($INC); // Register it ith the exchange - SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_themes` (`theme_path`, `theme_active`, `theme_ver`, `theme_name`) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_themes` (`theme_path`,`theme_active`,`theme_ver`,`theme_name`) VALUES ('%s','N','%s','%s')", array(REQUEST_POST('theme'), $THEME_VERSION, $THEME_NAME), __FILE__, __LINE__); diff --git a/inc/modules/admin/what-unlock_emails.php b/inc/modules/admin/what-unlock_emails.php index 0aea5c5dbd..f9d2821b00 100644 --- a/inc/modules/admin/what-unlock_emails.php +++ b/inc/modules/admin/what-unlock_emails.php @@ -49,7 +49,7 @@ ADD_DESCR("admin", __FILE__); global $DATA; // Check for mails -$result_main = SQL_QUERY("SELECT `id`, `sender`, `subject`, `payment_id` AS `payment`, `timestamp`, `url`, `target_send`, `cat_id` AS `category` +$result_main = SQL_QUERY("SELECT `id`,`sender`,`subject`,`payment_id` AS `payment`,`timestamp`,`url`,`target_send`,`cat_id` AS `category` FROM `{!_MYSQL_PREFIX!}_pool` WHERE `data_type`='ADMIN' ORDER BY `timestamp` ASC", __FILE__, __LINE__); diff --git a/inc/modules/member/what-primera.php b/inc/modules/member/what-primera.php index a30dd8add7..53d8284c5a 100644 --- a/inc/modules/member/what-primera.php +++ b/inc/modules/member/what-primera.php @@ -86,7 +86,7 @@ if (!REQUEST_ISSET_GET(('mode'))) { REQUEST_SET_GET('mode', "list"); // And load all rows! - $result = SQL_QUERY_ESC("SELECT `id`, `primera_account`, `primera_amount`, `primera_timestamp`, `primera_type` FROM `{!_MYSQL_PREFIX!}_user_primera` WHERE `userid` = %s ORDER BY `primera_timestamp` DESC", + $result = SQL_QUERY_ESC("SELECT `id`,`primera_account`,`primera_amount`,`primera_timestamp`,`primera_type` FROM `{!_MYSQL_PREFIX!}_user_primera` WHERE `userid` = %s ORDER BY `primera_timestamp` DESC", array(getUserId()), __FILE__, __LINE__); // Load all rows diff --git a/inc/modules/member/what-wernis.php b/inc/modules/member/what-wernis.php index a2a3991013..c34be7db0d 100644 --- a/inc/modules/member/what-wernis.php +++ b/inc/modules/member/what-wernis.php @@ -86,7 +86,7 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) { REQUEST_SET_GET('mode', "list"); // And load all rows! - $result = SQL_QUERY_ESC("SELECT `id`, `wernis_account`, `wernis_amount`, `wernis_timestamp`, `wernis_type` FROM `{!_MYSQL_PREFIX!}_user_wernis` WHERE `userid` = %s ORDER BY `wernis_timestamp` DESC", + $result = SQL_QUERY_ESC("SELECT `id`,`wernis_account`,`wernis_amount`,`wernis_timestamp`,`wernis_type` FROM `{!_MYSQL_PREFIX!}_user_wernis` WHERE `userid` = %s ORDER BY `wernis_timestamp` DESC", array(getUserId()), __FILE__, __LINE__); // Load all rows diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index edd8cdaf19..cac6de8417 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -943,7 +943,7 @@ function GET_ACTION ($MODE, &$wht) { if (isAdminRegistered()) { // Redirect // @TODO Why does this lead into an endless loop but we still need it??? - // Commented out LOAD_URL("admin.php"); + // @TODO Commented out LOAD_URL("admin.php"); } // END - if } diff --git a/index.php b/index.php index 1648faa21a..f4c8ab5e9a 100644 --- a/index.php +++ b/index.php @@ -82,7 +82,7 @@ if (isInstalled()) { define('__DELAY_VALUE', (getConfig('index_delay') * 1000 + 500)); define('__MOD_VALUE' , ADD_URL_DATA("index")); LOAD_TEMPLATE("index_forward"); - } + } // END - if } else { // Redirect to main page LOAD_URL("modules.php?module=index"); diff --git a/templates/de/html/admin/admin_config_home_settings_pro.tpl b/templates/de/html/admin/admin_config_home_settings_pro.tpl index 64fc01da4e..0142b7a6bc 100644 --- a/templates/de/html/admin/admin_config_home_settings_pro.tpl +++ b/templates/de/html/admin/admin_config_home_settings_pro.tpl @@ -13,15 +13,14 @@