$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
// 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__);
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
// 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)";
} 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
// 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
$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 {
// Get current year and subtract the configured minimum age
$OUT .= "<option value=\"".($minYear - 1)."\"><" . $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 {
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')) {
}
// 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') == '') {
} // END - if
} // END - if
-//
-?>
\ No newline at end of file
+// [EOF]
+?>
// 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;
$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);
}
//
$add = '';
// Updated extension?
- if (getExtensionVersion('rallye') >= '0.2.0') {
+ if (isExtensionInstalledAndNewer('rallye', '0.2.0')) {
$add .= ", `min_users`, `min_prices`";
} // END - if
$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);
//
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) {
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
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`';
$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?
// 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__);
// 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__);
// 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__);
$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')."");
$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));
// 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__);
$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__);
$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
// @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
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
}
// 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':
// 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__);
$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__);
$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);
$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(
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 {
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;
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;
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`';
}
// 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
}
// 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
// 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__);
$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`
} // 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__);
}
// 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__);
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';
// 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)) {
// 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`
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
// 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());
$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
}
$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
$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');
$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']);
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());
} // 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
// 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__);
} // 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;
//* 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);
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);
$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);
//* 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 {
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
// 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
// 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.'=>'.$version.'<br />';
- return ((isExtensionInstalled($ext_name)) && (getExtensionVersion($ext_name) >= $version));
+ //* DEBUG: */ print __FUNCTION__.':'.$ext_name.'=>'.$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.'<'.$version.'<br />';
- return ((isExtensionInstalled($ext_name)) && (isExtensionOlder($ext_name, $version)));
+ //* DEBUG: */ print __FUNCTION__.':'.$ext_name.'<'.$version.':'.intval($GLOBALS['ext_installed_older'][$ext_name][$version]).'<br />';
+ return $GLOBALS['ext_installed_older'][$ext_name][$version];
}
// Set username
// 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
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
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
// 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__);
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?