### 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
./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
// 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");
}
// 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;
}
} // 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,
$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."<br />\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."<br />\n";
+
+ // Remove brackes
+ $columnName = str_replace("(", "", str_replace(")", "", $columnName));
+ //* DEBUG: */ print __LINE__.":".$columnName."----------------".$begin."<br />\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 "<pre>".print_r($content, true)."</pre>";
+ 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."<br />\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."<br />\n";
$result = SQL_QUERY($sql, $F, $L, false);
}
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));
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,
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.");
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");
{
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'),
{
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.");
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!)
{
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
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.");
//
// 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
//
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!)
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!)
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.");
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.");
`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)");
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!)
{
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;
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__);
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");
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");
// 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__);
}
// 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);
// 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 {
$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");
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;
// 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__);
}
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__);
// 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",
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__);
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__);
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
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
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
}
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");
<td class="seperator" width="5"> </td>
<td width="185" align="center"><select name="index_delay"
size="1" class="admin_select">
- <option value="-1"{--$content[-1]--}>{--ADMIN_INDEX_MANUAL_FORWARD--}</option>
- <option value="0"{--$content[0]--}>{--ADMIN_INDEX_NO_DELAY--}</option>
- <!-- Fuehren Sie dies einfach so weiter, wenn Sie mehr Werte brauchen -->
- <option value="1"{--$content[1]--}>1 {--_SECONDS--}</option>
- <option value="2"{--$content[2]--}>2 {--_SECONDS--}</option>
- <option value="3"{--$content[3]--}>3 {--_SECONDS--}</option>
- <option value="4"{--$content[4]--}>4 {--_SECONDS--}</option>
- <option value="5"{--$content[5]--}>5 {--_SECONDS--}</option>
- <option value="10"{--$content[10]--}>10 {--_SECONDS--}</option>
+ <option value="-1"$content[-1]>{--ADMIN_INDEX_MANUAL_FORWARD--}</option>
+ <option value="0"$content[0]>{--ADMIN_INDEX_NO_DELAY--}</option>
+ <option value="1"$content[1]>1 {--_SECONDS--}</option>
+ <option value="2"$content[2]>2 {--_SECONDS--}</option>
+ <option value="3"$content[3]>3 {--_SECONDS--}</option>
+ <option value="4"$content[4]>4 {--_SECONDS--}</option>
+ <option value="5"$content[5]>5 {--_SECONDS--}</option>
+ <option value="10"$content[10]>10 {--_SECONDS--}</option>
</select></td>
</tr>
<tr>