From: Roland Häder Date: Sun, 20 Jun 2010 01:16:45 +0000 (+0000) Subject: Rewrites/fixes for handling config entries in SQLs X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4b7f401f2a4680ae46ca41c57f749cfe35163660;p=mailer.git Rewrites/fixes for handling config entries in SQLs --- diff --git a/.gitattributes b/.gitattributes index 69ada070cd..efdaa45424 100644 --- a/.gitattributes +++ b/.gitattributes @@ -99,6 +99,7 @@ inc/autopurge/purge-tsks.php -text inc/autopurge/purge-unconfirmed.php -text inc/cache/.htaccess -text inc/cache/_compiled/.htaccess -text +inc/cache/_compiled/emails/.htaccess -text inc/cache/_compiled/html/.htaccess -text inc/classes/.htaccess -text inc/classes/cachesystem.class.php -text diff --git a/inc/autopurge/purge-inact.php b/inc/autopurge/purge-inact.php index ae1d8907b5..1e725110c5 100644 --- a/inc/autopurge/purge-inact.php +++ b/inc/autopurge/purge-inact.php @@ -57,13 +57,13 @@ if (getConfig('autopurge_inactive') == 'Y') { // @TODO Rewrite these if() blocks to a filter $EXCLUDE_LIST = ''; if (getConfig('def_refid') > 0) { - $EXCLUDE_LIST = " AND d.userid != ".getConfig('def_refid'); + $EXCLUDE_LIST = ' AND d.`userid` != {?def_refid?}'; } // END - if // Check for more extensions - if (isExtensionActive('beg')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_userid').""; - if (isExtensionActive('bonus')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_userid').""; - if (isExtensionActive('doubler')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_userid').""; + if (isExtensionActive('beg')) $EXCLUDE_LIST .= ' AND d.`userid` != {?beg_userid?}'; + if (isExtensionActive('bonus')) $EXCLUDE_LIST .= ' AND d.`userid` != {?bonus_userid?}'; + if (isExtensionActive('doubler')) $EXCLUDE_LIST .= ' AND d.`userid` != {?doubler_userid?}'; // Check for new holiday extension if (isExtensionInstalledAndNewer('holiday', '0.1.3')) { @@ -127,11 +127,18 @@ ORDER BY // Now let's have a look for inactive accounts we want to delete we newly use the same exclude list // here for e.g. excluding holiday users - $result_inactive = SQL_QUERY_ESC("SELECT d.userid, d.email, d.last_online -FROM `{?_MYSQL_PREFIX?}_user_data` AS d -WHERE `status`='CONFIRMED' AND `joined` < (UNIX_TIMESTAMP() - %s) AND `last_online` < (UNIX_TIMESTAMP() - %s) AND `ap_notified` < (UNIX_TIMESTAMP() - %s) + $result_inactive = SQL_QUERY_ESC("SELECT + d.userid, d.email, d.last_online +FROM + `{?_MYSQL_PREFIX?}_user_data` AS d +WHERE + `status`='CONFIRMED' AND + `joined` < (UNIX_TIMESTAMP() - %s) AND + `last_online` < (UNIX_TIMESTAMP() - %s) AND + `ap_notified` < (UNIX_TIMESTAMP() - %s) ".$EXCLUDE_LIST." -ORDER BY `userid` ASC", +ORDER BY + `userid` ASC", array( getConfig('ap_inactive_since'), getConfig('ap_inactive_since'), diff --git a/inc/cache/_compiled/emails/.htaccess b/inc/cache/_compiled/emails/.htaccess new file mode 100644 index 0000000000..3a42882788 --- /dev/null +++ b/inc/cache/_compiled/emails/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index a851367cb6..30df3b4f1e 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -72,30 +72,27 @@ function SQL_QUERY ($sqlString, $F, $L) { // Remove \t, \n and \r from queries they may confuse some MySQL version I have heard $sqlString = str_replace("\t", ' ', str_replace("\n", ' ', str_replace("\r", ' ', $sqlString))); - // Replace {PER} - $sqlString = str_replace('{PER}', '%', $sqlString); - // Compile config entries out - $sqlString = SQL_PREPARE_SQL_STRING($sqlString); + $GLOBALS['last_sql'] = SQL_PREPARE_SQL_STRING($sqlString); // Starting time $querytimeBefore = microtime(true); // Run SQL command - //* DEBUG: */ print('F=' . basename($F) . ',L=' . $L . 'sql=' . htmlentities($sqlString) . '
'); - $result = mysql_query($sqlString, SQL_GET_LINK()) - or debug_report_bug(__FUNCTION__, __LINE__, 'file='. $F . ',line=' . $L . ':mysql_error()=' . mysql_error() . "\n". -'Query string:' . $sqlString); - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sql=' . $sqlString . ',numRows=' . SQL_NUMROWS($result) . ',affected=' . SQL_AFFECTEDROWS()); + //* DEBUG: */ print('F=' . basename($F) . ',L=' . $L . 'sql=' . htmlentities($GLOBALS['last_sql']) . '
'); + $result = mysql_query($GLOBALS['last_sql'], SQL_GET_LINK()) + or debug_report_bug($F, $L, 'file='. $F . ',line=' . $L . ':mysql_error()=' . mysql_error() . "\n". +'Query string:' . $GLOBALS['last_sql']); + /* DEBUG: */ logDebugMessage($F, $L, 'sql=' . $GLOBALS['last_sql'] . ',affected=' . SQL_AFFECTEDROWS()); // Calculate query time $queryTime = microtime(true) - $querytimeBefore; // Add this query to array including timing - addSqlToDebug($result, $sqlString, $queryTime, $F, $L); + addSqlToDebug($result, $GLOBALS['last_sql'], $queryTime, $F, $L); // Save last successfull query - setConfigEntry('db_last_query', $sqlString); + setConfigEntry('db_last_query', $GLOBALS['last_sql']); // Count all query times incrementConfigEntry('sql_time', $queryTime); @@ -114,7 +111,7 @@ function SQL_QUERY ($sqlString, $F, $L) { fwrite($fp, 'Module=' . getModule() . "\n"); $GLOBALS['sql_first_entry'] = true; } // END - if - fwrite($fp, $F . '(LINE=' . $L . '|NUM=' . SQL_NUMROWS($result) . '|AFFECTED=' . SQL_AFFECTEDROWS() . '|QUERYTIME:' . $queryTime . '): ' . str_replace("\r", '', str_replace("\n", ' ', $sqlString)) . "\n"); + fwrite($fp, $F . '(LINE=' . $L . '|NUM=' . SQL_NUMROWS($result) . '|AFFECTED=' . SQL_AFFECTEDROWS() . '|QUERYTIME:' . $queryTime . '): ' . str_replace("\r", '', str_replace("\n", ' ', $GLOBALS['last_sql'])) . "\n"); fclose($fp); } // END - if @@ -145,7 +142,7 @@ function SQL_NUMROWS ($resource) { $lines = mysql_num_rows($resource); } else { // No resource given, please fix this - trigger_error('No resource given! result[]=' . gettype($resource)); + debug_report_bug(__FUNCTION__, __LINE__, 'No resource given! result[]=' . gettype($resource) . ',last_sql=' . $GLOBALS['last_sql']); } // Return lines @@ -545,8 +542,11 @@ function SQL_HASZERONUMS ($result) { function SQL_PREPARE_SQL_STRING ($sqlString) { // Is it already cached? if (!isset($GLOBALS['sql_strings'][$sqlString])) { - // No, so compile and set it - $GLOBALS['sql_strings'][$sqlString] = FILTER_COMPILE_EXPRESSION_CODE(compileSqlConfig($sqlString)); + // Compile config+expression code + $sqlString2 = FILTER_COMPILE_EXPRESSION_CODE(FILTER_COMPILE_CONFIG($sqlString)); + + // Do final compilation + $GLOBALS['sql_strings'][$sqlString] = doFinalCompilation($sqlString2, false); } // END - if // Return it diff --git a/inc/expression-functions.php b/inc/expression-functions.php index dffef73d05..c114e31773 100644 --- a/inc/expression-functions.php +++ b/inc/expression-functions.php @@ -152,13 +152,7 @@ function doExpressionExt ($data) { // @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again function doExpressionConfig ($data) { // Default replacer is the config value itself - $replacer = '{DQUOTE} . getConfig(' . "'" . $data['matches'][4][$data['key']] . "'" . ') . {DQUOTE}'; - - // Is there a call-back function provided? - if (!empty($data['callback'])) { - // Construct a new expression - $replacer = '{%pipe,' . $data['callback'] . ',' . $configValue . '%}'; - } // END - if + $replacer = '{DQUOTE} . ' . $data['callback'] . '(getConfig(' . "'" . $data['matches'][4][$data['key']] . "'" . ')) . {DQUOTE}'; // Replace the config entry $code = replaceExpressionCode($data, $replacer); diff --git a/inc/extensions/ext-admins.php b/inc/extensions/ext-admins.php index 75d861ddd7..30c49c3248 100644 --- a/inc/extensions/ext-admins.php +++ b/inc/extensions/ext-admins.php @@ -62,8 +62,8 @@ switch (getExtensionMode()) { case 'remove': // Do stuff when removing extension // SQL commands to run addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='admins'"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_acls`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_mails`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_acls`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_mails`'); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` DROP `default_acl`"); // Remove filters @@ -104,7 +104,7 @@ switch (getExtensionMode()) { // But allow current admin everything (THIS SHALL BE YOU!) addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `default_acl`='allow' WHERE `login`='".getSession('admin_login')."' LIMIT 1"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_acls`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_acls`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admins_acls` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -124,7 +124,7 @@ PRIMARY KEY (`id`) break; case '0.4.0': // SQL queries for v0.4.0 - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_mails`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_mails`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admins_mails` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, admin_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, diff --git a/inc/extensions/ext-bank.php b/inc/extensions/ext-bank.php index 852120e5da..0d3677a0a7 100644 --- a/inc/extensions/ext-bank.php +++ b/inc/extensions/ext-bank.php @@ -54,7 +54,7 @@ enableExtensionProductive(false); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_accounts`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_accounts`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_accounts` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -81,7 +81,7 @@ INDEX (account_created), INDEX (account_locked), INDEX (last_tan_stamp) ) TYPE={?_TABLE_TYPE?}"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_transfers`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_transfers`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_transfers` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, to_account_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -94,7 +94,7 @@ PRIMARY KEY (id), INDEX (to_account_id, from_account_id), INDEX (day_bookkeeping, day_available) ) TYPE={?_TABLE_TYPE?}"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_packages`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_packages`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_packages` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, title VARCHAR(255) NOT NULL DEFAULT '', @@ -118,7 +118,7 @@ PRIMARY KEY (id) // what the member shall get for the specified income. output_system_mode // must be extended with the mode you get for free: output_system_mode:LOGIN // should be fine. More than one entry and not DISABLED ;) are not supported. - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_tanlist`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_tanlist`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_tanlist` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, idx TINYINT(3) UNSIGNED NOT NULL DEFAULT 0, @@ -158,10 +158,10 @@ UNIQUE (account_id, tan) case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_accounts`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_transfers`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_packages`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_tanlist`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_accounts`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_transfers`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_packages`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_tanlist`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='bank'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='bank'"); break; diff --git a/inc/extensions/ext-beg.php b/inc/extensions/ext-beg.php index 8ec17a7a54..db9a335c8e 100644 --- a/inc/extensions/ext-beg.php +++ b/inc/extensions/ext-beg.php @@ -58,7 +58,7 @@ switch (getExtensionMode()) { addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD beg_userid_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT 1800"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD beg_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00100"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD beg_clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_beg_ips`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_beg_ips`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_beg_ips` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -71,10 +71,10 @@ PRIMARY KEY (id) case 'remove': // Do stuff when removing extension // SQL commands to run + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_beg_ips`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_beg' OR `what`='list_beg'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='beg'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='beg' OR `what`='beg2'"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_beg_ips`"); break; case 'activate': // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-birthday.php b/inc/extensions/ext-birthday.php index 09d75959fd..3b951d4557 100644 --- a/inc/extensions/ext-birthday.php +++ b/inc/extensions/ext-birthday.php @@ -57,7 +57,7 @@ switch (getExtensionMode()) { case 'remove': // Do stuff when removing extension // SQL commands to run addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` DROP birthday_sent"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_birthday`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_birthday`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_birthday'"); break; @@ -79,8 +79,8 @@ switch (getExtensionMode()) { break; case '0.2.0': // SQL queries for v0.2 - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD birthday_points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_birthday`"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `birthday_points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_birthday`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_birthday` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index 1227a60562..a78c448c95 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -53,7 +53,7 @@ switch (getExtensionMode()) { // SQL commands to run addAdminMenuSql('email','send_bonus','Bonusmail senden','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.', 5); addMemberMenuSql('main','bonus','Bonuspunkte','N','Y',7); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bonus` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `cat_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -84,10 +84,10 @@ PRIMARY KEY (`id`) addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN ('bonus','config_bonus','send_bonus','list_bonus','list_notifications')"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='bonus' LIMIT 1"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='bonus'"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_urls`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_customer`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_turbo`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_urls`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_customer`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_turbo`'); // Unregister filter unregisterFilter('member_login_check', 'ADD_LOGIN_BONUS', true, getExtensionDryRun()); @@ -124,7 +124,7 @@ PRIMARY KEY (`id`) case '0.2.1': // SQL queries for v0.2.1 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `login_bonus` FLOAT(20,3) NOT NULL DEFAULT 10.000"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `turbo_bonus` FLOAT(20,3) NOT NULL DEFAULT 100.000"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `login_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('ONE_DAY').""); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `login_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT {?ONE_DAY?}"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `turbo_rates` VARCHAR(255) NOT NULL DEFAULT '50;20;10'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_ranks` TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"); // Use actual month for this update @@ -137,7 +137,7 @@ PRIMARY KEY (`id`) break; case '0.2.2': // SQL queries for v0.2.2 - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_turbo`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_turbo`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bonus_turbo` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -170,8 +170,8 @@ INDEX `userid` (`userid`) break; case '0.2.5': // SQL queries for v0.2.5 - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_urls`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_customer`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_urls`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_customer`'); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Tabellen {?_MYSQL_PREFIX?}_bonus_urls und {?_MYSQL_PREFIX?}_bonus_customer entfernt, da dies bald von der Erweiterung sponsor erledigt wird."); diff --git a/inc/extensions/ext-booking.php b/inc/extensions/ext-booking.php index e04a8b8931..5de7294616 100644 --- a/inc/extensions/ext-booking.php +++ b/inc/extensions/ext-booking.php @@ -58,7 +58,7 @@ switch (getExtensionMode()) { addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `booking_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY') * 3).""); // Drop/create table for user bookings - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_book`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_book`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_book`( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -82,7 +82,7 @@ PRIMARY KEY (`id`) break; case 'remove': // Do stuff when removing extension - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_book`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_book`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN ('config_booking','list_booking')"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='booking'"); diff --git a/inc/extensions/ext-country.php b/inc/extensions/ext-country.php index ef88cfb3b2..8a81b8ec74 100644 --- a/inc/extensions/ext-country.php +++ b/inc/extensions/ext-country.php @@ -54,7 +54,7 @@ setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_countries`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_countries`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_countries` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, code CHAR(2) NOT NULL DEFAULT 'DE', @@ -66,7 +66,7 @@ PRIMARY KEY (id) addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_countries` (code, descr, is_active) VALUES ('DE','Deutschland','Y')"); // Admin menu - addAdminMenuSql('country', NULL, 'Ländercodes verwalten','Stellen Sie hier Ländercodes ein, damit auch internationale Mitglieder sich zu Ihrem {?mt_word?} anmelden können.', 8); + addAdminMenuSql('country', NULL, 'Ländercodes verwalten','Stellen Sie hier Ländercodes ein, damit auch internationale Mitglieder sich zu Ihrem {OPEN_CONFIG}mt_word{CLOSE_CONFIG} anmelden können.', 8); addAdminMenuSql('country','list_country','Verwalten','Hinzufügen, Ändern und Löschen von Ländercodes.', 1); // Add entry to user table @@ -75,7 +75,7 @@ PRIMARY KEY (id) case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_countries`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_countries`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='country'"); break; diff --git a/inc/extensions/ext-debug.php b/inc/extensions/ext-debug.php index d18b6d28ff..cd044dd81d 100644 --- a/inc/extensions/ext-debug.php +++ b/inc/extensions/ext-debug.php @@ -57,7 +57,7 @@ enableExtensionProductive(false); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // Table for debug log entries - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_debug_log` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `sender_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -73,7 +73,7 @@ PRIMARY KEY (`id`) ) TYPE={?_TABLE_TYPE?} COMMENT='Debug log data'"); // Table against debug log abuse - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log_abuse`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log_abuse`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_debug_log_abuse` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `client_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -85,7 +85,7 @@ PRIMARY KEY (`id`) ) TYPE={?_TABLE_TYPE?} COMMENT='Debug log abuse'"); // Table on relay/server for client exchanges - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_debug_client` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `key` VARCHAR(255) NOT NULL DEFAULT 'SELF', @@ -105,7 +105,7 @@ PRIMARY KEY (`id`) addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_debug_client` (`url`,`title`,`webmaster`,`status`) VALUES ('{?URL?}','{?MAIN_TITLE?}','{?WEBMASTER?}','ACTIVE')"); // Table for debug log <-> client connection - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client_log`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client_log`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_debug_client_log` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `client_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 1, @@ -142,10 +142,10 @@ PRIMARY KEY (`id`) case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client_log`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log_abuse`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client_log`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log_abuse`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='debug'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='debug'"); break; @@ -183,7 +183,7 @@ PRIMARY KEY (`id`) default: // Unknown extension mode logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName())); break; -} +} // END - switch // [EOF] ?> diff --git a/inc/extensions/ext-doubler.php b/inc/extensions/ext-doubler.php index 9d784494aa..3b43bb01d3 100644 --- a/inc/extensions/ext-doubler.php +++ b/inc/extensions/ext-doubler.php @@ -51,7 +51,7 @@ setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0 switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // Doubler table - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_doubler`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_doubler`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_doubler` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -118,7 +118,7 @@ PRIMARY KEY (`id`) case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_doubler`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_doubler`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='doubler'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='doubler'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='doubler'"); diff --git a/inc/extensions/ext-holiday.php b/inc/extensions/ext-holiday.php index 71e8626cbc..07876b382a 100644 --- a/inc/extensions/ext-holiday.php +++ b/inc/extensions/ext-holiday.php @@ -51,7 +51,7 @@ setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0 switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // Create database - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_holidays`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_holidays`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_holidays` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -80,11 +80,11 @@ PRIMARY KEY (id) case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_holidays`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_holidays`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='holiday' LIMIT 1"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='holiday' LIMIT 4"); - addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE value=0 LIMIT 1"); - addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_max_receive` (value, comment) VALUES (0,'Urlaub')"); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE `value`=0 LIMIT 1"); + addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_max_receive` (`value`, `comment`) VALUES (0,'Urlaub')"); break; case 'activate': // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-imprint.php b/inc/extensions/ext-imprint.php index 315bc89117..2d7c16617f 100644 --- a/inc/extensions/ext-imprint.php +++ b/inc/extensions/ext-imprint.php @@ -64,7 +64,7 @@ switch (getExtensionMode()) { addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `imprint_image_script` VARCHAR(255) NOT NULL DEFAULT ''"); // Create imprint data table - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_imprint_data`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_imprint_data`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_imprint_data` ( `imprint_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `imprint_key` VARCHAR(255) NOT NULL DEFAULT '', @@ -79,14 +79,14 @@ PRIMARY KEY (`imprint_id`) break; case 'remove': // Do stuff when removing extension + // Imprint data + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_imprint_data`'); + // Guest menu addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='imprint' LIMIT 1"); // Admin menu addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_imprint' LIMIT 1"); - - // Imprint data - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_imprint_data`"); break; case 'activate': // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-logs.php b/inc/extensions/ext-logs.php index 48e44ec7da..417a49662a 100644 --- a/inc/extensions/ext-logs.php +++ b/inc/extensions/ext-logs.php @@ -51,7 +51,7 @@ setExtensionVersionHistory(array('0.0')); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run - addAdminMenuSql('stats','logs','Aufruflogbücher','Verwalten Sie Ihre Aufruflogbücher mit diesem Admin-Bereich! (Derzeit nur Download!)',8); + addAdminMenuSql('stats', 'logs', 'Aufruflogbücher', 'Verwalten Sie Ihre Aufruflogbücher mit diesem Admin-Bereich! (Derzeit nur Download!)', 8); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `logs_base` VARCHAR(255) NOT NULL DEFAULT 'logs'"); break; diff --git a/inc/extensions/ext-mediadata.php b/inc/extensions/ext-mediadata.php index 8d8d28750b..b5a33d9c88 100644 --- a/inc/extensions/ext-mediadata.php +++ b/inc/extensions/ext-mediadata.php @@ -63,7 +63,7 @@ switch (getExtensionMode()) { case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_mediadata`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_mediadata`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_mediadata'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='mediadata'"); @@ -101,7 +101,7 @@ switch (getExtensionMode()) { case '0.0.4': // SQL queries for v0.0.4 // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_mediadata`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_mediadata`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_mediadata` ( `media_key` VARCHAR(255) NOT NULL DEFAULT '', `media_value` VARCHAR(255) NOT NULL DEFAULT '', diff --git a/inc/extensions/ext-newsletter.php b/inc/extensions/ext-newsletter.php index 8fa7451587..4ee023fb83 100644 --- a/inc/extensions/ext-newsletter.php +++ b/inc/extensions/ext-newsletter.php @@ -194,10 +194,10 @@ PRIMARY KEY (`nl_order_id`) addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_archive` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); // Admin menu - addAdminMenuSql('newsletter', 'list_newsletter','Newsletter Verwalten','Legen Sie hier einen neuen Newsletter mit Betreff und Verfallsdatum an und listen Sie bestehende auf. Die Grunddaten lassen sich hier ebenfalls ändern.', 1); - addAdminMenuSql('newsletter', 'list_newsletter_topic','Thema verwalten','Legen Sie hier ein weiteres Thema an oder editieren bzw. löschen Sie bestehende.', 2); - addAdminMenuSql('newsletter', 'list_newsletter_ordrs','Buchungen verwalten','Verwalten Sie hier die Buchungen im Newsletter von Ihren Sponsoren.', 3); - addAdminMenuSql('newsletter', 'config_newsletter','Einstellungen','Einstellungen am Newsletter vornehmen.', 4); + addAdminMenuSql('newsletter', 'list_newsletter', 'Newsletter Verwalten', 'Legen Sie hier einen neuen Newsletter mit Betreff und Verfallsdatum an und listen Sie bestehende auf. Die Grunddaten lassen sich hier ebenfalls ändern.', 1); + addAdminMenuSql('newsletter', 'list_newsletter_topic', 'Thema verwalten', 'Legen Sie hier ein weiteres Thema an oder editieren bzw. löschen Sie bestehende.', 2); + addAdminMenuSql('newsletter', 'list_newsletter_ordrs', 'Buchungen verwalten', 'Verwalten Sie hier die Buchungen im Newsletter von Ihren Sponsoren.', 3); + addAdminMenuSql('newsletter', 'config_newsletter', 'Einstellungen', 'Einstellungen am Newsletter vornehmen.', 4); // Remove member menu addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='newsletter' LIMIT 1"); diff --git a/inc/extensions/ext-nickname.php b/inc/extensions/ext-nickname.php index 6475398f35..618d44b9f9 100644 --- a/inc/extensions/ext-nickname.php +++ b/inc/extensions/ext-nickname.php @@ -60,7 +60,7 @@ switch (getExtensionMode()) { // SQL commands to run addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='nickname'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN ('config_nickname','list_nickname')"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_nickname_history`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_nickname_history`'); break; case 'activate': // Do stuff when admin activates this extension @@ -176,16 +176,16 @@ switch (getExtensionMode()) { case '0.1.9': // SQL queries for v0.1.9 addAdminMenuSql('user','list_nickname','Nickname-Historie','Listet alle verwendeten Nicknames der Mitglieder auf.', 12); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_nickname_history`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_nickname_history`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_nickname_history` ( -id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, -userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -nickname VARCHAR(255) NOT NULL DEFAULT '', -added TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -last_used TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', -INDEX userid (userid), -INDEX (last_used DESC), -PRIMARY KEY (id) +`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, +`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`nickname` VARCHAR(255) NOT NULL DEFAULT '', +`added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, +`last_used` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', +INDEX `userid` (`userid`), +INDEX (`last_used` DESC), +PRIMARY KEY (`id`) ) TYPE={?_TABLE_TYPE?} COMMENT='History of used nicknames'"); // Update notes (these will be set as task text!) @@ -206,7 +206,7 @@ PRIMARY KEY (id) default: // Unknown extension mode logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName())); break; -} +} // END - switch -// +// [EOF] ?> diff --git a/inc/extensions/ext-online.php b/inc/extensions/ext-online.php index 1f6772bf35..fd513fe0cc 100644 --- a/inc/extensions/ext-online.php +++ b/inc/extensions/ext-online.php @@ -51,7 +51,7 @@ setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0 switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_online`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_online`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_online` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `sid` VARCHAR(32) NOT NULL DEFAULT '', @@ -74,7 +74,7 @@ KEY `admin_member` (`is_admin`,`is_member`) case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_online`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_online`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='usr_online'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='online'"); diff --git a/inc/extensions/ext-optimize.php b/inc/extensions/ext-optimize.php index 0820b56fe7..f05ea7e65d 100644 --- a/inc/extensions/ext-optimize.php +++ b/inc/extensions/ext-optimize.php @@ -54,18 +54,18 @@ setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_optimize_gain`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_optimize_gain`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_optimize_gain` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `gain` decimal(10,3) NOT NULL DEFAULT '0.000', PRIMARY KEY (`id`) ) TYPE={?_TABLE_TYPE?}"); - addAdminMenuSql('misc','optimize','DB optimieren','Führen Sie dies ab und an aus, damit überflüssige Binärdaten aus der Datenbank entfernt werden.',5); + addAdminMenuSql('misc', 'optimize', 'DB optimieren', 'Führen Sie dies ab und an aus, damit überflüssige Binärdaten aus der Datenbank entfernt werden.', 5); break; case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_optimize_gain`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_optimize_gain`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='optimize' LIMIT 1"); break; diff --git a/inc/extensions/ext-order.php b/inc/extensions/ext-order.php index 4e15c55d79..2dfbf60944 100644 --- a/inc/extensions/ext-order.php +++ b/inc/extensions/ext-order.php @@ -300,7 +300,7 @@ nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der Us break; case '0.5.0': // SQL queries for v0.5.0 - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_url_blacklist`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_url_blacklist`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_url_blacklist` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `url` VARCHAR(255) NOT NULL DEFAULT '', @@ -330,7 +330,7 @@ INDEX (`pool_id`) // Update notes (these will be set as task text!) setExtensionUpdateNotes("Inkonsistenz in Konfigurationsnamen korregiert."); break; - } + } // END - switch break; case 'modify': // When the extension got modified @@ -341,9 +341,10 @@ INDEX (`pool_id`) case 'init': // Do stuff when extension is initialized // Do daily reset only when installed and extension version is at least 0.1.1 + // @TODO This should be moved out to inc/reset/ if ((isResetModeEnabled()) && (isInstalled()) && (isAdminRegistered()) && (isExtensionInstalledAndNewer('order', '0.1.1'))) { // Reset mail order values - $result_ext = SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET mail_orders=0 WHERE mail_orders > 0", __FILE__, __LINE__); + $result_ext = SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `mail_orders`=0 WHERE `mail_orders` > 0", __FILE__, __LINE__); } // END - if break; @@ -353,7 +354,7 @@ INDEX (`pool_id`) default: // Unknown extension mode logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName())); break; -} +} // END - switch // [EOF] ?> diff --git a/inc/extensions/ext-payout.php b/inc/extensions/ext-payout.php index 604dcac05e..0e81799228 100644 --- a/inc/extensions/ext-payout.php +++ b/inc/extensions/ext-payout.php @@ -51,7 +51,7 @@ setExtensionVersionHistory(array('0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1 switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_payouts`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_payouts`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_payouts` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -65,7 +65,7 @@ KEY (userid), KEY (payout_id), PRIMARY KEY (id) ) TYPE={?_TABLE_TYPE?}"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_payout_types`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_payout_types`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_payout_types` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, type VARCHAR(255) NOT NULL DEFAULT '', @@ -80,8 +80,8 @@ PRIMARY KEY (id) case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_payouts`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_payout_types`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_payouts`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_payout_types`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='payouts'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='payout'"); break; @@ -251,7 +251,7 @@ PRIMARY KEY (id) default: // Unknown extension mode logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName())); break; -} +} // END - switch // [EOF] ?> diff --git a/inc/extensions/ext-primera.php b/inc/extensions/ext-primera.php index 4f89da3ff7..82ff0abefa 100644 --- a/inc/extensions/ext-primera.php +++ b/inc/extensions/ext-primera.php @@ -56,7 +56,7 @@ enableExtensionProductive(false); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_primera`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_primera`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_primera` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -91,7 +91,7 @@ PRIMARY KEY (`id`) case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_primera`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_primera`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='primera'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='primera'"); break; diff --git a/inc/extensions/ext-rallye.php b/inc/extensions/ext-rallye.php index a8c4d3d9c9..c6a84c8db3 100644 --- a/inc/extensions/ext-rallye.php +++ b/inc/extensions/ext-rallye.php @@ -51,9 +51,9 @@ setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0 switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_data`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_prices`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_users`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_data`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_prices`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_users`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_rallye_data` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, admin_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -104,9 +104,9 @@ PRIMARY KEY (id) case 'remove': // Do stuff when removing extension // Drop tables - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_data`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_prices`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_users`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_data`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_prices`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_users`'); // Remove menus addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='rallye'"); diff --git a/inc/extensions/ext-refback.php b/inc/extensions/ext-refback.php index 4930c2a2ac..f067d642af 100644 --- a/inc/extensions/ext-refback.php +++ b/inc/extensions/ext-refback.php @@ -51,7 +51,7 @@ setExtensionVersionHistory(array('0.0','0.0.1')); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_refs`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_refs`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_refs` ( `id` BIGINT(20) UNSIGNED NOT NULL auto_increment, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -72,7 +72,7 @@ KEY (`refid`) case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_refs`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_refs`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='refback'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_refback','list_refback')"); addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_refsystem` SET level=level-1"); diff --git a/inc/extensions/ext-register.php b/inc/extensions/ext-register.php index 8e373c8fcc..e9232b6462 100644 --- a/inc/extensions/ext-register.php +++ b/inc/extensions/ext-register.php @@ -57,7 +57,7 @@ switch (getExtensionMode()) { case 'remove': // Do stuff when removing extension // SQL commands to run addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_register'"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`'); // Unregister a filter unregisterFilter('register_must_fillout', 'REGISTER_MUST_FILLOUT', true, getExtensionDryRun()); @@ -74,10 +74,9 @@ switch (getExtensionMode()) { break; case 'update': // Update an extension - switch (getCurrentExtensionVersion()) - { + switch (getCurrentExtensionVersion()) { case '0.1.0': // SQL queries for v0.1 - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_must_register` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, field_name VARCHAR(255) NOT NULL DEFAULT '', diff --git a/inc/extensions/ext-removeip.php b/inc/extensions/ext-removeip.php index 1e44e01e67..cb4a241989 100644 --- a/inc/extensions/ext-removeip.php +++ b/inc/extensions/ext-removeip.php @@ -66,7 +66,7 @@ switch (getExtensionMode()) case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_removeip'"); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_removeip' LIMIT 1"); // Remove filters unregisterFilter('post_youhere_line', 'ADD_ANONYMITY_NOTICE', true, getExtensionDryRun()); diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php index 7a6e529256..bdb4d60333 100644 --- a/inc/extensions/ext-sponsor.php +++ b/inc/extensions/ext-sponsor.php @@ -62,7 +62,7 @@ switch (getExtensionMode()) { // // Sponsor data // - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_data`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_data`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_data` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `company` VARCHAR(255) NOT NULL DEFAULT '', @@ -104,7 +104,7 @@ PRIMARY KEY (`id`) // // Sponsor orders // - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_orders`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_orders`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_orders` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -124,7 +124,7 @@ PRIMARY KEY (`id`) // // Pay-types // - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_paytypes`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_paytypes`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_paytypes` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `pay_name` VARCHAR(255) NOT NULL DEFAULT '', @@ -136,7 +136,7 @@ PRIMARY KEY (`id`) // // Points-to-action converting // - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_action_convert`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_action_convert`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_action_convert` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `ext_name` VARCHAR(255) NOT NULL DEFAULT 'sponsor', @@ -148,7 +148,7 @@ PRIMARY KEY (`id`) // // Sponsor menu system (default) // - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_menu`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_menu`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_menu` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `action` VARCHAR(255) NOT NULL DEFAULT '', @@ -164,7 +164,7 @@ PRIMARY KEY (`id`) // // Registry for performable actions by your sponsors // - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_registry`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_registry`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_registry` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -178,7 +178,7 @@ PRIMARY KEY (`id`) // // URLs from the sponsors // - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_urls`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_urls`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_urls` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -192,7 +192,7 @@ PRIMARY KEY (`id`) // // Banners of any size from the sponsors // - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_banner`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_banner`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_banner` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -208,7 +208,7 @@ PRIMARY KEY (`id`) // // Campaigns // - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaigns`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaigns`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_campaigns` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -230,7 +230,7 @@ PRIMARY KEY (`id`) // // Campaigns + URLs + Banner // - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `campaignid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -246,7 +246,7 @@ PRIMARY KEY (`id`) // // Allowed data to display (administrative) // - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_admin_data`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_admin_data`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_admin_data` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `data_row` VARCHAR(255) NOT NULL DEFAULT '', @@ -256,7 +256,7 @@ PRIMARY KEY (`id`) // // Allowed data to display (sponsor-side) // - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_display_data`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_display_data`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_display_data` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -377,18 +377,18 @@ PRIMARY KEY (`id`) case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_data`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_orders`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_action_convert`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_paytypes`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_menu`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_registry`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_urls`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_banner`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaigns`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_admin_data`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_display_data`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_data`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_orders`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_action_convert`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_paytypes`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_menu`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_registry`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_urls`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_banner`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaigns`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_admin_data`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_display_data`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='sponsor' OR `what` IN('repr_sponsor','sponsor_medit','sponsor_madd')"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='sponsor'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='sponsor'"); diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index 8b2fb94ffb..b9ac1fc7b6 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -54,7 +54,7 @@ enableExtensionProductive(false); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run (surfbar URLs) - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_urls`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_urls`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_urls` ( `url_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `url_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -75,7 +75,7 @@ INDEX `status_userid` (`url_status`,`url_userid`) ) TYPE={?_TABLE_TYPE?} COMMENT='Surfbar URLs'"); // Reload locks - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_locks`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_locks`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_locks` ( `locks_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `locks_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -87,7 +87,7 @@ INDEX (`locks_url_id`) ) TYPE={?_TABLE_TYPE?} COMMENT='Surfbar reload locks'"); // Surfbar salts - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_salts`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_salts`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_salts` ( `salts_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `salts_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -99,7 +99,7 @@ INDEX (`salts_url_id`) ) TYPE={?_TABLE_TYPE?} COMMENT='Surfbar last used salts'"); // Statistics - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_stats`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_stats`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_stats` ( `stats_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `stats_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -112,7 +112,7 @@ INDEX (`stats_url_id`) ) TYPE={?_TABLE_TYPE?} COMMENT='Surfbar Statistics'"); // Member actions pending on status - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_actions`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_actions`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_actions` ( `actions_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `actions_status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NULL DEFAULT NULL, @@ -171,7 +171,7 @@ UNIQUE KEY `status_action` (`actions_status`,`actions_action`) addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_notify_limits` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_notify_admin_unlock` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_warn_low_points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 100"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_low_interval` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('ONE_DAY').""); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_low_interval` BIGINT(20) UNSIGNED NOT NULL DEFAULT {?ONE_DAY?}"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_migrate_order` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_notification_mode` ENUM('INSTANT','RESET') NOT NULL DEFAULT 'INSTANT'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_guest_login_form` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); @@ -198,11 +198,11 @@ UNIQUE KEY `status_action` (`actions_status`,`actions_action`) case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_actions`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_locks`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_salts`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_stats`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_urls`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_actions`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_locks`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_salts`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_stats`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_urls`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='surfbar'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='surfbar'"); break; diff --git a/inc/extensions/ext-theme.php b/inc/extensions/ext-theme.php index fbdd16955c..8545512f33 100644 --- a/inc/extensions/ext-theme.php +++ b/inc/extensions/ext-theme.php @@ -55,7 +55,7 @@ switch (getExtensionMode()) { case 'remove': // Do stuff when removing extension // Drop theme table - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_themes`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_themes`'); // Delete admin menu addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='theme'"); @@ -120,7 +120,7 @@ switch (getExtensionMode()) { case '0.0.8': // SQL queries for v0.0.8 // Theme table - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_themes`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_themes`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_themes` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `theme_path` VARCHAR(255) NOT NULL DEFAULT '', @@ -133,7 +133,7 @@ INDEX (`theme_active`) ) TYPE={?_TABLE_TYPE?} COMMENT='Themes'"); // Admin menu - addAdminMenuSql('theme', NULL, 'Themes','Verwalten Sie hier alle Designs (Themes) Ihres {?mt_word2?}.', 8); + addAdminMenuSql('theme', NULL, 'Themes','Verwalten Sie hier alle Designs (Themes) Ihres {OPEN_CONFIG}mt_word2{CLOSE_CONFIG}.', 8); addAdminMenuSql('theme','theme_import','Importieren','Es wird das Verzeichnis "theme" nach neuen Ordnern durchsucht und anschliessend in die Datenbank gesperrt aufgenommen.', 1); addAdminMenuSql('theme','theme_edit','Modifizieren','Ändern Sie Titel, Freigaben usw. an den Themes. Sie können bis auf das Standart-Theme "default" auch Themes aus der Datenbank entfernen. Vorher sollten Sie es jedoch vom Server löschen, damit es niht erneut importiert werden kann.', 2); addAdminMenuSql('theme','theme_check','Prüfen','Nach neuen Themes suchen bzw. nach Updates zu den Themes suchen.', 3); diff --git a/inc/extensions/ext-transfer.php b/inc/extensions/ext-transfer.php index 8cc661e434..8bdb7b3ac1 100644 --- a/inc/extensions/ext-transfer.php +++ b/inc/extensions/ext-transfer.php @@ -51,8 +51,8 @@ setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0 switch (getExtensionMode()) { case 'register': // Do stuff when installation is running // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_in`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_out`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_in`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_out`'); // Transfer from a member addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_transfers_in` ( @@ -92,11 +92,11 @@ PRIMARY KEY (id) addMemberMenuSql('main','transfer','{OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Transfer','N','Y', 5); // Add config values - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD transfer_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '50'"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD transfer_age BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('ONE_DAY')*28)."'"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD transfer_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".getConfig('ONE_DAY')."'"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD transfer_balance BIGINT(20) UNSIGNED NOT NULL DEFAULT 100"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD transfer_code BIGINT(20) UNSIGNED NOT NULL DEFAULT 5"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_max` BIGINT(20) UNSIGNED NOT NULL DEFAULT 50"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_age` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY')*28)); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT {?ONE_DAY?}"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_balance` BIGINT(20) UNSIGNED NOT NULL DEFAULT 100"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_code` BIGINT(20) UNSIGNED NOT NULL DEFAULT 5"); // Add row(s) to user's data addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD opt_in ENUM('Y','N') NOT NULL DEFAULT 'N'"); @@ -104,8 +104,8 @@ PRIMARY KEY (id) case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_in`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_out`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_in`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_out`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='transfer'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='transfer'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` DROP `opt_in`"); diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index 60f2c91e7d..d2cb8d16bb 100644 --- a/inc/extensions/ext-user.php +++ b/inc/extensions/ext-user.php @@ -53,7 +53,7 @@ setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_cats`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_cats`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_cats` ( `id` BIGINT(22) NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -63,7 +63,7 @@ INDEX (`userid`), INDEX (`cat_id`) ) TYPE={?_TABLE_TYPE?}"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_data`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_data`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_data` ( `userid` BIGINT(22) NOT NULL AUTO_INCREMENT, `surname` VARCHAR(255) NOT NULL DEFAULT '', @@ -104,7 +104,7 @@ INDEX (`refid`), INDEX `status_mails` (`status`,`max_mails`) ) TYPE={?_TABLE_TYPE?}"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_points`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_points`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_points` ( `id` BIGINT(22) NOT NULL AUTO_INCREMENT, `userid` BIGINT(22) NOT NULL DEFAULT 0, @@ -115,7 +115,7 @@ PRIMARY KEY (`id`), INDEX (`userid`) ) TYPE={?_TABLE_TYPE?}"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_links`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_links`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_links` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `stats_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -126,7 +126,7 @@ INDEX (`userid`), INDEX (`stats_id`) ) TYPE={?_TABLE_TYPE?}"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_stats` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -148,7 +148,7 @@ INDEX (`payment_id`), INDEX (`pool_id`) ) TYPE={?_TABLE_TYPE?}"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats_data`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats_data`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_stats_data` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -175,14 +175,14 @@ INDEX (`stats_type`) case 'remove': // Do stuff when removing extension // SQL commands to run + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_del`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_cats`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_data`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_points`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_links`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats_data`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') OR `action`='user'"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_del`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_cats`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_data`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_points`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_links`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats_data`"); break; case 'activate': // Do stuff when admin activates this extension @@ -349,8 +349,8 @@ INDEX (`stats_type`) addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `lock_reason` TINYTEXT"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `lock_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `user_delete_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY') * 30).""); - addAdminMenuSql('user','list_user_del','Löschungen auflisten','Listet die Löschungen von Usern auf.', 9); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_del`"); + addAdminMenuSql('user', 'list_user_del', 'Löschungen auflisten', 'Listet die Löschungen von Usern auf.', 9); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_del`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_del` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, diff --git a/inc/extensions/ext-wernis.php b/inc/extensions/ext-wernis.php index b71f35004e..4b466f3564 100644 --- a/inc/extensions/ext-wernis.php +++ b/inc/extensions/ext-wernis.php @@ -51,7 +51,7 @@ setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3')); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_wernis`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_wernis`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_wernis` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -89,7 +89,7 @@ PRIMARY KEY (id) case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_wernis`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_wernis`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='wernis'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='wernis'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='wernis_portal'"); diff --git a/inc/extensions/ext-yoomedia.php b/inc/extensions/ext-yoomedia.php index f406c3522d..bafb7d03cf 100644 --- a/inc/extensions/ext-yoomedia.php +++ b/inc/extensions/ext-yoomedia.php @@ -74,7 +74,7 @@ switch (getExtensionMode()) { addAdminMenuSql('email','list_yoomedia_tm','Yoo!Media Textmails','Listet Textmail-Buchungen über das Interface 2.0 von Yoo!Media nach Ihren eingestellten Kriterien auf. Vorsicht: Jede Aktualisierung dieser Liste kostet Ihnen eine Abfrage!',10); // Reload lock table - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_yoomedia_reload`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_yoomedia_reload`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_yoomedia_reload` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `type` VARCHAR(255) NOT NULL DEFAULT 'general', @@ -89,7 +89,7 @@ UNIQUE `y_type` (`type`,`y_id`) case 'remove': // Do stuff when removing extension // SQL commands to run addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_yoomedia','list_yoomedia_tm')"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_yoomedia_reload`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_yoomedia_reload`'); break; case 'activate': // Do stuff when admin activates this extension diff --git a/inc/filters.php b/inc/filters.php index 1570488b12..6b33ba7f8a 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -436,7 +436,7 @@ function FILTER_COMPILE_CONFIG ($code, $compiled = false) { if ($compiled === true) { // Run the code $eval = "\$GLOBALS['compiled_config'][\$uncompiled] = \"" . $GLOBALS['compiled_config'][$uncompiled] . "\";"; - /* DEBUG: */ print(__FUNCTION__.'['.__LINE__.']:
' . str_replace('$', '$', htmlentities($eval)) . '
'); + //* DEBUG: */ print(__FUNCTION__.'['.__LINE__.']:
' . str_replace('$', '$', htmlentities($eval)) . '
'); eval($eval); } // END - if diff --git a/inc/functions.php b/inc/functions.php index bac7b16a82..1d7c71f5d2 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -178,7 +178,7 @@ function doFinalCompilation ($code, $insertComments = true) { $cnt = 0; // Compile all out - while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{!') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($cnt < 3)) { + while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($cnt < 3)) { // Init common variables $content = array(); $newContent = ''; @@ -306,7 +306,7 @@ function loadTemplate ($template, $return = false, $content = array()) { // Do we have to compile the code? $ret = ''; - if ((strpos($GLOBALS['tpl_content'], '$') !== false) || (strpos($GLOBALS['tpl_content'], '{--') !== false) || (strpos($GLOBALS['tpl_content'], '{!') !== false) || (strpos($GLOBALS['tpl_content'], '{?') !== false) || (strpos($GLOBALS['tpl_content'], '{%') !== false)) { + if ((strpos($GLOBALS['tpl_content'], '$') !== false) || (strpos($GLOBALS['tpl_content'], '{--') !== false) || (strpos($GLOBALS['tpl_content'], '{?') !== false) || (strpos($GLOBALS['tpl_content'], '{%') !== false)) { // Normal HTML output? if (getOutputMode() == '0') { // Add surrounding HTML comments to help finding bugs faster @@ -607,7 +607,7 @@ Message : ' . htmlentities(utf8_decode($message)) . ' } // Why did we end up here? This should not happen - debug_report_bug('Ending up: template=' . $template); + debug_report_bug(__FUNCTION__, __LINE__, 'Ending up: template=' . $template); } // Check to use wether legacy mail() command or PHPMailer class @@ -880,7 +880,7 @@ function translateMenuVisibleLocked ($content, $prefix = '') { case 'N': $content[$prefix . 'visible_css'] = $prefix . 'menu_invisible'; break; default: // Please report this - debug_report_bug('Unsupported visible value detected. content=
'.print_r($content, true).'
'); + debug_report_bug(__FUNCTION__, __LINE__, 'Unsupported visible value detected. content=
'.print_r($content, true).'
'); break; } // END - switch @@ -891,7 +891,7 @@ function translateMenuVisibleLocked ($content, $prefix = '') { case 'N': $content[$prefix . 'locked_css'] = $prefix . 'menu_unlocked'; break; default: // Please report this - debug_report_bug('Unsupported locked value detected. content=
'.print_r($content, true).'
'); + debug_report_bug(__FUNCTION__, __LINE__, 'Unsupported locked value detected. content=
'.print_r($content, true).'
'); break; } // END - switch @@ -1049,7 +1049,7 @@ function compileCode ($code, $simple = false, $constants = true, $full = true) { } // Compiles the code (use compileCode() only for HTML because of the comments) -// @TODO $simple is deprecated +// @TODO $simple/$constants are deprecated function compileRawCode ($code, $simple = false, $constants = true, $full = true) { // Is the code a string? if (!is_string($code)) { @@ -1066,16 +1066,8 @@ function compileRawCode ($code, $simple = false, $constants = true, $full = true // Compile more through a filter $code = runFilterChain('compile_code', $code); - // Compile constants - if ($constants === true) { - // BEFORE 0.2.1 : Language and data constants - // WITH 0.2.1+ : Only language constants - $code = str_replace('{--', "{DQUOTE} . getMessage('", str_replace('--}', "') . {DQUOTE}", $code)); - - // BEFORE 0.2.1 : Not used - // WITH 0.2.1+ : Data constants - $code = str_replace('{!', "{DQUOTE} . constant('", str_replace('!}', "') . {DQUOTE}", $code)); - } // END - if + // Compile message strings + $code = str_replace('{--', '{%message,', str_replace('--}', '%}', $code)); // Compile QUOT and other non-HTML codes foreach ($secChars['to'] as $k => $to) { @@ -3487,7 +3479,7 @@ function initCacheInstance () { $GLOBALS['cache_instance'] = new CacheSystem(); if ($GLOBALS['cache_instance']->getStatus() != 'done') { // Failed to initialize cache sustem - addFatalMessage(__FUNCTION__, __LINE__, '(' . __LINE__ . '): ' . getMessage('CACHE_CANNOT_INITIALIZE')); + addFatalMessage(__FUNCTION__, __LINE__, '(' . __LINE__ . '): {--CACHE_CANNOT_INITIALIZE--}'); } // END - if } diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index 16ea671c73..d4eee50672 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -238,14 +238,14 @@ function outputAdvancedOverview (&$result_main) { $since = getConfig('ap_inactive_since'); $EXCLUDE_LIST = ''; if (getConfig('def_refid') > 0) { - $EXCLUDE_LIST = " AND d.userid != ".getConfig('def_refid').""; + $EXCLUDE_LIST = ' AND d.userid != {?def_refid?}'; } // END - if // Check for more extensions // @TODO These can be rewritten to filter - if (isExtensionActive('beg')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_userid').""; - if (isExtensionActive('bonus')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_userid').""; - if (isExtensionActive('doubler')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_userid').""; + if (isExtensionActive('beg')) $EXCLUDE_LIST .= ' AND d.userid != {?beg_userid?}'; + if (isExtensionActive('bonus')) $EXCLUDE_LIST .= ' AND d.userid != {?bonus_userid?}'; + if (isExtensionActive('doubler')) $EXCLUDE_LIST .= ' AND d.userid != {?doubler_userid?}'; if (isExtensionInstalledAndNewer('holiday', '0.1.3')) { // Recent ext-holiday found $EXCLUDE_LIST .= " AND d.`holiday_active`='N'"; diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index cc9c5fcc66..549340dd24 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -230,7 +230,7 @@ function determineRandomReferalId () { // Is the extension version fine? if (isExtensionInstalledAndNewer('user', '0.3.4')) { // Get all user ids - $totalUsers = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true, " AND `rand_confirmed` >= ".getConfig('user_min_confirmed').""); + $totalUsers = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true, " AND `rand_confirmed` >= {?user_min_confirmed?}"); // Do we have at least one? if ($totalUsers > 0) { diff --git a/inc/mails/bonus_mails.php b/inc/mails/bonus_mails.php index a2d715f7ea..a74c21a337 100644 --- a/inc/mails/bonus_mails.php +++ b/inc/mails/bonus_mails.php @@ -98,7 +98,8 @@ if (!empty($sql)) { // Okay lets notify all users! while ($content = SQL_FETCHARRAY($result_main)) { // Update account - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` + SQL_QUERY_ESC("UPDATE + `{?_MYSQL_PREFIX?}_user_data` SET `bonus_ral_notify`=UNIX_TIMESTAMP(), `bonus_ral_%s_notify`=UNIX_TIMESTAMP() diff --git a/inc/modules/admin/what-config_bonus.php b/inc/modules/admin/what-config_bonus.php index c05283cd95..c623e19b98 100644 --- a/inc/modules/admin/what-config_bonus.php +++ b/inc/modules/admin/what-config_bonus.php @@ -86,7 +86,6 @@ if (isFormSent()) { $content['member_selection'] = addMemberSelectionBox(getConfig('bonus_userid'), false, true, true, 'bonus_userid'); // Initialize array for the points list - //die("*".getConfig('turbo_rates')."*"); $RANKS = explode(';', getConfig('turbo_rates')); // Automatically calculate bonus points for ranks 2 and 3 when not set diff --git a/inc/modules/admin/what-list_autopurge.php b/inc/modules/admin/what-list_autopurge.php index e7d72d4dfe..5cbd509693 100644 --- a/inc/modules/admin/what-list_autopurge.php +++ b/inc/modules/admin/what-list_autopurge.php @@ -46,16 +46,16 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { addMenuDescription('admin', __FILE__); // Exclude default referal id if set +// @TODO Rewrite those lines to filter $EXCLUDE_LIST = ''; if (getConfig('def_refid') > 0) { - $EXCLUDE_LIST = " AND d.userid != ".getConfig('def_refid').""; + $EXCLUDE_LIST = ' AND d.userid != {?def_refid?}'; } // END - if // Check for more extensions -// @TODO Rewrite those lines to filter -if (isExtensionActive('beg')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_userid').""; -if (isExtensionActive('bonus')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_userid').""; -if (isExtensionActive('doubler')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_userid').""; +if (isExtensionActive('beg')) $EXCLUDE_LIST .= ' AND d.userid != {?beg_userid?}'; +if (isExtensionActive('bonus')) $EXCLUDE_LIST .= ' AND d.userid != {?bonus_userid?}'; +if (isExtensionActive('doubler')) $EXCLUDE_LIST .= ' AND d.userid != {?doubler_userid?}'; if (isExtensionInstalledAndNewer('holiday', '0.1.3')) $EXCLUDE_LIST .= " AND d.holiday_active='N'"; // Check for all accounts diff --git a/inc/modules/admin/what-unlock_emails.php b/inc/modules/admin/what-unlock_emails.php index 1ce67bbb3a..5fb789f51c 100644 --- a/inc/modules/admin/what-unlock_emails.php +++ b/inc/modules/admin/what-unlock_emails.php @@ -95,7 +95,7 @@ LIMIT 1", // Check for bonus extension version >= 0.4.4 for the order bonus if ((isExtensionInstalledAndNewer('bonus', '0.4.4')) && (getConfig('bonus_active') == 'Y')) { // Add points directly - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `bonus_order`=`bonus_order`+".getConfig('bonus_order')." WHERE `userid`=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `bonus_order`=`bonus_order`+{?bonus_order?} WHERE `userid`=%s LIMIT 1", array(bigintval($content['sender'])), __FILE__, __LINE__); // Subtract bonus points from system diff --git a/inc/modules/guest/what-confirm.php b/inc/modules/guest/what-confirm.php index 166f2b8a5b..1121248be5 100644 --- a/inc/modules/guest/what-confirm.php +++ b/inc/modules/guest/what-confirm.php @@ -56,11 +56,11 @@ if (isGetRequestParameterSet('hash')) { $userid = '0'; // Search for an unconfirmed or confirmed account - $result = SQL_QUERY_ESC("SELECT `userid`, `email`, `refid`,`gender` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `user_hash`='%s' AND (`status`='UNCONFIRMED' OR `status`='CONFIRMED') LIMIT 1", + $result = SQL_QUERY_ESC("SELECT `userid`, `email`, `refid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `user_hash`='%s' AND (`status`='UNCONFIRMED' OR `status`='CONFIRMED') LIMIT 1", array(getRequestParameter('hash')), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Ok, he want's to confirm now so we load some data - list($userid, $email, $rid, $gender) = SQL_FETCHROW($result); + list($userid, $email, $refid) = SQL_FETCHROW($result); // Fetch user data if (!fetchUserData($userid)) { @@ -70,11 +70,18 @@ if (isGetRequestParameterSet('hash')) { // Load all data and add points $content = getUserDataArray(); - $content['gender'] = translateGender($content['gender']); - $content['points'] = getConfig('points_register'); // Unlock his account (but only when it is on UNCONFIRMED!) - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `status`='CONFIRMED', ref_payout={?ref_payout?}, `user_hash`=NULL WHERE `user_hash`='%s' AND `status`='UNCONFIRMED' LIMIT 1", + SQL_QUERY_ESC("UPDATE + `{?_MYSQL_PREFIX?}_user_data` +SET + `status`='CONFIRMED', + `ref_payout`={?ref_payout?}, + `user_hash`=NULL +WHERE + `user_hash`='%s' AND + `status`='UNCONFIRMED' +LIMIT 1", array(getRequestParameter('hash')), __FILE__, __LINE__); if (SQL_AFFECTEDROWS() == 1) { // Send email if updated @@ -84,11 +91,11 @@ if (isGetRequestParameterSet('hash')) { sendEmail($email, getMessage('GUEST_THANX_CONFIRM'), $message); // Maybe he got "referaled"? - if (($rid > 0) && ($rid != $userid)) { + if (($refid > 0) && ($refid != $userid)) { // Select the referal userid - if (fetchUserData($rid)) { + if (fetchUserData($refid)) { // Update ref counter... - updateReferalCounter($rid); + updateReferalCounter($refid); // Shall I 'pay' the referal points imidiately? if (getConfig('ref_payout') == '0') { @@ -103,7 +110,7 @@ if (isGetRequestParameterSet('hash')) { if ((isExtensionInstalledAndNewer('bonus', '0.4.4')) && (getConfig('bonus_active') == 'Y')) { // Add points (directly only!) SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `bonus_ref`=`bonus_ref`+{?bonus_ref?} WHERE `userid`=%s LIMIT 1", - array(bigintval($rid)), __FILE__, __LINE__); + array(bigintval($refid)), __FILE__, __LINE__); // Subtract points from system handleBonusPoints(getConfig('bonus_ref')); @@ -112,7 +119,7 @@ if (isGetRequestParameterSet('hash')) { // Add one-time referal bonus over referal system or directly // @TODO Try to rewrite the following unset() unset($GLOBALS['ref_level']); - addPointsThroughReferalSystem('referal_bonus', $rid, getConfig('points_ref'), true, bigintval($userid), $locked, getConfig('reg_points_mode')); + addPointsThroughReferalSystem('referal_bonus', $refid, getConfig('points_ref'), true, bigintval($userid), $locked, getConfig('reg_points_mode')); } // END - if } // END - if diff --git a/inc/modules/guest/what-stats.php b/inc/modules/guest/what-stats.php index aadc78d976..a5165082ba 100644 --- a/inc/modules/guest/what-stats.php +++ b/inc/modules/guest/what-stats.php @@ -77,12 +77,12 @@ $ltitle = getMessage('GUEST_STATS_' . strtoupper($lmode)); switch (getConfig('guest_stats')) { case 'MEMBERS': // Statistics about your members // Members yesterday / today online - $ymem = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `last_online` >= ".getConfig('START_YDAY')." AND `last_online` < ".getConfig('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__)); - $tmem = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `last_online` >= ".getConfig('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__)); + $ymem = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `last_online` >= {?START_YDAY?} AND `last_online` < {?START_TDAY?} AND `status`='CONFIRMED'", __FILE__, __LINE__)); + $tmem = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `last_online` >= {?START_TDAY?} AND `status`='CONFIRMED'", __FILE__, __LINE__)); // Yesterday / today registered - $yreg = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `joined` >= ".getConfig('START_YDAY')." AND `joined` < ".getConfig('START_TDAY'), __FILE__, __LINE__)); - $treg = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `joined` >= ".getConfig('START_TDAY'), __FILE__, __LINE__)); + $yreg = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `joined` >= {?START_YDAY?} AND `joined` < {?START_TDAY?}", __FILE__, __LINE__)); + $treg = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `joined` >= {?START_TDAY?}", __FILE__, __LINE__)); // Only males / females $male = countSumTotalData('M', 'user_data', 'userid', 'gender', true, " AND `status`='CONFIRMED'"); @@ -241,7 +241,7 @@ switch (getConfig('guest_stats')) { case 'INACTIVE': // Deactivated stats loadTemplate('admin_settings_saved', false, getMessage('GUEST_STATS_DEACTIVATED')); break; -} +} // END - switch // [EOF] ?> diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index c360728d6a..83d8724ff2 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -219,7 +219,9 @@ LIMIT 1", $add = ''; if ((getConfig('order_multi_page') == 'Y') && (isPostRequestParameterSet('zip')) && (postRequestParameter('zip') != '')) { // Choose recipients by ZIP code - $add = " AND d.zip LIKE '".bigintval(postRequestParameter('zip'))."{PER}'"; + $add = sprintf(" AND d.zip LIKE '%s%%'", + bigintval(postRequestParameter('zip')) + ); } // END - if // Check for userids diff --git a/inc/modules/member/what-transfer.php b/inc/modules/member/what-transfer.php index ba40074cf8..ddc7586b6f 100644 --- a/inc/modules/member/what-transfer.php +++ b/inc/modules/member/what-transfer.php @@ -280,14 +280,14 @@ switch ($mode) { $nothingMessage = ''; switch ($mode) { case 'list_in': - $sql = "SELECT `trans_id`, `from_userid` AS party_userid, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `userid`=%s ORDER BY `time_trans` DESC LIMIT ".getConfig('transfer_max'); + $sql = "SELECT `trans_id`, `from_userid` AS party_userid, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `userid`=%s ORDER BY `time_trans` DESC LIMIT {?transfer_max?}"; $nothingMessage = getMessage('TRANSFER_NO_INCOMING_TRANSFERS'); $content['balance'] = getMessage('TRANSFER_TOTAL_INCOMING'); $content['title'] = getMessage('TRANSFER_LIST_INCOMING'); break; case 'list_out': - $sql = "SELECT `trans_id`, `to_userid` AS party_userid, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `userid`=%s ORDER BY `time_trans` DESC LIMIT ".getConfig('transfer_max'); + $sql = "SELECT `trans_id`, `to_userid` AS party_userid, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `userid`=%s ORDER BY `time_trans` DESC LIMIT {?transfer_max?}"; $nothingMessage = getMessage('TRANSFER_NO_OUTGOING_TRANSFERS'); $content['balance'] = getMessage('TRANSFER_TOTAL_OUTGOING'); $content['title'] = getMessage('TRANSFER_LIST_OUTGOING'); diff --git a/inc/modules/member/what-wernis.php b/inc/modules/member/what-wernis.php index a4bb4d0271..e99858cd74 100644 --- a/inc/modules/member/what-wernis.php +++ b/inc/modules/member/what-wernis.php @@ -75,7 +75,7 @@ if ((!isGetRequestParameterSet('mode')) || (getRequestParameter('mode') == 'choo setGetRequestParameter('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(getMemberId()), __FILE__, __LINE__); // Load all rows @@ -84,10 +84,9 @@ if ((!isGetRequestParameterSet('mode')) || (getRequestParameter('mode') == 'choo // Prepare data for output $rowContent = array( 'wernis_timestamp' => generateDateTime($data['wernis_timestamp'], 2), - 'points' => translateComma($data['wernis_amount']), - 'wernis_account' => bigintval($data['wernis_account']), - 'status' => WERNIS_TRANSFER_STATUS($data['wernis_type']), - 'raw_type' => strtolower($data['wernis_type']), + 'wernis_amount' => $data['wernis_amount'], + 'wernis_account' => $data['wernis_account'], + 'wernis_type' => $data['wernis_type'], 'sw' => $SW, ); @@ -106,13 +105,13 @@ if ((!isGetRequestParameterSet('mode')) || (getRequestParameter('mode') == 'choo // Is the payout mode active? if (getConfig('wernis_payout_active') == 'Y') { // Add link - $content['payout_link'] = "
{--MEMBER_WERNIS_MODE_PAYOUT--}
"; + $content['payout_link'] = '
{--MEMBER_WERNIS_MODE_PAYOUT--}
'; } // END - if // Is the withdraw mode active? if (getConfig('wernis_withdraw_active') == 'Y') { // Add link - $content['withdraw_link'] = "
{--MEMBER_WERNIS_MODE_WITHDRAW--}
"; + $content['withdraw_link'] = '
{--MEMBER_WERNIS_MODE_WITHDRAW--}
'; } // END - if // Mode chooser! ;-) diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index b988afb7d9..1c20fbe726 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -820,7 +820,7 @@ function addMaxReceiveList ($mode, $default = '', $return = false) { // Checks wether the given email address is used. function isEmailTaken ($email) { // Query the database - $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `email` LIKE '{PER}%s{PER}' OR `email` LIKE '{PER}%s{PER}' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `email` LIKE '%%%s%%' OR `email` LIKE '%%%s%%' LIMIT 1", array($email, str_replace('.', '{DOT}', $email)), __FUNCTION__, __LINE__); // Is the email there? diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index c91f93e88c..cee610df47 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -956,18 +956,6 @@ function getHttpStatus () { return $GLOBALS['http_status']; } -// Compiles config entries for SQL queries -function compileSqlConfig ($sqlString) { - // Replace all - foreach (array('_MYSQL_PREFIX', '_TABLE_TYPE') as $configEntry) { - // "Compile" it - $sqlString = str_replace('{?' . $configEntry . '?}', getConfig($configEntry), $sqlString); - } // END - foreach - - // Return the compiled SQL string - return $sqlString; -} - // Setter for 'is_template_html' function enableTemplateHtml ($enable = true) { $GLOBALS['is_template_html'] = (bool) $enable; diff --git a/templates/de/emails/admin/admin_wernis_request.tpl b/templates/de/emails/admin/admin_wernis_request.tpl index b46ccf1244..0e31d69026 100644 --- a/templates/de/emails/admin/admin_wernis_request.tpl +++ b/templates/de/emails/admin/admin_wernis_request.tpl @@ -25,7 +25,7 @@ An Konto: $content[account] Bitte überprüfen Sie diese Daten und überweisen Sie dann den geforderten Betrag. -Die {!WERNIS_POINTS_VALUE!} Wernis wurden dem Mitglied bereits abgebucht. +Die {%pipe,translateComma=$content[wernis_amout]%} Wernis wurden dem Mitglied bereits abgebucht. Bitte vergessen Sie nicht, das Mitglied über die Auszahlung zu informieren, da dies nicht automatisch erfolgt. diff --git a/templates/de/emails/confirm-member.tpl b/templates/de/emails/confirm-member.tpl index abb5253266..9e68df08bb 100644 --- a/templates/de/emails/confirm-member.tpl +++ b/templates/de/emails/confirm-member.tpl @@ -7,7 +7,7 @@ Sie können sich nun hier einloggen: Ihre Login-Id lautet: $userid URL zum Login: {?URL?}/login.php -für Ihre Anmeldung werden wir Ihnen als Willkommensgutschrift $content[points] {?POINTS?} gutschreiben, sobald Sie {?ref_payout?} Mails bestätigt haben. Erst dann können Sie Mails an die anderen Mitglieder verschicken! +für Ihre Anmeldung werden wir Ihnen als Willkommensgutschrift {%config,translateComma=points_register%} {?POINTS?} gutschreiben, sobald Sie {?ref_payout?} Mails bestätigt haben. Erst dann können Sie Mails an die anderen Mitglieder verschicken! Wir wünschen Ihnen viel Spass und Erfolg beim Mail-Versand! diff --git a/templates/de/emails/member/member_wernis_request.tpl b/templates/de/emails/member/member_wernis_request.tpl index 58ae5f913e..3b2db8c229 100644 --- a/templates/de/emails/member/member_wernis_request.tpl +++ b/templates/de/emails/member/member_wernis_request.tpl @@ -1,6 +1,6 @@ Hallo {%user,gender,translateGender=$userid%} {%user,surname=$userid%} {%user,family=$userid%}, -Sie hatten an uns {?MAIN_TITLE?} eine Auszahlungsanfrage geschickt. +Sie hatten an uns eine Auszahlungsanfrage geschickt. Wir haben folgende Daten von Ihnen per Mail erhalten: ------------------------------ @@ -15,7 +15,7 @@ Auszahlungshoehe: $content[payout] An Konto: $content[account] ------------------------------ -Die dazu nötigen {!WERNIS_POINTS_VALUE!} Wernis haben wir Ihnen bereits abgezogen. +Die dazu nötigen {%pipe,translateComma=$content[wernis_amout]%} Wernis haben wir Ihnen bereits abgezogen. Sie sollten soeben eine Aufbuchung auf Ihrem WDS66-Hauptaccount erhalten haben! diff --git a/templates/de/html/member/member_wernis_mode_list_row.tpl b/templates/de/html/member/member_wernis_mode_list_row.tpl index 1822ada377..376fc60575 100644 --- a/templates/de/html/member/member_wernis_mode_list_row.tpl +++ b/templates/de/html/member/member_wernis_mode_list_row.tpl @@ -1,6 +1,6 @@ - $content[points] Wernis - $content[wernis_account] + {%pipe,translateComma=$content[wernis_amount]%} Wernis + {%pipe,bigintval=$content[wernis_account]%} $content[wernis_timestamp] - $content[status] + {%pipe,WERNIS_TRANSFER_STATUS=$content[wernis_type]%}