// Process the request
processAjaxRequest();
- // Do we have an error? ('200 OK' is fine)
+ // Is there an error? ('200 OK' is fine)
if ((getHttpStatus() != '200 OK') && (getHttpStatus() != '404 NOT FOUND')) {
// The process was handled but didn't work
reportBug(__FUNCTION__, __LINE__, 'AJAX request is valid but does not do anything.');
// Default comment
$comment = str_replace('_', '-', $new);
- // Do we have a special comment?
+ // Is there a special comment?
if (isset($comments[$new])) {
// Then use it
$comment = $comments[$new];
} // END - if
- // Do we need to make $new lowercase?
+ // Does $new needs to be lower-case?
$oldNew = $new;
if (in_array($new, $lowerCase)) {
// Then do so... :)
// Default is empty SQL
$SQL = '';
- // Do we have multiple entries?
+ // Is there multiple entries?
if (is_array($entries)) {
// Walk through all
foreach ($entries as $idx => $entry) {
LIMIT 1",
array(bigintval($content['userid'])), __FILE__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result_holiday) == 1) {
// Okay, this user can be send away to holiday...
$content = merge_array($content, SQL_FETCHARRAY($result_holiday));
ORDER BY
`userid` ASC", __FILE__, __LINE__);
- // Do we have some notifications to sent?
+ // Are there some notifications to sent?
if (!SQL_HASZERONUMS($result)) {
// We need to send-out notifications...
while ($content = SQL_FETCHARRAY($result)) {
// SQL queries
function SQL_QUERY ($sqlString, $F, $L, $enableCodes = true) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$sqlString])) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called: ' . $sqlString);
// Escape a string for the database
function SQL_ESCAPE ($str, $secureString = true, $strip = true) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['sql_escapes']['' . $str . ''])) {
// Prepare the string here
$str = SQL_PREPARE_SQL_STRING($str);
// Debug log
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'columnName=' . $columnName . ',idx=' . $idx . ',sql=' . $sql . ',hasZeroNums=' . intval(ifSqlColumnExists($tableName, $columnName)));
- // Do we have no entry on ADD or an entry on DROP/CHANGE?
+ // Is there no entry on ADD or an entry on DROP/CHANGE?
if (((!ifSqlColumnExists($tableName, $columnName)) && (isInString('ADD', $sql))) || ((ifSqlColumnExists($tableName, $columnName)) && ((isInString('DROP', $sql)) || ((isInString('CHANGE', $sql)) && ($idx == 4) && ((!ifSqlColumnExists($tableName, $tableArray[5])) || ($columnName == $tableArray[5])))))) {
// Do the query
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Executing: ' . $sql);
// Checks if the link is up
function SQL_IS_LINK_UP () {
- // Do we have cached this?
+ // Is there cached this?
if (!isset($GLOBALS['is_sql_link_up'])) {
// Determine it
$GLOBALS['is_sql_link_up'] = is_resource(SQL_GET_LINK());
// Remember plain error in last_sql_error
$GLOBALS['last_sql_error'] = mysql_error();
- // Do we have installation phase?
+ // Is there installation phase?
if (isInstallationPhase()) {
/*
* In installation phase, we don't want SQL errors abort e.g. connection
// Check if there is a SQL table created
function ifSqlTableExists ($tableName) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ' - ENTERED!');
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$tableName])) {
// Check if the table is there
$result = SQL_QUERY_ESC("SHOW TABLES FROM `{?__DB_NAME?}` WHERE `Tables_in_{?__DB_NAME?}`='{?_MYSQL_PREFIX?}_%s'",
// Is a table column there?
function ifSqlColumnExists ($tableName, $columnName) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',columnName=' . $columnName . ' - ENTERED!');
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$tableName][$columnName])) {
// And column name as well
$columnName = str_replace('`', '', $columnName);
// Checks depending on the mode if the index is there
function isSqlTableIndexFound ($tableName, $keyName) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'tableName=' . $tableName . ',columnName=' . $keyName . ' - ENTERED!');
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$tableName][$keyName])) {
// Show indexes
$result = SQL_QUERY_ESC("SHOW INDEX FROM `%s`", array($tableName), __FUNCTION__, __LINE__);
// This also worked, now we need to check if the selected database type is supported
$result = SQL_QUERY('SHOW ENGINES', __FUNCTION__, __LINE__);
- // Do we have entries? (Bad if not)
+ // Are there entries? (Bad if not)
if (SQL_NUMROWS($result) > 0) {
// Load all and check for active entries
while ($content = SQL_FETCHARRAY($result)) {
// Get the enty we need and trim it
$entry = trim($data['matches'][4][$data['key']]);
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['expression_function_available'][$entry])) {
// Init function name
$functionName = 'get';
// Expression call-back function for URLs
function doExpressionUrl ($data) {
- // Do we have JS-mode?
+ // Is there JS-mode?
if ($data['callback'] == 'js') {
// Switch to it
$data['output_mode'] = '1';
// Expression call-back function for getting configuration data
// @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again
function doExpressionConfig ($data) {
- // Do we have a special expression function for it?
+ // Is there a special expression function for it?
if (isExpressionFunctionAvaiable($data)) {
// Then use it
$replacer = '{DQUOTE} . ' . $data['callback'] . '(' . getExpressionFunction($data) . '()) . {DQUOTE}';
// We need callback and extra_func: callback is really the call-back function, extra_func is our value
$replacer = $data['extra_func'];
- // Do we have a call-back? Should always be there!
+ // Is there a call-back? Should always be there!
if (!empty($data['callback'])) {
//* DEBUG: */ if ($data['callback'] == 'getMemberId') die('<pre>'.encodeEntities(print_r($data, true)).'</pre>');
// If the value is empty, we don't add it
loadLanguageFile($ext_name);
} // END - if
- // Do we have cache?
+ // Is there cache?
if (isExtensionFunctionFileReadable($ext_name)) {
// Not yet loaded?
if ((($GLOBALS['cache_array']['extension']['ext_func'][$ext_name] == 'Y') || (!isset($GLOBALS['cache_array']['extension']['ext_func'][$ext_name]))) && (!isExtensionLibraryLoaded($ext_name))) {
// Debug message
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'SQLs::count=' . countSqls());
- // Do we have entries?
+ // Are there entries?
if (isSqlsValid()) {
// Run SQL commands...
runFilterChain('run_sqls');
// Look in database
$ext_id = getExtensionId($ext_name);
- // Do we have a record?
+ // Is there a record?
$isInstalled = ($ext_id > 0);
// Log debug message
// Init variables
$OUT = '';
- // Do we have queries?
+ // Is there queries?
if (isVerboseSqlEnabled()) {
- // Do we have entries?
+ // Are there entries?
if (countExtensionSqls() > 0) {
// Init counter
$idx = 0;
// Init id number
$data['ext_id'] = '0';
- // Do we have cache?
+ // Is there cache?
if (isset($GLOBALS['cache_array']['extension']['ext_id'][$ext_name])) {
// Load from cache
$data['ext_id'] = $GLOBALS['cache_array']['extension']['ext_id'][$ext_name];
// Determines whether the given extension name is valid
function isExtensionNameValid ($ext_name) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['ext_name_valid'][$ext_name])) {
// Generate include file name
$INC = sprintf("inc/extensions/ext-%s.php", $ext_name);
// Init notification pool
initIncludePool('notify');
- // Do we have some entries?
+ // Are there some entries?
if (isset($GLOBALS['cache_array']['extension']['ext_name'])) {
// Load all found extensions if found
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'CACHE - START!');
// "Getter" for 'extension has a CSS file' (with same name, of course)
function getExtensionHasCss () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][getCurrentExtensionName()][getCurrentTheme()])) {
// Construct FQFN for check
$FQFN = sprintf("%stheme/%s/css/%s.css",
// Checks whether the given extension has a language file
function ifExtensionHasLanguageFile ($ext_name) {
- // Do we have cache?
+ // Is there cache?
if (isset($GLOBALS['cache_array']['extension']['ext_lang'][$ext_name])) {
// Count cache hits
incrementStatsEntry('cache_hits');
} // END - if
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - ENTERED!');
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$ext_name])) {
// Load extension only if not yet loaded
if (!isset($GLOBALS['ext_productive'][$ext_name])) {
// Debug message
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - ENTERED!');
- // Do we have cache entry?
+ // Is there a cache entry?
if (!isset($GLOBALS[__FUNCTION__][$ext_name])) {
// Default is not found
$GLOBALS[__FUNCTION__][$ext_name] = false;
getMemberId()
), __FUNCTION__, __LINE__);
- // Do we have entries left?
+ // Are there entries left?
if (!SQL_HASZERONUMS($result)) {
// Load all names
while ($content = SQL_FETCHARRAY($result)) {
// Is there still a query left?
if (!empty($sql)) {
- // Do we have an "ALTER TABLE" command?
+ // Is there an "ALTER TABLE" command?
if (substr(strtolower($sql), 0, 11) == 'alter table') {
// Analyse the alteration command
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Alterting table: ' . $sql . ',enable_codes=' . intval($filterData['enable_codes']));
// Simply remove it
unsetExtensionSqls();
- // Do we need to remove update depency?
+ // Are there update dependencies to remove?
if (countExtensionUpdateDependencies() > 0) {
// Then find all updates we shall no longer execute
foreach (getExtensionUpdateDependencies() as $id => $ext_name) {
// Save the uncompiled code
$uncompiled = $code;
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['compiled_config'][$code])) {
// Compile {?some_var?} to getConfig('some_var')
preg_match_all('/\{\?(([a-zA-Z0-9-_]+)*)\?\}/', $code, $matches);
if ((count($matches) > 0) && (count($matches[0]) > 0)) {
// Replace all matches
foreach ($matches[0] as $key => $match) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['compile_config'][$matches[1][$key]])) {
// Is the config valid?
if (isConfigEntrySet($matches[1][$key])) {
} // END - foreach
} // END - if
- // Do we have non-HTML mode?
+ // Is there non-HTML mode?
if (!isHtmlOutputMode()) {
$filterData = decodeEntities($filterData);
} // END - if
// Handles fatal errors
function FILTER_HANDLE_FATAL_ERRORS () {
- // Do we have errors to handle and right output mode?
+ // Is there errors to handle and right output mode?
if ((!ifFatalErrorsDetected()) || (!isHtmlOutputMode())) {
// Abort executing here
return false;
return;
} // END - if
- // Do we have cached eval() data?
+ // Is there cached eval() data?
if ((isset($GLOBALS['template_eval'])) && (count($GLOBALS['template_eval']) > 0)) {
// Now flush all
foreach ($GLOBALS['template_eval'] as $template => $eval) {
`filter_name` ASC,
`filter_function` ASC', __FILE__, __LINE__);
-// Do we have entries? (we should have!)
+// Are there entries? (there should be!)
if (!SQL_HASZERONUMS($result)) {
// Load row by row
while ($filter = SQL_FETCHARRAY($result)) {
// Now search again for this filter and get it's total count
$count = countSumTotalData($filter['filter_name'], 'filters', 'filter_id', 'filter_name', true, sprintf(" AND `filter_function`='%s'", SQL_ESCAPE($filter['filter_function'])));
- // Do we have more than one entry?
+ // Is there more than one entry?
if ($count > 1) {
// Then clean them up, except one
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_filters` WHERE `filter_name`='%s' AND `filter_function`='%s' LIMIT %s",
die();
} // END - if
-// Sanity-check: Do we have ref level 0? If so, this must be fixed to NULL and `level` must be increased by one
+// Sanity-check: Is there ref level 0? If so, this must be fixed to NULL and `level` must be increased by one
$result = SQL_QUERY('SELECT `id` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `level`=0', __FILE__, __LINE__);
if (!SQL_HASZERONUMS($result)) {
// Remove index temporaly
ORDER BY
`userid` ASC', __FILE__, __LINE__);
-// Do we have entries?
+// Are there entries?
if (!SQL_HASZERONUMS($result_direct)) {
// When 'walk' through all users
while ($content = SQL_FETCHARRAY($result_direct)) {
ORDER BY
`userid` ASC', __FILE__, __LINE__);
-// Do we have entries? (we should have!)
+// Are there entries? (there should be!)
if (!SQL_HASZERONUMS($result)) {
// Load row by row
while ($row = SQL_FETCHARRAY($result)) {
// Init count
$count = '0';
- // Do we have at least the first entry?
+ // Is there at least the first entry?
if (!empty($GLOBALS['fatal_messages'][0])) {
// Get total count
$count = count($GLOBALS['fatal_messages']);
// Default 'rel' value is external, nofollow is evil from Google and hurts the Internet
$rel = ' rel="external"';
- // Do we have internal or external URL?
+ // Is there internal or external URL?
if (substr($url, 0, strlen(getUrl())) == getUrl()) {
// Own (=internal) URL
$rel = '';
// Initial return value
$ret = '0';
- // Do we have a leap year?
+ // Is there a leap year?
$SWITCH = '0';
$TEST = getYear() / 4;
$M1 = getMonth();
} // END - if
} // END - foreach
- // Do we have something there?
+ // Is something there?
if (strlen($ret) > 0) {
// Remove leading commata and space
$ret = substr($ret, 2);
}
} // END - if
- // Do we miss an arry element here?
+ // Is an arry element missing here?
if (!isConfigEntrySet('file_hash')) {
// Stop here
reportBug(__FUNCTION__, __LINE__, 'Missing file_hash in ' . __FUNCTION__ . '.');
// The default theme is 'default'... ;-)
$ret = 'default';
- // Do we have ext-theme installed and active or is 'theme' in URL or POST data?
+ // Is there ext-theme installed and active or is 'theme' in URL or POST data?
if (isExtensionActive('theme')) {
// Call inner method
$ret = getActualTheme();
// Default is the value itself
$ret = $value;
- // Do we have a special filter function?
+ // Is there a special filter function?
if (!empty($filterFunction)) {
// Does the filter function exist?
if (function_exists($filterFunction)) {
- // Do we have extra parameters here?
+ // Is there extra parameters here?
if (!empty($extraValue)) {
// Put both parameters in one new array by default
$args = array($value, $extraValue);
// Add SQL debug data to array for later output
function addSqlToDebug ($result, $sqlString, $timing, $F, $L) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['debug_sql_available'])) {
// Check it and cache it in $GLOBALS
$GLOBALS['debug_sql_available'] = ((isConfigurationLoaded()) && (isDisplayDebugSqlEnabled()));
// Encodes an URL for adding session id, etc.
function encodeUrl ($url, $outputMode = '0') {
- // Do we have already have a PHPSESSID inside or view.php is called? Then abort here
+ // Is there already have a PHPSESSID inside or view.php is called? Then abort here
if ((isInStringIgnoreCase(session_name(), $url)) || (isRawOutputMode())) {
// Raw output mode detected or session_name() found in URL
return $url;
} // END - if
- // Do we have a valid session?
+ // Is there a valid session?
if (((!isset($GLOBALS['valid_session'])) || ($GLOBALS['valid_session'] === false) || (!isset($_COOKIE[session_name()]))) && (isSpider() === false)) {
// Determine right separator
$separator = '&';
$url = '{?URL?}/' . $url;
} // END - if
- // Do we have to decode entities?
+ // Is there to decode entities?
if ((!isHtmlOutputMode()) || ($outputMode != '0')) {
// Decode them for e.g. JavaScript parts
$url = decodeEntities($url);
// Capitalizes a string with underscores, e.g.: some_foo_string will become SomeFooString
// Note: This function is cached
function capitalizeUnderscoreString ($str) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$str])) {
// Init target string
$capitalized = '';
bigintval($mailId)
), __FILE__, __LINE__);
- // Do we have one entry there?
+ // Is there one entry there?
if (SQL_NUMROWS($result) == 1) {
// Load the entry
$content = SQL_FETCHARRAY($result);
// Now check all entries
foreach ($needles as $key => $needle) {
- // Do we have found a partial string?
+ // Is there found a partial string?
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'heystack='.$heystack.',key='.$key.',needle='.$needle.',offset='.$offset);
if (strpos($heystack, $needle, $offset) !== false) {
// Add the found key
// Debug message (to measure how often this function is called)
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'str=' . $str);
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$str])) {
// Trim it lower-case for validation
$strTrimmed = trim(strtolower($str));
reportBug(__FUNCTION__, __LINE__, 'varString=' . $varString . ' - No dollar sign detected, will not parse it.');
} // END - if
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$varString])) {
// Snap them in, if [,] are there
$GLOBALS[__FUNCTION__][$varString] = str_replace(array('[', ']'), array("['", "']"), $varString);
// Checks whether the URL is full-qualified (http[s]:// + hostname [+ request data])
function isFullQualifiedUrl ($url) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$url])) {
// Determine it
$GLOBALS[__FUNCTION__][$url] = ((substr($url, 0, 7) == 'http://') || (substr($url, 0, 8) == 'https://'));
// There should be data, else we don't need to extend $baseUrl with $body
if (!empty($body)) {
- // Do we have a question-mark in the script?
+ // Is there a question-mark in the script?
if (!isInString('?', $baseUrl)) {
// No, so first char must be question mark
$body = '?' . $body;
// Generate full GET URL
$getUrl = generateGetUrlFromBaseUrlData($baseUrl, $requestData);
- // Do we have http[s]:// in front of the URL?
+ // Is there http[s]:// in front of the URL?
if (isFullQualifiedUrl($getUrl)) {
// Remove http[s]://<hostname> from URL
$getUrl = removeHttpHostNameFromUrl($getUrl);
// Generate full GET URL
$getUrl = generateGetUrlFromBaseUrlData($baseUrl, $requestData);
- // Do we have http[s]:// in front of the URL?
+ // Is there http[s]:// in front of the URL?
if (isFullQualifiedUrl($getUrl)) {
// Remove http[s]://<hostname> from url
$getUrl = removeHttpHostNameFromUrl($getUrl);
// Copy baseUrl to getUrl
$getUrl = $baseUrl;
- // Do we have http[s]:// in front of the URL?
+ // Is there http[s]:// in front of the URL?
if (isFullQualifiedUrl($getUrl)) {
// Remove http[s]://<hostname> from url
$getUrl = removeHttpHostNameFromUrl($getUrl);
return $response;
}
- // Do we use proxy?
+ // Shall proxy be used?
if (isProxyUsed() === true) {
// Setup proxy tunnel
$response = setupProxyTunnel($host, $proxyHost, $port, $resource);
// Loads an include file and logs any missing files for debug purposes
function loadInclude ($inc) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['inc_loaded'][$inc])) {
// Is the include file there?
if (!isIncludeReadable($inc)) {
// Checks whether an include file (non-FQFN better) is readable
function isIncludeReadable ($inc) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['inc_readable'][$inc])) {
// Construct FQFN
$FQFN = getPath() . $inc;
$saveStatus['status'] = 'failed';
$saveStatus['message'] = '{%message,INSTALLER_POST_CHECK_' . strtoupper($currentTab) . '_FAILED=' . $GLOBALS['installer_post_error'][$currentTab] . '%}';
- // Do we have failed fields?
+ // Is there failed fields?
if (count($GLOBALS['installer_failed_fields'][$currentTab]) > 0) {
// Then merge both
$saveStatus['failed_fields'] = merge_array($saveStatus['failed_fields'], $GLOBALS['installer_failed_fields'][$currentTab]);
// Is it a valid email address?
(isEmailValid($value))
||
- // Or do we have 'localhost/127.0.0.1' as hostname? Then don't check email address (e.g. you@localhost)
+ // Or is there 'localhost/127.0.0.1' as hostname? Then don't check email address (e.g. you@localhost)
(in_array(detectServerName(), array('localhost', '127.0.0.1')))
);
// "Getter" for language
function getLanguage () {
- // Do we have cache?
+ // Is there cache?
if (!isCurrentLanguageSet()) {
// Default is 'de'. DO NOT CHANGE THIS!!!
$ret = 'de';
// Checks whether a language file is there for optional extension
function isLanguageIncludeReadable ($ext_name = 'none') {
- // Do we have array element?
+ // Is there array element?
if (!isset($GLOBALS['lang_inc'][$ext_name])) {
// Generate filename
if ($ext_name == 'none') {
setLanguage($currLanguage);
} // END - if
- // Do we have the language file NOT?
+ // Is there the language file NOT?
if (!isLanguageIncludeReadable($ext_name)) {
// Switch to default (DO NOT CHANGE!!!)
setLanguage('de');
// Set target language
setCurrentLanguage($targetLanguage);
- // Do we have an array?
+ // Is there an array?
if (!isset($GLOBALS['messages'][$targetLanguage])) {
// Then create it to avoid notice
$GLOBALS['messages'][$targetLanguage] = array();
$result = SQL_QUERY_ESC("SELECT `login`,`email`,`default_acl` AS `access_mode`,`la_mode` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
array($id), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Entry found, so load data
$content = SQL_FETCHARRAY($result);
$result = SQL_QUERY_ESC("SELECT `login_failures` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
array($adminId), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Get it
$data = SQL_FETCHARRAY($result);
$result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`last_failure`) AS `last_failure` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
array($adminId), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Get it
$data = SQL_FETCHARRAY($result);
// Checks whether auto-purging is enabled
function isAutoPurgingActive () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getConfig('auto_purge_active') == 'Y');
// Wrapper for 'autopurge_inactive
function getAutopurgeInactive () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getConfig('autopurge_inactive') == 'Y');
// Checks whether purging of inactive accounts is enabled
function isAutopurgeInactiveEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getAutopurgeInactive() == 'Y');
// "Getter" for beg_new_member_notify
function getBegNewMemberNotify () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get it
$GLOBALS[__FUNCTION__] = getConfig('beg_new_member_notify');
// Checks whether beg_new_member_notify is enabled
function isBegNewMemberNotifyEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('beg', '0.2.7')) && (getBegNewMemberNotify() == 'Y'));
// "Getter" for beg_userid
function getBegUserid () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get it
$GLOBALS[__FUNCTION__] = getConfig('beg_userid');
// "Getter" for beg_timeout
function getBegTimeout () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('beg_timeout');
// "Getter" for beg_userid_timeout
function getBegUseridTimeout () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('beg_userid_timeout');
// "Getter" for beg_ip_timeout
function getBegIpTimeout () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('beg_ip_timeout');
// "Getter" for beg_ranks
function getBegRanks () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('beg_ranks');
// "Getter" for beg_points_max
function getBegPointsMax () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('beg_points_max');
// "Getter" for beg_points
function getBegPoints () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('beg_points');
// "Getter" for beg_notify_bonus
function getBegNotifyBonus () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('beg_notify_bonus');
// "Getter" for beg_notify_wait
function getBegNotifyWait () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('beg_notify_wait');
// "Getter" for beg_pay_mode
function getBegPayMode () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('beg_pay_mode');
// "Getter" for beg_include_own
function getBegIncludeOwn () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('beg_include_own');
// Checks whether beg_include_own is "Y"
function isBegIncludeOwnEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getBegIncludeOwn() == 'Y');
// "Getter" for beg_active
function getBegActive () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('beg_active');
// Checks whether beg_active is "Y"
function isBegActiveEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getBegActive() == 'Y');
// "Getter" for beg_rallye
function getBegRallye () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('beg_rallye');
// Checks whether beg_rallye is "Y"
function isBegRallyeEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getBegRallye() == 'Y');
// "Getter" for beg_rallye_enable_notify
function getBegRallyeEnableNotify () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('beg_rallye_enable_notify');
// Checks whether beg_rallye_enable_notify is "Y"
function isBegRallyeEnableNotifyEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getBegRallyeEnableNotify() == 'Y');
// "Getter" for beg_rallye_disable_notify
function getBegRallyeDisableNotify () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('beg_rallye_disable_notify');
// Checks whether beg_rallye_disable_notify is "Y"
function isBegRallyeDisableNotifyEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getBegRallyeDisableNotify() == 'Y');
// Getter for birthday_points
function getBirthdayPoints () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('birthday_points');
// Determines whether the "bonus rallye" is active
function isBonusRallyeActive () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['bonus_rallye_active'])) {
// Just determine it
$GLOBALS['bonus_rallye_active'] = (getConfig('bonus_active') == 'Y');
// Determines whether the "bonus new_member_notify" is active
function isBonusNewMemberNotifyEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['bonus_new_member_notify_active'])) {
// Just determine it
$GLOBALS['bonus_new_member_notify_active'] = (getConfig('bonus_new_member_notify') == 'Y');
// Getter for bonus_timeout
function getBonusTimeout () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('bonus_timeout');
// Getter for bonus_mode
function getBonusMode () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('bonus_mode');
// Getter for bonus_ranks
function getBonusRanks () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('bonus_ranks');
// Getter for turbo_rates
function getTurboRates () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('turbo_rates');
// Getter for login_timeout
function getLoginTimeout () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('login_timeout');
// Getter for bonus_ref
function getBonusRef () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('bonus_ref');
// Wrapper function for 'coupon_default_points'
function getCouponDefaultPoints () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get config entry
$GLOBALS[__FUNCTION__] = getConfig('coupon_default_points');
// Wrapper function for 'coupon_autopurge_time'
function getCouponAutopurgeTime () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get config entry
$GLOBALS[__FUNCTION__] = getConfig('coupon_autopurge_time');
// Wrapper function for 'coupon_userid'
function getCouponUserid () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get config entry
$GLOBALS[__FUNCTION__] = getConfig('coupon_userid');
// "Getter" for doubler_timeout
function getDoublerTimeout () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('doubler_timeout');
// "Getter" for doubler_send_mode
function getDoublerSendMode () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('doubler_send_mode');
// "Getter" for doubler_ref
function getDoublerRef () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('doubler_ref');
// "Getter" for doubler_points
function getDoublerPoints () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('doubler_points');
// "Getter" for doubler_min
function getDoublerMin () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('doubler_min');
// "Getter" for doubler_max
function getDoublerMax () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('doubler_max');
// "Getter" for doubler_counter
function getDoublerCounter () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('doubler_counter');
// "Getter" for doubler_charge
function getDoublerCharge () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('doubler_charge');
ORDER BY
`forced_ads_id` ASC', __FUNCTION__, __LINE__);
- // Do we have at least one entry?
+ // Is there at least one entry?
if (!SQL_HASZERONUMS($result)) {
// Get all elements
while ($content = SQL_FETCHARRAY($result)) {
ORDER BY
`forced_costs_id` ASC", __FUNCTION__, __LINE__);
- // Do we have at least one entry?
+ // Is there at least one entry?
if (!SQL_HASZERONUMS($result)) {
// Get all elements
while ($content = SQL_FETCHARRAY($result)) {
$status
), __FUNCTION__, __LINE__);
- // Do we have at least one entry?
+ // Is there at least one entry?
if (!SQL_HASZERONUMS($result)) {
// Get all elements
while ($content = SQL_FETCHARRAY($result)) {
// Read them
$result = SQL_QUERY("SELECT `points` FROM `{?_MYSQL_PREFIX?}_jackpot` WHERE `ok`='ok' LIMIT 1", __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_HASZERONUMS($result)) {
// No, so create line
SQL_QUERY("INSERT INTO `{?_MYSQL_PREFIX?}_jackpot` (`ok`,`points`) VALUES ('ok','0.00000')", __FUNCTION__, __LINE__);
// Default is nothing added/updated
$added = false;
- // Do we have entries?
+ // Are there entries?
if (is_array($keys_array) && ($value > 0)) {
// Is an array so we can run it through
foreach ($keys_array as $key) {
$result = SQL_QUERY_ESC("SELECT `media_value` FROM `{?_MYSQL_PREFIX?}_mediadata` WHERE `media_key`='%s' LIMIT 1",
array($key), __FUNCTION__, __LINE__);
- // Do we have one?
+ // Is there one?
if (SQL_NUMROWS($result) == 1) {
// Load data
list($value) = SQL_FETCHROW($result);
// Handle a (maybe) sent form here
function doNetworkHandleForm () {
- // Do we have a form sent?
+ // Is there a form sent?
if (countRequestPost() > 0) {
// Detect sent POST form
detectNetworkProcessForm();
LIMIT 1",
array(bigintval($networkId)), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Then get it
$GLOBALS['network_data'][$networkId] = SQL_FETCHARRAY($result);
LIMIT 1",
array(bigintval($networkId)), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Then get it
$GLOBALS['network_data'][$networkId] = SQL_FETCHARRAY($result);
LIMIT 1',
array(bigintval($networkId)), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Then get it
$GLOBALS['network_type_data'][$networkId] = SQL_FETCHARRAY($result);
LIMIT 1',
array(bigintval($networkId)), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Then get it
$networkRequestData = SQL_FETCHARRAY($result);
ORDER BY
`network_short_name` ASC", __FUNCTION__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// List all entries
$rows = array();
bigintval($networkId)
), __FUNCTION__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// List all entries
$rows = array();
d.`network_short_name` ASC,
t.`network_type_handler` ASC", __FUNCTION__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// List all entries
$rows = array();
// Generates an option list of request types
function generateNetworkRequestTypeOptions ($default = '') {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$default])) {
// Generate the list
$GLOBALS[__FUNCTION__][$default] = generateOptions(
// Generates an option list of network_api_active
function generateNetworkApiActiveOptions ($default = '') {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$default])) {
// Generate the list
$GLOBALS[__FUNCTION__][$default] = generateYesNoOptions($default);
// Translates API index
function translateNetworkApiIndex ($index) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['network_array_index'])) {
// Get an array of all API array indexes
$GLOBALS['network_array_index'] = array();
ORDER BY
`sort` ASC', __FUNCTION__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// Get all entries
while ($row = SQL_FETCHARRAY($result)) {
// Translates network API configuration status (see function isNetworkApiConfigured()) by given id
function translateNetworkApiConfiguredStatusById ($networkId) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$networkId])) {
// By default it is not configured
$GLOBALS[__FUNCTION__][$networkId] = '{--ADMIN_NETWORK_API_NOT_CONFIGURED--}';
// Checks if the given network is configured by looking its API configuration entry up
function isNetworkApiConfigured ($networkId) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$networkId])) {
// Check for an entry in network_api_config
$GLOBALS[__FUNCTION__][$networkId] = (countSumTotalData(
// Checks whether the given network type handler is configured
function isNetworkTypeHandlerConfigured ($networkId, $networkTypeId) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$networkId][$networkTypeId])) {
// Determine it
$GLOBALS[__FUNCTION__][$networkId][$networkTypeId] = (countSumTotalData(
// Displays selected networks for editing
function doAdminNetworkProcessHandleNetworks () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// Something has been selected, so start displaying one by one
$OUT = '';
// Load this network's data
$networkData = getNetworkDataById($networkId);
- // Do we have found the network?
+ // Is there found the network?
if (count($networkData) > 0) {
// Add row template with given form name
$OUT .= loadTemplate('admin_' . $GLOBALS['network_form_name'] . '_networks_row', true, $networkData);
// Handle network type form
function doAdminNetworkProcessHandleNetworkTypes () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// Load network data
$networkData = getNetworkDataById(getRequestElement('network_id'));
// Load this network's data
$networkTypeData = getNetworkTypeDataById($networkId);
- // Do we have found the network?
+ // Is there found the network?
if (count($networkTypeData) > 0) {
if (isFormSent('edit')) {
// Add row template for deleting
// Handle network request parameter form
function doAdminNetworkProcessHandleRequestParams () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// Init cache array
$GLOBALS['network_request_params_disabled'] = array();
// Load this network's data
$networkRequestData = getNetworkRequestParamsDataById($networkId);
- // Do we have found the network?
+ // Is there found the network?
if (count($networkRequestData) > 0) {
if (isFormSent('edit')) {
// Add row template for deleting
// Changes given networks
function doAdminNetworkProcessChangeNetworks () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// By default nothing is updated
$updated = 0;
continue;
} // END - if
- // Do we have this enty?
+ // Is there this enty?
if (!isset($entry[$networkId])) {
// Not found, needs fixing
reportBug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $networkId . ' found.');
} // END - if
} // END - foreach
- // Do we have updates?
+ // Is there updates?
if ($updated > 0) {
// Updates done
displayMessage('{%message,ADMIN_NETWORK_UPDATED=' . $updated . '%}');
// Removes given networks
function doAdminNetworkProcessRemoveNetworks () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// By default nothing is removed
$removed = 0;
} // END - if
} // END - foreach
- // Do we have removes?
+ // Is there removes?
if ($removed > 0) {
// Removals done
displayMessage('{%message,ADMIN_NETWORK_REMOVED=' . $removed . '%}');
// Changes given network type handlers
function doAdminNetworkProcessChangeHandlerTypes () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// By default nothing is updated
$updated = 0;
continue;
} // END - if
- // Do we have this enty?
+ // Is there this enty?
if (!isset($entry[$networkId])) {
// Not found, needs fixing
reportBug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $networkId . ' found.');
} // END - if
} // END - foreach
- // Do we have updates?
+ // Is there updates?
if ($updated > 0) {
// Updates done
displayMessage('{%message,ADMIN_NETWORK_TYPE_HANDLER_UPDATED=' . $updated . '%}');
// Changes given network request parameters
function doAdminNetworkProcessChangeRequestParams () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// By default nothing is updated
$updated = 0;
continue;
} // END - if
- // Do we have this enty?
+ // Is there this enty?
if (!isset($entry[$networkId])) {
// Not found, needs fixing
reportBug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $networkId . ' found.');
} // END - if
} // END - foreach
- // Do we have updates?
+ // Is there updates?
if ($updated > 0) {
// Updates done
displayMessage('{%message,ADMIN_NETWORK_REQUEST_PARAMETER_UPDATED=' . $updated . '%}');
// Removes given network type handlers
function doAdminNetworkProcessRemoveNetworkTypes () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// By default nothing is removed
$removed = 0;
} // END - if
} // END - foreach
- // Do we have removes?
+ // Is there removes?
if ($removed > 0) {
// Removals done
displayMessage('{%message,ADMIN_NETWORK_TYPE_HANDLER_REMOVED=' . $removed . '%}');
// Removes given network request parameters
function doAdminNetworkProcessRemoveNetworkRequestParams () {
- // Do we have selections?
+ // Is there selections?
if (ifPostContainsSelections()) {
// By default nothing is removed
$removed = 0;
} // END - if
} // END - foreach
- // Do we have removes?
+ // Is there removes?
if ($removed > 0) {
// Removals done
displayMessage('{%message,ADMIN_NETWORK_REQUEST_PARAMETER_REMOVED=' . $removed . '%}');
$result = SQL_QUERY_ESC('SELECT `network_type_id` FROM `{?_MYSQL_PREFIX?}_network_types` WHERE `network_id`=%s ORDER BY `network_type_id` ASC',
array(bigintval(getRequestElement('network_id'))), __FUNCTION__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (SQL_HASZERONUMS($result)) {
// No, then abort here
displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_SET_ALL_404--}');
$result = SQL_QUERY_ESC('SELECT `network_data_id` FROM `{?_MYSQL_PREFIX?}_network_types_config` WHERE `network_id`=%s ORDER BY `network_type_id` ASC',
array(bigintval(getRequestElement('network_id'))), __FUNCTION__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (SQL_HASZERONUMS($result)) {
// No, then abort here
displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_SET_ALL_404--}');
$ret['total_tabs'] = SQL_NUMROWS($result);
$ret['tables'] = array();
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// Fetch all rows
while ($row = SQL_FETCHARRAY($result)) {
// Getter for 'order_multi_page' config entry
function getOrderMultiPage () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('order_multi_page');
// Determines whether 'order_multi_page' is set to 'Y'
function isOrderMultiPageEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getOrderMultiPage() == 'Y');
// "Getter" for payoutable user points
function getPayoutPoints ($userid) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$userid])) {
// Determine it
$GLOBALS[__FUNCTION__][$userid] = countSumTotalData($userid, 'user_points', 'points') - getUserUsedPoints($userid);
// Getter for profile_update
function getProfileUpdate () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('profile_update');
// Getter for resend_profile_update
function getResendProfileUpdate () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('resend_profile_update');
// Determines whether sending profile update notification is enabled
function isSendProfileUpdateEnabled() {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getConfig('send_prof_update') == 'Y');
LIMIT 1",
array(bigintval($content['id']), bigintval($content['userid'])), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_HASZERONUMS($result_ref)) {
// Add userid and his ref count to table
$result_ref = SQL_QUERY_ESC("SELECT
}
} // END - foreach
- // Do we have found templates which we can link with the new rallye?
+ // Is there found templates which we can link with the new rallye?
if (!empty($ral[0])) {
// Generate selection box for all found templates
$OUT = '<select class="form_select" name="' . $name . '" size="1">';
// Get refs from cache
$count = '0';
foreach ($GLOBALS['cache_array']['refsystem']['userid'] as $id => $userid) {
- // Do we have a ref for this user?
+ // Is there a ref for this user?
//* DEBUG: */ debugOutput('id='.$id.',userid='.$userid.',userid='.$userid.',oldReferralCount='.$oldReferralCount.',level='.$GLOBALS['cache_array']['refsystem']['level'][$id]);
if (($currUserid == $userid) && ($GLOBALS['cache_array']['refsystem']['level'][$id] == 1)) {
//* DEBUG: */ debugOutput('userid matches!');
// "Getter" for total rallye prices by given id
function getTotalRallyePrices ($rallyeId) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$rallyeId])) {
// Determine it
$GLOBALS[__FUNCTION__][$rallyeId] = countSumTotalData($rallyeId, 'rallye_prices', 'id', 'rallye_id', true);
// Checks whether refback is enabled
function isRefbackEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getConfig('refback_enabled') == 'Y');
$code = str_replace($rewrite . '/modules.php?module=', $target, $code);
} // END - foreach
- // Do we have an URL linked to mxchange.org?
+ // Is there an URL linked to mxchange.org?
if (isInStringIgnoreCase(getServerUrl(), $code)) {
// Convert URLs from my server
$code = str_replace('{?URL?}/modules.php?module=', getServerUrl() . '/cms/', $code);
// Email address is not valid
$SAVE = false;
} else {
- // Do we want to add a new sponsor or update his data?
+ // Add a new sponsor or update his data?
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE email='%s' LIMIT 1",
- array($postData['email']), __FUNCTION__, __LINE__);
+ array($postData['email']), __FUNCTION__, __LINE__);
// Is a sponsor alread in the db?
if (SQL_NUMROWS($result) == 1) {
// Search for an email address in the database
function isSponsorRegisteredWithEmail ($email) {
- // Do we already have the provided email address in our DB?
+ // Is there already the provided email address in database?
$ret = (countSumTotalData($email, 'sponsor_data', 'id', 'email', true) == 1);
// Return result
// Sponsor-related data, so is there a sponsor_id?
if (!empty($data['matches'][4][$data['key']])) {
- // Do we have a sponsor_id or $sponsor_id?
+ // Is there a sponsor_id or $sponsor_id?
if ($data['matches'][4][$data['key']] == '$userid') {
// Use dynamic call
$functionName = "getFetchedSponsorData('id', \$userid, '" . $data['callback'] . "')";
$functionName = "getSponsorData('" . $data['callback'] . "')";
}
- // Do we have another function to run (e.g. translations)
+ // Is there another function to run (e.g. translations)
if (!empty($data['extra_func'])) {
// Surround the original function call with it
$functionName = $data['extra_func'] . '(' . $functionName . ')';
$result = SQL_QUERY_ESC("SELECT *".$ADD." FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `%s`='%s' LIMIT 1",
array($column, $sponsor_id), __FUNCTION__, __LINE__);
- // Do we have a record?
+ // Is there a record?
if (SQL_NUMROWS($result) == 1) {
// Load data from cookies
$data = SQL_FETCHARRAY($result);
// Is given sponsor_id valid?
function isValidSponsorId ($sponsor_id) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$sponsor_id])) {
// Check it out
$GLOBALS[__FUNCTION__][$sponsor_id] = ((!is_null($sponsor_id)) && (!empty($sponsor_id)) && ($sponsor_id > 0));
// Getter for sponsor_min_points
function getSponsorMinPoints () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('sponsor_min_points');
// Getter for sponsor_ref_points
function getSponsorRefPoints () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('sponsor_ref_points');
// Get all URLs
$urlArray = getSurfbarUrlData(0, 'url_views_max', 'url_id', 'ASC', 'url_id', " AND `url_views_allowed` > 0 AND `url_status`='ACTIVE'");
- // Do we have some entries?
+ // Are there some entries?
if (count($urlArray) > 0) {
// Then handle all!
foreach ($urlArray as $id => $urlData) {
// Translates the given action into a link title for members
function translateMemberSurfbarActionToTitle ($action) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$action])) {
// Construct default return string (unknown
$GLOBALS[__FUNCTION__][$action] = '{%message,MEMBER_SURFBAR_ACTION_UNKNOWN_TITLE=' . $action . '%}';
// Translates the given action into a submit button for members
function translateMemberSurfbarActionToSubmit ($action) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$action])) {
// Construct default return string (unknown
$GLOBALS[__FUNCTION__][$action] = '{%message,MEMBER_SURFBAR_ACTION_UNKNOWN_SUBMIT=' . $action . '%}';
// Static values are default
$reward = getConfig('surfbar_static_reward');
- // Do we have static or dynamic?
+ // Is there static or dynamic?
if (getSurfbarPaymentModel() == 'DYNAMIC') {
// "Calculate" dynamic reward
if ($onlyMin === true) {
// Static costs is default
$costs = getConfig('surfbar_static_costs');
- // Do we have static or dynamic?
+ // Is there static or dynamic?
if (getSurfbarPaymentModel() == 'DYNAMIC') {
// "Calculate" dynamic costs
if ($onlyMin) {
// Cache static reload lock
$GLOBALS['surfbar_cache']['surf_lock'] = getConfig('surfbar_static_lock');
- // Do we have dynamic model?
+ // Is there dynamic model?
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'surf_lock=' . $GLOBALS['surfbar_cache']['surf_lock'] . ' - BEFORE');
if (getSurfbarPaymentModel() == 'DYNAMIC') {
// "Calculate" dynamic lock
// Get total URLs
$total = getSurfbarTotalUrls();
- // Do we have some URLs in lock? Admins can always surf on own URLs!
+ // Are there some URLs in lock? Admins can always surf on own URLs!
$isFull = ((getSurfbarUserLocks() == $total) && ($total > 0));
// Return result
// Search for an entry
$countLock = countSumTotalData(getMemberId(), 'surfbar_locks', 'locks_id', 'locks_userid', true, ' AND `locks_url_id`=' . bigintval($urlId));
- // Do we have no record?
+ // Is there no record?
if ($countLock == 0) {
// Just add it to the database
SQL_QUERY_ESC('INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_locks` (`locks_userid`,`locks_url_id`) VALUES (%s, %s)',
// Get allowed views
$allowed = gerSurfbarViewsAllowed();
- // Do we have a limit?
+ // Is there a limit?
if ($allowed > 0) {
// Then count views_max down!
$add .= ',`url_views_max`=`url_views_max`-1';
'notified' => array(),
);
- // Do we have a current user id?
+ // Is there a current user id?
if ((isMember()) && ($limit == '0')) {
// Then add this as well
$userids['url_userid'][getMemberId()] = getMemberId();
// "Getter" for surfbar_dynamic_percent
function getSurfbarDynamicPercent () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('surfbar_dynamic_percent');
// "Getter" for surfbar_static_reward
function getSurfbarStaticReward () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('surfbar_static_reward');
// "Getter" for surfbar_static_time
function getSurfbarStaticTime () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('surfbar_static_time');
// "Getter" for surfbar_max_order
function getSurfbarMaxOrder () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('surfbar_max_order');
// "Getter" for surfbar_payment_model
function getSurfbarPaymentModel () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('surfbar_payment_model');
// Only activated themes for the user
$add = " WHERE `theme_active`='Y'";
- // Do we have admin?
+ // Is there admin?
if (isAdmin()) $add = '';
// Select all themes we want
LIMIT 1",
array($email), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Load userid
list($userid) = SQL_FETCHROW($result);
// Get all user ids
$totalUsers = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true, runFilterChain('user_exclusion_sql', ' AND `rand_confirmed` >= {?user_min_confirmed?}'));
- // Do we have at least one?
+ // Is there at least one?
if ($totalUsers > 0) {
// Then choose random userid
$randUserid = mt_rand(0, ($totalUsers - 1));
$result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` " . runFilterChain('user_exclusion_sql', "WHERE `status`='CONFIRMED'") . ' AND `rand_confirmed` >= {?user_min_confirmed?} ORDER BY `rand_confirmed` DESC LIMIT %s, 1',
array($randUserid), __FUNCTION__, __LINE__);
- // Do we have one entry there?
+ // Is there one entry there?
if (SQL_NUMROWS($result) == 1) {
// Use that userid as new referral id
list($refid) = SQL_FETCHROW($result);
// "Getter" for total tester accounts
function getTotalTesterUsers () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = countSumTotalData('', 'user_data', 'userid', '', true, runFilterChain('user_inclusion_sql'));
// User-related data, so is there a userid?
if (!empty($data['matches'][4][$data['key']])) {
- // Do we have a userid or $userid?
+ // Is there a userid or $userid?
if (substr($data['matches'][4][$data['key']], 0, 1) == '$') {
// Use dynamic call
$functionName = "getFetchedUserData('userid', " . $data['matches'][4][$data['key']] . ", '" . $data['callback'] . "')";
} elseif (!empty($data['matches'][4][$data['key']])) {
- // Do we have a number or a dollar sign in front of it?
+ // Is there a number or a dollar sign in front of it?
if (preg_replace('/[^0123456789]/', '', $data['matches'][4][$data['key']]) != $data['matches'][4][$data['key']]) {
// Possible database column, so get it again
$data['matches'][4][$data['key']] = "getFetchedUserData('userid', getMemberId(), '" . $data['matches'][4][$data['key']] . "')";
$functionName = "getUserData('" . $data['callback'] . "')";
}
- // Do we have another function to run (e.g. translations)
+ // Is there another function to run (e.g. translations)
if (!empty($data['extra_func'])) {
// Surround the original function call with it
$functionName = $data['extra_func'] . '(' . $functionName . ')';
// Init title with "all accounts"
$code = '{--ADMIN_LIST_ALL_ACCOUNTS--}';
- // Do we have a 'status' or 'do' set?
+ // Is there a 'status' or 'do' set?
if (isGetRequestElementSet('status')) {
// Set title according to the 'status'
$code = sprintf("{--ADMIN_LIST_STATUS_%s_ACCOUNTS--}", strtoupper(getRequestElement('status')));
reportBug(__FUNCTION__, __LINE__, 'template=' . $template . ',clear=' . intval($clear) . ',userid[' . gettype($userid) . ']=' . intval($userid) . ' - Invalid userid provided.');
} // END - if
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$userid])) {
// Generate code
$GLOBALS[__FUNCTION__][$userid] = $userid . ' ({%user,nickname,fixEmptyContentToDashes=' . $userid . '%})';
// Getter for user_alpha
function getUserAlpha () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('user_alpha');
// Getter for user_limit
function getUserLimit () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('user_limit');
// Getter for tester_user_surname_prefix
function getTesterUserSurnamePrefix () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('tester_user_surname_prefix');
// Getter for tester_user_maximum
function getTesterUserMaximum () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('tester_user_maximum');
// Getter for tester_user_check_cat
function getTesterUserCheckCat () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('tester_user_check_cat');
// Getter for tester_user_gender
function getTesterUserGender () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('tester_user_gender');
// Getter for tester_user_family
function getTesterUserFamily () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('tester_user_family');
// Getter for tester_user_password
function getTesterUserPassword () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('tester_user_password');
// Getter for tester_user_street_nr
function getTesterUserStreetNr () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('tester_user_street_nr');
// Getter for tester_user_zip
function getTesterUserZip () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('tester_user_zip');
// Getter for tester_user_city
function getTesterUserCity () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('tester_user_city');
// Getter for tester_user_email
function getTesterUserEmail () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('tester_user_email');
// Wrapper function for 'wernis_refid'
function getWernisRefid () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get config entry
$GLOBALS[__FUNCTION__] = getConfig('wernis_refid');
// Wrapper function for 'wernis_pass_md5'
function getWernisPassMd5 () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get config entry
$GLOBALS[__FUNCTION__] = getConfig('wernis_pass_md5');
// Wrapper function for 'wernis_api_id'
function getWernisApiId () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get config entry
$GLOBALS[__FUNCTION__] = getConfig('wernis_api_id');
// Wrapper function for 'wernis_api_md5'
function getWernisApiMd5 () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get config entry
$GLOBALS[__FUNCTION__] = getConfig('wernis_api_md5');
// Wrapper function for 'wernis_api_url'
function getWernisApiUrl () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get config entry
$GLOBALS[__FUNCTION__] = getConfig('wernis_api_url');
// Wrapper function for 'wernis_withdraw_active'
function getWernisWithdrawActive () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get config entry
$GLOBALS[__FUNCTION__] = getConfig('wernis_withdraw_active');
// Wrapper function for 'wernis_payout_active'
function getWernisPayoutActive () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get config entry
$GLOBALS[__FUNCTION__] = getConfig('wernis_payout_active');
// Wrapper function for 'wernis_withdraw_active'
function isWernisWithdrawActive () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get config entry
$GLOBALS[__FUNCTION__] = (getConfig('wernis_withdraw_active') == 'Y');
// Wrapper function for 'wernis_payout_active'
function isWernisPayoutActive () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get config entry
$GLOBALS[__FUNCTION__] = (getConfig('wernis_payout_active') == 'Y');
// Wrapper function for 'wernis_withdraw_factor'
function getWernisWithdrawFactor () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get config entry
$GLOBALS[__FUNCTION__] = getConfig('wernis_withdraw_factor');
// Wrapper function for 'wernis_payout_factor'
function getWernisPayoutFactor () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get config entry
$GLOBALS[__FUNCTION__] = getConfig('wernis_payout_factor');
// Wrapper function for 'wernis_withdraw_fee_percent'
function getWernisWithdrawFeePercent () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get config entry
$GLOBALS[__FUNCTION__] = getConfig('wernis_withdraw_fee_percent');
// Wrapper function for 'wernis_withdraw_fee_fix'
function getWernisWithdrawFeeFix () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get config entry
$GLOBALS[__FUNCTION__] = getConfig('wernis_withdraw_fee_fix');
$errorCode = '0';
}
- // Do we have some data there?
+ // Is some data there?
return ($errorCode == '0');
}
foreach ($GLOBALS['cache_array']['admin']['login'] as $idx => $admin) {
// Rewrite all entries
foreach ($GLOBALS['cache_array']['admin'] as $key => $entry) {
- // Do we have login or regular entries?
+ // Is there login or regular entries?
if ($key == 'admin_id') {
// Admin id, so use login
$admins[$key][$GLOBALS['cache_array']['admin']['login'][$idx]] = $entry[$idx];
foreach ($GLOBALS['cache_array']['admin_acls']['admin_id'] as $idx => $admin) {
// Rewrite all entries
foreach ($GLOBALS['cache_array']['admin_acls'] as $key => $entry) {
- // Do we have 'admin_id' or regular entries?
+ // Is there 'admin_id' or regular entries?
if ($key != 'admin_id') {
// Regular entry so use id
array_push($admins[$key][$GLOBALS['cache_array']['admin_acls']['admin_id'][$idx]], $entry[$idx]);
// Init extension inc-pool
$EXT_POOL = array();
- // Do we have entries?
+ // Are there entries?
if (count($EXT_DUMMY) > 0) {
// Init arrays
$EXT_NAMES = array();
// Create cache file here
$GLOBALS['cache_instance']->init();
- // Do we have up-to-date ext-sql_patches?
+ // Is there up-to-date ext-sql_patches?
if (isExtensionInstalledAndNewer('sql_patches', '0.3.6')) {
// Yes, has_menu shall be there
$result = SQL_QUERY('SELECT
// Load cache
$GLOBALS['cache_array']['points_data'] = $GLOBALS['cache_instance']->getArrayFromCache();
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['cache_array']['points_data']['subject'])) {
// Try to remove the cache file
$GLOBALS['cache_instance']->removeCacheFile();
$DOUBLER_POINTS
), __FILE__, __LINE__);
-// Do we have entries found?
+// Are there entries found?
if (((!SQL_HASZERONUMS($result_total)) && (getConfig('doubler_sent_all') == 'Y')) || ((SQL_NUMROWS($result_main) == getConfig('doubler_group_sent')) && (getConfig('doubler_sent_all') != 'Y'))) {
// Switch to matching SQL resource
$result_load = $result_main;
// "Getter" for module title
function getModuleTitle ($module) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$module])) {
// Init variables
$data['title'] = '';
$module = getModule();
} // END - if
- // Do we have cache?
+ // Is there cache?
if (isModuleStatusSet($module)) {
// Then use it
return getModuleStatus($module);
$what
), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result_action) == 1) {
// Is valid but does the inlcude file exists?
$inc = sprintf("inc/modules/admin/action-%s.php", $action);
* combination (only one is allowed to be null!).
*/
function isAdminAllowedAccessMenu ($action, $what = NULL) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$action][$what])) {
// ACL is always 'allow' when no ext-admins is installed
// @TODO This can be rewritten into a filter
`sort` ASC,
`id` DESC", __FUNCTION__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result_main)) {
$OUT .= '<ul class="admin_menu_main">';
// Start li-tag for sub menu content
$OUT .= '<li class="admin_menu_sub" id="action_menu_' . $mainContent['main_action'] . '"' . addStyleMenuContent('admin', $mainContent['main_action'], $action) . '>';
- // Do we have entries?
+ // Are there entries?
if (ifAdminMenuHasEntries($mainContent['main_action'])) {
// Sub menu has been called
$SUB = true;
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result_what)) {
// Start HTML code
$OUT .= '<ul class="admin_menu_sub">';
$result = SQL_QUERY_ESC("SELECT `la_mode` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
array($adminId), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Load data
list($adminMode) = SQL_FETCHROW($result);
continue;
} // END - if
- //Â Do we have a userid?
+ //Â Is there a userid?
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',userIdColumn=' . $userIdColumn[0]);
if ($key == $userIdColumn[0]) {
// Add it again as raw id
$GLOBALS['admin_list_builder_id_value'] = bigintval($value);
} // END - if
- // Do we have a call-back function and extra-value pair?
+ // Is there a call-back function and extra-value pair?
if ((isset($filterFunctions[$idx])) && (isset($extraValues[$idx]))) {
// Handle the call in external function
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',fucntion=' . $filterFunctions[$idx] . ',value=' . $value);
// Init output
$OUT = $unconfirmed;
- // Do we have unconfirmed mails?
+ // Is there unconfirmed mails?
if ($unconfirmed > 0) {
// Add link to list_unconfirmed what-file
$OUT = '<a href="{%url=modules.php?module=admin&what=list_unconfirmed&' . $type . '=' . $id . '%}">{%pipe,translateComma=' . $unconfirmed . '%}</a>';
// Add/translate some content
$content['task_created'] = generateDateTime($content['task_created'], 2);
- // Do we have extension task?
+ // Is there extension task?
if (isExtensionTask($content)) {
// Load extension row template
$OUT .= loadTemplate('admin_overview_list_ext_rows', true, $content);
// Run SQL
$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?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// Init variables
$OUT = '';
// Query for all imprint data rows
$result = SQL_QUERY('SELECT `imprint_key`,`imprint_value` FROM `{?_MYSQL_PREFIX?}_imprint_data` ORDER BY `imprint_id` ASC', __FILE__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// Load all entries
$OUT = '';
return;
} // END - if
-// Do we have a network selected?
+// Is there a network selected?
if (isGetRequestElementSet('network_id')) {
// Check all networks that doesn't have a configuration entry
$result = SQL_QUERY_ESC("SELECT
bigintval(getRequestElement('network_id'))
), __FILE__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Load data
$content = SQL_FETCHARRAY($result);
bigintval(getRequestElement('network_id'))
), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result_config) == 1) {
// Load entries
$content = merge_array($content, SQL_FETCHARRAY($result_config));
return;
} // END - if
-// Do we have a network selected?
+// Is there a network selected?
if (isGetRequestElementSet('network_id')) {
// Set current network id
setCurrentNetworkId(getRequestElement('network_id'));
bigintval(getRequestElement('network_type_id'))
), __FUNCTION__, __LINE__);
- // Do we have a record?
+ // Is there a record?
if (SQL_NUMROWS($result) == 1) {
// Load it
$content = SQL_FETCHARRAY($result);
bigintval(getRequestElement('network_id'))
), __FUNCTION__, __LINE__);
- // Do we have entries left?
+ // Are there entries left?
if (!SQL_HASZERONUMS($result)) {
// Init row output
$OUT = '';
bigintval($content['network_type_id'])
), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result_config) == 1) {
// Load this data as well
$content = merge_array($content, SQL_FETCHARRAY($result_config));
break;
case 'register': // Register new extension
- // Do we have some tasks?
+ // Are there some tasks?
$numTasks = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, "AND `task_type`='EXTENSION'");
// Is the id number valid and the task was found?
array($subMenu), __FILE__, __LINE__);
}
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// Init variables
$count = '0';
'title' => '{--ADMIN_COUNTRY_ACTIVATION_NEXT_LINK--}'
));
} elseif (((isFormSent('edit')) || (isPostRequestElementSet('delete'))) && (isPostRequestElementSet('id'))) {
- // Do we have entries?
+ // Are there entries?
if (ifPostContainsSelections('id')) {
// Is the proper form sent?
if (isFormSent('edit')) {
$result = SQL_QUERY('SELECT `id`,`code`,`descr`,`is_active` FROM `{?_MYSQL_PREFIX?}_countries` ORDER BY `code` ASC',
__FILE__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// List all countries
$OUT = '';
bigintval(getRequestElement('coupon_id'))
), __FILE__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// Init variable
$OUT = '';
ORDER BY
d.`id` ASC', __FILE__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// Init variable
$OUT = '';
bigintval(getRequestElement('userid'))
), __FILE__, __LINE__);
- // Do we have some entries?
+ // Are there some entries?
if (!SQL_HASZERONUMS($result)) {
// Some unconfirmed mails left
if (getRequestElement('delete') == 'all') {
break;
} // END - switch
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result_data) == 1) {
// Mail was found
$mailData = merge_array($linkData, SQL_FETCHARRAY($result_data));
return;
} // END - if
-// Do we have a network selected?
+// Is there a network selected?
if (isGetRequestElementSet('network_id')) {
// Get its data for template
$networkData = getNetworkDataById(getRequestElement('network_id'));
bigintval(getRequestElement('network_id'))
), __FILE__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// List all entries
$OUT = '';
return;
} // END - if
-// Do we have a network selected?
+// Is there a network selected?
if (isGetRequestElementSet('network_id')) {
// Get its data for template
$networkData = getNetworkDataById(getRequestElement('network_id'));
p.`network_request_param_id` ASC",
array(getRequestElement('network_id')), __FILE__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// List all entries
$OUT = '';
return;
} // END - if
-// Do we have a network selected?
+// Is there a network selected?
if (isGetRequestElementSet('network_id')) {
// Get its data for template
$networkData = getNetworkDataById(getRequestElement('network_id'));
`network_type_handler` ASC',
array(getRequestElement('network_id')), __FILE__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// List all entries
$OUT = '';
return;
} // END - if
-// Do we have a network selected?
+// Is there a network selected?
if (isGetRequestElementSet('network_id')) {
// Get its data for template
$networkData = getNetworkDataById(getRequestElement('network_id'));
`network_vcheck_param_id` ASC",
array(getRequestElement('network_id')), __FILE__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// List all entries
$OUT = '';
ORDER BY
`network_short_name` ASC', __FILE__, __LINE__);
-// Do we have entries?
+// Are there entries?
if (!SQL_HASZERONUMS($result)) {
// List all
$OUT = '';
), __FILE__, __LINE__);
//* DEBUG: */ debugOutput($userid.'/'.$levels['level'].'/'.SQL_NUMROWS($result_refs));
- // Do we have levels?
+ // Is there levels?
if (!SQL_HASZERONUMS($result_refs)) {
// Count entries
$totalReferrals = getUsersTotalReferrals($userid, $levels['level']);
} else {
// Load all payment types
$result = SQL_QUERY("SELECT
- `id`,`pay_name`,`pay_rate`,`pay_min_count`,`pay_currency`
+ `id`,
+ `pay_name`,
+ `pay_rate`,
+ `pay_min_count`,
+ `pay_currency`
FROM
`{?_MYSQL_PREFIX?}_sponsor_paytypes`
ORDER BY
`pay_name` ASC",
__FILE__, __LINE__);
- // Do we have some paytypes setup?
+ // Are there some payment types setup?
if (!SQL_HASZERONUMS($result)) {
// Prepare variables for listing
$OUT = '';
'task_created' => generateDateTime($content['task_created'], 2)
));
- // Do we have an extension task?
+ // Is there an extension task?
if (isExtensionTask($content)) {
// Load extension row template
$OUT .= loadTemplate('admin_list_task_ext_rows', true, $content);
// Load mail data
$result_master = SQL_QUERY($sql, __FILE__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result_master) == 1) {
// Mail order / bonus mail found
$poolData = SQL_FETCHARRAY($result_master);
bigintval($poolData['max_rec'])
),__FILE__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// At least one link left to confirm
$OUT = '';
`userid` ASC",
__FILE__, __LINE__);
- // Do we have entries left?
+ // Are there entries left?
if (!SQL_HASZERONUMS($result)) {
// Convert timestamp selections
$expirationTime = time() + createEpocheTimeFromSelections('coupon_default_time', postRequestArray());
// Email is set
$userid = SQL_ESCAPE(postRequestElement('email'));
} elseif (isPostRequestElementSet('id')) {
- // Do we have nickname or userid?
+ // Is there nickname or userid?
if (isNicknameUsed(postRequestElement('id'))) {
// Nickname entered
$userid = SQL_ESCAPE(postRequestElement('id'));
// Login problems?
if (!empty($errorCode)) {
- // Do we have a userid set?
+ // Is there a userid set?
if (isSessionVariableSet('userid')) {
// Then prefetch data for this account
fetchUserData(getSession('userid'));
getMemberId()
), __FILE__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Load data
$content = SQL_FETCHARRAY($result);
// Get all categories
$result = SQL_QUERY("SELECT `id`,`cat` FROM `{?_MYSQL_PREFIX?}_cats`".$whereStatement." ORDER BY `sort` ASC", __FILE__, __LINE__);
-// Do we have entries?
+// Are there entries?
if (!SQL_HASZERONUMS($result)) {
$LEAST = false;
if (isFormSent()) {
} // END - switch
} // END - foreach
- // Do we have entries?
+ // Are there entries?
if (countSqls() > 0) {
// Run SQL commands
$count = runFilterChain('run_sqls');
ORDER BY
d.`earning_sorting` ASC', __FILE__, __LINE__);
-// Do we have entries?
+// Are there entries?
if (!SQL_HASZERONUMS($result)) {
// Init output
$OUT = '';
getMemberId()
), __FILE__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result2) == 1) {
// Load it
$content = merge_array($content, SQL_FETCHARRAY($result2));
// Free result
SQL_FREERESULT($result2);
- // Do we have user_earning data available?
+ // Is there user_earning data available?
if (!isset($content['earning_active'])) {
// Load row template "open subscription"
$OUT .= loadTemplate('member_earning_' . strtolower($content['earning_group']) . '_form_row', true, $content);
if (isPostRequestElementSet('stop')) {
// Okay, end the holiday here...
$result = SQL_QUERY_ESC("SELECT
- `holiday_active`,`holiday_activated`
+ `holiday_active`,
+ `holiday_activated`
FROM
`{?_MYSQL_PREFIX?}_user_data`
WHERE
`userid`=%s
LIMIT 1", array(getMemberId()), __FILE__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Merge arrays
$content = merge_array($content, SQL_FETCHARRAY($result));
if (($content['holiday_active'] == 'Y') && (($content['holiday_activated'] + getConfig('holiday_lock')) < time())) {
// Load data
$result2 = SQL_QUERY_ESC("SELECT
- `holiday_start`,`holiday_end`
+ `holiday_start`,
+ `holiday_end`
FROM
`{?_MYSQL_PREFIX?}_user_holidays`
WHERE
$content['end'] = generateDateTime($content['holiday_end'] , 3);
// Deactivate it now
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data`
+ SQL_QUERY_ESC("UPDATE
+ `{?_MYSQL_PREFIX?}_user_data`
SET
`holiday_active`='N',
`holiday_activated`=0
if ((!isFormSent()) && (!isPostRequestElementSet('stop'))) {
// Check if user is in holiday...
$result = SQL_QUERY_ESC("SELECT
- `holiday_active`,`holiday_activated`
+ `holiday_active`,
+ `holiday_activated`
FROM
`{?_MYSQL_PREFIX?}_user_data`
WHERE
ORDER BY
u.`cashed_on` DESC", array(getMemberId()), __FILE__, __LINE__);
-// Do we have entries?
+// Are there entries?
if (!SQL_HASZERONUMS($result)) {
// Init variable
$OUT = '';
// Load template
displayMessage($content);
} else {
- // Do we have already submit the form?
+ // Is there already submit the form?
if (isPostRequestElementSet('nickname')) {
loadTemplate('admin_settings_unsaved', false, '{--MEMBER_NICKNAME_IS_INVALID--}');
} // END - if
getMemberId()
), __FILE__, __LINE__);
- // Do we enougth receivers left?
+ // Are there still receivers left?
if (SQL_NUMROWS($result) >= postRequestElement('receiver')) {
// Load receivers from database
$TEST = array(); $count = '0';
bigintval(postRequestElement('zip'), true, false),
), __FILE__, __LINE__);
}
+
+ // Get insert id
+ $id = SQL_INSERTID();
} else {
// Change current order
if (isExtensionActive('html_mail')) {
}
}
- // Do we need to get the id number?
- if ($id == '0') {
- // Order is placed as temporary. We need to get it's id for the frametester
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `sender`=%s AND `subject`='%s' AND `payment_id`=%s AND `data_type`='TEMP' AND `timestamp`=UNIX_TIMESTAMP() LIMIT 1",
- array(
- getMemberId(),
- postRequestElement('subject'),
- bigintval(postRequestElement('mail_type'))
- ), __FILE__, __LINE__);
-
- // Get pool id
- list($id) = SQL_FETCHROW($result);
-
- // Free result
- SQL_FREERESULT($result);
- } // END - if
+ // Make sure only valid id numbers can pass
+ assert((!is_bool($id)) && ($id > 0));
- // id is received so we can redirect the user, used points will be added when he send's out the mail
+ // Id is received so we can redirect the user, used points will be added when he send's out the mail
$url = 'modules.php?module=frametester&order=' . $id;
} elseif ($content['target_send'] == '0') {
// Not enougth receivers found which can receive mails
convertZeroToNull($content['level'])
), __FILE__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result_points) == 1) {
// Load data
$content = merge_array($content, SQL_FETCHARRAY($result_points));
// Check for 'url_id' element
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isFormSent()=' . intval(isFormSent('add_subid')) . ',ifPostContainsSelections()=' . intval(ifPostContainsSelections()) . ',countRequestPost()=' . countRequestPost());
-if ((!isFormSent('add_subid')) && ((!ifPostContainsSelections()) || (countRequestPost() == 0))) {
+if ((countRequestPost() > 0) && (!isFormSent('add_subid')) && ((!ifPostContainsSelections()) || (countRequestPost() == 0))) {
// Not found so output message
displayMessage('{--MEMBER_SUBID_NO_SELECTIONS--}');
bigintval(postRequestElement('to_userid'))
), __FILE__, __LINE__);
- // Do we have two entries?
+ // Is there two entries?
$valid_data = (SQL_NUMROWS($result) == 2);
// Final check if all is fine
$totalPoints = '0';
$result = SQL_QUERY_ESC($sql, array(getMemberId()), __FILE__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
getMemberId()
), __FILE__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Load newest transaction
list($newest) = SQL_FETCHROW($result);
// Get access level from it
$modCheck = getModuleFromFileName($file, $accessLevel);
- // Do we have admin? Then display all
+ // Is there admin? Then display all
$ADD = " AND `visible`='Y' AND `locked`='N'";
if (isAdmin()) {
// Display all!
$content['action']
), __FUNCTION__, __LINE__);
- // Do we have some entries?
+ // Are there some entries?
if (!SQL_HASZERONUMS($result_sub)) {
// Init counter
$count = '0';
$value
), __FUNCTION__, __LINE__);
- // Do we have a record?
+ // Is there a record?
if (SQL_NUMROWS($result) == 1) {
// Load data from cookies
$data = SQL_FETCHARRAY($result);
return false;
} // END - if
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$adminId])) {
// Init it with failed
$GLOBALS[__FUNCTION__][$adminId] = false;
// Default value...
$data[$lookFor] = NULL;
- // Do we have cache?
+ // Is there cache?
if (isset($GLOBALS['cache_array']['payments'][$paymentsId]['id'])) {
// Use it if found to save SQL queries
$data[$lookFor] = $GLOBALS['cache_array']['payments'][$lookFor][$paymentsId];
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `login`='%s' LIMIT 1",
array($adminLogin), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Get it
$data = SQL_FETCHARRAY($result);
// Log debug message
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'called!');
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['current_admin_id'])) {
// Get the admin login from session
$adminId = getSession('admin_id');
$result = SQL_QUERY_ESC("SELECT `password` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
array(bigintval($adminId)), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Fetch data
$data = SQL_FETCHARRAY($result);
$result_admin_id = SQL_QUERY_ESC("SELECT `default_acl` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
array(bigintval($adminId)), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result_admin_id) == 1) {
// Fetch data
$data = SQL_FETCHARRAY($result_admin_id);
$result_admin_id = SQL_QUERY_ESC("SELECT `la_mode` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
array(bigintval($adminId)), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result_admin_id) == 1) {
// Fetch data
$data = SQL_FETCHARRAY($result_admin_id);
$value
), __FUNCTION__, __LINE__);
- // Do we have rows?
+ // Is there rows?
if (!SQL_HASZERONUMS($result)) {
// Found data so add them as OPTION lines
while ($content = SQL_FETCHARRAY($result)) {
LIMIT 1",
array(bigintval($userid)), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Save his points to add them to the jackpot
$data = SQL_FETCHARRAY($result);
$result = SQL_QUERY('SELECT `id`,`cat` FROM `{?_MYSQL_PREFIX?}_cats`' . $whereStatement . ' ORDER BY `sort` ASC',
__FUNCTION__, __LINE__);
- // Do we have entries?
+ // Are there entries?
if (!SQL_HASZERONUMS($result)) {
// ... and begin loading stuff
while ($content = SQL_FETCHARRAY($result)) {
// Remove last commata and add FROM statement
$SQL .= ' FROM `{?_MYSQL_PREFIX?}_' . $tableName[0] . '`';
- // Do we have entries from whereColumns to add?
+ // Are there entries from whereColumns to add?
if (count($whereColumns) > 0) {
// Then add these as well
if (count($whereColumns) == 1) {
}
} // END - if
- // Do we have entries from orderByColumns to add?
+ // Are there entries from orderByColumns to add?
if (count($orderByColumns) > 0) {
// Add them as well
$SQL .= ' ORDER BY ';
// Run the SQL query
$result = SQL_QUERY($SQL, __FUNCTION__, __LINE__);
- // Do we have some URLs left?
+ // Are there some URLs left?
if (!SQL_HASZERONUMS($result)) {
// List all URLs
$OUT = '';
// Fill the callback arguments
$args = array($content[$columnName]);
- // Do we have more to add?
+ // Is there more to add?
if (isset($extraParameters[$columnName])) {
// Add them as well
$args = merge_array($args, $extraParameters[$columnName]);
// Default is that all went fine
$GLOBALS['__XML_PARSE_RESULT'] = true;
- // Do we have "time columns"?
+ // Is there "time columns"?
if (count($timeColumns) > 0) {
// Then "walk" through all entries
foreach ($timeColumns as $column) {
// Default is ext-html_mail is gone
$add = '';
- // Do we need to send out bonus mails?
+ // Send out bonus mails?
if (isExtensionActive('html_mail')) {
// With HTML support
$add = ', `html_msg`';
// Lookup user id
//* DEBUG: */ debugOutput('*L:'.__LINE__.'/'.SQL_NUMROWS($result_user).'*');
if (fetchUserData($userid)) {
- // Do we have a stats entry?
+ // Is there a stats entry?
$result_stats = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s AND `userid`=%s AND timestamp_ordered='%s' LIMIT 1",
array($mailData['id'], $mailData['sender_userid'], $mailData['timestamp']), __FILE__, __LINE__);
} // END - switch
} // END - if
- // Do we have reached the maximum to send mails? || (getConfig('max_send') >= $GLOBALS['pool_cnt'])
+ // Is there reached the maximum to send mails? || (getConfig('max_send') >= $GLOBALS['pool_cnt'])
//* DEBUG: */ debugOutput('*L:'.__LINE__.'/'.$GLOBALS['pool_cnt'].'>='.$mailData['target_send'].'/'.getConfig('max_send').'>='.$GLOBALS['pool_cnt'].'/'.$lastSentId.'!='.$mailData['id'].'*');
if ((($GLOBALS['pool_cnt'] >= $mailData['target_send'])) && ($lastSentId != $mailData['id'])) {
// Prepare content
//* DEBUG: */ debugOutput('*EXIT/L:'.__LINE__.'/'.$P);
break;
}
- // Do we have send maximum mails?
+ // Is there send maximum mails?
elseif (($GLOBALS['pool_cnt'] >= getConfig('max_send')) || ($count2 >= getConfig('max_send'))) {
// There are some mails left to send for next round, so we reset the status back to NEW (=still not fully delivered)
$add = '';
} // END - if
} // END - while
- // Do we have points to "pay back"?
+ // Is there points to "pay back"?
if ((count($pointsBack) > 0) && (!empty($pointsBack[0]))) {
// Walk through all points
foreach ($pointsBack as $userid => $PB) {
ORDER BY
`id` ASC', __FILE__, __LINE__);
-// Do we have entries?
+// Are there entries?
if (SQL_NUMROWS($result) > 0) {
// Init variables
$out = '';
// Init counter...
$deletedStats = '0';
-// Do we have "purged" mails?
+// Is there "purged" mails?
if (!SQL_HASZERONUMS($result_mails)) {
// Okay, check for their sender's
while ($content = SQL_FETCHARRAY($result_mails)) {
ORDER BY
`userid` ASC", __FILE__, __LINE__);
-// Do we have "purged" mails?
+// Is there "purged" mails?
if (!SQL_HASZERONUMS($result_mails)) {
// Okay, check for their sender's
while ($content = SQL_FETCHARRAY($result_mails)) {
// Free memory
SQL_FREERESULT($result_mails);
-// Do we have deleted mails and the admin want's to receive a notification
+// Is there deleted mails and the admin want's to receive a notification
if (($deletedStats > 0) && (getConfig('ap_dm_notify') == 'Y')) {
// Send out email to admin
sendAdminNotification('{--ADMIN_AUTOPURGE_DELETE_MAILS_SUBJECT--}', 'admin_autopurge_del_mails', $deletedStats);
// Get deleted rows
$deletedTasks = SQL_AFFECTEDROWS();
- // Do we need to send a notification?
+ // Send out a notification?
if (($deletedTasks > 0) && (getConfig('ap_tasks_notify') == 'Y')) {
// Send out email to admin
sendAdminNotification('{--ADMIN_AUTOPURGE_TASKS_SUBJECT--}', 'admin_autopurge_tsks', $deletedTasks);
// Default is zero
$data['percents'] = '0';
- // Do we have cache?
+ // Is there cache?
if ((isset($GLOBALS['cache_array']['refdepths']['level'])) && (isExtensionActive('cache'))) {
// First look for level
$key = array_search($level, $GLOBALS['cache_array']['refdepths']['level']);
$result = SQL_QUERY_ESC("SELECT `id`,`subject`,`column_name`,`locked_mode`,`payment_method`,`notify_recipient` FROM `{?_MYSQL_PREFIX?}_points_data` WHERE `subject`='%s' LIMIT 1",
array($subject), __FUNCTION__, __LINE__);
- // Do we have an entry?
+ // Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Then load it
$pointsData = SQL_FETCHARRAY($result);
$GLOBALS['referral_result'][$userid] = SQL_QUERY_ESC('SELECT `level` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `userid`=%s ORDER BY `level` ASC',
array($userid), __FUNCTION__, __LINE__);
- // Do we have entries?
+ // Are there entries?
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',SQL_NUMROWS()=' . SQL_NUMROWS($GLOBALS['referral_result'][$userid]));
if (SQL_NUMROWS($GLOBALS['referral_result'][$userid]) > 0) {
// Then walk through all levels
$GLOBALS['referral_result_refs'][$userid] = SQL_QUERY_ESC('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `refid`=%s ORDER BY `userid` ASC',
array($userid), __FUNCTION__, __LINE__);
- // Do we have entries?
+ // Are there entries?
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',SQL_NUMROWS()=' . SQL_NUMROWS($GLOBALS['referral_result_refs'][$userid]));
if (SQL_NUMROWS($GLOBALS['referral_result_refs'][$userid]) > 0) {
// Then again walk through all
$refid
), __FUNCTION__, __LINE__));
- // Do we have no entry?
+ // Is there no entry?
if ($count == 0) {
// Then add it to the SQL
$SQL .= '(' . $userid . ',' . $level . ',' . $refid . '),';
// Determines referral id and sets it
function determineReferralId () {
- // Do we have it already detected?
+ // Is it already detected?
if (isReferralIdValid()) {
// Do not determine it, just return it
return getReferralId();
// Default is not found
$found = false;
- // Do we have nickname or userid set?
+ // Is there nickname or userid set?
if ((isExtensionActive('nickname')) && (isNicknameUsed(getReferralId()))) {
// Nickname in URL, so load the id
$found = fetchUserData(getReferralId(), 'nickname');
// Checks if an element in $_POST exists
function isPostRequestElementSet ($element, $subElement = NULL) {
+ /*
+ * Always check that $element is a string and that $subElement is NULL or
+ * a string as numerical indexes are not wanted in POST data (in this
+ * project).
+ */
+ assert(is_string($element) && ((is_null($subElement)) || (is_string($subElement))));
+
+ // Is a sub element set?
if (is_null($subElement)) {
- if (!is_string($element)) die(gettype($element));
+ // No, then only check $element
return ((isset($GLOBALS['raw_request']['post'][$element])) && ((is_array($GLOBALS['raw_request']['post'][$element])) || (('' . $GLOBALS['raw_request']['post'][$element] . '') != '')));
} else {
+ // Yes, then check both together
return ((isset($GLOBALS['raw_request']['post'][$element][$subElement])) && (('' . $GLOBALS['raw_request']['post'][$element][$subElement] . '') != ''));
}
}
continue;
} // END - if
- // Do we have a non-string (e.g. number, NULL, SQL function or back-tick at the beginning?
+ // Is there a non-string (e.g. number, NULL, SQL function or back-tick at the beginning?
if (is_null($multiDimId)) {
// Handle one-dimensional data
if (is_null($value)) {
// Checks if we have a statistics entry
function isStatsEntrySet ($entry) {
- // Do we have the entry?
+ // Is there the entry?
return (isset($GLOBALS['stats'][$entry]));
}
// Increments a statistics entry
function incrementStatsEntry ($entry, $amount=1) {
- // Do we have stats enabled?
+ // Is there stats enabled?
if ((!ifInternalStatsEnabled()) && ($entry != 'db_hits')) {
// Abort here
return;
// Check if the link is up
if (!SQL_IS_LINK_UP()) return false;
- // Do we have it there for today?
+ // Is it there for today?
if (!isStatsTableCreated()) {
// Then create a default one
createStatsTable();
$result = SQL_QUERY_ESC("SHOW TABLES LIKE '{?_MYSQL_PREFIX?}_stats_%s'",
array(generateDateTime(time(), '6')), __FUNCTION__, __LINE__);
- // Do we have a row?
+ // Is there a row?
return SQL_NUMROWS($result);
}
} // END - if
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getOutputMode()=' . getOutputMode() . ',htmlCode(length)=' . strlen($htmlCode) . ',output(length)=' . strlen($GLOBALS['__output']));
- // Do we have HTML-Code here?
+ // Is there HTML-Code here?
if (!empty($htmlCode)) {
// Yes, so we handle it as you have configured
switch (getOutputMode()) {
// Set current template
$GLOBALS['current_template'] = $template;
- // Do we have cache?
+ // Is there cache?
if ((!isDebuggingTemplateCache()) && (isTemplateCached($template))) {
// Evaluate the cache
eval(readTemplateCache($template));
// The local file does exists so we load it. :)
$GLOBALS['tpl_content'][$template] = readFromFile($FQFN);
- // Do we have to compile the code?
+ // Is there to compile the code?
if ((isInString('$', $GLOBALS['tpl_content'][$template])) || (isInString('{--', $GLOBALS['tpl_content'][$template])) || (isInString('{?', $GLOBALS['tpl_content'][$template])) || (isInString('{%', $GLOBALS['tpl_content'][$template]))) {
// Normal HTML output?
if ((isHtmlOutputMode()) && (substr($template, 0, 3) != 'js_')) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'template=' . $template . ' - AFTER EVAL');
} // END - if
- // Do we have some content to output or return?
+ // Is there some content to output or return?
if (!empty($ret)) {
// Not empty so let's put it out! ;)
if ($return === true) {
// Default is empty
$extraPath = '';
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['extra_path'][$template])) {
// Check for admin/guest/member/etc. templates
if (substr($template, 0, 6) == 'admin_') {
$newContent = '{--NO_TEMPLATE_SUPPLIED--}';
}
- // Is there some content?
+ // Are there some content?
if (empty($newContent)) {
// Compiling failed
$newContent = "Compiler error for template " . $template . " !\nUncompiled content:\n" . $GLOBALS['tpl_content'][$template];
function getMenuCssClasses ($data) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'data=' . $data);
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$data])) {
// $data needs to be converted into an array
$content = explode('|', $data);
$stamp = round($timestamp);
//* DEBUG: */ debugOutput('*' . $stamp .'/' . $timestamp . '*');
- // Do we have a leap year?
+ // Is there a leap year?
$SWITCH = '0';
$TEST = getYear() / 4;
$M1 = getMonth();
sendAdminNotification('{--REPORT_BUG_SUBJECT--}', 'admin_report_bug', $content);
} // END - if
- // Do we have HTML/CSS/AJAX mode?
+ // Is there HTML/CSS/AJAX mode?
if ((isHtmlOutputMode()) || (isCssOutputMode()) || (isAjaxOutputMode())) {
// And abort here
app_exit($F, $L, $debug);
$pageTitle .= '{%config,trim=title_left%} ';
} // END - if
- // Do we have some extra title?
+ // Is there an extra title?
if (isExtraTitleSet()) {
// Then prepend it
$pageTitle .= '{%pipe,getExtraTitle%} by ';
// Checks whethere there is a cache file there. This function is cached.
function isTemplateCached ($template) {
- // Do we have cached this result?
+ // Is there cached this result?
if (!isset($GLOBALS['template_cache'][$template])) {
// Generate FQFN
$FQFN = generateCacheFqfn($template);
// Function to add style tag (whether display:none/block)
function addStyleMenuContent ($menuMode, $mainAction, $action) {
- // Do we have foo_menu_javascript enabled?
+ // Is there foo_menu_javascript enabled?
if ((!isConfigEntrySet($menuMode . '_menu_javascript')) || (getConfig($menuMode . '_menu_javascript') == 'N')) {
// Silently abort here, not enabled
return '';
// Function to add onclick attribute
function addJavaScriptMenuContent ($menuMode, $mainAction, $action, $what) {
- // Do we have foo_menu_javascript enabled?
+ // Is there foo_menu_javascript enabled?
if ((!isConfigEntrySet($menuMode . '_menu_javascript')) || (getConfig($menuMode . '_menu_javascript') == 'N')) {
// Silently abort here, not enabled
return '';
// Write it with fopen
$fp = fopen($FQFN, 'w') or reportBug(__FUNCTION__, __LINE__, 'Cannot write to file ' . basename($FQFN) . '!');
- // Do we need to aquire a lock?
+ // Aquire a lock?
if ($aquireLock === true) {
- // Aquire lock
+ // Aquire a lock.
flock($fp, LOCK_EX);
} // END - if
// Check if given FQFN is a readable file
function isFileReadable ($FQFN) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS['file_readable'][$FQFN])) {
// Check all...
$GLOBALS['file_readable'][$FQFN] = ((is_file($FQFN)) && (file_exists($FQFN)) && (is_readable($FQFN)));
// Checks whether the given FQFN is a directory and not ., .. or .svn
function isDirectory ($FQFN) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$FQFN])) {
// Generate baseName
$baseName = basename($FQFN);
// Removes any existing www. from SERVER_NAME. This is very silly but enough
// for our purpose here.
function detectDomainName () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Get server name
$domainName = detectServerName();
// Check whether this script is installed
function isInstalled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine whether this script is installed
$GLOBALS[__FUNCTION__] = (
// Checks whether the cache instance is valid
function isCacheInstanceValid () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = ((isset($GLOBALS['cache_instance'])) && (is_object($GLOBALS['cache_instance'])));
$GLOBALS['file_readable'][$dest] = true;
}
+ // All fine by default
+ $status = true;
+
// If there are chmod rights set, apply them
if (!empty($chmod)) {
// Try to apply them
$status = changeMode($dest, $chmod);
- } else {
- // All fine
- $status = true;
- }
+ } // END - if
// All fine
return $status;
// Wrapper for $_POST['sel']
function countPostSelection ($element = 'sel') {
- // Is it set?
- if (isPostRequestElementSet($element)) {
- // Return counted elements
- return countSelection(postRequestElement($element));
- } else {
- // Return zero if not found
- return '0';
- }
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__][$element])) {
+ // Default is zero
+ $GLOBALS[__FUNCTION__][$element] = '0';
+
+ // Is it set?
+ if (isPostRequestElementSet($element)) {
+ // Return counted elements
+ $GLOBALS[__FUNCTION__][$element] = countSelection(postRequestElement($element));
+ } // END - if
+ } // END - if
+
+ // Return cached value
+ return $GLOBALS[__FUNCTION__][$element];
}
// Checks whether the config-local.php is loaded
// Wrapper function for installation phase
function isInstallationPhase () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = ((!isInstalled()) || (isInstalling()));
// Log debug message
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'called!');
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getAdminLogin(getCurrentAdminId());
// Checks whether given user data is set to 'Y'
function isUserDataEnabled ($column) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][getCurrentUserId()][$column])) {
// Determine it
$GLOBALS[__FUNCTION__][getCurrentUserId()][$column] = (getUserData($column) == 'Y');
// Checks if current userid is set
function isCurrentUserIdSet () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = ((isset($GLOBALS['current_userid'])) && (isValidUserId($GLOBALS['current_userid'])));
// Unsets current userid
function unsetCurrentUserId () {
- // Do we have it set?
+ // Is it set?
if (isset($GLOBALS['current_userid'])) {
// Unset this, too
unset($GLOBALS['isValidUserId'][$GLOBALS['current_userid']]);
// Checks whether we are debugging template cache
function isDebuggingTemplateCache () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getConfig('DEBUG_TEMPLATE_CACHE') == 'Y');
// Determines the country of the given user id
function determineCountry ($userid) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$userid])) {
// Default is 'invalid'
$GLOBALS[__FUNCTION__][$userid] = 'invalid';
// Debug message
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid[' . gettype($userid) . ']=' . $userid);
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$userid])) {
// Check it out
$GLOBALS[__FUNCTION__][$userid] = ((!is_null($userid)) && (!empty($userid)) && ($userid > 0));
// Checks whether the title decoration is enabled
function isTitleDecorationEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Just check it
$GLOBALS[__FUNCTION__] = (getConfig('enable_title_deco') == 'Y');
// Checks whether filter usage updates are enabled (expensive queries!)
function isFilterUsageUpdateEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.6.0')) && (isConfigEntrySet('update_filter_usage')) && (getConfig('update_filter_usage') == 'Y'));
// Checks whether debugging of weekly resets is enabled
function isWeeklyResetDebugEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = ((isConfigEntrySet('DEBUG_WEEKLY')) && (getConfig('DEBUG_WEEKLY') == 'Y'));
// Checks whether debugging of monthly resets is enabled
function isMonthlyResetDebugEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = ((isConfigEntrySet('DEBUG_MONTHLY')) && (getConfig('DEBUG_MONTHLY') == 'Y'));
// Checks whether displaying of debug SQLs are enabled
function isDisplayDebugSqlEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.2.2')) && (getConfig('display_debug_sqls') == 'Y'));
// Checks whether module title is enabled
function isModuleTitleEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getConfig('enable_mod_title') == 'Y');
// Checks whether what title is enabled
function isWhatTitleEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getConfig('enable_what_title') == 'Y');
// Checks whether stats are enabled
function ifInternalStatsEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Then determine it
$GLOBALS[__FUNCTION__] = (getConfig('internal_stats') == 'Y');
// Checks whether admin-notification of certain user actions is enabled
function isAdminNotificationEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getConfig('admin_notify') == 'Y');
// Checks whether random referral id selection is enabled
function isRandomReferralIdEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('user', '0.3.4')) && (getConfig('select_user_zero_refid') == 'Y'));
// "Getter" for default language
function getDefaultLanguage () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('DEFAULT_LANG');
// "Getter" for default referral id
function getDefRefid () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('def_refid');
// "Getter" for path
function getPath () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('PATH');
// "Getter" for url
function getUrl () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('URL');
// "Getter" for cache_path
function getCachePath () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('CACHE_PATH');
// "Getter" for secret_key
function getSecretKey () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('secret_key');
// "Getter" for SITE_KEY
function getSiteKey () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('SITE_KEY');
// "Getter" for DATE_KEY
function getDateKey () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('DATE_KEY');
// "Getter" for master_salt
function getMasterSalt () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('master_salt');
// "Getter" for prime
function getPrime () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('_PRIME');
// "Getter" for encrypt_separator
function getEncryptSeparator () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('ENCRYPT_SEPARATOR');
// "Getter" for mysql_prefix
function getMysqlPrefix () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('_MYSQL_PREFIX');
// "Getter" for table_type
function getTableType () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('_TABLE_TYPE');
// "Getter" for salt_length
function getSaltLength () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('salt_length');
// "Getter" for output_mode
function getOutputMode () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('OUTPUT_MODE');
// "Getter" for full_version
function getFullVersion () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('FULL_VERSION');
// "Getter" for title
function getTitle () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('TITLE');
// "Getter" for curr_svn_revision
function getCurrentRepositoryRevision () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('CURRENT_REPOSITORY_REVISION');
// "Getter" for server_url
function getServerUrl () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('SERVER_URL');
// "Getter" for mt_word
function getMtWord () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('mt_word');
// "Getter" for mt_word2
function getMtWord2 () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('mt_word2');
// "Getter" for mt_word3
function getMtWord3 () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('mt_word3');
// "Getter" for START_TDAY
function getStartTday () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('START_TDAY');
// "Getter" for START_YDAY
function getStartYday () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('START_YDAY');
// "Getter" for main_title
function getMainTitle () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('MAIN_TITLE');
// "Getter" for file_hash
function getFileHash () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('file_hash');
// "Getter" for pass_scramble
function getPassScramble () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('pass_scramble');
// "Getter" for ap_inactive_since
function getApInactiveSince () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('ap_inactive_since');
// "Getter" for user_min_confirmed
function getUserMinConfirmed () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('user_min_confirmed');
// "Getter" for auto_purge
function getAutoPurge () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('auto_purge');
// "Getter" for bonus_userid
function getBonusUserid () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('bonus_userid');
// "Getter" for ap_inactive_time
function getApInactiveTime () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('ap_inactive_time');
// "Getter" for ap_dm_timeout
function getApDmTimeout () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('ap_dm_timeout');
// "Getter" for ap_tasks_time
function getApTasksTime () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('ap_tasks_time');
// "Getter" for ap_unconfirmed_time
function getApUnconfirmedTime () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('ap_unconfirmed_time');
// "Getter" for points
function getPoints () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('POINTS');
// "Getter" for slogan
function getSlogan () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('SLOGAN');
// "Getter" for copy
function getCopy () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('COPY');
// "Getter" for webmaster
function getWebmaster () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('WEBMASTER');
// "Getter" for sql_count
function getSqlCount () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('sql_count');
// "Getter" for num_templates
function getNumTemplates () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('num_templates');
// "Getter" for dns_cache_timeout
function getDnsCacheTimeout () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('dns_cache_timeout');
// "Getter" for menu_blur_spacer
function getMenuBlurSpacer () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('menu_blur_spacer');
// "Getter" for points_register
function getPointsRegister () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('points_register');
// "Getter" for points_ref
function getPointsRef () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('points_ref');
// "Getter" for ref_payout
function getRefPayout () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('ref_payout');
// "Getter" for online_timeout
function getOnlineTimeout () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('online_timeout');
// "Getter" for index_home
function getIndexHome () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('index_home');
// "Getter" for one_day
function getOneDay () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('ONE_DAY');
// "Getter" for activate_xchange
function getActivateXchange () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('activate_xchange');
// "Getter" for img_type
function getImgType () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('img_type');
// "Getter" for code_length
function getCodeLength () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('code_length');
// "Getter" for least_cats
function getLeastCats () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('least_cats');
// "Getter" for pass_len
function getPassLen () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('pass_len');
// "Getter" for admin_menu
function getAdminMenu () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('admin_menu');
// "Getter" for last_month
function getLastMonth () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('last_month');
// "Getter" for max_send
function getMaxSend () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('max_send');
// "Getter" for mails_page
function getMailsPage () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('mails_page');
// "Getter" for rand_no
function getRandNo () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('rand_no');
// "Getter" for __DB_NAME
function getDbName () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('__DB_NAME');
// "Getter" for DOMAIN
function getDomain () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('DOMAIN');
// "Getter" for proxy_username
function getProxyUsername () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('proxy_username');
// "Getter" for proxy_password
function getProxyPassword () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('proxy_password');
// "Getter" for proxy_host
function getProxyHost () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('proxy_host');
// "Getter" for proxy_port
function getProxyPort () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('proxy_port');
// "Getter" for SMTP_HOSTNAME
function getSmtpHostname () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('SMTP_HOSTNAME');
// "Getter" for SMTP_USER
function getSmtpUser () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('SMTP_USER');
// "Getter" for SMTP_PASSWORD
function getSmtpPassword () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('SMTP_PASSWORD');
// "Getter" for points_word
function getPointsWord () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('points_word');
// "Getter" for profile_lock
function getProfileLock () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('profile_lock');
// "Getter" for url_tlock
function getUrlTlock () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('url_tlock');
// "Getter" for title_left
function getTitleLeft () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('title_left');
// "Getter" for title_right
function getTitleRight () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('title_right');
// "Getter" for title_middle
function getTitleMiddle () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('title_middle');
// Checks whether proxy configuration is used
function isProxyUsed () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.4.3')) && (getConfig('proxy_host') != '') && (getConfig('proxy_port') > 0));
// Checks whether POST data contains selections
function ifPostContainsSelections ($element = 'sel') {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$element])) {
// Determine it
$GLOBALS[__FUNCTION__][$element] = ((isPostRequestElementSet($element)) && (is_array(postRequestElement($element))) && (countPostSelection($element) > 0));
// Checks whether verbose_sql is Y and returns true/false if so
function isVerboseSqlEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.0.7')) && (getConfig('verbose_sql') == 'Y'));
// "Getter" for total user points
function getTotalPoints ($userid) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$userid])) {
// Init array for filter chain
$data = array(
// Wrapper to get used points for given userid
function getUserUsedPoints ($userid) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$userid])) {
// Determine it
$GLOBALS[__FUNCTION__][$userid] = countSumTotalData($userid, 'user_data', 'used_points');
// Wrapper to check if url_blacklist is enabled
function isUrlBlacklistEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getConfig('url_blacklist') == 'Y');
// Checks whether direct payment is allowed in configuration
function isDirectPaymentEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = (getConfig('allow_direct_pay') == 'Y');
// Checks whether JavaScript-based admin menu is enabled
function isAdminMenuJavascriptEnabled () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.8.7')) && (getAdminMenuJavaScript() == 'Y'));
// Wrapper to check if current task is for extension (not update)
function isExtensionTask ($content) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$content['task_type'] . '_' . $content['infos']])) {
// Determine it
$GLOBALS[__FUNCTION__][$content['task_type'] . '_' . $content['infos']] = (($content['task_type'] == 'EXTENSION') && ((isExtensionNameValid($content['infos'])) || (isExtensionDeprecated($content['infos']))) && (!isExtensionInstalled($content['infos'])));
// Wrapper to check if user points are locked
function ifUserPointsLocked ($userid) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - ENTERED!');
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$userid])) {
// Determine it
$GLOBALS[__FUNCTION__][$userid] = ((getFetchedUserData('userid', $userid, 'ref_payout') > 0) && (!isDirectPaymentEnabled()));
// Wrapper "getter" to get total unconfirmed mails for given userid
function getTotalUnconfirmedMails ($userid) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$userid])) {
// Determine it
$GLOBALS[__FUNCTION__][$userid] = countSumTotalData($userid, 'user_links', 'id', 'userid', true);
// Gets given user's total referral
function getUsersTotalReferrals ($userid, $level = NULL) {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$userid][$level])) {
// Is the level NULL?
if (is_null($level)) {
// Gets given user's total referral
function getUsersTotalLockedReferrals ($userid, $level = NULL) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level[' . gettype($level) . ']=' . $level . ' - ENTERED!');
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$userid][$level])) {
// Default is all refs
$add = '';
if (function_exists($FQCN)) {
// Call it
call_user_func($FQCN);
- } else {
+ } elseif (isDebugModeEnabled()) {
// This callback function is only optional
logDebugMessage(__FUNCTION__, __LINE__, 'Call-back function ' . $FQCN . ' for template ' . $template . ' does not exist.');
}
// Parses the XML content
function parseXmlData ($content) {
- // Do we have recode?
+ // Is there recode?
if (!function_exists('recode')) {
// No fallback ATM
reportBug('PHP extension recode is missing. Please install it.');
function doCallXmlCallbackFunction () {
// Loop through all added entries
foreach ($GLOBALS['__XML_CALLBACKS']['callbacks'] as $callback) {
- // Do we have the entry?
+ // Is there the entry?
if ((isset($GLOBALS['__XML_CALLBACKS']['functions'][$callback])) && (isset($GLOBALS['__XML_ARGUMENTS'][$callback]))) {
// Run all function callbacks
foreach ($GLOBALS['__XML_CALLBACKS']['functions'][$callback] as $function) {
// Trim spaces away
$characters = trim($characters);
- // Do we have some to handle?
+ // Are there some to handle?
if (strlen($characters) == 0) {
// Nothing to handle
return;
// Init SQL part
$sqlPart = '';
- // Do we have a table/alias
+ // Is there a table/alias
if (!empty($columnArray['table'])) {
// Pre-add it
$sqlPart .= $columnArray['table'] . '.';
// Handle fatal errors
runFilterChain('handle_fatal_errors');
-// Do we have plain or AJAX-enabled installation?
+// Is plain or AJAX-enabled installation used?
if (isGetRequestElementSet('installer')) {
// Set installer type
setSession('installer', getRequestElement('installer'));
return;
} // END - if
- // Do we have a 'next' entry?
+ // Is there a 'next' entry?
//* DEBUG: */ alert('doFooterPage(): button=' + button + ',currentTabId=' + currentTabId + ',nextPage[currentTabId]=' + nextPage[currentTabId]);
if ((button == 'next') && (nextPage[currentTabId] != null)) {
// Then call the AJAX requester
// Mark all elements as unchanged
markAllElementsAsUnchanged();
- // Do we have changed elements
+ // Is there changed elements
if (changedElements.length == 0) {
// This should not happen
displayErrorWindow(prefix, '<div class="ajax_error_message">saveChanges() called with no changed elements.</div>');
// Reset form
resetMailerAjaxForm();
} else {
- // Do we have 'failed_fields' set?
+ // Is there 'failed_fields' set?
if ((ajax_content.failed_fields != undefined) && (ajax_content.message != undefined)) {
// Mark all fields as 'failed'
markFormFieldsFailed(ajax_content.failed_fields);
// Countdown function
function ajaxTestCounter () {
- // Do we have element set?
+ // Is there element set?
if (element != null) {
// Yes, then set the new counter value
element.innerHTML = counter;
} // END - if
- // Do we have reached zero?
+ // Is there reached zero?
if (counter < 1) {
// Clear the interval
clearInterval(ajaxTest);
// Base URL for redirection
$url = 'modules.php?module=index';
-// Do we have a referral id?
+// Is there a referral id?
if (isReferralIdValid()) {
// We have an refid here. So we simply add it
$url .= '&what=sponsor_reg&refid=' . determineReferralId();
//-----------------------------------------
$('a').each(function (i) {
$(this).on('click', {index:i}, function (event) {
- // Do we have a valid index?
+ // Is there a valid index?
if (indexTranslation[event.data.index] != null) {
// Prevent default action
event.preventDefault();
//-----------------------------------------
$('a').each(function (i) {
$(this).on('click', {index:i}, function (event) {
- // Do we have a valid index?
+ // Is there a valid index?
if (indexTranslation[event.data.index] != null) {
// Prevent default action
event.preventDefault();
$result = SQL_QUERY_ESC("SELECT `url` FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `id`=%s LIMIT 1",
array(bigintval(getRequestElement('banner'))), __FILE__, __LINE__);
- // Do we have the banner?
+ // Is there the banner?
if (SQL_NUMROWS($result) == 1) {
// Load the URL
$data = SQL_FETCHARRAY($result);