]> git.mxchange.org Git - mailer.git/commitdiff
Countless fixes, ext-grade started:
authorRoland Häder <roland@mxchange.org>
Sun, 3 Jul 2011 21:47:01 +0000 (21:47 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 3 Jul 2011 21:47:01 +0000 (21:47 +0000)
- Extension ext-grade started: First tables created
- Countless fixes applied, this includes extension and cache management as well
  as avoiding around 3 needless SQL queries and badly handled ALTER TABLE
  queries in db-mysql3.php
- TODOs.txt updated

48 files changed:
DOCS/TODOs.txt
inc/classes/cachesystem.class.php
inc/config-functions.php
inc/db/lib-mysql3.php
inc/extensions-functions.php
inc/extensions/ext-admins.php
inc/extensions/ext-autopurge.php
inc/extensions/ext-beg.php
inc/extensions/ext-bonus.php
inc/extensions/ext-cache.php
inc/extensions/ext-coupon.php
inc/extensions/ext-grade.php
inc/extensions/ext-order.php
inc/extensions/ext-sql_patches.php
inc/extensions/ext-user.php
inc/filter-functions.php
inc/filter/cache_filter.php
inc/filter/coupon_filter.php
inc/filter/online_filter.php
inc/filters.php
inc/functions.php
inc/language/coupon_de.php
inc/libs/register_functions.php
inc/loader/load-admins.php
inc/loader/load-extension.php
inc/loader/load-refdepths.php
inc/loader/load-themes.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-add_rallye.php
inc/modules/admin/what-adminedit.php
inc/modules/admin/what-config_coupon.php
inc/modules/admin/what-config_home.php
inc/modules/admin/what-extensions.php
inc/modules/admin/what-list_admins_acls.php
inc/modules/admin/what-list_country.php
inc/modules/admin/what-list_links.php
inc/modules/admin/what-unlock_sponsor.php
inc/modules/guest/what-sponsor_login.php
inc/modules/guest/what-top10.php
inc/modules/member/what-categories.php
inc/mysql-manager.php
inc/session.php
inc/template-functions.php
inc/wrapper-functions.php
mailid.php
templates/de/html/admin/admin_config_coupon.tpl
templates/de/html/admin/admin_config_order.tpl
templates/de/html/admin/admin_config_refid.tpl

index 3e4f77a6cd1a837c4b8098b9442610ba8c007a0c..f4ede999e5cfddff1ae1b8677b3404984e3c89b2 100644 (file)
@@ -4,7 +4,7 @@
 ./beg.php:171:                 // @TODO Opps, what is missing here???
 ./birthday_confirm.php:93:             // @TODO Try to rewrite the following unset()
 ./inc/cache/config-local.php:124:// @TODO Rewrite the following three constants, somehow...
-./inc/classes/cachesystem.class.php:504:       // @TODO Add support for more types which break in last else-block
+./inc/classes/cachesystem.class.php:505:       // @TODO Add support for more types which break in last else-block
 ./inc/config-functions.php:136:        // @TODO Make this all better... :-/
 ./inc/daily/daily_beg.php:52:// @TODO This should be converted in a daily beg rallye
 ./inc/daily/daily_birthday.php:95:                     // @TODO 4 is hard-coded here, should we move it out in config?
 ./inc/extensions/ext-network.php:38: * @TODO Yoo!Media: What is LayerAd compared to Layer click?            *
 ./inc/extensions/ext-network.php:93:           // @TODO network_type_handle is an internal name and needs documentation
 ./inc/extensions/ext-newsletter.php:218:               // @TODO Move these into configuration
-./inc/extensions/ext-order.php:351:            // @TODO This should be moved out to inc/daily/
+./inc/extensions/ext-order.php:356:            // @TODO This should be moved out to inc/daily/
 ./inc/extensions/ext-rallye.php:329:           // @TODO Move this code into a hook
 ./inc/extensions/ext-rallye.php:92:            // @TODO Fix config_rallye_prices to list_rallye_prices
 ./inc/extensions/ext-yoomedia.php:121:         // @TODO Can this be moved into a database table?
 ./inc/extensions/ext-yoomedia.php:54:// @TODO Only deprecated when 'ext-network' is ready! setExtensionDeprecated('Y');
 ./inc/extensions-functions.php:155:    // @TODO Do we still need this? setExtensionUpdateNotes('');
-./inc/extensions-functions.php:1939:// @TODO This should be rewrittten to allow, more development states, e.g. 'planing','alpha','beta','beta2','stable'
+./inc/extensions-functions.php:1931:// @TODO This should be rewrittten to allow, more development states, e.g. 'planing','alpha','beta','beta2','stable'
 ./inc/extensions-functions.php:424:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
-./inc/extensions-functions.php:554:            // @TODO Extension is loaded, what next?
+./inc/extensions-functions.php:559:            // @TODO Extension is loaded, what next?
 ./inc/filter/bonus_filter.php:56:              // @TODO This query isn't right, it will only update if the user was for a longer time away!
 ./inc/filter/cache_filter.php:92:              // @TODO This should be rewritten not to load the cache file for just checking if it is there for save removal.
 ./inc/functions.php:1223:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
 ./inc/modules/admin/what-del_email.php:61:             // @TODO Unused: cat_id, payment_id
 ./inc/modules/admin/what-edit_user.php:18: * @TODO Add support for ext-country                                    *
 ./inc/modules/admin/what-email_stats.php:46:// @TODO Unused at the moment
-./inc/modules/admin/what-extensions.php:364:                                           // @TODO Rewrite this to a filter
+./inc/modules/admin/what-extensions.php:371:                                           // @TODO Rewrite this to a filter
 ./inc/modules/admin/what-guest_add.php:129:                            // @TODO This can be somehow rewritten to a function
 ./inc/modules/admin/what-guest_add.php:67:             // @TODO Cant this be rewritten?
 ./inc/modules/admin/what-guest_add.php:80:             // @TODO This can be somehow rewritten to a function
 ./inc/modules/admin/what-list_cats.php:69:                             // @TODO Rewrite this to countSum.....() function
 ./inc/modules/admin/what-list_links.php:55:            // @TODO Try to rewrite this to a filter
 ./inc/modules/admin/what-list_links.php:85:                            // @TODO Find a way to rewrite this. See some lines above for different queries
-./inc/modules/admin/what-list_links.php:94:                                    // @TODO Rewrite this to includes/filter
+./inc/modules/admin/what-list_links.php:93:                                    // @TODO Rewrite this to includes/filter
 ./inc/modules/admin/what-list_refs.php:107:                                                            // @TODO Try to rewrite some to EL
 ./inc/modules/admin/what-list_unconfirmed.php:107:     // @TODO "Please do not call me directly." Should be rewritten to a nice selection depending on ext-bonus
 ./inc/modules/admin/what-list_unconfirmed.php:84:      // @TODO This constant might be unused? define('__LIST_UNCON_TITLE', '{--ADMIN_LIST_UNCONFIRMED_BONUS_LINKS--}');
 ./inc/mysql-manager.php:1479:                  // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
 ./inc/mysql-manager.php:1567:          // @TODO Rewrite these lines to a filter
 ./inc/mysql-manager.php:1591:  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1965:                  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:2009:// @TODO Fix inconsistency between last_module and getWhat()
+./inc/mysql-manager.php:1959:                  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2003:// @TODO Fix inconsistency between last_module and getWhat()
 ./inc/mysql-manager.php:368:   // @TODO Try to rewrite this to one or more functions
 ./inc/mysql-manager.php:44:// @TODO Can we cache this?
 ./inc/purge/purge-inact.php:55:        // @TODO Rewrite these if() blocks to a filter
index 8f0b7e7175fbacd7b4f08b11c64cf22c31b454e4..aaaebe605205fd0b843abcb2761c5b5f5a1e5333 100644 (file)
@@ -333,6 +333,7 @@ class CacheSystem {
                        } // END - if
 
                        // Remove cache file from system
+                       //* DEBUG: */ debug_report_bug(__METHOD__, __LINE__, 'About to remove ' . basename($this->fqfn) . '!');
                        removeFile($this->fqfn);
 
                        // Reset read status
index 01d538db1977cd093cbb6e9edb1239a021e9220d..6a89335d85cc17a34b470dda5bf1f15b7bf953f0 100644 (file)
@@ -218,7 +218,7 @@ function updateOldConfigFile () {
                                        $new = strtolower($new);
                                } // END - if
 
-                               /// ... and write it to the new config
+                               // ... and write it to the new config
                                //* DEBUG: */ debugOutput('function=' . $function . ',new=' . $new . ',comment=' . $comment);
                                changeDataInInclude(getCachePath() . 'config-local.php', $comment, $function . "('" . $oldNew . "', \"", '");', constant($new), 0);
                                //* DEBUG: */ debugOutput('CHANGED!');
index 6a11f697f10bdbd08f0b8cc81bf3be3c357240df..03f3079edc7d89284f4ccb775c91db511b7490d7 100644 (file)
@@ -378,7 +378,7 @@ function SQL_ALTER_TABLE ($sql, $F, $L, $enableCodes = true) {
        $tableName = str_replace('`', '', $tableArray[2]);
 
        // Debug log
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sql=' . $sql . ',tableName=' . $tableName);
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sql=' . $sql . ',tableName=' . $tableName . ',tableArray=<pre>' . print_r($tableArray, true) . '</pre>');
 
        // Shall we add/drop?
        if (((strpos($sql, 'ADD') !== false) || (strpos($sql, 'DROP') !== false) || (strpos($sql, 'CHANGE') !== false)) && ($noIndex === true)) {
@@ -424,14 +424,15 @@ function SQL_ALTER_TABLE ($sql, $F, $L, $enableCodes = true) {
                // Skip this query silently because InnoDB does not understand fulltext indexes
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Skipped FULLTEXT: sql=%s,tableName=%s,hasZeroNums=%d,file=%s,line=%s", $sql, $tableName, intval((is_bool($result)) ? 0 : isSqlTableColumnFound($columnName)), $F, $L));
        } elseif ($noIndex === false) {
-               // And column name as well
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableArray=<pre>' . print_r($tableArray, true) . '</pre>');
+               // And column name as well without backticks
                $keyName = str_replace('`', '', $tableArray[5]);
+               /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'keyName=' . $keyName . ',tableArray=<pre>' . print_r($tableArray, true) . '</pre>');
 
                // Is this "UNIQUE" or so? FULLTEXT has been handled the elseif() block above
-               if (in_array(strtoupper($keyName), array('INDEX', 'UNIQUE', 'KEY', 'FULLTEXT'))) {
+               if (in_array(strtoupper($tableArray[4]), array('INDEX', 'UNIQUE', 'KEY', 'FULLTEXT'))) {
                        // Init loop
-                       $begin = 1; $keyName = ',';
+                       $begin = 1;
+                       $keyName = ',';
                        while (strpos($keyName, ',') !== false) {
                                // Use last
                                $keyName = str_replace('`', '', $tableArray[count($tableArray) - $begin]);
@@ -447,13 +448,18 @@ function SQL_ALTER_TABLE ($sql, $F, $L, $enableCodes = true) {
                } // END - if
 
                // Shall we run it?
-               if (!isSqlTableIndexAdded($tableName, $tableArray[3], $keyName)) {
-                       // Send it to the SQL_QUERY() function
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $sql);
+               /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ', tableArray[3]=' . $tableArray[3] . ',keyName=' . $keyName);
+               if ((!isSqlTableIndexAdded($tableName, $tableArray[3], $keyName)) && ($tableArray[3] == 'ADD')) {
+                       // Send it to the SQL_QUERY() function to add it
+                       /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $sql);
+                       $result = SQL_QUERY($sql, $F, $L, $enableCodes);
+               } elseif ((isSqlTableIndexAdded($tableName, $tableArray[3], $keyName)) && ($tableArray[3] == 'DROP')) {
+                       // Send it to the SQL_QUERY() function to drop it
+                       /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $sql);
                        $result = SQL_QUERY($sql, $F, $L, $enableCodes);
                } else {
                        // Not executed
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Not executed: ' . $sql);
+                       /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Not executed: ' . $sql);
                }
        } else {
                // Other ALTER TABLE query
index 9c270f2ff06c669d74a2ee122a4213af8e42f714..5ed3e89ecf1affbae67e9c159e7398f73e29f5db 100644 (file)
@@ -178,7 +178,7 @@ function loadExtension ($ext_name, $ext_mode, $ext_ver = '0.0.0', $dry_run = fal
        return true;
 }
 
-// Registeres an extension and possible update depencies
+// Registers an extension and possible update dependencies
 function registerExtension ($ext_name, $taskId, $dry_run = false) {
        // Set current extension name
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',task_id=' . $taskId . ',dry_run=' . intval($dry_run) . ' - ENTERED!');
@@ -482,6 +482,7 @@ function doExtensionSqls ($ext_id, $load_mode) {
 // Check wether the given extension is installed
 function isExtensionInstalled ($ext_name) {
        // We don't like empty extension names here
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - ENTERED!');
        if (empty($ext_name)) {
                // Please fix them all
                debug_report_bug(__FUNCTION__, __LINE__, 'ext_name is empty.');
@@ -493,25 +494,28 @@ function isExtensionInstalled ($ext_name) {
        // Check if there is a cache entry
        if (isset($GLOBALS['ext_is_installed'][$ext_name])) {
                // Use cache built from below queries
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - CACHE!');
                $isInstalled = $GLOBALS['ext_is_installed'][$ext_name];
        } elseif (isset($GLOBALS['cache_array']['extension']['ext_id'][$ext_name])) {
                // Found!
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - FOUND!');
                $isInstalled = true;
 
                // Count cache hits
                incrementStatsEntry('cache_hits');
        } elseif ((isInstallationPhase())) {
                // Extensions are all inactive/not installed during installation
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - installion phase');
        } else {
                // Look in database
                $ext_id = getExtensionId($ext_name);
 
-               // Log debug message
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Extension ' . $ext_name . ' has ext_id=' . $ext_id);
-
                // Do we have a record?
                $isInstalled = ($ext_id > 0);
 
+               // Log debug message
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',ext_id=' . $ext_id . ',isInstalled=' . intval($isInstalled));
+
                // Is it installed, then cache the entry
                if ($isInstalled === true) {
                        // Dummy call (get is okay here)
@@ -523,6 +527,7 @@ function isExtensionInstalled ($ext_name) {
        }
 
        // Return status
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',isInstalled=' . intval($isInstalled) . ' - EXIT!');
        return $isInstalled;
 }
 
@@ -620,16 +625,16 @@ function getExtensionVersion ($ext_name, $force = false) {
                if (SQL_NUMROWS($result) == 1) {
                        // Load entry
                        $data = SQL_FETCHARRAY($result);
+
+                       // Set cache
+                       $GLOBALS['cache_array']['extension']['ext_version'][$ext_name] = $data['ext_version'];
                } elseif (isDebugModeEnabled()) {
-                       // Not found, please report all
-                       debug_report_bug(__FUNCTION__, __LINE__, sprintf(": Cannot find extension %s in database!", $ext_name));
+                       // Not found, may happen while an extension is uninstalled
+                       logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot find extension %s in database!", $ext_name));
                }
 
                // Free result
                SQL_FREERESULT($result);
-
-               // Set cache
-               $GLOBALS['cache_array']['extension']['ext_version'][$ext_name] = $data['ext_version'];
        }
 
        // Extension version should not be invalid
@@ -855,7 +860,7 @@ function getExtensionId ($ext_name) {
                incrementStatsEntry('cache_hits');
        } else {
                // Load from database
-               $result = SQL_QUERY_ESC("SELECT `id` AS ext_id FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `id` AS `ext_id` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1",
                        array($ext_name), __FUNCTION__, __LINE__);
 
                // Is the entry there?
@@ -1218,11 +1223,11 @@ function addExtensionDependency ($updateDepends) {
        // Is it not yet added?
        if ((isset($updateDepends, $GLOBALS['ext_running_updates'][getCurrentExtensionName()])) && (in_array($updateDepends, getExtensionUpdatesRunning()))) {
                /*
-                * Double-adding isn't fine, too. This may mean that
-                * addExtensionDependency() was called outside the switch() command in
-                * the extension's file which requires fixing.
+                * Double-adding happens when the extension and an update of the same
+                * extension requires the same other extension again.
                 */
-               debug_report_bug(__FUNCTION__, __LINE__, 'updateDepends=' . $updateDepends . ',extensionMode=' . getExtensionMode() . ',currentExtension=' . getCurrentExtensionName() . ' - CALLED TWICE!');
+               logDebugMessage(__FUNCTION__, __LINE__, 'updateDepends=' . $updateDepends . ',extensionMode=' . getExtensionMode() . ',currentExtension=' . getCurrentExtensionName() . ' - called twice.');
+               return;
        } // END - if
 
        // Add it to the list of extension update depencies map
@@ -1634,28 +1639,29 @@ function removeExtensionFromArray () {
                        } // END - if
                }
        } // END - foreach
+
+       // Remove from other caches as well
+       unset($GLOBALS['ext_is_installed'][$ext_name]);
+       unset($GLOBALS['loaded_extension'][$ext_name]);
 }
 
 // "Getter" for 'extension has a CSS file' (with same name, of course)
 function getExtensionHasCss () {
-       // Default is no CSS
-       $hasCss = 'N';
-
-       // Construct FQFN for check
-       $FQFN = sprintf("%stheme/%s/css/%s.css",
-               getPath(),
-               getCurrentTheme(),
-               getCurrentExtensionName()
-       );
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__][getCurrentExtensionName()][getCurrentTheme()])) {
+               // Construct FQFN for check
+               $FQFN = sprintf("%stheme/%s/css/%s.css",
+                       getPath(),
+                       getCurrentTheme(),
+                       getCurrentExtensionName()
+               );
 
-       // Is it there?
-       if (isFileReadable($FQFN)) {
-               // Readable, so it is there...
-               $hasCss = 'Y';
+               // Is it there?
+               $GLOBALS[__FUNCTION__][getCurrentExtensionName()][getCurrentTheme()] = convertBooleanToYesNo(isFileReadable($FQFN));
        } // END - if
 
        // Return it
-       return $hasCss;
+       return $GLOBALS[__FUNCTION__][getCurrentExtensionName()][getCurrentTheme()];
 }
 
 // Checks wether the given extension has a language file
@@ -1665,17 +1671,8 @@ function ifExtensionHasLanguageFile ($ext_name) {
                // Count cache hits
                incrementStatsEntry('cache_hits');
        } else {
-               // Not readable is default
-               $readable = 'N';
-
-               // Is the language file readable for this extension?
-               if (isLanguageIncludeReadable($ext_name)) {
-                       // Readable
-                       $readable = 'Y';
-               } // END - if
-
-               // Put it in cache
-               $GLOBALS['cache_array']['extension']['ext_lang'][$ext_name] = $readable;
+               // Determine it and put it in cache
+               $GLOBALS['cache_array']['extension']['ext_lang'][$ext_name] = convertBooleanToYesNo(isLanguageIncludeReadable($ext_name));
        }
 
        // Return result
@@ -1731,15 +1728,10 @@ function isExtensionFunctionFileReadable ($ext_name) {
                $funcsInclude = sprintf("inc/libs/%s_functions.php", $ext_name);
 
                // Is this include there?
-               if ((isFileReadable($funcsInclude)) && (!isExtensionLibraryLoaded($ext_name)) && (getExtensionMode() == 'test')) {
-                       // Cache it!
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',ext_func=Y - FOUND!');
-                       $GLOBALS['cache_array']['extension']['ext_func'][$ext_name] = 'Y';
-               } else {
-                       // Cache it!
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',ext_func=N - NOT FOUND!');
-                       $GLOBALS['cache_array']['extension']['ext_func'][$ext_name] = 'N';
-               }
+               $isIncludeFound = ((isFileReadable($funcsInclude)) && (!isExtensionLibraryLoaded($ext_name)) && (getExtensionMode() == 'test'));
+
+               // And put in cache, converted
+               $GLOBALS['cache_array']['extension']['ext_func'][$ext_name] = convertBooleanToYesNo($isIncludeFound);
        }
 
        // Return result
index efb790295c738b50533ab3796f442b1ba604fb38..965c8335a88320cdabeb937097235f13ccbd622e 100644 (file)
@@ -118,7 +118,7 @@ PRIMARY KEY (`id`)
                                break;
 
                        case '0.3.1': // SQL queries for v0.3.1
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins_acls` MODIFY id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT");
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins_acls` CHANGE `id` `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT");
                                break;
 
                        case '0.4.0': // SQL queries for v0.4.0
index a92b734c67b6ce284bb05bba6e50df93d6594ef3..1fc0951f73efffc2b39104f602de25d427e9febe 100644 (file)
@@ -55,14 +55,14 @@ switch (getExtensionMode()) {
                addExtensionDependency('bonus');
 
                // SQL commands to run
-               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_pool` MODIFY data_type ENUM('TEMP','SEND','NEW','ADMIN','ACTIVE','DELETED') NOT NULL DEFAULT 'TEMP'");
-               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_bonus` MODIFY `data_type` ENUM('NEW','QUEUE','SEND','DELETED') NOT NULL DEFAULT 'NEW'");
+               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_pool` CHANGE `data_type` `data_type` ENUM('TEMP','SEND','NEW','ADMIN','ACTIVE','DELETED') NOT NULL DEFAULT 'TEMP'");
+               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_bonus` CHANGE `data_type` ENUM('NEW','QUEUE','SEND','DELETED') NOT NULL DEFAULT 'NEW'");
                break;
 
        case 'remove': // Do stuff when removing extension
                // SQL commands to run
-               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_pool` MODIFY `data_type` ENUM('TEMP','SEND','NEW','ADMIN','ACTIVE') NOT NULL DEFAULT 'TEMP'");
-               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_bonus` MODIFY `data_type` ENUM('NEW','QUEUE','SEND') NOT NULL DEFAULT 'NEW'");
+               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_pool` CHANGE `data_type` `data_type` ENUM('TEMP','SEND','NEW','ADMIN','ACTIVE') NOT NULL DEFAULT 'TEMP'");
+               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_bonus` CHANGE `data_type` `data_type` ENUM('NEW','QUEUE','SEND') NOT NULL DEFAULT 'NEW'");
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_autopurge','list_autopurge')");
                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` DROP `ap_notified`");
                break;
index 069bd9de865aa6f6d2a3c73877c5a41f0405eca0..59a28de5a8564de2714ce37cf5d0fdf94dff3735 100644 (file)
@@ -159,11 +159,9 @@ PRIMARY KEY (`id`)
                                addConfigAddSql('beg_rallye', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
                                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `beg_points` FLOAT(21,5) UNSIGNED NOT NULL DEFAULT 0.00000");
 
-                               $visible = 'N'; $locked = 'Y';
-                               if (isExtensionActive('beg')) {
-                                       $visible = 'Y';
-                                       $locked = 'N';
-                               } // END - if
+                               // Determine if menu entries are locked and/or visible to the user
+                               $visible = convertBooleanToYesNo(isExtensionActive('beg'));
+                               $locked = convertBooleanToYesNo(!isExtensionActive('beg'));
 
                                addMemberMenuSql('main','beg2','Bettel-Rallye', $visible, $locked, 7);
                                addAdminMenuSql('user','list_beg','Bettel-Rallye','Listet alle Teilnehmer der monatlichen Bettel-Rallye auf.','12');
@@ -311,7 +309,9 @@ INDEX (`userid`)
        case 'init': // When extension is initialized
                // Remove old entries
                $OLD = getBegTimeout();
-               if (getBegUseridTimeout() > $OLD) $OLD = getBegUseridTimeout();
+               if (getBegUseridTimeout() > $OLD) {
+                       $OLD = getBegUseridTimeout();
+               } // END - if
                SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_beg_ips` WHERE (UNIX_TIMESTAMP() - `timeout`) >= ' . ($OLD + 60*60) . '', __FILE__, __LINE__);
 
                // Check for beg rallye is active and send mails out
index 553388d74441377a8306a3655a94a0cf7c9e619c..e7e5e68e464f57f79ae0d7e8b83f687b0340bde5 100644 (file)
@@ -72,7 +72,7 @@ switch (getExtensionMode()) {
 KEY (`cat_id`),
 PRIMARY KEY (`id`)
 ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Bonus mails'");
-               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` MODIFY `link_type` ENUM('NORMAL','BONUS') NOT NULL DEFAULT 'NORMAL'");
+               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` CHANGE `link_type` `link_type` ENUM('NORMAL','BONUS') NOT NULL DEFAULT 'NORMAL'");
                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` ADD `bonus_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` ADD INDEX (`bonus_id`)");
 
@@ -125,8 +125,8 @@ PRIMARY KEY (`id`)
                                break;
 
                        case '0.2.1': // SQL queries for v0.2.1
-                               // Add extension dependency because of the update command
-                               addExtensionDependency('sql_patches');
+                               // Add extension dependency to ex-tuser because of the ALTER command
+                               addExtensionDependency('user');
 
                                addConfigAddSql('login_bonus', 'FLOAT(20,3) NOT NULL DEFAULT 10.000');
                                addConfigAddSql('turbo_bonus', 'FLOAT(20,3) NOT NULL DEFAULT 100.000');
index ee324dcf1c81c2b85ba52ae715c474f8e4c831b7..fe584e1459301fbc5f971a0d1907d1d268f7d4c2 100644 (file)
@@ -100,14 +100,8 @@ switch (getExtensionMode()) {
                                break;
 
                        case '0.0.4': // SQL queries for v0.0.4
-                               // Is the cache extension itself there?
-                               if (isExtensionActive('cache')) {
-                                       // Check for cache when extension is already installed
-                                       if ($GLOBALS['cache_instance']->loadCacheFile('extension')) $GLOBALS['cache_instance']->removeCacheFile();
-                               } // END - if
-
                                // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Spalte &quot;keep_active&quot; ist hinzugef&uuml;gt. Cache wurde reinitialisiert.");
+                               setExtensionUpdateNotes("Spalte &quot;keep_active&quot; ist hinzugef&uuml;gt.");
                                break;
 
                        case '0.0.5': // SQL queries for v0.0.5
@@ -249,7 +243,7 @@ switch (getExtensionMode()) {
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Daten von gefundenen Sprachdateien werden zu den Erweiterungen gecacht.");
                                break;
-               }
+               } // END - switch
                break;
 
        case 'modify': // When the extension got modified
@@ -264,7 +258,7 @@ switch (getExtensionMode()) {
        default: // Unknown extension mode
                logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
                break;
-}
+} // END - switch
 
 // [EOF]
 ?>
index b092481bb7da48b1c60cc7bd6c8aea4824d71a53..7f9ab18d82718bfb5d3844c7e5cbc363772f183e 100644 (file)
@@ -43,14 +43,14 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.0.0');
+setThisExtensionVersion('0.0.1');
 
 // Version history array (add more with , '0.1' and so on)
-setExtensionVersionHistory(array('0.0.0'));
+setExtensionVersionHistory(array('0.0.0', '0.0.1'));
 
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installtion is running
-               // This extension requires an up-to-date user
+               // This extension requires an up-to-date ext-user
                addExtensionDependency('user');
 
                // Coupon data
@@ -62,7 +62,7 @@ switch (getExtensionMode()) {
 `coupon_type` ENUM('CODE','API') NOT NULL DEFAULT 'CODE',
 `total_created` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `total_cashed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`points` FLOAT(20,5) NOT NULL DEFAULT 0.00000,
+`points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
 `coupon_description` TEXT,
 PRIMARY KEY (`id`)
 ) TYPE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Created coupons'");
@@ -82,10 +82,7 @@ UNIQUE KEY (`coupon_code`)
 
                // Configuration entries
                addConfigAddSql('coupon_default_time', 'BIGINT(20) NOT NULL DEFAULT ' . (getOneDay() * 7));
-               addConfigAddSql('coupon_default_points', 'FLOAT(20,5) NOT NULL DEFAULT 100.00000');
-               addConfigAddSql('coupon_points_account', "ENUM('ORDER','GENERAL') NOT NULL DEFAULT 'ORDER'");
-               addConfigAddSql('coupon_payment_method', "ENUM('DIRECT','REF') NOT NULL DEFAULT 'DIRECT'");
-               addConfigAddSql('coupon_locked_points_mode', "ENUM('LOCKED','UNLOCKED') NOT NULL DEFAULT 'LOCKED'");
+               addConfigAddSql('coupon_default_points', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 100.00000');
                addConfigAddSql('coupon_autopurge_time', 'BIGINT(20) NOT NULL DEFAULT ' . (getOneDay() * 7));
                addConfigAddSql('coupon_userid', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
 
@@ -131,7 +128,16 @@ UNIQUE KEY (`coupon_code`)
        case 'update': // Update an extension
                switch (getCurrentExtensionVersion()) {
                        case '0.0.1': // SQL queries for v0.0.1
-                               addExtensionSql('');
+                               addConfigDropSql('coupon_points_account');
+                               addConfigDropSql('coupon_payment_method');
+                               addConfigDropSql('coupon_locked_points_mode');
+
+                               // This extension's update requires an up-to-date ext-sql_patches and ext-order
+                               addExtensionDependency('sql_patches');
+                               addExtensionDependency('order');
+
+                               // Insert data in new table
+                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_points_data` (`ext_name`,`column_name`,`locked_mode`,`payment_method`) VALUES('coupon','order_points','LOCKED','DIRECT')");
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes('');
index aa953614e644268783353b3fc7664f5e7b0fb3ac..750c41fba83cad2d3067eb301c5bc84cbacd15aa 100644 (file)
@@ -51,11 +51,58 @@ enableExtensionProductive(false);
 
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running
-               // SQL commands to run
+               // General and grade level data
+               addDropTableSql('grade_data');
+               addCreateTableSql('grade_data', "(
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`grade_name` VARCHAR(255) NOT NULL DEFAULT '',
+`grade_parent_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
+PRIMARY KEY (`id`),
+INDEX (`grade_parent_id`)
+) TYPE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Grade general data'");
+
+               // Data for if a grade level has been reached
+               addDropTableSql('grade_cash_data');
+               addCreateTableSql('grade_cash_data', "(
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`grade_cash_name` VARCHAR(255) NOT NULL DEFAULT '',
+`grade_cash_type` ENUM('DISCOUNT','BONUS') NOT NULL DEFAULT 'DISCOUNT',
+`reached_points` FLOAT(20,5) UNSIGNED NULL DEFAULT NULL,
+`reached_mails` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
+`time_valid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+PRIMARY KEY (`id`),
+) TYPE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Grade data if the grade have been \"cashed\"'");
+
+               // Connection grade<->cash data
+               addDropTableSql('grade_cash_connect');
+               addCreateTableSql('grade_cash_conenct', "(
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`grade_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`grade_cash_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+PRIMARY KEY (`id`),
+UNIQUE KEY `grade_cash` (`grade_id`, `grade_cash_id`),
+INDEX (`grade_cash_id`)
+) TYPE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Grade<->cash data connection'");
+
+               // Connection grade<->user data
+               addDropTableSql('grade_user_connect');
+               addCreateTableSql('grade_user_connect', "(
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`grade_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`grade_expired TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
+PRIMARY KEY (`id`),
+UNIQUE KEY (`userid`, `grade_id`),
+INDEX (`grade_id`)
+) TYPE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Grade<->user connection'");
                break;
 
        case 'remove': // Do stuff when removing extension
                // SQL commands to run
+               addDropTableSql('grade_data');
+               addDropTableSql('grade_cash_data');
+               addDropTableSql('grade_cash_connect');
+               addDropTableSql('grade_user_connect');
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index 97256d5ccfec35d07f646c3252c49766ecf61ed2..c730ffb8c3b51e2023333c712636bc67adeb20ef 100644 (file)
@@ -329,8 +329,8 @@ INDEX (`pool_id`)
                                break;
 
                        case '0.5.3': // SQL queries for v0.5.3
-                               addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` ADD `order_points` FLOAT(20,5) NOT NULL DEFAULT 0.00000');
-                               addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` ADD `locked_order_points` FLOAT(20,5) NOT NULL DEFAULT 0.00000');
+                               addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` ADD `order_points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000');
+                               addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` ADD `locked_order_points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000');
 
                                // This update depends on ext-user
                                addExtensionDependency('user');
index 41b96a4ef7a33cf7c708bd657c45a84f064956f7..aadb6f7534313114079fa839f1824c26e8372cf6 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.7.9');
+setThisExtensionVersion('0.8.0');
 
 // Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9'));
+setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0'));
 
 // Keep this extension always active!
 setExtensionAlwaysActive('Y');
@@ -60,21 +60,26 @@ switch (getExtensionMode()) {
                addDropTableSql('admin_menu_las');
                addDropTableSql('admin_menu_las_data');
                addDropTableSql('admin_las_stats');
-               addDropTableSql('filters');
                addDropTableSql('dns_cache');
 
                // Delete admin menu entries
-               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE
-`what`='config_extensions' OR
-`what`='config_home' OR
-`what`='list_unconfirmed' OR
-`what`='config_refid' OR
-`what`='config_title' OR
-`what`='sub_points' OR
-`what`='config_admin' OR
-`what`='config_proxy' OR
-`what`='config_session' OR
-`what`='list_filter'");
+               addExtensionSql("DELETE LOW_PRIORITY FROM
+       `{?_MYSQL_PREFIX?}_admin_menu`
+WHERE
+       `what`
+IN (
+       'config_extensions',
+       'config_home',
+       'list_unconfirmed',
+       'config_refid',
+       'config_title',
+       'sub_points',
+       'config_admin',
+       'config_proxy',
+       'config_session',
+       'list_filter',
+       'list_point_accounts'
+)");
 
                // Delete/update member menu entries
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE
@@ -209,7 +214,7 @@ switch (getExtensionMode()) {
                                break;
 
                        case '0.1.5': // SQL queries for v0.1.5
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_extensions` DROP ext_has_admin");
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_extensions` DROP `ext_has_admin`");
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Spalte <u>ext_has_admin</u> aus der Tabelle <u>{?_MYSQL_PREFIX?}_extensions</u> entfernt, da sie keinen Sinn mehr macht.");
@@ -445,7 +450,7 @@ PRIMARY KEY (`id`)
                        case '0.3.6': // SQL queries for v0.3.6
                                addConfigAddSql('salt_length', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 10');
                                addConfigAddSql('pass_scramble', "VARCHAR(255) NOT NULL DEFAULT ''");
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` MODIFY `password` VARCHAR(255) NOT NULL DEFAULT ''");
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` CHANGE `password` `password` VARCHAR(255) NOT NULL DEFAULT ''");
                                addConfigAddSql('rand_no', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
                                addConfigAddSql('file_hash', "VARCHAR(255) NOT NULL DEFAULT ''");
                                addConfigAddSql('master_salt', "VARCHAR(255) NOT NULL DEFAULT ''");
@@ -617,9 +622,9 @@ PRIMARY KEY (`id`)
                                break;
 
                        case '0.5.9': // SQL queries for v0.5.9
-                               addDropTableSql('filters');
+                               // Table 'filters' is vital because many functionality depends on it, so don't remove it
                                addCreateTableSql('filters', "(
-`filter_id` BIGINT(20) UNSIGNED AUTO_INCREMENT,
+`filter_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `filter_name` VARCHAR(50) NOT NULL DEFAULT '',
 `filter_function` VARCHAR(100) NOT NULL DEFAULT '',
 `filter_active` ENUM('N','Y') NOT NULL DEFAULT 'Y',
@@ -724,7 +729,7 @@ PRIMARY KEY (`filter_id`)
 `added` DATETIME NOT NULL,
 PRIMARY KEY (`hostname`),
 INDEX (`ip`)
-) ENGINE = {?_TABLE_TYPE?}");
+) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Cache for DNS requests'");
 
                                // Configuration
                                addConfigAddSql('dns_cache_timeout', 'BIGINT(20) NOT NULL DEFAULT ' . (60*60*24));
@@ -802,6 +807,26 @@ INDEX (`ip`)
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Adminscript <strong>what-config_email.php</strong> nach <strong>what-list_email_max_rec.php</strong> umbenannt.");
                                break;
+
+                       case '0.8.0': // SQL queries for v0.8.0
+                               // Points account data
+                               addDropTableSql('points_data');
+                               addCreateTableSql('points_data', "(
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`ext_name` VARCHAR(255) NOT NULL DEFAULT '',
+`column_name` VARCHAR(255) NOT NULL DEFAULT 'points',
+`locked_mode` ENUM('LOCKED','UNLOCKED') NOT NULL DEFAULT 'LOCKED',
+`payment_method` ENUM('DIRECT','REF') NOT NULL DEFAULT 'REF',
+PRIMARY KEY(`id`),
+INDEX (`ext_name`)
+) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Points account data'");
+
+                               // Admin menu
+                               addAdminMenuSql('setup','list_point_accounts','Guthabenkonten...','Veralten Sie hier bequem Einstellungen zu den Guthabenkonten.',5);
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Tabelle <em>points_data</em> erzeugt, diese soll das {?POINTS?}-Guthaben komplett lenken.");
+                               break;
                } // END - switch
                break;
 
index 0bcac1b6b73a53666a3d578699df06e74de59175..5fdfa40d1b9dca1c814d88f9c48968702bb7e923 100644 (file)
@@ -410,9 +410,6 @@ PRIMARY KEY (`id`)
                                addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `pool_id`=NULL WHERE `pool_id`=0');
                                addExtensionSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `userid` IS NULL');
 
-                               // This update depends on ext-bonus
-                               addExtensionDependency('bonus');
-
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("NULL ist wichtiger als 0 und UNSIGNED auch.");
                                break;
index 4d766f980ee59f7b7ad4e581242cd1390c7fdbc2..0ec69f0fb318f4701ebf997779aaae6aa08a2245 100644 (file)
@@ -58,7 +58,9 @@ function initFilterSystem () {
        } elseif ((!isInstallationPhase()) && (isExtensionInstalledAndNewer('sql_patches', '0.5.9'))) {
                // Init add
                $add = '';
-               if (isExtensionINstalledAndNewer('sql_patches', '0.6.0')) $add = ", `filter_counter`";
+               if (isExtensionINstalledAndNewer('sql_patches', '0.6.0')) {
+                       $add = ", `filter_counter`";
+               } // END - if
 
                // Load all filters
                $result = SQL_QUERY('SELECT
@@ -133,6 +135,7 @@ ORDER BY
        registerFilter('post_extension_installed', 'SOLVE_TASK');
        registerFilter('post_extension_installed', 'LOAD_INCLUDES');
        registerFilter('post_extension_installed', 'REMOVE_UPDATES');
+       registerFilter('post_extension_installed', 'EXTENSION_MARK_INSTALLED');
 
        // Solving tasks
        registerFilter('solve_task', 'SOLVE_TASK');
@@ -225,7 +228,7 @@ function registerFilter ($filterName, $filterFunction, $silentAbort = true, $for
 
 // "Unregisters" a filter from the given chain
 function unregisterFilter ($F, $L, $filterName, $filterFunction, $force = false, $dry_run = false) {
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',dry_run=' . intval($dry_run) . ' - ENTERED!');
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',dry_run=' . intval($dry_run) . ' - ENTERED!');
 
        // Extend the filter function name only if not loaded from database
        if (!isset($GLOBALS['cache_array']['filter']['loaded'][$filterName][$filterFunction])) {
@@ -242,11 +245,11 @@ function unregisterFilter ($F, $L, $filterName, $filterFunction, $force = false,
        // Shall we remove? (default, not while just showing an extension removal)
        if ($dry_run === false) {
                // Mark for filter removal
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'REMOVE: F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction);
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ' - REMOVE!');
                $GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = 'R';
        } // END - if
 
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',dry_run=' . intval($dry_run) . ' - EXIT!');
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',dry_run=' . intval($dry_run) . ' - EXIT!');
 }
 
 // "Runs" the given filters, filterData is optional and can be any type of data
index dd9d22b7d8be6df9dde9e6f4d6e02dfd163ca0b5..704d3e8f3c74cfc56f15a313df6be84e01794093 100644 (file)
@@ -104,7 +104,7 @@ function FILTER_CACHE_DESTROY_ALL ($data) {
 function FILTER_CACHE_DESTROY_FILTER ($data) {
        // Skip this step if the cache instance is not there
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
-       if ((!isCacheInstanceValid()) || (getConfig('update_filter_usage') != 'Y')) {
+       if ((!isCacheInstanceValid()) || ((isConfigEntrySet('update_filter_usage')) && (getConfig('update_filter_usage') != 'Y'))) {
                return false;
        } // END - if
 
index cafe31b95ee302a2dc0259658909a68fe902a78b..098c83ec8f68592b670cf31909542c2216a9ff46 100644 (file)
@@ -43,17 +43,8 @@ if (!defined('__SECURITY')) {
 // Filter to change column name for the right "points account"
 function FILTER_COUPON_CHANGE_POINTS_COLUMN_NAME ($data) {
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
-       // Are the points locked?
-       if (($data['locked'] === true) && (getConfig('coupon_locked_points_mode') == 'LOCKED')) {
-               // Locked points may be routed to special account
-               $data['column'] = 'locked_order_points';
-       } elseif (getConfig('coupon_points_account') == 'ORDER') {
-               // These points should be routed to 'order' account
-               $data['column'] = 'order_points';
-       } else {
-               // Else all went to general account
-               $data['column'] = 'points';
-       }
+       // Get the column name from extension's name and 'locked'
+       $data['column'] = getPointsColumnNameFromExtensionNameLocked('coupon', $data['locked']);
 
        // Return data
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
index d31c793c63484772b2885b102f6bbc04bfb799ed..68e73929e5a53d8fc4e6b9fbce7e3ea8f874c2d9 100644 (file)
@@ -57,20 +57,14 @@ function FILTER_UPDATE_ONLINE_LIST ($data) {
 
        // Initialize variables
        $userid = '0';
-       $isMember = 'N';
-       $isAdmin = 'N';
-       $action = getActionFromModuleWhat(getModule(), getWhat());
+       $isMember = convertBooleanToYesNo(isMember());
+       $isAdmin  = convertBooleanToYesNo(isAdmin());
+       $action   = getActionFromModuleWhat(getModule(), getWhat());
 
        // Valid userid?
        if (isMember()) {
-               // Is valid user
+               // Is valid user, so get the userid
                $userid = getMemberId();
-               $isMember = 'Y';
-       } // END - if
-
-       if (isAdmin()) {
-               // Is administrator
-               $isAdmin = 'Y';
        } // END - if
 
        // Now search for the user
index c8b52da2c81ef4dabc3415d27884e8f91c2e18bd..020521858b84c815a9825f604c764518fc69343a 100644 (file)
@@ -61,6 +61,7 @@ function FILTER_FLUSH_FILTERS () {
        // Is the extension sql_patches updated?
        if ((!isExtensionInstalled('sql_patches')) || (isExtensionInstalledAndOlder('sql_patches', '0.5.9'))) {
                // Abort silently here
+               logDebugMessage(__FUNCTION__, __LINE__, 'Cannot flush filters, sql_patches might be missing. isExtensionInstalled()=' . isExtensionInstalled('sql_patches') . ',isExtensionInstalledAndOlder()=' . isExtensionInstalledAndOlder('sql_patches', '0.5.9'));
                return false;
        } // END - if
 
@@ -242,6 +243,7 @@ function FILTER_LOAD_INCLUDES ($pool) {
 // Filter for running SQL commands
 function FILTER_RUN_SQLS ($data) {
        // Debug message
+       //* DEBUG: */ die('getSqls()=<pre>'.print_r(getSqls(), true).'</pre>ext_update_depends=<pre>'.print_r($GLOBALS['ext_update_depends'], true).'</pre>');
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '- Entered!');
 
        // Is the array there?
@@ -600,16 +602,15 @@ function FILTER_RUN_RESET_INCLUDES () {
 
        // Is the config entry set?
        if (isExtensionInstalledAndNewer('sql_patches', '0.4.2')) {
-               // Create current week mark
-               $currWeek = getWeek();
-
                // Has it changed?
-               if ((getConfig('last_week') != $currWeek) || (isWeeklyResetDebugEnabled())) {
+               if (((isConfigEntrySet('last_week')) && (getConfig('last_week') != getWeek())) || (isWeeklyResetDebugEnabled())) {
                        // Include weekly reset scripts
                        mergeIncludePool('reset', getArrayFromDirectory('inc/weekly/', 'weekly_'));
 
                        // Update config if not in debug mode
-                       if (!isWeeklyResetDebugEnabled()) updateConfiguration('last_week', $currWeek);
+                       if (!isWeeklyResetDebugEnabled()) {
+                               updateConfiguration('last_week', getWeek());
+                       } // END - if
                } // END - if
 
                // Create current month mark
@@ -783,7 +784,7 @@ function FILTER_RUN_HOURLY_RESET () {
        } // END - if
 
        // Shall we run the reset scripts? If a day has changed, maybe also a week/month has changed... Simple! :D
-       if (((getConfig('last_hour') != getHour()) || (isDebugResetEnabled())) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestParameterSet('register')) && (!isCssOutputMode())) {
+       if ((((isConfigEntrySet('last_hour')) && (getConfig('last_hour') != getHour())) || (isDebugResetEnabled())) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestParameterSet('register')) && (!isCssOutputMode())) {
                // Tell every module we are in reset-mode!
                doHourly();
        } // END - if
@@ -1078,5 +1079,11 @@ function FILTER_SET_CURRENT_DATE () {
        setConfigEntry('START_TDAY', makeTime(0, 0, 0, time()));
 }
 
+// Filter for marking extension as installed
+function FILTER_EXTENSION_MARK_INSTALLED ($data) {
+       // Mark it as installed
+       $GLOBALS['ext_is_installed'][$data['ext_name']] = true;
+}
+
 // [EOF]
 ?>
index d8f842c1f4194d7954f5cddc520fe3e7b1b0f87b..4b5a7854cb2599f803b96b4338143a1369765860 100644 (file)
@@ -2360,6 +2360,19 @@ function getReferalId () {
        return $GLOBALS['refid'];
 }
 
+// Converts a boolean variable into 'Y' for true and 'N' for false
+function convertBooleanToYesNo ($boolean) {
+       // Default is 'N'
+       $converted = 'N';
+       if ($boolean === true) {
+               // Set 'Y'
+               $converted = 'Y';
+       } // END - if
+
+       // Return it
+       return $converted;
+}
+
 //-----------------------------------------------------------------------------
 // Automatically re-created functions, all taken from user comments on www.php.net
 //-----------------------------------------------------------------------------
index 7c1a6d33c7ed123aaa73eeaca75c31c9b4e2be76..1974e5cacf148abc96ac330c3c027ce00bce5cdf 100644 (file)
@@ -47,9 +47,6 @@ addMessages(array(
        'ADMIN_CONFIG_COUPON_DEFAULT_TIME' => "Zeit, bis Gutscheine ablaufen sollen. Sie k&ouml;nnen diesen Ausgangswert beim Erstellen von neuen Gutscheinen nachtr&auml;glich anpassen.",
        'ADMIN_CONFIG_COUPON_DEFAULT_POINTS' => "Ausgangsverg&uuml;tung in {?POINTS?}. Sie k&ouml;nnen diesen Ausgangswert beim Erstellen von neuen Gutscheinen nachtr&auml;glich anpassen.",
        'ADMIN_CONFIG_COUPON_AUTOPURGE_TIME' => "Dauer bis abgelaufene Gutscheine aus der Datenbank entfernt werden",
-       'ADMIN_CONFIG_COUPON_SELECT_PAYMENT_METHOD' => "Soll nur dem Mitglied direkt die Gutschrift aus dem Einl&ouml;sen von Gutscheinen oder &uuml;ber das Referal-System gutgeschrieben werden?",
-       'ADMIN_CONFIG_COUPON_SELECT_POINTS_ACCOUNT' => "Sollen die {?POINTS?} aus den eingel&ouml;sten Gutscheinen dem allgemeinen oder dem Werbekonto gutgeschrieben werden?",
-       'ADMIN_CONFIG_COUPON_SELECT_LOCKED_POINTS_MODE' => "Wenn das Mitglied noch zu best&auml;tigende Mails offen hat, sollen die eingel&ouml;sten Gutscheine einem gesperrten Konto oder dem oben eingestellten gutgeschrieben werden?",
        'ADMIN_CONFIG_COUPON_USERID' => "Mitgliederaccount, von dem die eingel&ouml;sten {?POINTS?} abgebucht werden sollen:",
 
        // Admin - Send coupon to members
index 2c64352d764d6cb2bdf509b08b816b30b5d071bc..f1c329ea0b8b5f06d6ebb068aef9407e32033330 100644 (file)
@@ -369,11 +369,14 @@ function doRegistration () {
 
        // Write catgories
        if ((is_array(postRequestParameter('cat'))) && (count(postRequestParameter('cat')))) {
-               foreach (postRequestParameter('cat') as $cat => $joined) {
+               foreach (postRequestParameter('cat') as $categoryId => $joined) {
                        if ($joined == 'Y') {
                                // Insert category entry
                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_cats` (`userid`, `cat_id`) VALUES (%s, %s)",
-                                       array($userid, bigintval($cat)), __FUNCTION__, __LINE__);
+                                       array(
+                                               $userid,
+                                               bigintval($categoryId)
+                                       ), __FUNCTION__, __LINE__);
                        } // END - if
                } // END - foreach
        } // END - if
index f769d6b98cfa4cd42a03e121d53393d36cb9d2d1..190347f9a3e42c1732ff1034b32b986836d9af1f 100644 (file)
@@ -140,17 +140,20 @@ if (isExtensionInstalledAndNewer('admins', '0.3')) {
                                $GLOBALS['cache_instance']->removeCacheFile();
                                unset($GLOBALS['cache_array']['admin_acls']);
                        }
-               } else {
+               } elseif (count($GLOBALS['cache_array']['admin_acls']) > 0) {
                        // Nope, cache file is corrupted!
                        $GLOBALS['cache_instance']->removeCacheFile();
                        unset($GLOBALS['cache_array']['admin_acls']);
+               } elseif (isDebugModeEnabled()) {
+                       // This may drive a lot messages to the logfile
+                       //* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'No entry found in admin_acls to rewrite.');
                }
        } elseif (isHtmlOutputMode()) {
                // Create cache file here
                $GLOBALS['cache_instance']->init();
 
-               // Load all modules and their data (column 'id' is no longer required)
-               $result = SQL_QUERY('SELECT `admin_id`, `action_menu`, `what_menu`, `access_mode` FROM `{?_MYSQL_PREFIX?}_admins_acls` ORDER BY `admin_id` ASC, `action_menu` ASC, `what_menu` ASC', __FILE__, __LINE__);
+               // Load all admins and their data
+               $result = SQL_QUERY('SELECT * FROM `{?_MYSQL_PREFIX?}_admins_acls` ORDER BY `admin_id` ASC, `action_menu` ASC, `what_menu` ASC', __FILE__, __LINE__);
 
                // Add all rows
                while ($content = SQL_FETCHARRAY($result)) {
index aad9cd0ab782e5fac67a1cd14bf99c64592449d4..3922ef4d2d018dbe93408a836ea65b9847900d53 100644 (file)
@@ -61,7 +61,9 @@ if (($GLOBALS['cache_instance']->loadCacheFile('extension')) && ($GLOBALS['cache
                // Loop through all
                foreach ($EXT_DUMMY['ext_name'] as $k => $ext_name) {
                        // Load CSS file
-                       if ($EXT_DUMMY['ext_css'][$k] == 'Y') addExtensionCssFile($ext_name . '.css');
+                       if ($EXT_DUMMY['ext_css'][$k] == 'Y') {
+                               addExtensionCssFile($ext_name . '.css');
+                       } // END - if
 
                        // Load extension file itself
                        if (($EXT_DUMMY['ext_active'][$k] == 'Y') || ($EXT_DUMMY['ext_keep'][$k] == 'Y')) {
@@ -136,34 +138,24 @@ if (($GLOBALS['cache_instance']->loadCacheFile('extension')) && ($GLOBALS['cache
 
        // Add more if sql_patches is recent enougth
        $add = '';
-       if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) $add = ", `ext_has_css` AS ext_css";
+       if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
+               $add = ', `ext_has_css` AS `ext_css`';
+       } // END - if 
 
        // Load all modules and their data
-       $result = SQL_QUERY('SELECT `id` AS ext_id, `ext_name`, `ext_active`, `ext_version`'.$add.' FROM `{?_MYSQL_PREFIX?}_extensions` ORDER BY `ext_name` ASC', __FILE__, __LINE__);
+       $result = SQL_QUERY('SELECT `id` AS `ext_id`, `ext_name`, `ext_active`, `ext_version`' . $add . ' FROM `{?_MYSQL_PREFIX?}_extensions` ORDER BY `ext_name` ASC', __FILE__, __LINE__);
        while ($content = SQL_FETCHARRAY($result)) {
                // Load extension
                loadExtension($content['ext_name'], 'test');
 
                // Get menu entry
-               $content['ext_menu'] = 'N';
-               if (ifModuleHasMenu($content['ext_name'], true)) {
-                       // Extension is a module and has menu... pew!
-                       $content['ext_menu'] = 'Y';
-               } // END - if
+               $content['ext_menu'] = convertBooleanToYesNo(ifModuleHasMenu($content['ext_name'], true));
 
                // Get language entry
-               $content['ext_lang'] = 'N';
-               if (isLanguageIncludeReadable($content['ext_name'])) {
-                       // Readable
-                       $content['ext_lang'] = 'Y';
-               } // END - if
+               $content['ext_lang'] = convertBooleanToYesNo(isLanguageIncludeReadable($content['ext_name']));
 
                // Get function entry
-               $content['ext_func'] = 'N';
-               if (isExtensionFunctionFileReadable($content['ext_name'])) {
-                       // Readable
-                       $content['ext_func'] = 'Y';
-               } // END - if
+               $content['ext_func'] = convertBooleanToYesNo(isExtensionFunctionFileReadable($content['ext_name']));
 
                // Transfer EXT_ALWAYS_ACTIVE flag
                $content['ext_keep'] = getThisExtensionAlwaysActive();
index e563c8737d851ba42975bd873d7a858b39f4a69b..e1a05818aa4316f0b1044201fa46917327585d3b 100644 (file)
@@ -52,7 +52,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('refdepths')) && ($GLOBALS['cache
        $GLOBALS['cache_instance']->init();
 
        // Load all modules and their data
-       $result = SQL_QUERY('SELECT id, level, percents FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY level', __FILE__, __LINE__);
+       $result = SQL_QUERY('SELECT `id`, `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY `level` ASC', __FILE__, __LINE__);
        while ($content = SQL_FETCHARRAY($result)) {
                // Add row to cache file
                $GLOBALS['cache_instance']->addRow($content);
index 4461adc71ca6d074d3dd1adc4e452de6a5f2857b..d41705652a574679edd6a32a20dc6344aabe8632 100644 (file)
@@ -76,9 +76,9 @@ if (($GLOBALS['cache_instance']->loadCacheFile('themes')) && ($GLOBALS['cache_in
 
        // Load all themes and their data
        if (isExtensionInstalledAndNewer('theme', '0.0.7')) {
-               $result = SQL_QUERY('SELECT id, theme_path, theme_active, theme_ver, theme_name FROM `{?_MYSQL_PREFIX?}_themes` ORDER BY `id`', __FILE__, __LINE__);
+               $result = SQL_QUERY('SELECT `id`, `theme_path`, `theme_active`, `theme_ver`, `theme_name` FROM `{?_MYSQL_PREFIX?}_themes` ORDER BY `id` ASC', __FILE__, __LINE__);
        } else {
-               $result = SQL_QUERY('SELECT id, theme_path, theme_active, theme_ver FROM `{?_MYSQL_PREFIX?}_themes` ORDER BY `id`', __FILE__, __LINE__);
+               $result = SQL_QUERY('SELECT `id`, `theme_path`, `theme_active`, `theme_ver` FROM `{?_MYSQL_PREFIX?}_themes` ORDER BY `id` ASC', __FILE__, __LINE__);
        }
        while ($content = SQL_FETCHARRAY($result)) {
                // Add row to cache file
index 926c89df177e300c00b5f09d6df844b097e2bd53..82cb196abecc01361e90e739d807cffacc204b56 100644 (file)
@@ -697,7 +697,7 @@ function adminGetMenuMode () {
 
 // Change activation status
 function adminChangeActivationStatus ($IDs, $table, $row, $idRow = 'id') {
-       $count = '0'; $newStatus = 'Y';
+       $count = '0';
        if ((is_array($IDs)) && (count($IDs) > 0)) {
                // "Walk" all through and count them
                foreach ($IDs as $id => $selected) {
@@ -708,7 +708,12 @@ function adminChangeActivationStatus ($IDs, $table, $row, $idRow = 'id') {
                        if (!empty($selected)) {
                                // Determine new status
                                $result = SQL_QUERY_ESC("SELECT %s FROM `{?_MYSQL_PREFIX?}_%s` WHERE %s=%s LIMIT 1",
-                               array($row, $table, $idRow, $id), __FUNCTION__, __LINE__);
+                                       array(
+                                               $row,
+                                               $table,
+                                               $idRow,
+                                               $id
+                                       ), __FUNCTION__, __LINE__);
 
                                // Row found?
                                if (SQL_NUMROWS($result) == 1) {
@@ -716,11 +721,17 @@ function adminChangeActivationStatus ($IDs, $table, $row, $idRow = 'id') {
                                        list($currStatus) = SQL_FETCHROW($result);
 
                                        // And switch it N<->Y
-                                       if ($currStatus == 'Y') $newStatus = 'N'; else $newStatus = 'Y';
+                                       $newStatus = convertBooleanToYesNo(!($currStatus == 'Y'));
 
                                        // Change this status
                                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s` SET %s='%s' WHERE %s=%s LIMIT 1",
-                                       array($table, $row, $newStatus, $idRow, $id), __FUNCTION__, __LINE__);
+                                               array(
+                                                       $table,
+                                                       $row,
+                                                       $newStatus,
+                                                       $idRow,
+                                                       $id
+                                               ), __FUNCTION__, __LINE__);
 
                                        // Count up affected rows
                                        $count += SQL_AFFECTEDROWS();
index 22bfb3beaee3a5f2e97f834bcd797d883cd12b6e..ace68d7486c53df9e5ac4378cd25809bff0c6712 100644 (file)
@@ -49,7 +49,7 @@ if (isFormSent()) {
        $END   = mktime(postRequestParameter('end_hour')  , postRequestParameter('end_min')  , postRequestParameter('end_sec')  , postRequestParameter('end_month')  , postRequestParameter('end_day')  , postRequestParameter('end_year')  );
 
        // Is there already a rallye running?
-       $result = SQL_QUERY_ESC("SELECT id, admin_id FROM `{?_MYSQL_PREFIX?}_rallye_data` WHERE (start_time <= %s AND end_time >= %s) OR (start_time >= %s AND start_time <= %s) LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `id`, `admin_id` FROM `{?_MYSQL_PREFIX?}_rallye_data` WHERE (`start_time` <= %s AND `end_time` >= %s) OR (`start_time` >= %s AND `start_time` <= %s) LIMIT 1",
                array($START, $START, $START, $END), __FILE__, __LINE__);
 
        if (SQL_HASZERONUMS($result)) {
index 05290a1e3bf690fd9ef0de270d1ba4dc467931f9..738f9d01d078f960f279a713ff004f6259bb6fd9 100644 (file)
@@ -189,7 +189,7 @@ LIMIT 1",
        doAdminProcessMenuWeightning('admin', $AND);
 
        // Run SQL
-       $result = SQL_QUERY("SELECT id, action, what, title, sort FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." ORDER BY `sort` ASC", __FILE__, __LINE__);
+       $result = SQL_QUERY("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." ORDER BY `sort` ASC", __FILE__, __LINE__);
 
        // Do we have entries?
        if (!SQL_HASZERONUMS($result)) {
index 36118680ad409a554b917d4524ce62f56d4d5f33..cfd0aa9bf82fad33edbc968bd0d41c67d74d19aa 100644 (file)
@@ -53,16 +53,6 @@ if (isFormSent()) {
        // Add userid selection
        $content['coupon_userid'] = addMemberSelectionBox(getConfig('coupon_userid'), false, true, true, 'coupon_userid');
 
-       // Init all other template entries
-       foreach (array('payment_method_ref', 'payment_method_direct', 'points_account_order', 'points_account_general', 'locked_points_mode_locked', 'locked_points_mode_unlocked') as $entry) {
-               $content['coupon_' . $entry] = '';
-       } // END - foreach
-
-       // Set current selections
-       foreach (array('payment_method', 'points_account', 'locked_points_mode') as $entry) {
-               $content['coupon_' . $entry . '_' . strtolower(getConfig('coupon_' . $entry))] = ' checked="checked"';
-       } // END - foreach
-
        // Prepare some template data
        $content['coupon_default_time_selection']   = createConfigurationTimeSelections('coupon_default_time'  , 'WDh');
        $content['coupon_autopurge_time_selection'] = createConfigurationTimeSelections('coupon_autopurge_time', 'WDh');
index 5810fb04d9b29aaac3b18a4688b7519066ab8845..cda95994d6a4da33433e5ddf8fac15196d69537a 100644 (file)
@@ -77,10 +77,17 @@ switch ($sub) {
                } // END - if
 
                // Load all what menu points
-               $result = SQL_QUERY("SELECT id, what, title
-FROM `{?_MYSQL_PREFIX?}_guest_menu`
-WHERE `action`='main' AND `what` != '' AND `what` IS NOT NULL AND `locked`='N'
-ORDER BY `sort` ASC", __FILE__, __LINE__);
+               $result = SQL_QUERY("SELECT
+       `id`, `what`, `title`
+FROM
+       `{?_MYSQL_PREFIX?}_guest_menu`
+WHERE
+       `action`='main' AND
+       `what` != '' AND
+       `what` IS NOT NULL AND
+       `locked`='N'
+ORDER BY
+       `sort` ASC", __FILE__, __LINE__);
 
                // Init variables
                $OUT = '';
index 4b9f9a988be10db568e2998c1d647240e0b66d18..e7bdea2baf583e70682811cd2620cf9518f8233c 100644 (file)
@@ -278,7 +278,11 @@ switch ($do) {
                if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
                        // Load extension data with CSS informations
                        $result = SQL_QUERY("SELECT
-       `id` AS ext_id, `ext_name`, `ext_active`, `ext_has_css` AS ext_css, `ext_version`
+       `id` AS `ext_id`,
+       `ext_name`,
+       `ext_active`,
+       `ext_has_css` AS `ext_css`,
+       `ext_version`
 FROM
        `{?_MYSQL_PREFIX?}_extensions`
 ".$where."
@@ -287,7 +291,10 @@ ORDER BY
                } else {
                        // Load extension data without CSS informations
                        $result = SQL_QUERY("SELECT
-       `id` AS ext_id, `ext_name`, `ext_active`, `ext_version`
+       `id` AS `ext_id`,
+       `ext_name`,
+       `ext_active`,
+       `ext_version`
 FROM
        `{?_MYSQL_PREFIX?}_extensions`
 ".$where."
@@ -303,7 +310,7 @@ ORDER BY
                                // Prepare CSS selection output
                                $cssSelection = '---';
                                if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
-                                       $cssSelection = translateYesNo($content['ext_css']);
+                                       $cssSelection = '{%pipe,translateYesNo=' . $content['ext_css'] . '%}';
                                } // END - if
 
                                // Prepare data for the row template
index b5fb48cd431921d87c15ced76d06f91b6d924940..8924be90af3d522368ddecd73e45bd932a885f61 100644 (file)
@@ -173,7 +173,7 @@ LIMIT 1",
                        if (SQL_HASZERONUMS($result)) {
                                // Finally add the new ACL
                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_admins_acls` (`admin_id`, `action_menu`, `what_menu`, `access_mode`)
-VALUES ('%s','%s','%s','%s')",
+VALUES (%s,'%s','%s','%s')",
                                array(
                                        bigintval(postRequestParameter('admin_id')),
                                        postRequestParameter('action_menu'),
index 05fe8420bd702a38e0a3ed32414a3c96beafb6ee..31692ad9c571baade2f8ae16a76381b5a960de73 100644 (file)
@@ -46,15 +46,15 @@ addYouAreHereLink('admin', __FILE__);
 // Add new code?
 if ((isFormSent('add')) && (isPostRequestParameterSet('code')) && (isPostRequestParameterSet('descr'))) {
        // Check if country code does already exist
-       $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_countries` WHERE code='%s' LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_countries` WHERE `code`='%s' LIMIT 1",
        array(strtoupper(postRequestParameter('code'))), __FILE__, __LINE__);
        if (SQL_HASZERONUMS($result)) {
                // Save entry
-               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_countries` (code, descr, is_active) VALUES ('%s','%s','%s')",
+               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_countries` (`code`, `descr`, `is_active`) VALUES ('%s','%s','%s')",
                array(
-               strtoupper(substr(postRequestParameter('code'), 0, 2)),
-               postRequestParameter('descr'),
-               postRequestParameter('is_active')
+                       strtoupper(substr(postRequestParameter('code'), 0, 2)),
+                       postRequestParameter('descr'),
+                       postRequestParameter('is_active')
                ), __FILE__, __LINE__);
 
                // Country added
@@ -113,7 +113,7 @@ if ((isFormSent('add')) && (isPostRequestParameterSet('code')) && (isPostRequest
                                        $content['is_active'] = generateOptionList('/ARRAY/', array('Y', 'N'), array('{--YES--}', '{--NO--}'), $isActive);
                                } else {
                                        // Only display status when in delete-mode
-                                       $content['is_active'] = translateYesNo($isActive);
+                                       $content['is_active'] = '{%pipe,translateYesNo=' . $isActive . '%}';
                                }
 
                                // Insert row template and switch color
@@ -136,10 +136,11 @@ if ((isFormSent('add')) && (isPostRequestParameterSet('code')) && (isPostRequest
 
                // Load main template
                loadTemplate('admin_list_country_form', false, $content);
-       }
+       } // END - if
 } else {
        // Shall we modify / remove entries now?
-       $message = ''; initSqls();
+       $message = '';
+       initSqls();
        if ((isPostRequestParameterSet('modify')) && (isPostRequestParameterSet('id'))) {
                // Modify
                foreach (postRequestParameter('id') as $id => $sel) {
index 46a1f82f1dc4c101f176b7082a2f414bcc74deee..367c945f1a230c2e2710923265e8f626b397d5a4 100644 (file)
@@ -85,7 +85,6 @@ if (isGetRequestParameterSet('userid')) {
                                // @TODO Find a way to rewrite this. See some lines above for different queries
                                while (list($id, $id2, $type) = SQL_FETCHROW($result)) {
                                        // Initializes all variables
-                                       $cat = '';
                                        $DATA = '';
                                        $PROBLEM = '{--ADMIN_GENERAL_MAIL_PROBLEM--}';
                                        $result_data = false;
index 3a1852f82561ac98ef5512ffd68d79ce115d7d1a..b70f6b73a5230fb1299575a2fafe652054f12a14 100644 (file)
@@ -70,7 +70,7 @@ WHERE
 LIMIT 1",
                        array($content['id']), __FILE__, __LINE__);
 
-                       /// Is there an entry?
+                       // Is there an entry?
                        if (SQL_NUMROWS($result_main) == 1) {
                                // Load data
                                $content = SQL_FETCHARRAY($result_main);
index 7082a5cf0cf17c01ce88da9347fecea4c9da23b5..f6c598620b361a767fbc220a1adb4f60fb4259f0 100644 (file)
@@ -136,7 +136,7 @@ LIMIT 1",
                                displayMessage('{--SPONSOR_ACCOUNT_EMAIL_FAILED--}');
                        }
                } else {
-                       /// ??? Other status?
+                       // ??? Other status?
                        displayMessage('{--SPONSOR_ACCOUNT_STATUS_FAILED--}');
                }
        } else {
index a4dc1f524a2ee0542fd48666cd73d8060540ab2a..ebde2cb86c4fa8e1d14923d6e983502d9c3424c5 100644 (file)
@@ -51,7 +51,7 @@ if ((!isExtensionActive('top10')) && (!isAdmin())) {
 // Init array
 $rows = array();
 
-//// TOP logins
+// TOP logins
 $result = SQL_QUERY("SELECT
        `userid`, `total_logins`, `last_online`
 FROM
@@ -107,7 +107,7 @@ $rows['logins_out'] = $OUT;
 // Free result
 SQL_FREERESULT($result);
 
-//// TOP earners
+// TOP earners
 $result = SQL_QUERY("SELECT
        d.userid,
        (SUM(p.points) - d.used_points) AS `points`,
@@ -171,7 +171,7 @@ $rows['points_out'] = $OUT;
 // Free result
 SQL_FREERESULT($result);
 
-//// TOP referal "hunter"
+// TOP referal "hunter"
 $result = SQL_QUERY("SELECT
        d.userid,
        SUM(r.counter) AS refs,
index 45e79d7492528bf8cf62b26c3dc4871debd1d0ce..dad195c7088d797efc1e84baa55b245430aca217 100644 (file)
@@ -56,7 +56,7 @@ if (!SQL_HASZERONUMS($result)) {
        $LEAST = false;
        if (isFormSent()) {
                $count = '0';
-               foreach (postRequestParameter('cat') as $cat => $joined) {
+               foreach (postRequestParameter('cat') as $categoryId => $joined) {
                        if ($joined != 'Y') $count++;
                } // END - foreach
 
@@ -72,7 +72,7 @@ if (!SQL_HASZERONUMS($result)) {
                $count = '0';
 
                // Go through all entries
-               foreach (postRequestParameter('cat') as $cat => $joined) {
+               foreach (postRequestParameter('cat') as $categoryId => $joined) {
                        // Ini sql here
                        $sql = '';
 
@@ -80,10 +80,10 @@ if (!SQL_HASZERONUMS($result)) {
                        switch ($joined) {
                                case 'Y':
                                        $result_user = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `userid`=%s AND `cat_id`=%s LIMIT 1",
-                                               array(getMemberId(), bigintval($cat)), __FILE__, __LINE__);
+                                               array(getMemberId(), bigintval($categoryId)), __FILE__, __LINE__);
 
                                        // Debug message
-                                       //* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'cat='.$cat.',joined='.$joined.',getMemberId()='.getMemberId().',SQL_HASZERONUMS()='.intval(SQL_HASZERONUMS($result_user)));
+                                       //* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'categoryId='.$categoryId.',joined='.$joined.',getMemberId()='.getMemberId().',SQL_HASZERONUMS()='.intval(SQL_HASZERONUMS($result_user)));
 
                                        if (SQL_HASZERONUMS($result_user)) {
                                                $sql = "INSERT INTO `{?_MYSQL_PREFIX?}_user_cats` (`userid`, `cat_id`) VALUES (%s,%s)";
@@ -100,7 +100,7 @@ if (!SQL_HASZERONUMS($result)) {
 
                        if (!empty($sql)) {
                                // Run SQL command
-                               SQL_QUERY_ESC(trim($sql), array(getMemberId(), bigintval($cat)), __FILE__, __LINE__);
+                               SQL_QUERY_ESC(trim($sql), array(getMemberId(), bigintval($categoryId)), __FILE__, __LINE__);
 
                                // Count this row
                                $count += SQL_AFFECTEDROWS();
index 6df25311c6e342088fb03a13730bbbcc411eaa74..45dbbf1a0ae904d991a92137a8c70a8efdfb7f22 100644 (file)
@@ -1738,7 +1738,7 @@ function generateCategoryOptionsList ($mode) {
 }
 
 // Add bonus mail to queue
-function addBonusMailToQueue ($subject, $text, $receiverList, $points, $seconds, $url, $cat, $mode='normal', $receiver=0) {
+function addBonusMailToQueue ($subject, $text, $receiverList, $points, $seconds, $url, $categoryId, $mode='normal', $receiver=0) {
        // Is admin or bonus extension there?
        if (!isAdmin()) {
                // Abort here
@@ -1759,27 +1759,21 @@ function addBonusMailToQueue ($subject, $text, $receiverList, $points, $seconds,
 
        // HTML extension active?
        if (isExtensionActive('html_mail')) {
-               // No HTML by default
-               $HTML = 'N';
-
-               // HTML mode?
-               if ($mode == 'html') {
-                       // Yes, please
-                       $HTML = 'Y';
-               } // END - if
+               // Determine if we have HTML mode active
+               $HTML = convertBooleanToYesNo($mode == 'html');
 
                // Add HTML mail
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_bonus`
 (`subject`, `text`, `receivers`, `points`, `time`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`, `mails_sent`, `html_msg`)
-VALUES ('%s','%s','%s','%s','%s','NEW', UNIX_TIMESTAMP(),'%s','%s','%s','%s','%s')",
+VALUES ('%s','%s','%s',%s,%s,'NEW', UNIX_TIMESTAMP(),'%s',%s,%s,%s,'%s')",
                array(
                        $subject,
                        $text,
                        $receiverList,
                        $points,
-                       $seconds,
+                       bigintval($seconds),
                        $url,
-                       $cat,
+                       bigintval($categoryId),
                        $target,
                        bigintval($receiver),
                        $HTML
@@ -1788,15 +1782,15 @@ VALUES ('%s','%s','%s','%s','%s','NEW', UNIX_TIMESTAMP(),'%s','%s','%s','%s','%s
                // Add regular mail
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_bonus`
 (`subject`, `text`, `receivers`, `points`, `time`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`, `mails_sent`)
-VALUES ('%s','%s','%s','%s','%s','NEW', UNIX_TIMESTAMP(),'%s','%s','%s','%s')",
+VALUES ('%s','%s','%s',%s,%s,'NEW', UNIX_TIMESTAMP(),'%s',%s,%s,%s)",
                array(
                        $subject,
                        $text,
                        $receiverList,
                        $points,
-                       $seconds,
+                       bigintval($seconds),
                        $url,
-                       $cat,
+                       bigintval($categoryId),
                        $target,
                        bigintval($receiver),
                ), __FUNCTION__, __LINE__);
@@ -1804,7 +1798,7 @@ VALUES ('%s','%s','%s','%s','%s','NEW', UNIX_TIMESTAMP(),'%s','%s','%s','%s')",
 }
 
 // Generate a receiver list for given category and maximum receivers
-function generateReceiverList ($cat, $receiver, $mode = '') {
+function generateReceiverList ($categoryId, $receiver, $mode = '') {
        // Init variables
        $CAT_TABS     = '';
        $CAT_WHERE    = '';
@@ -1812,8 +1806,8 @@ function generateReceiverList ($cat, $receiver, $mode = '') {
        $result       = false;
 
        // Secure data
-       $cat      = bigintval($cat);
-       $receiver = bigintval($receiver);
+       $categoryId = bigintval($categoryId);
+       $receiver   = bigintval($receiver);
 
        // Is the receiver zero and mode set?
        if (($receiver == '0') && (!empty($mode))) {
@@ -1822,10 +1816,10 @@ function generateReceiverList ($cat, $receiver, $mode = '') {
        } // END - if
 
        // Category given?
-       if ($cat > 0) {
+       if ($categoryId > 0) {
                // Select category
                $CAT_TABS  = "LEFT JOIN `{?_MYSQL_PREFIX?}_user_cats` AS c ON d.`userid`=c.`userid`";
-               $CAT_WHERE = sprintf(" AND c.`cat_id`=%s", $cat);
+               $CAT_WHERE = sprintf(" AND c.`cat_id`=%s", $categoryId);
        } // END - if
 
        // Exclude users in holiday?
@@ -1836,13 +1830,13 @@ function generateReceiverList ($cat, $receiver, $mode = '') {
 
        if ((isExtensionActive('html_mail')) && ($mode == 'html')) {
                // Only include HTML receivers
-               $result = SQL_QUERY_ESC("SELECT d.userid FROM `{?_MYSQL_PREFIX?}_user_data` AS d ".$CAT_TABS." WHERE d.`status`='CONFIRMED' AND d.`html`='Y'".$CAT_WHERE." ORDER BY d.{?order_select?} {?order_mode?} LIMIT %s",
+               $result = SQL_QUERY_ESC("SELECT d.`userid` FROM `{?_MYSQL_PREFIX?}_user_data` AS d ".$CAT_TABS." WHERE d.`status`='CONFIRMED' AND d.`html`='Y'".$CAT_WHERE." ORDER BY d.`{?order_select?}` {?order_mode?} LIMIT %s",
                        array(
                                $receiver
                        ), __FUNCTION__, __LINE__);
        } else {
                // Include all
-               $result = SQL_QUERY_ESC("SELECT d.userid FROM `{?_MYSQL_PREFIX?}_user_data` AS d ".$CAT_TABS." WHERE d.`status`='CONFIRMED'".$CAT_WHERE." ORDER BY d.{?order_select?} {?order_mode?} LIMIT %s",
+               $result = SQL_QUERY_ESC("SELECT d.`userid` FROM `{?_MYSQL_PREFIX?}_user_data` AS d ".$CAT_TABS." WHERE d.`status`='CONFIRMED'".$CAT_WHERE." ORDER BY d.`{?order_select?}` {?order_mode?} LIMIT %s",
                        array(
                                $receiver
                        ), __FUNCTION__, __LINE__);
@@ -2017,5 +2011,65 @@ function updateLastActivity($userid) {
                ), __FUNCTION__, __LINE__);
 }
 
+// Get points data for given extension's name
+function getPointsDataArrayFromExtensionName ($ext_name) {
+       // If we have cache, shortcut it here
+       if (isset($GLOBALS['cache_array']['points_data'])) {
+               // Return it
+               return $GLOBALS['cache_array']['points_data'];
+       } // END - if
+
+       // Now checkout the entry in database table
+       $result = SQL_QUERY_ESC("SELECT `id`, `ext_name`, `column_name`, `locked_mode`, `payment_method` FROM `{?_MYSQL_PREFIX?}_points_data` WHERE `ext_name`='%s' LIMIT 1",
+               array($ext_name), __FUNCTION__, __LINE__);
+
+       // Do we have an entry?
+       if (SQL_NUMROWS($result) == 1) {
+               // Then load it
+               $pointsData = SQL_FETCHARRAY($result);
+
+               // Add all remaining entries
+               foreach ($pointsData as $key=>$value) {
+                       $GLOBALS['cache_array']['points_data'][$key][$ext_name][$isLocked] = $value;
+               } // END - foreach
+       } else {
+               /*
+                * Having no entry is not bad but it means that all points will go to
+                * the general account which the user can let payout.
+                */
+               logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',isLocked=' . intval($isLocked) . ' - No entry found, switching to general points account.');
+       }
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return it
+       return $GLOBALS['cache_array']['points_data'];
+}
+
+// Determines the right points column name for given extension and 'locked'
+function getPointsColumnNameFromExtensionNameLocked ($ext_name, $isLocked) {
+       // Extension sql_patches must be up-to-date
+       if (isExtensionInstalledAndOlder('sql_patches', '0.8.0')) {
+               // Please update ext-sql_patches
+               debug_report_bug(__FUNCTION__, __LINE__, 'sql_patches is out-dated. Please update to at least 0.8.0 to continue. ext_name=' . $ext_name . ',isLocked=' . intval($isLocked));
+       } // END - if
+
+       // Get the points_data entry
+       $pointsData = getPointsDataArrayFromExtensionName($ext_name);
+
+       // Regular points by default
+       $columnName = $pointsData['columnName'];
+
+       // Are the points locked?
+       if (($isLocked === true) && ($pointsData['locked_mode'] == 'LOCKED')) {
+               // Locked points, so prefix it
+               $columnName = 'locked_' . $pointsData['column_name'];
+       } // END - if
+
+       // Return the result
+       return $columName;
+}
+
 // [EOF]
 ?>
index b3f6f883ff6729bf0ab75fead0a02b4aae9b64bf..e9abd0e7a28d12b057c30a5bfb547a0a6c410bac 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 // Is ext-sql_patches there and newer?
 if (isExtensionInstalledAndNewer('sql_patches', '0.5.3')) {
        // Set session save path if set
-       if (getConfig('session_save_path') != '') {
+       if ((isConfigEntrySet('session_save_path')) && (getConfig('session_save_path') != '')) {
                // Please make sure this valid!
                session_save_path(getConfig('session_save_path'));
        } // END - if
index 0c10acd3396a0a8fbc565c25a3062d6dc93f2c4b..7d5e670a2c2eb9b2c4bb0ed47aa5c6da240476c8 100644 (file)
@@ -448,7 +448,7 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0', $loadU
                        fetchUserData($userid, 'nickname');
                } else {
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "NO-NICK!<br />");
-                       /// Load by userid
+                       // Load by userid
                        fetchUserData($userid);
                }
 
index eb9419c94e5f07279ce1377e9ab169636f293b3f..8a4387f00be239a9611c964f853e51b24784c536 100644 (file)
@@ -554,7 +554,7 @@ function isNicknameUsed ($userid) {
        // Is the cache there
        if (!isset($GLOBALS[__FUNCTION__][$userid])) {
                // Determine it
-               $GLOBALS[__FUNCTION__][$userid] = (('' . round($userid) . '') != $userid);
+               $GLOBALS[__FUNCTION__][$userid] = ((!empty($userid)) && (('' . round($userid) . '') != $userid));
        } // END - if
 
        // Return the result
index 7f1746bdfb4204ba4de49f9974df7815e3717e33..dfefdcac9fd38083901954544d36b433273ee54a 100644 (file)
@@ -106,7 +106,7 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr
                                redirectOnUninstalledExtension('bonus');
 
                                // Bonus-Mails
-                               $result = SQL_QUERY_ESC("SELECT id, url, subject FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
+                               $result = SQL_QUERY_ESC("SELECT `id`, `url`, `subject` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
                                        array($bonusId), __FILE__, __LINE__);
                                break;
 
index 6d380bcbdc593c883e6a0a04a2d6c739b985800a..014a32cf9ce5ab3f888b4bf96cca8d500f036f16 100644 (file)
                        <span class="tiny">({?POINTS?})</span>
                </td>
        </tr>
-       <tr>
-               <td colspan="2" align="center" class="table_header bottom">
-                       <strong>{--ADMIN_CONFIG_COUPON_SELECT_PAYMENT_METHOD--}</strong>
-               </td>
-       </tr>
-       <tr>
-               <td class="bottom" align="right" height="20">
-                       <input type="radio" class="form_field" name="coupon_payment_method" value="DIRECT"$content[coupon_payment_method_direct] />
-                       {--ADMIN_CONFIG_PAYMENT_MODE_DIRECT--}
-               </td>
-               <td class="bottom" align="center">
-                       <input type="radio" class="form_field" name="coupon_payment_method" value="REF"$content[coupon_payment_method_ref] />
-                       {--ADMIN_CONFIG_PAYMENT_MODE_REF--}
-               </td>
-       </tr>
-       <tr>
-               <td colspan="2" align="center" class="table_header bottom">
-                       <strong>{--ADMIN_CONFIG_COUPON_SELECT_POINTS_ACCOUNT--}</strong>
-               </td>
-       </tr>
-       <tr>
-               <td class="bottom" align="right" height="20">
-                       <input type="radio" class="form_field" name="coupon_points_account" value="ORDER"$content[coupon_points_account_order] />
-                       {--ADMIN_CONFIG_POINTS_ACCOUNT_ORDER--}
-               </td>
-               <td class="bottom" align="center">
-                       <input type="radio" class="form_field" name="coupon_points_account" value="GENERAL"$content[coupon_points_account_general] />
-                       {--ADMIN_CONFIG_POINTS_ACCOUNT_GENERAL--}
-               </td>
-       </tr>
-       <tr>
-               <td colspan="2" align="center" class="table_header bottom">
-                       <strong>{--ADMIN_CONFIG_COUPON_SELECT_LOCKED_POINTS_MODE--}</strong>
-               </td>
-       </tr>
-       <tr>
-               <td class="bottom" align="right" height="20">
-                       <input type="radio" class="form_field" name="coupon_locked_points_mode" value="locked"$content[coupon_locked_points_mode_locked] />
-                       {--ADMIN_CONFIG_LOCKED_POINTS_MODE_LOCKED--}
-               </td>
-               <td class="bottom" align="center">
-                       <input type="radio" class="form_field" name="coupon_locked_points_mode" value="unlocked"$content[coupon_locked_points_mode_unlocked] />
-                       {--ADMIN_CONFIG_LOCKED_POINTS_MODE_UNLOCKED--}
-               </td>
-       </tr>
        <tr>
                <td class="bottom" align="right">{--ADMIN_CONFIG_COUPON_USERID--}:</td>
                <td class="bottom" align="center">
index 290d541de9952bdec0ca8acd2bdc7209457e36c4..e07ebdff3e8c306b09a1744d9d5baa4a3bb82249 100644 (file)
@@ -3,7 +3,7 @@
 <table border="0" cellspacing="0" cellpadding="0" class="table dashed">
        <tr>
                <td colspan="2" class="table_header bottom" align="center">
-                       <strong>{--ADMIN_ORDER_SETTINGS--}:</strong>
+                       <strong>{--ADMIN_CONFIG_ORDER_TITLE--}:</strong>
                </td>
        </tr>
 
index 45411ad55f955d805e35336aa00bd02120ae67c5..3ffbe185fd8dec2074ba014a364e41a7f6a6d1b5 100644 (file)
@@ -41,7 +41,7 @@
        </tr>
 
        <tr>
-               <td class="bottom" align="right" width="200" style="padding-right:5px">{--ADMIN_RANDOM_MIN_CONFIRMED--}</td>
+               <td class="bottom" align="right" width="200" style="padding-right:5px">{--ADMIN_CONFIG_RANDOM_MIN_CONFIRMED--}</td>
                <td class="bottom" align="center">
                        <input type="text" class="form_field" name="user_min_confirmed" size="3" maxlength="3" value="{?user_min_confirmed?}" />
                </td>