]> git.mxchange.org Git - mailer.git/commitdiff
More complete rewrite to use wrapper function isExtensionInstalledAndNewer(), some...
authorRoland Häder <roland@mxchange.org>
Thu, 1 Apr 2010 18:38:06 +0000 (18:38 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 1 Apr 2010 18:38:06 +0000 (18:38 +0000)
36 files changed:
inc/extensions-functions.php
inc/extensions/ext-order.php
inc/extensions/ext-rallye.php
inc/filter-functions.php
inc/filters.php
inc/functions.php
inc/gen_sql_patches.php
inc/libs/admins_functions.php
inc/libs/bonus_functions.php
inc/libs/rallye_functions.php
inc/libs/task_functions.php
inc/libs/theme_functions.php
inc/libs/user_functions.php
inc/loader/load_cache-them.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-config_mods.php
inc/modules/admin/what-config_points.php
inc/modules/admin/what-del_email.php
inc/modules/admin/what-extensions.php
inc/modules/admin/what-list_beg.php
inc/modules/admin/what-list_bonus.php
inc/modules/admin/what-list_user.php
inc/modules/admin/what-lock_user.php
inc/modules/admin/what-unlock_emails.php
inc/modules/guest/what-confirm.php
inc/modules/member/what-bonus.php
inc/modules/member/what-order.php
inc/modules/member/what-payout.php
inc/modules/member/what-points.php
inc/modules/member/what-support.php
inc/mysql-manager.php
inc/pool/pool-bonus.php
inc/pool/pool-user.php
inc/reset/reset_daily.php
inc/wrapper-functions.php
mailid_top.php

index 743f97281f7ba3a345559218d5eba0316139385f..23c4d68bb00c6163fb4c14c0d750a303ef39f2c1 100644 (file)
@@ -939,7 +939,7 @@ function createExtensionDeactivationTask ($ext) {
        $subject = sprintf("[%s:] %s", $ext, getMessage('TASK_SUBJ_EXTENSION_DEACTIVATED'));
 
        // Not installed and do we have created a task for the admin?
-       if ((determineTaskIdBySubject($subject) == '0') && (getExtensionVersion($ext) != '')) {
+       if ((determineTaskIdBySubject($subject) == '0') && (isExtensionInstalled($ext))) {
                // Task not created so add it
                createNewTask($subject, SQL_ESCAPE(loadTemplate('task_ext_deactivated', true, $ext)), 'EXTENSION_DEACTIVATION');
        } // END - if
@@ -965,7 +965,7 @@ function ifModuleHasMenu ($mod, $forceDb = false) {
                        // Admin/guest/member/sponsor modules have always a menu!
                        $ret = in_array($mod, array('admin', 'index', 'login', 'sponsor'));
                }
-       } elseif ((isExtensionInstalled('sql_patches')) && (getExtensionVersion('sql_patches') >= '0.3.6') && ((!isExtensionActive('cache')) || ($forceDb === true))) {
+       } elseif ((isExtensionInstalledAndNewer('sql_patches', '0.3.6')) && ((!isExtensionActive('cache')) || ($forceDb === true))) {
                // Check database for entry
                $result = SQL_QUERY_ESC("SELECT `has_menu` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `module`='%s' LIMIT 1",
                        array($mod), __FUNCTION__, __LINE__);
index b3ec12f3f0bee730222ba7368db71c59d3397280..4e15c55d796be9742d5185939f223c1f50f6fb28 100644 (file)
@@ -341,7 +341,7 @@ INDEX (`pool_id`)
 
        case 'init': // Do stuff when extension is initialized
                // Do daily reset only when installed and extension version is at least 0.1.1
-               if ((isResetModeEnabled()) && (isInstalled()) && (isAdminRegistered()) && (getExtensionVersion('order') >= '0.1.1')) {
+               if ((isResetModeEnabled()) && (isInstalled()) && (isAdminRegistered()) && (isExtensionInstalledAndNewer('order', '0.1.1'))) {
                        // Reset mail order values
                        $result_ext = SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET mail_orders=0 WHERE mail_orders > 0", __FILE__, __LINE__);
                } // END - if
index 816f95cc5177777ff0701e90931cd491e31c1965..a8c4d3d9c9c222ff9e78a29482a40b6696dd2eac 100644 (file)
@@ -335,7 +335,7 @@ Zudem sollten Sie mindestens folgende Templates (in <strong>templates/".getLangu
 
                        // Add more data on higher versions
                        $ADD1 = ''; $ADD2 = ''; $OR = '';
-                       if (getExtensionVersion('rallye') >= '0.2.0') {
+                       if (isExtensionInstalledAndNewer('rallye', '0.2.0')) {
                                $ADD1 = ", `min_users`, `min_prices`";
                                $ADD2 = ", d.min_users, d.min_prices";
                                $OR   = " OR (d.min_users <= ".$total." AND d.min_users > 0)";
index 82747fef797677782a26230abab3c6528210e5a2..7bc55f018c67f9880e6e7227a525e1321f526d93 100644 (file)
@@ -60,7 +60,7 @@ function initFilterSystem () {
        } elseif ((!isInstallationPhase()) && (isExtensionInstalledAndNewer('sql_patches', '0.5.9'))) {
                // Init add
                $add = '';
-               if (getExtensionVersion('sql_patches') >= '0.6.0') $add = ", `filter_counter`";
+               if (isExtensionINstalledAndNewer('sql_patches', '0.6.0')) $add = ", `filter_counter`";
 
                // Load all active filers
                $result = SQL_QUERY("SELECT
index 4028bef01fe275ded0fb498f08c54a12f5b16579..cc17b3e381c9074b5a4d5771d03d20638e5e108d 100644 (file)
@@ -586,7 +586,7 @@ function FILTER_HTML_INCLUDE_USERS ($mode) {
 
        // HTML mail?
        if ($mode == 'html') $MORE = " AND `html`='Y'";
-       if ((isExtensionActive('holiday')) && (getExtensionVersion('holiday') >= '0.1.3')) {
+       if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
                // Add something for the holiday extension
                $MORE .= " AND `holiday_active`='N'";
        } // END - if
index 320c774ce890aeec5c55e6b1ea4bd344273b5703..8b1f6ce32bf7605360c93c05d83824976bbda41d 100644 (file)
@@ -1197,7 +1197,7 @@ function addSelectionBox ($type, $default, $prefix = '', $id = '0', $class = 're
                        $year = date('Y', time());
 
                        // Use configured min age or fixed?
-                       if ((isExtensionActive('other')) && (getExtensionVersion('other') >= '0.2.1')) {
+                       if (isExtensionInstalledAndNewer('order', '0.2.1')) {
                                // Configured
                                $startYear = $year - getConfig('min_age');
                        } else {
@@ -1225,7 +1225,7 @@ function addSelectionBox ($type, $default, $prefix = '', $id = '0', $class = 're
                                // Get current year and subtract the configured minimum age
                                $OUT .= "<option value=\"".($minYear - 1)."\">&lt;" . $minYear."</option>\n";
                                // Calculate earliest year depending on extension version
-                               if ((isExtensionActive('other')) && (getExtensionVersion('other') >= '0.2.1')) {
+                               if (isExtensionInstalledAndNewer('order', '0.2.1')) {
                                        // Use configured minimum age
                                        $year = date('Y', time()) - getConfig('min_age');
                                } else {
@@ -2107,7 +2107,7 @@ function generateEmailLink ($email, $table = 'admins') {
        if ((isExtensionActive('admins')) && ($table == 'admins')) {
                // Create email link for contacting admin in guest area
                $EMAIL = generateAdminEmailLink($email);
-       } elseif ((isExtensionActive('user')) && (getExtensionVersion('user') >= '0.3.3') && ($table == 'user_data')) {
+       } elseif ((isExtensionInstalledAndNewer('user', '0.3.3')) && ($table == 'user_data')) {
                // Create email link for contacting a member within admin area (or later in other areas, too?)
                $EMAIL = generateUserEmailLink($email, 'admin');
        } elseif ((isExtensionActive('sponsor')) && ($table == 'sponsor_data')) {
index 91dd06ea859147f5a3eb3917b459aaa033b7ba31..594f984846496bf08434f164640750365653b5fc 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Check for version of sql_patches
-if (getExtensionVersion('sql_patches') < '0.3.6') return false;
+if (isExtensionInstalledAndNewer('sql_patches', '0.3.6')) return false;
 
 // Check if there is no scrambling string
 if (getConfig('pass_scramble') == '') {
@@ -114,5 +114,5 @@ if (getConfig('file_hash') == '') {
        } // END - if
 } // END - if
 
-//
-?>
\ No newline at end of file
+// [EOF]
+?>
index de6dcd93b84a493006601988e259b8862a883335..3ec0d018869a6c7d6a770bb94d0266f6822b8ad7 100644 (file)
@@ -636,10 +636,10 @@ function getAdminLastFailure ($adminLogin) {
 // Filter for adding extra data to the query
 function FILTER_ADD_EXTRA_SQL_DATA ($add = '') {
        // Is the admins extension updated? (should be!)
-       if (getExtensionVersion('admins') >= '0.3.0') $add .= ', `default_acl` AS def_acl';
-       if (getExtensionVersion('admins') >= '0.6.7') $add .= ', `la_mode`';
-       if (getExtensionVersion('admins') >= '0.7.2') $add .= ', `login_failures`, UNIX_TIMESTAMP(`last_failure`) AS last_failure';
-       if (getExtensionVersion('admins') >= '0.7.3') $add .= ', `expert_settings`, `expert_warning`';
+       if (isExtensionInstalledAndNewer('admins', '0.3.0')) $add .= ', `default_acl` AS def_acl';
+       if (isExtensionInstalledAndNewer('admins', '0.6.7')) $add .= ', `la_mode`';
+       if (isExtensionInstalledAndNewer('admins', '0.7.2')) $add .= ', `login_failures`, UNIX_TIMESTAMP(`last_failure`) AS last_failure';
+       if (isExtensionInstalledAndNewer('admins', '0.7.3')) $add .= ', `expert_settings`, `expert_warning`';
 
        // Return it
        return $add;
index 08a4d619b52a99753a5bff25a086db8e439ef7ac..f3424a46d76c9942119a1d2f48410e200b5b2820 100644 (file)
@@ -109,7 +109,7 @@ function addTurboBonus ($mid, $userid, $type) {
                        $points
                ), __FUNCTION__, __LINE__);
 
-       if ((getExtensionVersion('bonus') >= '0.3.5') && (getConfig('bonus_mode') != "ADD") && ($points > 0)) handleBonusPoints($points);
+       if ((isExtensionInstalledAndNewer('bonus', '0.3.5')) && (getConfig('bonus_mode') != 'ADD') && ($points > 0)) handleBonusPoints($points);
 }
 
 //
index 59c1f0192f29f6005113ce91fa2cea04f8588a34..ba5e615897a5565f36b1de50d56b0c150f664935 100644 (file)
@@ -320,7 +320,7 @@ function addUserToReferalRallye ($userid, $content = array()) {
        $add = '';
 
        // Updated extension?
-       if (getExtensionVersion('rallye') >= '0.2.0') {
+       if (isExtensionInstalledAndNewer('rallye', '0.2.0')) {
                $add .= ", `min_users`, `min_prices`";
        } // END - if
 
@@ -340,7 +340,7 @@ LIMIT 1", __FUNCTION__, __LINE__);
                $min_users = '0'; $min_prices = '0';
 
                // Load data
-               if (getExtensionVersion('rallye') >= '0.2.0') {
+               if (isExtensionInstalledAndNewer('rallye', '0.2.0')) {
                        list($id, $title, $start, $end, $notify, $min_users, $min_prices) = SQL_FETCHROW($result);
                } else {
                        list($id, $title, $start, $end, $notify) = SQL_FETCHROW($result);
@@ -804,7 +804,7 @@ function addReferalRallyeTemplateSelection ($name = 'template', $default = '') {
 //
 function getReferalRallyeRefsCount ($userid, $old = '0') {
        // Check current refs
-       if (getExtensionVersion('cache') >= '0.1.2') {
+       if (isExtensionInstalledAndNewer('cache', '0.1.2')) {
                // Get refs from cache
                $cnt = '0';
                foreach ($GLOBALS['cache_array']['refsystem']['userid'] as $id => $userid) {
index c6c61aafd10cacce9df151b4b7f768d17c67ebb2..ed919e1267f09e60d2dc90baa317955e97baf1cb 100644 (file)
@@ -246,7 +246,7 @@ function outputAdvancedOverview (&$result_main) {
                if (isExtensionActive('beg'))                  $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_userid')."";
                if (isExtensionActive('bonus'))                $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_userid')."";
                if (isExtensionActive('doubler'))              $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_userid')."";
-               if ((isExtensionActive('holiday')) && (getExtensionVersion('holiday') >= '0.1.3')) {
+               if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
                        // Recent ext-holiday found
                        $EXCLUDE_LIST .= " AND d.`holiday_active`='N'";
                } // END - if
@@ -323,7 +323,7 @@ ORDER BY
 
        if (isExtensionInstalledAndNewer('bonus', '0.2.3')) {
                // Active rallye
-               if (getExtensionVersion('bonus') >= '0.6.9') {
+               if (isExtensionInstalledAndNewer('bonus', '0.6.9')) {
                        // Add more bonus points here
                        $USE = '(0';
                        if (getConfig('bonus_click_yn') == 'Y') $USE .= ' + `turbo_bonus`';
@@ -358,7 +358,7 @@ ORDER BY
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_BONUS_TITLE');
        }
 
-       if ((isExtensionActive('beg')) && (getExtensionVersion('beg') >= '0.1.2')) {
+       if (isExtensionInstalledAndNewer('beg', '0.1.2')) {
                // Begging rallye
 
                // Autopurge installed?
index 2fb7de3b7f8a9b8d1a36c7c8bd45c2767fed3609..c733441a6afdd10f7f09f190da1f632f3c878645 100644 (file)
@@ -127,7 +127,7 @@ function getThemeVersion ($name) {
 
                // Count up
                incrementStatsEntry('cache_hits');
-       } elseif (getExtensionVersion('cache') != '0.1.8') {
+       } elseif (isExtensionInstalledAndNewer('cache', '0.1.8')) {
                // Load version from database
                $result = SQL_QUERY_ESC("SELECT `theme_ver` FROM `{?_MYSQL_PREFIX?}_themes` WHERE `theme_path`='%s' LIMIT 1",
                        array($name), __FUNCTION__, __LINE__);
@@ -170,7 +170,7 @@ function isThemeActive ($name) {
 
                // Count up
                incrementStatsEntry('cache_hits');
-       } elseif (getExtensionVersion('cache') != '0.1.8') {
+       } elseif (isExtensionInstalledAndNewer('cache', '0.1.8')) {
                // Check if current theme is already imported or not
                $result = SQL_QUERY_ESC("SELECT `theme_active` FROM `{?_MYSQL_PREFIX?}_themes` WHERE `theme_path`='%s' AND `theme_active`='Y' LIMIT 1",
                        array($name), __FUNCTION__, __LINE__);
@@ -204,7 +204,7 @@ function getCurrentThemeName () {
 
                // Count up
                incrementStatsEntry('cache_hits');
-       } elseif (getExtensionVersion('cache') != '0.1.8') {
+       } elseif (isExtensionInstalledAndNewer('cache', '0.1.8')) {
                // Check if current theme is already imported or not
                $result = SQL_QUERY_ESC("SELECT `theme_name` FROM `{?_MYSQL_PREFIX?}_themes` WHERE `theme_path`='%s' AND `theme_active`='Y' LIMIT 1",
                        array($name), __FUNCTION__, __LINE__);
index 61ae0ea3cc8ddeb615cfd35589eba711c7a2ac83..af1e552320412fe79659b800254069069e156db7 100644 (file)
@@ -228,7 +228,7 @@ function determineRandomReferalId () {
        $refid = '0';
 
        // Is the extension version fine?
-       if (getExtensionVersion('user') >= '0.3.4') {
+       if (isExtensionInstalledAndNewer('user', '0.3.4')) {
                // Get all user ids
                $totalUsers = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true, " AND `rand_confirmed` >= ".getConfig('user_min_confirmed')."");
 
@@ -331,7 +331,7 @@ function doUserLogin ($userid, $passwd, $successUrl = '', $errorUrl = 'modules.p
                                $GLOBALS['bonus_payed'] = true;
 
                                // Subtract login bonus from userid's account or jackpot
-                               if ((getExtensionVersion('bonus') >= '0.3.5') && (getConfig('bonus_mode') != 'ADD')) handleBonusPoints('login_bonus');
+                               if ((isExtensionInstalledAndNewer('bonus', '0.3.5')) && (getConfig('bonus_mode') != 'ADD')) handleBonusPoints('login_bonus');
                        } // END - if
 
                        // @TODO Make this filter working: $URL = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
@@ -368,7 +368,7 @@ function doUserLogin ($userid, $passwd, $successUrl = '', $errorUrl = 'modules.p
                                // Cookies not setable!
                                $errorCode = getCode('COOKIES_DISABLED');
                        }
-               } elseif (getExtensionVersion('sql_patches') >= '0.6.1') {
+               } elseif (isExtensionInstalledAndNewer('sql_patches', '0.6.1')) {
                        // Update failture counter
                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `login_failures`=`login_failures`+1,`last_failure`=NOW() WHERE `userid`=%s LIMIT 1",
                                array($userid), __FUNCTION__, __LINE__);
index 76faa9653a82e3b3bc4cc7985ed5cfbcc77ddec7..ad4766dfbd67eeb7979ebc6f04f479e3967156f2 100644 (file)
@@ -77,7 +77,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('themes')) && ($GLOBALS['cache_in
        $GLOBALS['cache_instance']->init();
 
        // Load all themes and their data
-       if (getExtensionVersion('theme') >= '0.0.7') {
+       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__);
        } else {
                $result = SQL_QUERY('SELECT id, theme_path, theme_active, theme_ver FROM `{?_MYSQL_PREFIX?}_themes` ORDER BY `id`', __FILE__, __LINE__);
index 3a053f102646cada334612ff856588526a745621..7817289f93aff946bc218780962e996755c29d6a 100644 (file)
@@ -253,7 +253,7 @@ ORDER BY
                $OUT .= '<ul class="admin_menu_main">';
                // @TODO Rewrite this to $content = SQL_FETCHARRAY()
                while (list($menu, $title, $descr) = SQL_FETCHROW($result_main)) {
-                       if ((isExtensionActive('admins')) && (getExtensionVersion('admins') > '0.2.0')) {
+                       if (isExtensionInstalledAndActive('admins', '0.2.0')) {
                                $ACL = adminsCheckAdminAcl($menu, '');
                        } else {
                                // @TODO ACL is 'allow'... hmmm
@@ -325,7 +325,7 @@ ORDER BY
                                        // @TODO Rewrite this to $content = SQL_FETCHARRAY()
                                        while (list($what_sub, $title_what, $desc_what) = SQL_FETCHROW($result_what)) {
                                                // Check for access level
-                                               if ((isExtensionActive('admins')) && (getExtensionVersion('admins') > '0.2.0')) {
+                                               if (isExtensionInstalledAndNewer('admins', '0.2.0')) {
                                                        $ACL = adminsCheckAdminAcl('', $what_sub);
                                                } else {
                                                        // @TODO ACL is 'allow'... hmmm
index 20488564182465e58a60c31c4e252ca9392a8832..57c7327e0e5582beaa4b6fa6020457b9dca05b8a 100644 (file)
@@ -115,7 +115,7 @@ if (isPostRequestParameterSet('edit')) {
        runFilterChain('run_sqls');
 
        // Remove cache file if version matches
-       if (getExtensionVersion('cache') >= '0.1.2') {
+       if (isExtensionInstalledAndNewer('cache', '0.1.2')) {
                if ($GLOBALS['cache_instance']->loadCacheFile('modules')) $GLOBALS['cache_instance']->removeCacheFile();
        } // END - if
 
index c3a8ad74b929643280e6e2f92b052b4be8eb2f83..73e80fc3c6306599a465506e90b57fb3bb700008 100644 (file)
@@ -110,9 +110,10 @@ if (isFormSent()) {
                        }
 
                        // Update cache file
-                       if (getExtensionVersion('cache') >= '0.1.2') {
+                       // @TODO Rewrite this to a filter
+                       if (isExtensionInstalledAndNewer('cache', '0.1.2')) {
                                if ($GLOBALS['cache_instance']->loadCacheFile('refdepths')) $GLOBALS['cache_instance']->removeCacheFile();
-                       }
+                       } // END - if
                        break;
 
                case 'settings':
index e3e3146bce9d8a89b8bee47337fa40d87a6afc49..6fb6f1c43934f521931cc5c88d1af0ae2d5f487e 100644 (file)
@@ -202,7 +202,7 @@ LIMIT 1",
 
        // Free result
        SQL_FREERESULT($result);
-} elseif ((isGetRequestParameterSet('nid')) && (getExtensionVersion('bonus') >= '0.8.7')) {
+} elseif ((isGetRequestParameterSet('nid')) && (isExtensionInstalledAndNewer('bonus', '0.8.7'))) {
        // Load data from bonus mail
        $result = SQL_QUERY_ESC("SELECT `id`, `subject`, `url`, `timestamp` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s",
                array(bigintval(getRequestParameter('nid'))), __FILE__, __LINE__);
index a9403850a7f71d8f408bb2a1ab5cab0998a9e4b0..4e9b0573b76dfdd46c23f86ca03c2cd26f7b4c92 100644 (file)
@@ -88,7 +88,7 @@ if (isGetRequestParameterSet('reg_ext')) {
                                $active = postRequestParameter('active', $ext_id);
 
                                // Update extension's record
-                               if (getExtensionVersion('sql_patches') >= '0.0.6') {
+                               if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
                                        // Update also CSS column when extensions sql_patches is newer or exact v0.0.6
                                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_has_css`='%s', `ext_active`='%s' WHERE `id`=%s LIMIT 1",
                                                array(postRequestParameter('css', $ext_id), $active, $ext_id), __FILE__, __LINE__);
@@ -121,7 +121,7 @@ if (isGetRequestParameterSet('reg_ext')) {
                                $css = 'N';
 
                                // Load required data
-                               if (getExtensionVersion('sql_patches') >= '0.0.6') {
+                               if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
                                        $result = SQL_QUERY_ESC("SELECT ext_has_css, ext_active FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `id`=%s LIMIT 1",
                                                array(bigintval($ext_id)), __FILE__, __LINE__);
                                        list($css, $active) = SQL_FETCHROW($result);
@@ -134,9 +134,11 @@ if (isGetRequestParameterSet('reg_ext')) {
                                        $css = 'X';
                                }
 
-                               // Output row
+                               // Prepare CSS column
                                $cssSelection = '---';
-                               if (getExtensionVersion('sql_patches') >= '0.0.6') $cssSelection = addSelectionBox('yn', $css, 'css', $ext_id);
+                               if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
+                                       $cssSelection = addSelectionBox('yn', $css, 'css', $ext_id);
+                               } // END - if
 
                                // Prepare data for the row template
                                $content = array(
@@ -352,7 +354,7 @@ ORDER BY `ext_name` ASC", __FILE__, __LINE__);
                                                        if ($GLOBALS['cache_instance']->loadCacheFile('extension')) $GLOBALS['cache_instance']->removeCacheFile();
                                                        if ($GLOBALS['cache_instance']->loadCacheFile('modules'))   $GLOBALS['cache_instance']->removeCacheFile();
                                                } // END - if
-                                       } elseif (getExtensionVersion($ext_name) != '') {
+                                       } elseif (isExtensionInstalled($ext_name)) {
                                                // Notify the admin that we have a problem here...
                                                loadTemplate('admin_settings_saved', false, getMessage('ADMIN_REG_FAILED_ALREADY'));
                                        } else {
index 75e0ecdb482e91172814a8cd3e57a8272c2c4393..967b68ee8157280f98ee659eae747f357c12b266 100644 (file)
@@ -47,7 +47,7 @@ addMenuDescription('admin', __FILE__);
 
 if (getConfig('beg_rallye') == 'Y') {
        // Shall I withdraw now?
-       if (isPostRequestParameterSet(('withdraw'))) {
+       if (isPostRequestParameterSet('withdraw')) {
                // Okay, let's prepare...
                $curr = date('m', time()) - 1;
                if (strlen($curr) == 1) $curr = '0' . $curr;
index 75a28ebbcc621cf6fba56da288204f1696ac6d1f..aa6ca5fed6edcc478cde39ffbdb057751e09a023 100644 (file)
@@ -47,7 +47,7 @@ addMenuDescription('admin', __FILE__);
 
 if (getConfig('bonus_active') == 'Y') {
        // Shall I withdraw now?
-       if (isPostRequestParameterSet(('withdraw'))) {
+       if (isPostRequestParameterSet('withdraw')) {
                // Okay, let's prepare...
                $curr = date('m', time()) - 1;
                if (strlen($curr) == 1) $curr = '0' . $curr;
@@ -55,7 +55,7 @@ if (getConfig('bonus_active') == 'Y') {
                loadTemplate('admin_settings_saved', false, getMessage('ADMIN_BONUS_WITHDRAW_PREPARED'));
        } // END - if
 
-       if (getExtensionVersion('bonus') >= '0.6.9') {
+       if (isExtensionInstalledAndNewer('bonus', '0.6.9')) {
                // Add more bonus points here
                $USE = '(0';
                if (getConfig('bonus_click_yn') == 'Y') $USE .= ' + `turbo_bonus`';
index 4fa37486d957098d7f950d8deca4ca655e271af5..b27461d4645e9e5c50346d5ac6b5fc11ffae6cc7 100644 (file)
@@ -65,12 +65,12 @@ if (isExtensionActive('nickname')) {
 }
 
 // Add random confirmed if extension version matches
-if (getExtensionVersion('user') >= '0.3.4') {
+if (isExtensionInstalledAndNewer('user', '0.3.4')) {
        // Add it...
        $MORE .= ", `rand_confirmed`";
 
        // Add lock reason?
-       if (getExtensionVersion('user') >= '0.3.5') {
+       if (isExtensionInstalledAndNewer('user', '0.3.5')) {
                // Add them...
                $MORE .= ", `lock_reason`, UNIX_TIMESTAMP(`lock_timestamp`) AS lock_timestamp";
        } // END - if
@@ -167,7 +167,7 @@ LIMIT 1",
                }
 
                // Is the user extension newer?
-               if (getExtensionVersion('user') >= '0.3.4') {
+               if (isExtensionInstalledAndNewer('user', '0.3.4')) {
                        // Then "translate" the number
                        $content['rand_confirmed'] = translateComma($content['rand_confirmed']);
                } // END - if
index c5d68665d1e1932a3c49d97cd87fcf29fdfe15a9..5656c7b34a3f6201a9e17dfe8e992f8e43aa8b40 100644 (file)
@@ -55,7 +55,7 @@ if (isGetRequestParameterSet('userid')) {
                // Is a lock reason set?
                if ((isPostRequestParameterSet('lock')) && (getUserData('status') != 'LOCKED')) {
                        // Ok, lock the account!
-                       if (getExtensionVersion('user') >= '0.3.5') {
+                       if (isExtensionInstalledAndNewer('user', '0.3.5')) {
                                // Lock with reason
                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `status`='LOCKED', `lock_reason`='%s', `lock_timestamp`=NOW() WHERE `userid`=%s LIMIT 1",
                                        array(postRequestParameter('reason'), bigintval(getRequestParameter('userid'))), __FILE__, __LINE__);
@@ -79,7 +79,7 @@ if (isGetRequestParameterSet('userid')) {
                        $ACT = true;
                } elseif ((isPostRequestParameterSet('unlock')) && (getUserData('status') == 'LOCKED')) {
                        // Ok, unlock the account!
-                       if (getExtensionVersion('user') >= '0.3.5') {
+                       if (isExtensionInstalledAndNewer('user', '0.3.5')) {
                                // Reset lock reason as well
                                SQL_QUERY_ESC("UPDATE
        `{?_MYSQL_PREFIX?}_user_data`
index 194a3a0ff1c635e52b22d5d654c603a78b039ee5..9b7ed99b3f26b4e2e9e17c89d3ee3749b985537f 100644 (file)
@@ -93,7 +93,7 @@ LIMIT 1",
                                        } // END - if
 
                                        // Check for bonus extension version >= 0.4.4 for the order bonus
-                                       if ((getExtensionVersion('bonus') >= '0.4.4') && (getConfig('bonus_active') == 'Y')) {
+                                       if ((isExtensionInstalledAndNewer('bonus', '0.4.4')) && (getConfig('bonus_active') == 'Y')) {
                                                // Add points directly
                                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `bonus_order`=`bonus_order`+".getConfig('bonus_order')." WHERE `userid`=%s LIMIT 1",
                                                        array(bigintval($content['sender'])), __FILE__, __LINE__);
index 6fb1d870258ca676226d4c1c2f1c8d8eef9299b3..75bf5075bf663349b55a44ff4d22255310c06875 100644 (file)
@@ -100,7 +100,7 @@ if (isGetRequestParameterSet('hash')) {
                                        }
 
                                        // If version matches add ref bonus to refid's account
-                                       if ((getExtensionVersion('bonus') >= '0.4.4') && (getConfig('bonus_active') == 'Y')) {
+                                       if ((isExtensionInstalledAndNewer('bonus', '0.4.4')) && (getConfig('bonus_active') == 'Y')) {
                                                // Add points (directly only!)
                                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `bonus_ref`=`bonus_ref`+{?bonus_ref?} WHERE `userid`=%s LIMIT 1",
                                                        array(bigintval($rid)), __FILE__, __LINE__);
index 36bff36b2c4597b2f8c70078480536df74175905..5c9871a969c333a9ccda3f18a087520a6a03561b 100644 (file)
@@ -52,7 +52,7 @@ if ((!isExtensionActive('bonus')) && (!isAdmin())) {
        return;
 } // END - if
 
-if (getExtensionVersion('bonus') >= '0.6.9') {
+if (isExtensionInstalledAndNewer('bonus', '0.6.9')) {
        // Add more bonus points here
        // @TODO Rewrite this to a filter
        $USE = '(0';
index a73aaab6f417a7162c1334b232502f8edb9856fd..c9bfafc8b1a5d2b84a7716cb103e554e2ccad803 100644 (file)
@@ -97,7 +97,7 @@ if (getConfig('order_max_full') == 'MAX') $ALLOWED = $MAXI;
 // Now check his points amount
 $total = countSumTotalData(getMemberId(), 'user_points', 'points') - countSumTotalData(getMemberId(), 'user_data', 'used_points');;
 
-if (($HOLIDAY == 'Y') && (getExtensionVersion('holiday') >= '0.1.3')) {
+if (($HOLIDAY == 'Y') && (isExtensionInstalledAndNewer('holiday', '0.1.3'))) {
        // Holiday is active!
        loadTemplate('admin_settings_saved', false, getMessage('HOLIDAY_ORDER_NOT_POSSIBLE'));
 } elseif ((isPostRequestParameterSet('frametester')) && ($ALLOWED > 0) && (postRequestParameter('receiver') > 0)) {
@@ -251,7 +251,7 @@ ORDER BY
                        // Load receivers from database
                        $TEST = array(); $cnt = '0';
                        while ($holidayContent = SQL_FETCHARRAY($result)) {
-                               if (getExtensionVersion('holiday') >= '0.1.3') {
+                               if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
                                        // Check for his holiday status
                                        $result_holiday = SQL_QUERY_ESC("SELECT
        `id`
@@ -474,7 +474,7 @@ ORDER BY
                                while (list($ucat) = SQL_FETCHROW($result_userids)) {
                                        // Check for holiday system
                                        $HOL_ACTIVE = false;
-                                       if (isExtensionInstalledAndNewer('holiday', '0.1.3') {
+                                       if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
                                                // Check user's holiday status
                                                $result_holiday = SQL_QUERY_ESC("SELECT
        d.userid FROM `{?_MYSQL_PREFIX?}_user_data` AS d
index fd7daa875fed076e7f64bdac46f555aca6fd27c7..95ccddf4d562bbf4078749af90712cfc68838180 100644 (file)
@@ -195,7 +195,7 @@ VALUES (%s,%s,%s, UNIX_TIMESTAMP(), 'NEW','%s','%s','%s')",
 
                                        // Load templates
                                        $message_mem = loadEmailTemplate('member_payout_request_banner', postRequestArray(), getMemberId());
-                                       if (getExtensionVersion('admins') >= '0.4.1') {
+                                       if (isExtensionInstalledAndNewer('admins', '0.4.1')) {
                                                $adm_tpl = 'admin_payout_request_banner';
                                        } else {
                                                $message_adm = loadEmailTemplate('admin_payout_request_banner', postRequestArray(), getMemberId());
@@ -219,7 +219,7 @@ VALUES (%s,%s,%s,'%s',%s, UNIX_TIMESTAMP(), 'NEW','%s')",
                                        $admin_tpl = '';
 
                                        // @TODO Rewrite this to a filter
-                                       if (getExtensionVersion('admins') >= '0.4.1') {
+                                       if (isExtensionInstalledAndNewer('admins', '0.4.1')) {
                                                $admin_tpl = 'admin_payout_request';
                                        } // END - if
                                }
index 0aceb6ee41687c56dc3ba5718967fea19e1cdd29..9f4ffc049b4d8e7c097257192a7123e1a31616f7 100644 (file)
@@ -141,7 +141,7 @@ if (isExtensionInstalledAndNewer('user', '0.1.2')) {
        $add = '';
        $CONFIRMED = getUserData('mails_confirmed');
 
-       if (getExtensionVersion('user') >= '0.1.4') {
+       if (isExtensionInstalledAndNewer('user', '0.1.4')) {
                $SENT     = getUserData('emails_sent');
                $RECEIVED = getUserData('emails_received');
        } // END - if
@@ -178,7 +178,7 @@ if ((isExtensionInstalledAndNewer('bonus', '0.2.2')) && (isExtensionActive('bonu
        $content['stats'] = '0.00000';
 
        // Get more data if ext-bonus is newer
-       if (getExtensionVersion('bonus') >= '0.4.4') {
+       if (isExtensionInstalledAndNewer('bonus', '0.4.4')) {
                $content['ref']   = getUserData('bonus_ref');
                $content['order'] = getUserData('bonus_order');
                $content['stats'] = getUserData('bonus_stats');
@@ -191,7 +191,7 @@ if ((isExtensionInstalledAndNewer('bonus', '0.2.2')) && (isExtensionActive('bonu
        $content['turbo'] = translateComma($content['turbo']);
        $content['login'] = translateComma($content['login']);
 
-       if (getExtensionVersion('bonus') >= '0.4.4') {
+       if (isExtensionInstalledAndNewer('bonus', '0.4.4')) {
                // Add referal, stats and order bonys
                $content['ref']   = translateComma($content['ref']);
                $content['order'] = translateComma($content['order']);
index f24de73545bacf9bd6c99590f9215555d334e832..253836a1ee91a81dd14e396dc587757e292a88a4 100644 (file)
@@ -57,7 +57,7 @@ if ((!isFormSent()) || (!isPostRequestParameterSet(('qsummary')))) {
        loadTemplate('member_support_form', false, getUserDataArray());
 } else {
        // Load mail template based on your member's decision
-       if (getExtensionVersion('admins') >= '0.4.1') {
+       if (isExtensionInstalledAndNewer('admins', '0.4.1')) {
                $a_tpl = 'admin_support-' . postRequestParameter('qsummary');
        } else {
                $message_a = loadEmailTemplate('admin_support-' . postRequestParameter('qsummary'), array('text' => postRequestParameter('qdetails')), getMemberId());
index 44e848747020d5efa5fb0dd5cc999045bfc4bde4..52091822ef70e9ee72822dab64d76700d9b83a44 100644 (file)
@@ -1921,7 +1921,7 @@ function generateReceiverList ($cat, $receiver, $mode = '') {
        } // END - if
 
        // Exclude users in holiday?
-       if (getExtensionVersion('holiday') >= '0.1.3') {
+       if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
                // Add something for the holiday extension
                $CAT_WHERE .= " AND d.`holiday_active`='N'";
        } // END - if
index d904d52758b135fc7c2b0b800601fac29dea639c..6276de68290a22b048c95350d8d1a6663c92cd8a 100644 (file)
@@ -124,7 +124,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                                // Count one up and remove entry from dummy array
                                                $GLOBALS['pool_cnt']++; unset($dummy[$key]);
 
-                                               if (getExtensionVersion('user') >= '0.1.4') {
+                                               if (isExtensionInstalledAndNewer('user', '0.1.4')) {
                                                        // Update mails received for receiver
                                                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `emails_received`=`emails_received`+1 WHERE `userid`=%s LIMIT 1",
                                                        array(bigintval($userid)), __FILE__, __LINE__);
@@ -141,7 +141,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                        } // END - foreach
 
                        // Update mediadata if version is 0.0.4 or higher
-                       if (getExtensionVersion('mediadata') >= '0.0.4') {
+                       if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
                                // Update entry (or add missing
                                $P = $GLOBALS['pool_cnt'];
                                if (!empty($cnt2) && empty($GLOBALS['pool_cnt'])) $P = $cnt2;
@@ -158,7 +158,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                //* DEBUG: */ print("*L:".__LINE__."*<br />");
 
                                // Update mediadata if version is 0.0.4 or higher
-                               if (getExtensionVersion('mediadata') >= '0.0.4') {
+                               if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
                                        // Update entry (or add missing)
                                        //* DEBUG: */ print("*MEDIA/L:".__LINE__."*<br />");
                                        updateMediadataEntry(array('total_orders', 'bonus_orders'), 'add', 1);
index 981c43d62e098349be589cac75fe026c6b42392a..54e6bd065f01923537ce44be458d0cc9004c96a4 100644 (file)
@@ -152,14 +152,14 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET emails_sent=emails_sent+1 WHERE `userid`=%s LIMIT 1",
                                                                        array(bigintval($DATA['sender'])), __FILE__, __LINE__);
 
-                                                               if (getExtensionVersion('user') >= '0.1.4') {
+                                                               if (isExtensionInstalledAndNewer('user', '0.1.4')) {
                                                                        // Update mails received for receiver
                                                                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `emails_received`=`emails_received`+1 WHERE `userid`=%s LIMIT 1",
                                                                                array(bigintval($userid)), __FILE__, __LINE__);
                                                                } // END - if
 
                                                                // Update mediadata if version is 0.0.4 or higher
-                                                               if (getExtensionVersion('mediadata') >= '0.0.4') {
+                                                               if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
                                                                        // Update entry (or add missing)
                                                                        //* DEBUG: */ outputHtml("*MEDIA/L:".__LINE__."*<br />");
                                                                        updateMediadataEntry(array('total_send', 'normal_send'), 'add', 1);
@@ -214,7 +214,7 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                $cnt2 += $GLOBALS['pool_cnt'];
 
                                                // Update mediadata if version is 0.0.4 or higher
-                                               if (getExtensionVersion('mediadata') >= '0.0.4') {
+                                               if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
                                                        // Update entry (or add missing)
                                                        //* DEBUG: */ outputHtml("*MEDIA/L:".__LINE__."*<br />");
                                                        updateMediadataEntry(array('total_orders', 'normal_orders'), 'add', 1);
index 37cc0136551b36eb57b79e009a459c901af4376c..be14b25c2b6c771e5a22f94472418411b989b992 100644 (file)
@@ -49,7 +49,7 @@ if ((getOutputMode() != 0) || (!isResetModeEnabled())) return;
 //* DEBUG: */ outputHtml(basename(__FILE__)."<br />");
 
 // Update user profiles
-if ((isExtensionActive('order')) && (getExtensionVersion('order') >= '0.1.1')) {
+if (isExtensionInstalledAndNewer('order', '0.1.1')) {
        // Latest version
        $result_daily = SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET receive_mails=max_mails, mail_orders=0 WHERE receive_mails != max_mails", __FILE__, __LINE__);
 } else {
@@ -86,7 +86,7 @@ LIMIT 1",
                                array($content['locked_points'], bigintval($content['userid']), $content['ref_depth']), __FILE__, __LINE__, false));
 
                                // Update mediadata as well
-                               if (getExtensionVersion('mediadata') >= '0.0.4') {
+                               if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
                                        // Update database
                                        updateMediadataEntry(array('total_points'), 'add', $content['locked_points']);
                                } // END - if
index 218bab23d89a1898550aac7930a50e4b42f1bdcd..2127a208e7e62d1e6b70ade8346aa97d1f12fdd9 100644 (file)
@@ -368,8 +368,14 @@ function isSqlDebuggingEnabled () {
 
 // Checks wether we shall debug regular expressions
 function isDebugRegularExpressionEnabled () {
-       // Simply check it
-       return ((isConfigEntrySet('DEBUG_REGEX')) && (getConfig('DEBUG_REGEX') == 'Y'));
+       // Is cache set?
+       if (!isset($GLOBALS['is_regular_exp_debug_enabled'])) {
+               // Simply check it
+               $GLOBALS['is_regular_exp_debug_enabled'] = ((isConfigEntrySet('DEBUG_REGEX')) && (getConfig('DEBUG_REGEX') == 'Y'));
+       } // END - if
+
+       // Return it
+       return $GLOBALS['is_regular_exp_debug_enabled'];
 }
 
 // Checks wether the cache instance is valid
@@ -707,16 +713,26 @@ function redirectToDereferedUrl ($URL) {
 
 // Wrapper function for checking if extension is installed and newer or same version
 function isExtensionInstalledAndNewer ($ext_name, $version) {
+       // Is an cache entry found?
+       if (!isset($GLOBALS['ext_installed_newer'][$ext_name][$version])) {
+               $GLOBALS['ext_installed_newer'][$ext_name][$version] = ((isExtensionInstalled($ext_name)) && (getExtensionVersion($ext_name) >= $version));
+       } // END - if
+
        // Return it
-       //* DEBUG: */ print __FUNCTION__.':'.$ext_name.'=&gt;'.$version.'<br />';
-       return ((isExtensionInstalled($ext_name)) && (getExtensionVersion($ext_name) >= $version));
+       //* DEBUG: */ print __FUNCTION__.':'.$ext_name.'=&gt;'.$version.':'.intval($GLOBALS['ext_installed_newer'][$ext_name][$version]).'<br />';
+       return $GLOBALS['ext_installed_newer'][$ext_name][$version];
 }
 
 // Wrapper function for checking if extension is installed and older than given version
 function isExtensionInstalledAndOlder ($ext_name, $version) {
+       // Is an cache entry found?
+       if (!isset($GLOBALS['ext_installed_older'][$ext_name][$version])) {
+               $GLOBALS['ext_installed_older'][$ext_name][$version] = ((isExtensionInstalled($ext_name)) && (isExtensionOlder($ext_name, $version)));
+       } // END - if
+
        // Return it
-       //* DEBUG: */ print __FUNCTION__.':'.$ext_name.'&lt;'.$version.'<br />';
-       return ((isExtensionInstalled($ext_name)) && (isExtensionOlder($ext_name, $version)));
+       //* DEBUG: */ print __FUNCTION__.':'.$ext_name.'&lt;'.$version.':'.intval($GLOBALS['ext_installed_older'][$ext_name][$version]).'<br />';
+       return $GLOBALS['ext_installed_older'][$ext_name][$version];
 }
 
 // Set username
@@ -750,7 +766,14 @@ function isInstallationPhase () {
 
 // Checks wether the extension demo is actuve and the admin login is demo (password needs to be demo, too!)
 function isDemoModeActive () {
-       return ((isExtensionActive('demo')) && (getSession('admin_login') == 'demo'));
+       // Is cache set?
+       if (!isset($GLOBALS['demo_mode_active'])) {
+               // Simply check it
+               $GLOBALS['demo_mode_active'] = ((isExtensionActive('demo')) && (getSession('admin_login') == 'demo'));
+       } // END - if
+
+       // Return it
+       return $GLOBALS['demo_mode_active'];
 }
 
 // Getter for PHP caching value
index ff1cecd9a49baebb0d4b6f54676f8b3e72271cb5..29a08b5f24b4a4a7bcbc0dd8f7fedab7bf4e7274 100644 (file)
@@ -194,7 +194,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDe
                                                                                                array($url_mid), __FILE__, __LINE__);
 
                                                                                        // Update mediadata as well
-                                                                                       if (getExtensionVersion('mediadata') >= '0.0.4') {
+                                                                                       if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
                                                                                                // Update database
                                                                                                updateMediadataEntry(array('total_clicks', 'normal_clicks'), 'add', 1);
                                                                                        } // END - if
@@ -206,7 +206,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDe
                                                                                                array($url_bid), __FILE__, __LINE__);
 
                                                                                        // Update mediadata as well
-                                                                                       if (getExtensionVersion('mediadata') >= '0.0.4') {
+                                                                                       if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
                                                                                                // Update database
                                                                                                updateMediadataEntry(array('total_clicks', 'bonus_clicks'), 'add', 1);
                                                                                        } // END - if
@@ -224,13 +224,13 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDe
 
                                                                        // Only when user extension = v0.1.2: Update mails-confirmed counter
                                                                        // @TODO Rewrite these blocks to filter
-                                                                       if (getExtensionVersion('user') >= '0.1.2') {
+                                                                       if (isExtensionInstalledAndNewer('user', '0.1.2')) {
                                                                                // Update counter
                                                                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET mails_confirmed=mails_confirmed + 1 WHERE `userid`=%s LIMIT 1",
                                                                                        array($url_userid), __FILE__, __LINE__);
 
                                                                                // Update random confirmed as well?
-                                                                               if (getExtensionVersion('user') >= '0.3.4') {
+                                                                               if (isExtensionInstalledAndNewer('user', '0.3.4')) {
                                                                                        // Update second counter
                                                                                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET rand_confirmed=rand_confirmed + 1 WHERE `userid`=%s LIMIT 1",
                                                                                                array($url_userid), __FILE__, __LINE__);
@@ -263,7 +263,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDe
                                                                                addPointsThroughReferalSystem('mailid_okay', $url_userid, $payment, false, 0, $locked);
 
                                                                                // Shall I add bonus points for "turbo clickers" ?
-                                                                               if (getExtensionVersion('bonus') >= '0.2.2') {
+                                                                               if (isExtensionInstalledAndNewer('bonus', '0.2.2')) {
                                                                                        // Is an active-rallye running and this is not a notification mail?
                                                                                        if ((getConfig('bonus_active') == 'Y') && ($notify != 'Y')) {
                                                                                                // Shall I exclude the webmaster's own userid from the active-rallye?