./inc/functions.php:1090: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
./inc/functions.php:1176: // @TODO Are these convertions still required?
./inc/functions.php:1197:// @TODO Rewrite this function to use readFromFile() and writeToFile()
-./inc/functions.php:1732: // @TODO Find a way to cache this
-./inc/functions.php:1837: // @TODO This is still very static, rewrite it somehow
-./inc/functions.php:2041: // @TODO Rename column data_type to e.g. mail_status
+./inc/functions.php:1733: // @TODO Find a way to cache this
+./inc/functions.php:1838: // @TODO This is still very static, rewrite it somehow
+./inc/functions.php:2042: // @TODO Rename column data_type to e.g. mail_status
./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter
./inc/header.php:66:// @TODO Find a way to not use direct module comparison
./inc/install-functions.php:91: // @TODO DEACTIVATED: changeDataInLocalConfigurationFile('OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestElement('omode'), 0);
./inc/libs/theme_functions.php:94: // @TODO Can't this be rewritten to an API function?
./inc/libs/user_functions.php:325: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
./inc/libs/user_functions.php:354: // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
-./inc/libs/yoomedia_functions.php:108: $response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script
+./inc/libs/yoomedia_functions.php:108: $response = YOOMEDIA_QUERY_API('out_textmail.php', TRUE); // @TODO Ask Yoo!Media for test script
./inc/load_config.php:75: // @TODO Rewrite them to avoid this else block
./inc/loader/load-extension.php:13: * @TODO Rewrite this whole file *
./inc/mails/doubler_mails.php:53:// @TODO Can this be rewritten to a filter?
print "Validating template ".$_SERVER['argv'][1]."...\n";
$doc = new DOMDocument();
-$doc->formatOutput = true;
-$doc->preserveWhiteSpace = false;
+$doc->formatOutput = TRUE;
+$doc->preserveWhiteSpace = FALSE;
$doc->encoding = 'UTF-8';
$doc->xmlVersion = '1.1';
$doc->loadHTMLFile($_SERVER['argv'][1]);
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module
$GLOBALS['__module'] = 'admin';
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module and output mode (raw)
$GLOBALS['__module'] = 'agb';
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
/*
* Set output to "AJAX mode", proper module and prevent HTML headers/footers
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module
$GLOBALS['__module'] = 'autoreg';
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module and output mode (HTML)
$GLOBALS['__module'] = 'beg';
$points = '0';
// Don't pay is the default...
- $pay = false;
+ $pay = FALSE;
// Validate if it is not a number
if ((isExtensionActive('nickname')) && (isNicknameUsed(getRequestElement('userid')))) {
// Set nickname / userid for template
$content['userid'] = getRequestElement('userid');
$content['clicks'] = (getUserData('beg_clicks') + 1);
- $content['header_banner'] = loadTemplate('beg_header_banner', true);
- $content['footer_banner'] = loadTemplate('beg_footer_banner', true);
+ $content['header_banner'] = loadTemplate('beg_header_banner', TRUE);
+ $content['footer_banner'] = loadTemplate('beg_footer_banner', TRUE);
$content['points'] = $points;
} // END - if
// Pay points?
//* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'pay=' . intval($pay));
- if ($pay === true) {
+ if ($pay === TRUE) {
// Add points to user or begging rallye account
if (addPointsBeg(getUserData('userid'), $points)) {
// Set 'done' message
- $content['message'] = loadTemplate('beg_done', true, $content);
+ $content['message'] = loadTemplate('beg_done', TRUE, $content);
} else {
// Error!
- $content['message'] = loadTemplate('beg_failed', true, $content);
+ $content['message'] = loadTemplate('beg_failed', TRUE, $content);
}
} else {
// Error!
- $content['message'] = loadTemplate('beg_failed', true, $content);
+ $content['message'] = loadTemplate('beg_failed', TRUE, $content);
}
} elseif (isMember()) {
// Logged in user found
- $content['message'] = loadTemplate('beg_login', true, $content);
+ $content['message'] = loadTemplate('beg_login', TRUE, $content);
} elseif (getBegPayMode() != 'NONE') { // Other pay-mode active!
// Load message template depending on pay-mode
- $content['message'] = loadTemplate('beg_pay_mode_' . strtolower(getBegPayMode()), true, $content);
- $pay = true;
+ $content['message'] = loadTemplate('beg_pay_mode_' . strtolower(getBegPayMode()), TRUE, $content);
+ $pay = TRUE;
} else {
// Clicked received while reload lock is active
- $content['message'] = loadTemplate('beg_failed', true, $content);
+ $content['message'] = loadTemplate('beg_failed', TRUE, $content);
}
// Free memory
loadIncludeOnce('inc/header.php');
// Load final template
- loadTemplate('beg_link', false, $content);
+ loadTemplate('beg_link', FALSE, $content);
// Tracker code enabled? (We don't track users here!
- if ((getBegPayMode() != 'NONE') && ($pay === true)) {
+ if ((getBegPayMode() != 'NONE') && ($pay === TRUE)) {
// Prepare content for template
// @TODO Opps, what is missing here???
$content = array(
);
// Include config-depending template
- loadTemplate('beg_pay_code_' . strtolower(getBegPayMode()), false, $content);
- } elseif (($pay === false) && (!isset($content['message']))) {
+ loadTemplate('beg_pay_code_' . strtolower(getBegPayMode()), FALSE, $content);
+ } elseif (($pay === FALSE) && (!isset($content['message']))) {
// Cannot pay! :-(
- $content['message'] = loadTemplate('beg_failed', true);
+ $content['message'] = loadTemplate('beg_failed', TRUE);
}
// Include footer
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module
$GLOBALS['__module'] = 'birthday_confirm';
$userid = bigintval(getRequestElement('userid'));
// Only allow numbers here...
-$chk = bigintval(getRequestElement('check'), false);
+$chk = bigintval(getRequestElement('check'), FALSE);
// Check if link is not clicked so far
$result = SQL_QUERY_ESC("SELECT
// Is an entry there?
if (SQL_NUMROWS($result) == 1) {
// Ok, congratulation again! Here's your gift from us...
- $data = SQL_FETCHARRAY($result, false);
+ $data = SQL_FETCHARRAY($result, FALSE);
// Is the account confirmed?
if ($data['status'] == 'CONFIRMED') {
array($userid, $chk), __FILE__, __LINE__);
// Load message from template
- $content['message'] = loadTemplate('birthday_msg', true, $data);
+ $content['message'] = loadTemplate('birthday_msg', TRUE, $data);
} else {
// Unconfirmed / locked accounts cannot get points
$content['message'] = '{%message,MEMBER_BIRTHDAY_CANNOT_STATUS=' . $data['status'] . '%}';
loadIncludeOnce('inc/header.php');
// Load birthday header template (for your banners, e.g.?)
-$content['header'] = loadTemplate('birthday_header', true);
+$content['header'] = loadTemplate('birthday_header', TRUE);
// Load birthday footer template (for your banners, e.g.?)
-$content['footer'] = loadTemplate('birthday_footer', true);
+$content['footer'] = loadTemplate('birthday_footer', TRUE);
// Load final template and output it
-loadTemplate('birthday_confirm', false, $content);
+loadTemplate('birthday_confirm', FALSE, $content);
// Include footer
loadIncludeOnce('inc/footer.php');
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module
$GLOBALS['__module'] = 'click';
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module to confirm and output-mode to raw
$GLOBALS['__module'] = 'confirm';
$GLOBALS['__footer_sent'] = -1;
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// This is a CSS file loader
$GLOBALS['__module'] = 'css';
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module and fake "CSS mode"
$GLOBALS['__module'] = 'debug';
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module and output mode
$GLOBALS['__module'] = 'doubler';
updateConfiguration('doubler_counter', 1, '+');
// Set constant
- $content['message'] = loadTemplate('doubler_reflink', true, postRequestElement('userid'));
+ $content['message'] = loadTemplate('doubler_reflink', TRUE, postRequestElement('userid'));
} else {
// Not enougth points left
$content['message'] = '{--DOUBLER_FORM_NO_POINTS_LEFT--}';
loadIncludeOnce('inc/header.php');
// Banner in text
-$content['banner'] = loadTemplate('doubler_banner', true);
+$content['banner'] = loadTemplate('doubler_banner', TRUE);
// Load header/footer templates
-$content['header'] = loadTemplate('doubler_header', true);
-$content['footer'] = loadTemplate('doubler_footer', true);
+$content['header'] = loadTemplate('doubler_header', TRUE);
+$content['footer'] = loadTemplate('doubler_footer', TRUE);
if (isUserDataValid()) {
// Transfer userid/nickname to constant
$content['payout_history'] = generateDoublerTable(0, 'Y', 'N', 'DESC');
// Output neccessary form for this
-loadTemplate('doubler_index', false, $content);
+loadTemplate('doubler_index', FALSE, $content);
// Output footer
loadIncludeOnce('inc/footer.php');
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module and output mode
$GLOBALS['__module'] = 'img';
// Setter for AJAX reply content
function setAjaxReplyContent ($content) {
// Set it, but with URL encoding
- $GLOBALS['ajax_reply']['reply_content'] = urlencode(doFinalCompilation($content, false));
+ $GLOBALS['ajax_reply']['reply_content'] = urlencode(doFinalCompilation($content, FALSE));
}
/**
*/
function isAjaxRequestLevelValid () {
// By default nothing is valid
- $isValid = false;
+ $isValid = FALSE;
// Switch on the 'level' value
switch (postRequestElement('level')) {
// "Generates" admin content by loading a message template
function generateAdminContent () {
// Return it
- return displayMessage('{--ADMIN_AJAX_MENU_IS_LOADING--}', true);
+ return displayMessage('{--ADMIN_AJAX_MENU_IS_LOADING--}', TRUE);
}
// Processes AJAX requests for admin menu
// Is the HTTP status still the same? (204 No Content)
if (getHttpStatus() == '204 No Content') {
// We use the current access level 'install' as prefix and construct a template name
- setAjaxReplyContent(loadTemplate('admin_area_' . trim(postRequestElement('tab')), true));
+ setAjaxReplyContent(loadTemplate('admin_area_' . trim(postRequestElement('tab')), TRUE));
// Has the template been loaded?
if (isset($GLOBALS['template_content']['html']['admin_page_' . trim(postRequestElement('tab'))])) {
// Processes installer request for testing
function doAjaxInstallerTest () {
// Load the "test passed" template
- setAjaxReplyContent(loadTemplate('ajax_test_passed', true));
+ setAjaxReplyContent(loadTemplate('ajax_test_passed', TRUE));
// All okay if we reach this point
setHttpStatus('200 OK');
// Is the HTTP status still the same? (204 No Content)
if (getHttpStatus() == '204 No Content') {
// We use the current access level 'install' as prefix and construct a template name
- setAjaxReplyContent(loadTemplate('install_page_' . trim(postRequestElement('tab')), true));
+ setAjaxReplyContent(loadTemplate('install_page_' . trim(postRequestElement('tab')), TRUE));
// Has the template been loaded?
if (isset($GLOBALS['template_content']['html']['install_page_' . trim(postRequestElement('tab'))])) {
if (in_array(postRequestElement('button'), array('previous', 'next'))) {
// Load 'prefixed' template
- setAjaxReplyContent(loadTemplate('install_warning_' . postRequestElement('button'), true, $content));
+ setAjaxReplyContent(loadTemplate('install_warning_' . postRequestElement('button'), TRUE, $content));
} else {
// Load 'tab' template
- setAjaxReplyContent(loadTemplate('install_warning_tab', true, $content));
+ setAjaxReplyContent(loadTemplate('install_warning_tab', TRUE, $content));
}
// All okay if we reach this point
'status' => 'failed',
'message' => '{--INSTALLER_SAVE_CHANGES_FAILED--}',
// Don't set this to false, or else it will be returned as 'failed' but is saved
- 'is_saved' => true,
+ 'is_saved' => TRUE,
'failed_fields' => array()
);
// Init overall status
- $isAllSaved = true;
+ $isAllSaved = TRUE;
// Now set all remaining data in session
foreach (postRequestArray() as $key => $value) {
);
// Save the overall status for below final check
- $isAllSaved = (($isAllSaved === true) && ($saveStatus['is_saved'] === true));
+ $isAllSaved = (($isAllSaved === TRUE) && ($saveStatus['is_saved'] === TRUE));
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',value=' . $value . ',is_saved=' . intval($saveStatus['is_saved']) . ',isAllSaved=' . intval($isAllSaved));
} // END - foreach
// 'is_saved' is still true?
- if ($isAllSaved === true) {
+ if ($isAllSaved === TRUE) {
// Set 'done' and message
$saveStatus['status'] = 'done';
$saveStatus['message'] = '{--INSTALLER_SAVE_CHANGES_DONE--}';
// Status message (e.g. for output)
'message' => '{--INSTALLER_OVERVIEW_FINAL_CHECK_FAILED--}',
// Don't set this to false, or else it will be returned as 'failed' but is saved
- 'is_valid' => true,
+ 'is_valid' => TRUE,
// Failed fields
'failed_fields' => array()
);
// Init overall status and final output
- $isAllValid = true;
+ $isAllValid = TRUE;
$output = '';
// Check all data in session
$verificationStatus['is_valid'] = (isInstallerDataValid($verificationStatus, $key, $value));
// Is this step okay?
- if ($verificationStatus['is_valid'] === true) {
+ if ($verificationStatus['is_valid'] === TRUE) {
// Add this key/value pair to a overview group
addKeyValueToInstallerOverviewGroup($key, $value);
} // END - if
// Save the overall status for below final check
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',value=' . $value . ',is_valid=' . intval($verificationStatus['is_valid']) . ',isAllValid=' . intval($isAllValid));
- $isAllValid = (($isAllValid === true) && ($verificationStatus['is_valid'] === true));
+ $isAllValid = (($isAllValid === TRUE) && ($verificationStatus['is_valid'] === TRUE));
} // END - foreach
// Is it still true?
- if ($isAllValid === true) {
+ if ($isAllValid === TRUE) {
// Set 'done' and message
$verificationStatus['status'] = 'done';
$verificationStatus['message'] = '{--INSTALLER_OVERVIEW_FINAL_CHECK_DONE--}';
$GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][] = $attributes['VALUE'];
} elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['NAME']])) {
// Already created
- reportBug(__FUNCTION__, __LINE__, 'NAME=' . $attributes['NAME'] . ' already addded to ' . $element . ' attributes=<pre>' . print_r($attributes, true) . '</pre>');
+ reportBug(__FUNCTION__, __LINE__, 'NAME=' . $attributes['NAME'] . ' already addded to ' . $element . ' attributes=<pre>' . print_r($attributes, TRUE) . '</pre>');
} else {
// Use from NAME
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',NAME=' . $attributes['NAME'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NAME!');
} // END - if
// Just call it
- //* DEBUG: */ die('callbackFunction=' . $callbackName . ',columnIndex=' . $columnIndex . ',args=<pre>'.print_r($args, true).'</pre>');
+ //* DEBUG: */ die('callbackFunction=' . $callbackName . ',columnIndex=' . $columnIndex . ',args=<pre>'.print_r($args, TRUE).'</pre>');
call_user_func_array($callbackName, $args);
}
var $fqfn = '';
// Resource to cache file
- var $pointer = false;
+ var $pointer = FALSE;
// Data array from cache
var $data = array();
// Filter
$GLOBALS['cache_array']['filter']['chains'][$data['filter_name']][$data['filter_function']] = $data['filter_active'];
$GLOBALS['cache_array']['filter']['counter'][$data['filter_name']][$data['filter_function']] = $data['filter_counter'];
- $GLOBALS['cache_array']['filter']['loaded'][$data['filter_name']][$data['filter_function']] = true;
+ $GLOBALS['cache_array']['filter']['loaded'][$data['filter_name']][$data['filter_function']] = TRUE;
} elseif ($this->name == 'modules') {
// Modules
$GLOBALS['cache_array']['modules'][$k][$data['module']] = $v;
$this->finalize();
// Remove cache
- $this->removeCacheFile(true);
+ $this->removeCacheFile(TRUE);
// Unsupported/unhandled cache detected
- reportBug(__METHOD__, __LINE__, 'Unsupported cache ' . $this->name . ' detected, data=' . print_r($data, true) . ',k=' . $k . ',v=' . $v);
+ reportBug(__METHOD__, __LINE__, 'Unsupported cache ' . $this->name . ' detected, data=' . print_r($data, TRUE) . ',k=' . $k . ',v=' . $v);
}
// Write cache line to file
// Remove pointer and status
unset($this->status[$this->name]);
- $this->pointer = false;
+ $this->pointer = FALSE;
//* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, 'name=' . $this->name . ' - FINALIZED!');
} // END - if
}
}
// Destroy an existing cache file
- function removeCacheFile ($force = false) {
+ function removeCacheFile ($force = FALSE) {
// Reset read status
$this->resetCacheReadStatus();
// Is the cache file not yet rebuilt?
if ((!isset($this->rebuilt[$this->name])) && ($this->isCacheReadable())) {
// Only run in regular output mode
- if ((!isHtmlOutputMode()) && ($force === false)) {
+ if ((!isHtmlOutputMode()) && ($force === FALSE)) {
// Debug message if allowed
if (isDebugModeEnabled()) {
// Debug message
// The cache does no longer exist so kill the content
unset($this->data[$this->name]);
unset($this->version[$this->name]);
- $this->rebuilt[$this->name] = true;
+ $this->rebuilt[$this->name] = TRUE;
} else {
// Not removed!
reportBug(__METHOD__, __LINE__, '{%message,CACHE_CANNOT_UNLINK=' . $this->name . '%}');
if ((is_array($dummy)) && (isset($dummy[$search])) && (is_array($dummy[$search]))) {
// Search for key in array
$key_found = array_key_exists($search_key, $dummy[$search]);
- if ($key_found == true) {
+ if ($key_found == TRUE) {
$key = $search_key;
// Key (hopefully) found?
foreach ($dummy as $a => $v) {
$this->version[$this->name][$ext_name] = $ext_ver;
// Write cache line to file
- $this->writeLine($this->rewriteEntry($ext_name, $ext_ver, 'version', true));
+ $this->writeLine($this->rewriteEntry($ext_name, $ext_ver, 'version', TRUE));
} // END - if
//* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, 'name=' . $this->name . ',ext_name=' . $ext_name . ',ext_ver=' . $ext_ver);
} else {
// Check cache
if (!isset($GLOBALS[__METHOD__][$ext_name])) {
// Does never match by default
- $GLOBALS[__METHOD__][$ext_name] = false;
+ $GLOBALS[__METHOD__][$ext_name] = FALSE;
// Compare only if installed
if (isExtensionInstalled($ext_name)) {
logDebugMessage(__METHOD__, __LINE__, 'Cache ' . $this->name . ' has missing version entry for extension ' . $ext_name . '! Purging cache...');
// Remove the cache file
- $this->removeCacheFile(true);
+ $this->removeCacheFile(TRUE);
}
} else {
// Not installed, does always match
- $GLOBALS[__METHOD__][$ext_name] = true;
+ $GLOBALS[__METHOD__][$ext_name] = TRUE;
}
} else {
// Cache entry found, log debug message
// Rewrit the entry so it can be stored in cache file
// @TODO Add support for more types which break in last else-block
- function rewriteEntry ($key, $value, $prefix = 'data', $single = false) {
+ function rewriteEntry ($key, $value, $prefix = 'data', $single = FALSE) {
// Default is not single entry
$extender = '[]';
// Add only for single array entry?
- if ($single === true) {
+ if ($single === TRUE) {
$extender = '';
} // END - if
$line = '$this->' . $prefix . "['" . $this->name . "']['" . $key . "']" . $extender . ' = NULL;';
} elseif (is_bool($value)) {
// Boolean value
- if ($value === true) {
+ if ($value === TRUE) {
// True
- $line = '$this->' . $prefix . "['" . $this->name . "']['" . $key . "']" . $extender . ' = true;';
+ $line = '$this->' . $prefix . "['" . $this->name . "']['" . $key . "']" . $extender . ' = TRUE;';
} else {
// False
- $line = '$this->' . $prefix . "['" . $this->name . "']['" . $key . "']" . $extender . ' = false;';
+ $line = '$this->' . $prefix . "['" . $this->name . "']['" . $key . "']" . $extender . ' = FALSE;';
}
} elseif (isset($value[0])) {
// These lines needs fixing
* @param string $Description Beschreibung (Sichtbar in Einzelauflistung)
*/
function payPrimera ($Receiver, $Amount, $Description = '') {
- $valid = false;
+ $valid = FALSE;
$postData = array('PrimusInterface_Action' => 'Pay',
'PrimusInterface_Receiver' => base64_encode($Receiver),
'PrimusInterface_Amount' => base64_encode($Amount),
$this->data = $postReturn;
if ($postReturn['status'] == '200') {
- $valid = true;
+ $valid = TRUE;
}
return $valid;
}
* @param string/int $User Userid / Username
*/
function CheckPrimusUser($User) {
- $valid = false;
+ $valid = FALSE;
$postData = array('PrimusInterface_Action'=> 'CheckPrimusUser',
'PrimusInterface_CheckPrimusUser' => $User);
$this->data = $postReturn;
if ($postReturn['status'] == self::PI_USER_CHECK_OK) {
- $valid = true;
+ $valid = TRUE;
}
return $valid;
}
* Die Funktion liefer den aktuellen Primerastand
*/
function getPrimera() {
- $primera = false;
+ $primera = FALSE;
$postData = array( 'PrimusInterface_Action' => 'GetPrimera' );
$postReturn = $this->parseContent( $this->queryApi($postData) );
* @access private
* @var boolean
*/
- var $_use_nl2br = true;
+ var $_use_nl2br = TRUE;
/**
* Sets the decoding mode of the read data (UTF8 scrambles some german umlauts here!)
* @see set_proxy()
* @var bool
*/
- var $_use_proxy = false;
+ var $_use_proxy = FALSE;
/**
* just a flag for checking if proxy-support with authentication
* @see set_proxy()
* @var boolean
*/
- var $_use_proxy_auth = false;
+ var $_use_proxy_auth = FALSE;
/**
* The time the Files will be cached (in seconds).
* @access private
* @var boolean
*/
- var $_use_cached_file = true;
+ var $_use_cached_file = TRUE;
/**
* (fast|normal) depends on _use_dynamic_display(). _use_dynamic_display( TRUE ) -> 'normal', otherwise 'fast'
* @access private
* @var boolean
*/
- var $_cache_dir_ok = false;
+ var $_cache_dir_ok = FALSE;
/**
* Type of the file to be parsed (RSS or RDF).
* @access private
* @var array
*/
- var $_use_dynamic_display = false;
+ var $_use_dynamic_display = FALSE;
/**
* <item> count
* @access private
* @var boolean
*/
- var $_max_count = false;
+ var $_max_count = FALSE;
/**
* Array containing the content of <channel />
$this->out .= "</table>";
$this->_output = '';
$this->_item_count = '0';
- return true;
+ return TRUE;
}
/**
* @return string Displays RDF Content ( using _display() )
* @see _remote_file, cache()
*/
- function finish($return = false) {
+ function finish($return = FALSE) {
$this->out = str_replace('$', '$', $this->out);
if (!$return) {
*/
function use_dynamic_display( $bool ) {
$this->_use_dynamic_display = $bool;
- return true;
+ return TRUE;
}
/**
*/
function set_refresh( $seconds ) {
$this->_refresh = (time() - $seconds);
- return true;
+ return TRUE;
}
function set_salt( $saltPara ) {
$this->salt = $saltPara;
- return true;
+ return TRUE;
}
/**
function set_max_item( $int )
{
$this->_max_count = $int;
- return true;
+ return TRUE;
}
/**
function _throw_exception( $msg )
{
$this->out .= "<div style=\"font-family: verdana, helvetica, arial, sans-serif;font-size:11px; color: #6699cc;margin-top:10px;margin-bottom:10px;\" align=\"center\">fase4 RDF Error: ".$msg."</div>";
- return true;
+ return TRUE;
}
/**
if (($this->_word_wrap > 0) && (strlen($this->_item['description']) > $this->_word_wrap))
{
// Switch off _use_nl2br
- $this->_use_nl2br = false;
+ $this->_use_nl2br = FALSE;
// First remove all \n
$this->_item['description'] = str_replace('\n', ' ', $this->_item['description']);
// Wrap with <br />\n
{
if(is_array( $options )) {
$this->_display_opt = $options;
- return true;
+ return TRUE;
} else {
unset($this->_display_opt);
- return false;
+ return FALSE;
}
}
function set_table_width( $width = 400 )
{
$this->_table_width = $width;
- return true;
+ return TRUE;
}
/**
if(!$this->_cache_dir_ok) {
$this->_create_cache_dir();
}
- if($this->_use_dynamic_display == true) {
+ if($this->_use_dynamic_display == TRUE) {
$this->_cached_file = md5('dynamic'.$this->salt.$this->_remote_file) . '.cache';
$this->_cache_type = 'normal';
} else {
if ( (!file_exists($_cache_f)) || (filemtime($_cache_f) < $this->_refresh) || (filesize($_cache_f) == 0)) {
// We have to parse the remote file
- $this->_use_cached_file = false;
+ $this->_use_cached_file = FALSE;
// --> we want to provide proper Information for Use in
// get_cache_update_time()
clearstatcache();
- if($this->_use_dynamic_display == true) {
+ if($this->_use_dynamic_display == TRUE) {
$_rdf = implode(' ', $this->_rdf_data()); // -> proxy
if(!$_rdf) {
$this->_throw_exception( $this->_remote_file.' is not available' );
}
} else {
// we can use the cached file
- $this->_use_cached_file = true;
- if($this->_use_dynamic_display == true) {
+ $this->_use_cached_file = TRUE;
+ if($this->_use_dynamic_display == TRUE) {
$this->_parse_xRDF( implode(' ', file($_cache_f)) );
$data = $this->_output;
} else {
if(!@is_dir($path)) {
if(!@mkdir($path, 0777)) {
$this->_throw_exception("failed to create directory:<b>".$this->_cache_dir."</b>.<br /><br />Exception on Line: ".__LINE__);
- return false;
+ return FALSE;
}
}
}
}
- $this->_cache_dir_ok = true;
- return true;
+ $this->_cache_dir_ok = TRUE;
+ return TRUE;
} else {
- $this->_cache_dir_ok = true;
- return true;
+ $this->_cache_dir_ok = TRUE;
+ return TRUE;
}
} // END _create_cache_dir()
$_local = @fopen( $this->_cache_dir.$this->_cached_file, 'w' );
if(!$_local) {
$this->_throw_exception( 'Cannot open '.$this->_cached_file.'<br /><br />Exception at Line: '.__LINE__ );
- return false;
+ return FALSE;
}
- if (fwrite( $_local, $content) === false) {
+ if (fwrite( $_local, $content) === FALSE) {
$this->_throw_exception( 'Cannot write to '.$this->_cached_file.'<br /<br />Exeception at Line: '.__LINE__);
- return false;
+ return FALSE;
}
fclose( $_local );
@chmod( $this->_cache_dir.$this->_cached_file, 0666);
- return true;
+ return TRUE;
} // END _update_cache()
/**
if (is_file($dir->path.$file) && substr($file, -6, 6) != '.cache' && substr($file, -4, 4) != '.log') {
if(!@unlink($dir->path.$file)) {
$this->_throw_exception("Unable to unlink ".$dir->path.$file."<br />\n<br />\nException at Line: ".__LINE__ );
- return false;
+ return FALSE;
} // END - if
} // END - if
} // END - while
$dir->close();
- return true;
+ return TRUE;
} // END clear_cache()
/**
*/
function set_proxy($phost, $pport)
{
- $this->_use_proxy = true;
+ $this->_use_proxy = TRUE;
if ($phost != '')
$this->_phost = $phost;
*/
function set_proxy_auth( $pname, $ppasswd )
{
- $this->_use_proxy_auth = true;
+ $this->_use_proxy_auth = TRUE;
if ($pname != '')
$this->_pname = $pname;
*/
function _rdf_data()
{
- if ( $this->_use_proxy == true )
+ if ( $this->_use_proxy == TRUE )
{
// we need a raw socket here to connect to proxy
$fp = fsockopen($this->_phost,$this->_pport);
if (!$fp) {
$this->_throw_exception( $this->_remote_file.' is not available with proxy' );
} else {
- if ( $this->_use_proxy_auth == true ) {
+ if ( $this->_use_proxy_auth == TRUE ) {
fputs($fp, "GET ".$this->_remote_file." HTTP/1.0\r\nUser-Agent: Fase4 RDF-Reader/1.40 modified by Quix0r\r\n\r\n");
} else {
fputs($fp, "GET ".$this->_remote_file." HTTP/1.0\r\nUser-Agent: Fase4 RDF-Reader/1.40 modified by Quix0r\r\nProxy-Authorization: Basic ".base64_encode("$this->_pname:$this->_ppasswd") ."\r\n\r\n");
$request = sprintf("GET %s HTTP/1.0\r\nHost: %s\r\nUser-Agent: Fase4 RDF-Reader/1.40 modified by Quix0r\r\n\r\n", $get, $host);
// Send request out
fputs($fp, $request);
- $reply = ''; $isContent = false; $dummy = '';
+ $reply = ''; $isContent = FALSE; $dummy = '';
// Read reply
$i=0;
while ( !feof($fp) ) {
if (substr($read, 0, 5) == '<?xml' || $isContent) {
// Add content
$reply[] = $read;
- $isContent = true;
+ $isContent = TRUE;
} else {
// Put in dummy
$dummy[] = $read;
} // END - foreach
// By default the old array $MySQL was not found
- $found = false;
+ $found = FALSE;
// Analyze every entry again for the MySQL configuration
foreach ($oldConfig as $line) {
// Is the $MySQL found?
if (substr($line, 0, 6) == '$MySQL') {
// Okay, found
- $found = true;
- } elseif ($found === true) {
+ $found = TRUE;
+ } elseif ($found === TRUE) {
// Now check this row
if (substr($line, 0, 2) == ');') {
// MySQL array is closed so stop looking for it
// Check if string or number but no array
if (is_array($values[$idx])) {
// Arrays must be fixed...
- reportBug(__FUNCTION__, __LINE__, 'values[' . $idx . '] should not be an array! Content=<pre>'.print_r($values[$idx], true).'</pre>');
+ reportBug(__FUNCTION__, __LINE__, 'values[' . $idx . '] should not be an array! Content=<pre>'.print_r($values[$idx], TRUE).'</pre>');
} elseif ($values[$idx] == 'UNIX_TIMESTAMP()') {
// Function UNIX_TIMESTAMP() detected
$SQL .= sprintf("`%s`=UNIX_TIMESTAMP(),", $entry);
WHERE
`userid`=%s
LIMIT 1",
- array(bigintval($content['userid'])), __FILE__, __LINE__, false));
+ array(bigintval($content['userid'])), __FILE__, __LINE__, FALSE));
} // END - if
// Free memory
$columnName,
bigintval($content['userid']),
$content['ref_depth']
- ), __FILE__, __LINE__, false)
+ ), __FILE__, __LINE__, FALSE)
);
} else {
// Level zero
$content['locked_' . $columnName],
$columnName,
bigintval($content['userid'])
- ), __FILE__, __LINE__, false)
+ ), __FILE__, __LINE__, FALSE)
);
}
} // END - if
// SQL queries
-function SQL_QUERY ($sqlString, $F, $L, $enableCodes = true) {
+function SQL_QUERY ($sqlString, $F, $L, $enableCodes = TRUE) {
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$sqlString])) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called: ' . $sqlString);
}
// Starting time
- $querytimeBefore = microtime(true);
+ $querytimeBefore = microtime(TRUE);
// Run SQL command
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'F=' . basename($F) . ',L=' . $L . ',sql=' . $GLOBALS['last_sql']);
//* DEBUG: */ logDebugMessage($F, $L, 'sql=' . $GLOBALS['last_sql'] . ',affected=' . SQL_AFFECTEDROWS() . ',numRows='.(is_resource($result) ? SQL_NUMROWS($result) : gettype($result)));
// Calculate query time
- $queryTime = microtime(true) - $querytimeBefore;
+ $queryTime = microtime(TRUE) - $querytimeBefore;
// Add this query to array including timing
addSqlToDebug($result, $GLOBALS['last_sql'], $queryTime, $F, $L);
if (!isset($GLOBALS['sql_first_entry'])) {
// Write first entry
appendLineToFile(getCachePath() . 'mysql.log', 'Module=' . getModule());
- $GLOBALS['sql_first_entry'] = true;
+ $GLOBALS['sql_first_entry'] = TRUE;
} // END - if
// Append debug line
// SQL num rows
function SQL_NUMROWS ($resource) {
// Valid link resource?
- if (!SQL_IS_LINK_UP()) return false;
+ if (!SQL_IS_LINK_UP()) return FALSE;
// Link is not up, no rows by default
- $lines = false;
+ $lines = FALSE;
// Is the result a valid resource?
if (isset($GLOBALS['sql_numrows'][intval($resource)])) {
// SQL affected rows
function SQL_AFFECTEDROWS() {
// Valid link resource?
- if (!SQL_IS_LINK_UP()) return false;
+ if (!SQL_IS_LINK_UP()) return FALSE;
// Get affected rows
$lines = mysql_affected_rows(SQL_GET_LINK());
// SQL fetch row
function SQL_FETCHROW ($resource) {
// Is a result resource set?
- if ((!is_resource($resource)) || (!SQL_IS_LINK_UP())) return false;
+ if ((!is_resource($resource)) || (!SQL_IS_LINK_UP())) return FALSE;
// Fetch the data and return it
return mysql_fetch_row($resource);
// SQL fetch array
function SQL_FETCHARRAY ($resource) {
// Is a result resource set?
- if ((!is_resource($resource)) || (!SQL_IS_LINK_UP())) return false;
+ if ((!is_resource($resource)) || (!SQL_IS_LINK_UP())) return FALSE;
// Load row from database
$row = mysql_fetch_assoc($resource);
return $row;
} else {
// Return a false, else some loops would go endless...
- return false;
+ return FALSE;
}
}
// SQL result
function SQL_RESULT ($resource, $row, $field = '0') {
// Is $resource valid?
- if ((!is_resource($resource)) || (!SQL_IS_LINK_UP())) return false;
+ if ((!is_resource($resource)) || (!SQL_IS_LINK_UP())) return FALSE;
// Run the result command
$result = mysql_result($resource, $row, $field);
// SQL select database
function SQL_SELECT_DB ($dbName, $F, $L) {
// Is there still a valid link? If not, skip it.
- if (!SQL_IS_LINK_UP()) return false;
+ if (!SQL_IS_LINK_UP()) return FALSE;
// Return the result
return mysql_select_db($dbName, SQL_GET_LINK()) or SQL_ERROR($F, $L, mysql_error());
function SQL_CLOSE ($F, $L) {
if (!SQL_IS_LINK_UP()) {
// Skip double close
- return false;
+ return FALSE;
} // END - if
// Close database link and forget the link
function SQL_FREERESULT ($resource) {
if ((!is_resource($resource)) || (!SQL_IS_LINK_UP())) {
// Abort here
- return false;
+ return FALSE;
} // END - if
// Free result
}
// SQL string escaping
-function SQL_QUERY_ESC ($sqlString, $data, $F, $L, $run = true, $strip = true, $secure = true) {
+function SQL_QUERY_ESC ($sqlString, $data, $F, $L, $run = TRUE, $strip = TRUE, $secure = TRUE) {
// Link is there?
if ((!SQL_IS_LINK_UP()) || (!is_array($data))) {
// Link is down or data is not an array
/* DEBUG: */ logDebugMessage($F, $L, 'SQL_IS_LINK_UP()=' . intval(SQL_IS_LINK_UP()) . ',data[]=' . gettype($data) . ',sqlString=' . $sqlString . ': ABORTING!');
- return false;
+ return FALSE;
} // END - if
// Init array for escaped data with SQL string
// Generate query
$query = call_user_func_array('sprintf', $dataSecured);
- if ($run === true) {
+ if ($run === TRUE) {
// Run SQL query (default)
return SQL_QUERY($query, $F, $L);
} else {
// Get id from last INSERT command
function SQL_INSERTID () {
- if (!SQL_IS_LINK_UP()) return false;
+ if (!SQL_IS_LINK_UP()) return FALSE;
return mysql_insert_id();
}
// Escape a string for the database
-function SQL_ESCAPE ($str, $secureString = true, $strip = true) {
+function SQL_ESCAPE ($str, $secureString = TRUE, $strip = TRUE) {
// Is there cache?
if (!isset($GLOBALS['sql_escapes']['' . $str . ''])) {
// Prepare the string here
$str = SQL_PREPARE_SQL_STRING($str);
// Secure string first? (which is the default behaviour!)
- if ($secureString === true) {
+ if ($secureString === TRUE) {
// Then do it here
$str = secureString($str, $strip);
} // END - if
));
// Abort here with 'false'
- return false;
+ return FALSE;
} // END - if
// Is this is a simple array?
}
// ALTER TABLE wrapper function
-function SQL_ALTER_TABLE ($sql, $F, $L, $enableCodes = true) {
+function SQL_ALTER_TABLE ($sql, $F, $L, $enableCodes = TRUE) {
// Abort if link is down
- if (!SQL_IS_LINK_UP()) return false;
+ if (!SQL_IS_LINK_UP()) return FALSE;
// This is the default result...
- $result = false;
+ $result = FALSE;
// Determine index/fulltext/unique word
$isAlterIndex = (
$tableName = str_replace('`', '', $tableArray[2]);
// Debug log
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sql=' . $sql . ',tableName=' . $tableName . ',tableArray=<pre>' . print_r($tableArray, true) . '</pre>,isAlterIndex=' . intval($isAlterIndex));
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sql=' . $sql . ',tableName=' . $tableName . ',tableArray=<pre>' . print_r($tableArray, TRUE) . '</pre>,isAlterIndex=' . intval($isAlterIndex));
// Shall we add/drop?
- if (((isInString('ADD', $sql)) || (isInString('DROP', $sql)) || (isInString('CHANGE', $sql))) && ($isAlterIndex === false)) {
+ if (((isInString('ADD', $sql)) || (isInString('DROP', $sql)) || (isInString('CHANGE', $sql))) && ($isAlterIndex === FALSE)) {
// Try two columns, one should fix
foreach (array(4,5) as $idx) {
// If an entry is not set, abort here
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);
- $result = SQL_QUERY($sql, $F, $L, false);
+ $result = SQL_QUERY($sql, $F, $L, FALSE);
// Skip further attempt(s)
break;
} elseif ((getTableType() == 'InnoDB') && (isInString('FULLTEXT', $sql))) {
// Skip this query silently because InnoDB does not understand fulltext indexes
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Skipped FULLTEXT: sql=%s,tableName=%s,hasZeroNums=%d,file=%s,line=%s", $sql, $tableName, intval((is_bool($result)) ? 0 : ifSqlColumnExists($columnName)), $F, $L));
- } elseif ($isAlterIndex === true) {
+ } elseif ($isAlterIndex === TRUE) {
// And column name as well without backticks
$keyName = str_replace('`', '', $tableArray[5]);
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'keyName=' . $keyName . ',tableArray=<pre>' . print_r($tableArray, true) . '</pre>');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'keyName=' . $keyName . ',tableArray=<pre>' . print_r($tableArray, TRUE) . '</pre>');
// Is this "UNIQUE" or so? FULLTEXT has been handled the elseif() block above
if (in_array(strtoupper($tableArray[4]), array('INDEX', 'UNIQUE', 'KEY', 'FULLTEXT'))) {
}
// Private function to prepare the SQL query string
-function SQL_PREPARE_SQL_STRING ($sqlString, $enableCodes = true) {
+function SQL_PREPARE_SQL_STRING ($sqlString, $enableCodes = TRUE) {
// Is it already cached?
if (!isset($GLOBALS['sql_strings'][$sqlString])) {
// Compile URI codes+config+expression code
$sqlString2 = FILTER_COMPILE_EXPRESSION_CODE(FILTER_COMPILE_CONFIG(compileUriCode($sqlString)));
// Do final compilation
- $GLOBALS['sql_strings'][$sqlString] = doFinalCompilation($sqlString2, false, $enableCodes);
+ $GLOBALS['sql_strings'][$sqlString] = doFinalCompilation($sqlString2, FALSE, $enableCodes);
} // END - if
// Return it
$result = SQL_QUERY_ESC("SHOW INDEX FROM `%s`", array($tableName), __FUNCTION__, __LINE__);
// The column is not found by default
- $GLOBALS[__FUNCTION__][$tableName][$keyName] = false;
+ $GLOBALS[__FUNCTION__][$tableName][$keyName] = FALSE;
// Walk through all
while ($content = SQL_FETCHARRAY($result)) {
// Add all entries for better caching behavior
- $GLOBALS[__FUNCTION__][$tableName][$content['Key_name']] = true;
+ $GLOBALS[__FUNCTION__][$tableName][$content['Key_name']] = TRUE;
} // END - while
// Free result
} // END - if
} else {
// No engines! :(
- $engines = false;
+ $engines = FALSE;
}
// Free result
</pre>');
// This is always fine
- return true;
+ return TRUE;
} elseif (!empty($toEmail)) {
// Send Mail away
return sendRawEmail($toEmail, $subject, $message, $mailHeader);
// Send out a raw email with PHPMailer class or plain mail() command
function sendRawEmail ($toEmail, $subject, $message, $headers) {
// Just compile all to put out all configs, etc.
- $eval = '$toEmail = decodeEntities("' . escapeQuotes(doFinalCompilation(compileRawCode($toEmail), false)) . '"); ';
- $eval .= '$subject = decodeEntities("' . escapeQuotes(doFinalCompilation(compileRawCode($subject), false)) . '"); ';
- $eval .= '$headers = decodeEntities("' . escapeQuotes(doFinalCompilation(compileRawCode($headers), false)) . '"); ';
+ $eval = '$toEmail = decodeEntities("' . escapeQuotes(doFinalCompilation(compileRawCode($toEmail), FALSE)) . '"); ';
+ $eval .= '$subject = decodeEntities("' . escapeQuotes(doFinalCompilation(compileRawCode($subject), FALSE)) . '"); ';
+ $eval .= '$headers = decodeEntities("' . escapeQuotes(doFinalCompilation(compileRawCode($headers), FALSE)) . '"); ';
// Do not decode entities in the message because we also send HTML mails through this function
- $eval .= '$message = "' . escapeQuotes(doFinalCompilation(compileRawCode($message), false)) . '";';
+ $eval .= '$message = "' . escapeQuotes(doFinalCompilation(compileRawCode($message), FALSE)) . '";';
// Run the final eval() command
eval($eval);
$mail->PluginDir = sprintf("%sinc/phpmailer/", getPath());
$mail->IsSMTP();
- $mail->SMTPAuth = true;
+ $mail->SMTPAuth = TRUE;
$mail->Host = getConfig('SMTP_HOSTNAME');
$mail->Port = 25;
$mail->Username = getConfig('SMTP_USER');
$mail->Body = $message;
$mail->AltBody = decodeEntities($message);
$mail->WordWrap = 70;
- $mail->IsHTML(true);
+ $mail->IsHTML(TRUE);
} else {
$mail->Body = decodeEntities(strip_tags($message));
}
logDebugMessage(__FUNCTION__, __LINE__, 'Error while sending mail: ' . $mail->ErrorInfo);
// Raise an error
- return false;
+ return FALSE;
} else {
// All fine!
- return true;
+ return TRUE;
}
} else {
// Use plain mail() command
if (function_exists($functionName)) {
// Cache it all
$GLOBALS['expression_function_name'][$entry] = $functionName;
- $GLOBALS['expression_function_available'][$entry] = true;
+ $GLOBALS['expression_function_available'][$entry] = TRUE;
} else {
// Not avaiable
logDebugMessage(__FUNCTION__, __LINE__, 'Expression function ' . $functionName . ' not found. Please consider adding it to improve execution speed.');
// And cache it
- $GLOBALS['expression_function_available'][$entry] = false;
+ $GLOBALS['expression_function_available'][$entry] = FALSE;
}
- } elseif ($GLOBALS['expression_function_available'][$entry] == false) {
+ } elseif ($GLOBALS['expression_function_available'][$entry] == FALSE) {
// Debug message
logDebugMessage(__FUNCTION__, __LINE__, 'Expression function for entry ' . $entry . ' requested but does not exist.');
}
$functionName = 'getExtension' . capitalizeUnderscoreString($data['callback']);
// Construct call of the function
- $replacer = "{DQUOTE} . call_user_func_array('" . $functionName . "', array('" . $data['matches'][4][$data['key']] . "', true)) . {DQUOTE}";
+ $replacer = "{DQUOTE} . call_user_func_array('" . $functionName . "', array('" . $data['matches'][4][$data['key']] . "', TRUE)) . {DQUOTE}";
} // END - if
// Generate replacer
// 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>');
+ //* DEBUG: */ if ($data['callback'] == 'getMemberId') die('<pre>'.encodeEntities(print_r($data, TRUE)).'</pre>');
// If the value is empty, we don't add it
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'value[' . gettype($data['value']) . ']=' . $data['value']);
if ((empty($data['value'])) && ($data['value'] != '0')) {
// Should we generally include validator links?
if ((isExtensionInstalled('validator')) && (getConfig('enable_validator') == 'Y') && (!in_array(getModule(), array('admin', 'login')))) {
// Load the validator template
- $replacer = escapeQuotes(loadTemplate('validator_links', true));
+ $replacer = escapeQuotes(loadTemplate('validator_links', TRUE));
} // END - if
// Replace the code
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'callback=' . $data['callback'] . ',extra_func=' . $data['extra_func'] . ',value=' . $data['value']);
// Message string replacement depends on if message is masked
- if ((isMessageMasked($data['callback'], false)) && ((!empty($data['extra_func'])) || ($data['extra_func'] == '0'))) {
+ if ((isMessageMasked($data['callback'], FALSE)) && ((!empty($data['extra_func'])) || ($data['extra_func'] == '0'))) {
// Message should be masked
$replacer = "{DQUOTE} . getMaskedMessage('" . $data['callback'] . "', '" . $data['extra_func'] . "') . {DQUOTE}";
} elseif (!empty($data['value'])) {
} else {
// Do the replacement
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'template='.$GLOBALS['current_template']);
- $replacer = '{DQUOTE} . ' . $callbackFunction . '(' . chr(39) . $GLOBALS['current_template'] . chr(39) . ', true';
+ $replacer = '{DQUOTE} . ' . $callbackFunction . '(' . chr(39) . $GLOBALS['current_template'] . chr(39) . ', TRUE';
// Is 'value' set?
if (!empty($data['value'])) {
} // END - if
// Load the extension and maybe found language and function files.
-function loadExtension ($ext_name, $ext_mode, $ext_ver = '0.0.0', $isDryRun = false, $previousExtension = NULL) {
+function loadExtension ($ext_name, $ext_mode, $ext_ver = '0.0.0', $isDryRun = FALSE, $previousExtension = NULL) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',ext_mode=' . $ext_mode . ',ext_ver=' . $ext_ver . ',isDryRun=' . intval($isDryRun) . ' - ENTERED!');
// Loading an extension in same mode, but not test/update, twice is not
// good, so is the extension $ext_name already loaded in mode $ext_mode?
if ((isset($GLOBALS['loaded_extension'][$ext_name][$ext_mode])) && (!in_array($ext_mode, array('update', 'test')))) {
// If this happens twice, we need the bug report from you, except for updates/tests
- reportBug(__FUNCTION__, __LINE__, __FUNCTION__ . '() is called twice: ext_name=' . $ext_name . ', ext_mode='. $ext_mode . ',ext_sqls=' . print_r(getExtensionSqls(), true) . ', ext_register_running=' . print_r($GLOBALS['ext_register_running'], true) . ', ext_running_updates=' . print_r($GLOBALS['ext_running_updates'], true));
+ reportBug(__FUNCTION__, __LINE__, __FUNCTION__ . '() is called twice: ext_name=' . $ext_name . ', ext_mode='. $ext_mode . ',ext_sqls=' . print_r(getExtensionSqls(), TRUE) . ', ext_register_running=' . print_r($GLOBALS['ext_register_running'], TRUE) . ', ext_running_updates=' . print_r($GLOBALS['ext_running_updates'], TRUE));
} // END - if
// Make sure this situation can only happen once
- $GLOBALS['loaded_extension'][$ext_name][$ext_mode] = true;
+ $GLOBALS['loaded_extension'][$ext_name][$ext_mode] = TRUE;
// Remember previous extension here
$GLOBALS['previous_extension'][$ext_name] = $previousExtension;
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Extension %s already loaded.", $ext_name));
// Abort here
- return false;
+ return FALSE;
} // END - if
// Is the extension file NOT there?
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Extension %s not found or not readable or the PHP script is deprecated.", $ext_name));
// Abort here
- return false;
+ return FALSE;
} // END - if
// Load extension's own language file if not in test mode
// Abort here
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Extension load aborted, ext_name=' . $ext_name . ' - Extension is deprecated.');
- return false;
+ return FALSE;
} // END - if
// Mark it as loaded in normal mode
// All fine!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Extension successfully loaded, ext_name=' . $ext_name);
- return true;
+ return TRUE;
}
// Registers an extension and possible update dependencies
-function registerExtension ($ext_name, $taskId, $isDryRun = false, $ignoreUpdates = false, $previousExtension = NULL) {
+function registerExtension ($ext_name, $taskId, $isDryRun = FALSE, $ignoreUpdates = FALSE, $previousExtension = NULL) {
// Set current extension name
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',taskId=' . intval($taskId) . ',isDryRun=' . intval($isDryRun) . ',ignoreUpdates=' . intval($ignoreUpdates) . ' - ENTERED!');
setCurrentExtensionName($ext_name);
if (((!isAdmin()) && (!isInstallationPhase())) || (isExtensionInstalled($ext_name))) {
// Abort here with 'false'
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - ABORTED: isAdmin()=' . intval(isAdmin()) . ',isInstallationPhase()=' . intval(isInstallationPhase()) . ',isExtensionInstalled()=' . intval(isExtensionInstalled($ext_name)));
- return false;
+ return FALSE;
} // END - if
// When this extension is already in registration/update phase, all is fine
- if ((isExtensionRegistrationRunning($ext_name)) || ((isExtensionUpdateRunning($ext_name)) && ($ignoreUpdates === false))) {
+ if ((isExtensionRegistrationRunning($ext_name)) || ((isExtensionUpdateRunning($ext_name)) && ($ignoreUpdates === FALSE))) {
// Then abort here with 'true' becaus it is fine
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - already in registration/update phase, all fine,taskId=' . $taskId . ',isDryRun=' . intval($isDryRun) . ',ignoreUpdates=' . intval($ignoreUpdates));
//* BUG: */ reportBug(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',taskId=' . $taskId . ',isDryRun=' . intval($isDryRun) . ',ignoreUpdates=' . intval($ignoreUpdates) . ' - Please investigate!');
- return true;
+ return TRUE;
} // END - if
// This registration is running
initExtensionNotes();
// Init variables
- $ret = false;
- $processResult = false;
+ $ret = FALSE;
+ $processResult = FALSE;
initIncludePool('extension');
// By default we have no failures
if (($updateTaskId > 0) || (isInstallationPhase())) {
// Try to register the extension
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . ',ext_update=' . $ext_update . ',updateTaskId=' . $updateTaskId . ',isExtensionDryRun()=' . intval(isExtensionDryRun()));
- $processResult = registerExtension($ext_update, $updateTaskId, isExtensionDryRun(), true, $ext_name);
+ $processResult = registerExtension($ext_update, $updateTaskId, isExtensionDryRun(), TRUE, $ext_name);
// Reset extension name
setCurrentExtensionName($ext_name);
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . ',currVer=' . getCurrentExtensionVersion());
// All okay!
- $processResult = true;
+ $processResult = TRUE;
} else {
// Nothing to register / update before...
- $processResult = true;
+ $processResult = TRUE;
}
} else {
// Required file for update does not exists!
- $processResult = true;
+ $processResult = TRUE;
// But this is fine for the first time...
}
if (countExtensionUpdateDependencies(getCurrentExtensionName()) == 0) {
// Then test is passed!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . ',processResult=true,countExtensionUpdateDependencies()=0 - Test passed!');
- $processResult = true;
+ $processResult = TRUE;
} // END - if
// Switch back to register mode
// Remains true if extension registration reports no failures
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . ',processResult=' . intval($processResult));
- $processResult = (($processResult === true) && (isExtensionReportingFailure() === false));
+ $processResult = (($processResult === TRUE) && (isExtensionReportingFailure() === FALSE));
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . ',processResult=' . intval($processResult));
// Does everthing before wents ok?
- if ($processResult === true) {
+ if ($processResult === TRUE) {
// "Dry-run-mode" activated?
- if ((isExtensionDryRun() === false) && (!isExtensionOnRemovalList())) {
+ if ((isExtensionDryRun() === FALSE) && (!isExtensionOnRemovalList())) {
// Init SQLs and transfer ext->generic
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . getCurrentExtensionName());
initSqls();
setSqlsArray(getExtensionSqls());
// Run installation pre-installation filters
- runFilterChain('pre_extension_installed', array('dry_run' => isExtensionDryRun(), 'enable_codes' => false));
+ runFilterChain('pre_extension_installed', array('dry_run' => isExtensionDryRun(), 'enable_codes' => FALSE));
// Register extension
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'insert=' . getCurrentExtensionName() . '/' . getCurrentExtensionVersion() . ' - INSERT!');
$GLOBALS['cache_array']['extension']['ext_name'][SQL_INSERTID()] = getCurrentExtensionName();
// Mark it as installed
- $GLOBALS['ext_is_installed'][getCurrentExtensionName()] = true;
+ $GLOBALS['ext_is_installed'][getCurrentExtensionName()] = TRUE;
// Remove cache file(s) if extension is active
runFilterChain('post_extension_installed', array(
));
// Re-init queries and notes
- initExtensionSqls(true);
- initExtensionNotes(true);
+ initExtensionSqls(TRUE);
+ initExtensionNotes(TRUE);
// In normal mode return a true on success
- $ret = true;
- } elseif (isExtensionDryRun() === true) {
+ $ret = TRUE;
+ } elseif (isExtensionDryRun() === TRUE) {
// In "dry-run" mode do always return a true
- $ret = true;
+ $ret = TRUE;
} else {
// Extension has been removed for updates, so all is fine!
- $ret = true;
+ $ret = TRUE;
}
} else {
// No, an error occurs while registering extension :-(
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currentExtension=' . getCurrentExtensionName());
- $ret = false;
+ $ret = FALSE;
}
} elseif (($taskId > 0) && (getCurrentExtensionName() != '')) {
// Remove task from system when id and extension's name is valid
}
// @TODO This redirect is still needed to register sql_patches! Please try to avoid it
- if (($ret === true) && ($isDryRun === false) && ($ext_name == 'sql_patches') && (!isInstallationPhase())) {
+ if (($ret === TRUE) && ($isDryRun === FALSE) && ($ext_name == 'sql_patches') && (!isInstallationPhase())) {
/*
* This is a really dirty hack to prevent an error about a missing
* configuration entry which should be there after registration of
// This shall never do a non-admin user but installation phase is okay
if ((!isAdmin()) && (!isInstallationPhase())) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_id=' . $ext_id. ',load_mode=' . $load_mode . ',isAdmin()=' . intval(isAdmin()) . ',isInstallationPhase()=' . intval(isInstallationPhase()) . ' - ABORT!');
- return false;
+ return FALSE;
} // END - if
// Get extension's name
} // END - if
// Init array
- initExtensionSqls(true);
+ initExtensionSqls(TRUE);
// By default no SQL has been executed
- $sqlRan = false;
+ $sqlRan = FALSE;
// Load extension in detected mode
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name[' . $ext_id . ']=' . getCurrentExtensionName() . ',load_mode=' . $load_mode);
- loadExtension(getCurrentExtensionName(), $load_mode, '0.0.0', false);
+ loadExtension(getCurrentExtensionName(), $load_mode, '0.0.0', FALSE);
// Init these SQLs
initSqls();
runFilterChain('extension_' . $load_mode);
// Remove cache file(s) if extension is active
- if (((isExtensionActive('cache')) && ((!SQL_HASZEROAFFECTED()) || ($sqlRan === true) || ($load_mode == 'activate') || ($load_mode == 'deactivate')))) {
+ if (((isExtensionActive('cache')) && ((!SQL_HASZEROAFFECTED()) || ($sqlRan === TRUE) || ($load_mode == 'activate') || ($load_mode == 'deactivate')))) {
// Run filters
runFilterChain('post_extension_run_sql', getCurrentExtensionName());
} // END - if
} // END - if
// By default non is installed
- $isInstalled = false;
+ $isInstalled = FALSE;
// Check if there is a cache entry
if (isset($GLOBALS['ext_is_installed'][$ext_name])) {
} elseif (isset($GLOBALS['cache_array']['extension']['ext_id'][$ext_name])) {
// Found!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - FOUND!');
- $isInstalled = true;
+ $isInstalled = TRUE;
// Count cache hits
incrementStatsEntry('cache_hits');
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',ext_id=' . $ext_id . ',isInstalled=' . intval($isInstalled));
// Is it installed, then cache the entry
- if ($isInstalled === true) {
+ if ($isInstalled === TRUE) {
// Dummy call (get is okay here)
- getExtensionId($ext_name, true);
+ getExtensionId($ext_name, TRUE);
} // END - if
// Remember the status
if (isInstallationPhase()) {
// Extensions are all inactive during installation
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Extensions are always inactive while installation phase. ext_name=' . $ext_name);
- return false;
+ return FALSE;
} elseif (empty($ext_name)) {
// Empty extension names must befixed
reportBug(__FUNCTION__, __LINE__, 'Empty extension name provided.');
} elseif (!isExtensionInstalled($ext_name)) {
// Not installed extensions are always inactive
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Not installed extensions are always inactive. ext_name=' . $ext_name);
- return false;
+ return FALSE;
}
// Not active is the default
}
// Get version from extensions
-function getExtensionVersion ($ext_name, $force = false) {
+function getExtensionVersion ($ext_name, $force = FALSE) {
// By default no extension is found
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - ENTERED!');
$data['ext_version'] = 'false';
}
// Extension version should not be invalid
- if (($data['ext_version'] == 'false') && ($force === false)) {
+ if (($data['ext_version'] == 'false') && ($force === FALSE)) {
// Please report this trouble
reportBug(__FUNCTION__, __LINE__, sprintf("Extension <span class=\"data\">%s</span> has empty version!", $ext_name));
} // END - if
}
// Updates a given extension with current extension version to latest version
-function updateExtension ($ext_name, $ext_ver, $isDryRun = false, $ignoreDependencies = false) {
+function updateExtension ($ext_name, $ext_ver, $isDryRun = FALSE, $ignoreDependencies = FALSE) {
// Only admins are allowed to update extensions
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',ext_ver=' . $ext_ver . ',isDryRun=' . intval($isDryRun) . ',ignoreDependencies=' . intval($ignoreDependencies) . ' - ENTERED!');
if ((!isAdmin()) || (empty($ext_name))) {
setCurrentExtensionName($ext_name);
// Is this extension update already running?
- if ((isExtensionUpdateRunning($ext_name, $ignoreDependencies)) && ($isDryRun === false)) {
+ if ((isExtensionUpdateRunning($ext_name, $ignoreDependencies)) && ($isDryRun === FALSE)) {
// This is fine but needs logging ATM
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - already in update phase, all fine.');
//* BUG: */ reportBug(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - already in update phase, please investigate!');
- return true;
+ return TRUE;
} // END - if
// Init arrays
setCurrentExtensionName($ext_depend);
// Mark it as already updated before we update it
- $GLOBALS['ext_updated'][$ext_depend] = true;
+ $GLOBALS['ext_updated'][$ext_depend] = TRUE;
// Is the extension there?
if (isExtensionInstalled($ext_depend)) {
// Update another extension first!
- $processResult = updateExtension($ext_depend, getExtensionVersion($ext_depend), isExtensionDryRun(), true);
+ $processResult = updateExtension($ext_depend, getExtensionVersion($ext_depend), isExtensionDryRun(), TRUE);
} else {
// Register new extension
$processResult = registerExtension($ext_depend, NULL, isExtensionDryRun());
} // END - for
// In real-mode execute any existing includes
- if (isExtensionDryRun() === false) {
+ if (isExtensionDryRun() === FALSE) {
$GLOBALS['ext_inc_pool'][getCurrentExtensionName()] = getIncludePool('extension');
runFilterChain('load_includes', 'extension');
setIncludePool('extension', $GLOBALS['ext_inc_pool'][getCurrentExtensionName()]);
setSqlsArray(getExtensionSqls());
// Run SQLs
- runFilterChain('run_sqls', array('dry_run' => isExtensionDryRun(), 'enable_codes' => false));
+ runFilterChain('run_sqls', array('dry_run' => isExtensionDryRun(), 'enable_codes' => FALSE));
- if (isExtensionDryRun() === false) {
+ if (isExtensionDryRun() === FALSE) {
// Run filters on success extension update
runFilterChain('extension_update', getCurrentExtensionName());
} // END - if
);
// Load row template
- $OUT .= loadTemplate('admin_extension_sql_row', true, $content);
+ $OUT .= loadTemplate('admin_extension_sql_row', TRUE, $content);
// Count up
$idx++;
);
// Load main template
- $OUT = loadTemplate('admin_extension_sql_table', true, $content);
+ $OUT = loadTemplate('admin_extension_sql_table', TRUE, $content);
} else {
// No addional SQL commands to run
- $OUT = displayMessage('{--ADMIN_EXTENSION_VERBOSE_SQLS_404--}', true);
+ $OUT = displayMessage('{--ADMIN_EXTENSION_VERBOSE_SQLS_404--}', TRUE);
}
} // END - if
// Determines whether the given extension id is valid
function isExtensionIdValid ($ext_id) {
// Default is nothing valid
- $isValid = false;
+ $isValid = FALSE;
// Check in cache then in database
if (isset($GLOBALS['cache_array']['extension']['ext_name'][$ext_id])) {
// Valid!
- $isValid = true;
+ $isValid = TRUE;
// Count cache hits
incrementStatsEntry('cache_hits');
} else {
// Query database
- $isValid = (countSumTotalData($ext_id, 'extensions', 'id', 'id', true) == 1);
+ $isValid = (countSumTotalData($ext_id, 'extensions', 'id', 'id', TRUE) == 1);
}
// Return result
}
// Deactivate given extension
-function doDeactivateExtension ($ext_name, $inRebuild = false) {
+function doDeactivateExtension ($ext_name, $inRebuild = FALSE) {
// Is the extension installed?
if (!isExtensionInstalled($ext_name)) {
// Non-installed extensions cannot be activated
createExtensionDeactivationTask($ext_name);
// Do not rebuild cache if it is already been rebuild
- if ($inRebuild === false) {
+ if ($inRebuild === FALSE) {
// Rebuild cache
rebuildCache('extension', 'extension');
} // END - if
// Load text for task if found
if (isFileReadable($FQFN)) {
// Load extension's description template (but do not compile the code)
- $message = loadTemplate('ext_' . $ext_name, true, array(), false);
+ $message = loadTemplate('ext_' . $ext_name, TRUE, array(), FALSE);
} else {
// Write this in debug.log as well
logDebugMessage(__FUNCTION__, __LINE__, $message);
}
// Task not created so it's a brand-new extension which we need to register and create a task for!
- $taskId = createNewTask($subject, $message, 'EXTENSION', 0, getCurrentAdminId(), false);
+ $taskId = createNewTask($subject, $message, 'EXTENSION', 0, getCurrentAdminId(), FALSE);
} // END - if
// Return task id
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',taskId[' . gettype($taskId) . ']=' . $taskId);
if (((is_null($taskId)) || ($taskId == '0')) && (isExtensionInstalled($ext_name))) {
// Task not created so add it
- $taskId = createNewTask($subject, SQL_ESCAPE(loadTemplate('task_EXTENSION_deactivated', true, $ext_name)), 'EXTENSION_DEACTIVATION');
+ $taskId = createNewTask($subject, SQL_ESCAPE(loadTemplate('task_EXTENSION_deactivated', TRUE, $ext_name)), 'EXTENSION_DEACTIVATION');
} // END - if
// Return task id
}
// Load template
- $out = loadTemplate('admin_extension_notes', true, $content);
+ $out = loadTemplate('admin_extension_notes', TRUE, $content);
} // END - if
// Add the notes
}
// Checks whether an update is already running for given extension
-function isExtensionUpdateRunning ($ext_name, $ignoreDependencies = false) {
+function isExtensionUpdateRunning ($ext_name, $ignoreDependencies = FALSE) {
// Current and given extensions means whole array
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currentExtension=' . getCurrentExtensionName() . ',ext_name=' . $ext_name . ',ignoreDependencies=' . intval($ignoreDependencies) . ' - ENTERED!');
if ($ext_name == getCurrentExtensionName()) {
// Default is not found
- $isRunning = false;
+ $isRunning = FALSE;
// Walk through whole array
foreach ($GLOBALS['ext_running_updates'] as $ext1 => $depends) {
// Is it found?
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext1=' . $ext1 . ',ext_name=' . $ext_name . ',depends=' . print_r($depends, true));
- if (($ext1 == $ext_name) || ((in_array($ext_name, $depends)) && ($ignoreDependencies === false))) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext1=' . $ext1 . ',ext_name=' . $ext_name . ',depends=' . print_r($depends, TRUE));
+ if (($ext1 == $ext_name) || ((in_array($ext_name, $depends)) && ($ignoreDependencies === FALSE))) {
// Found
- $isRunning = true;
+ $isRunning = TRUE;
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext1=' . $ext1 . ',ext_name=' . $ext_name . ',isRunning=true - FOUND!');
break;
} // END - if
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',key[' . gettype($key) . ']=' . $key);
// Is it valid?
- if ($key !== false) {
+ if ($key !== FALSE) {
// Then remove it
unset($GLOBALS['ext_update_depends'][getCurrentExtensionName()][$key]);
}
// Setter for EXT_REPORTS_FAILURE flag
-function enableExtensionReportingFailure ($reportsFailure = false) {
+function enableExtensionReportingFailure ($reportsFailure = FALSE) {
$GLOBALS['ext_reports_failure'] = (bool) $reportsFailure;
}
}
// Init extension notice
-function initExtensionNotes ($force = false) {
+function initExtensionNotes ($force = FALSE) {
// Is it already initialized?
- if (($force === false) && (isset($GLOBALS['ext_notes'][getCurrentExtensionName()]))) {
+ if (($force === FALSE) && (isset($GLOBALS['ext_notes'][getCurrentExtensionName()]))) {
// This is mostly not wanted, so please report it
reportBug(__FUNCTION__, __LINE__, 'ext_notes already set for extension ' . getCurrentExtensionName());
} // END - if
}
// Init SQLs array for current extension
-function initExtensionSqls ($force = false) {
+function initExtensionSqls ($force = FALSE) {
// Auto-init the array or if forced
- if (($force === true) || (!isset($GLOBALS['ext_sqls'][getCurrentExtensionName()]))) {
+ if (($force === TRUE) || (!isset($GLOBALS['ext_sqls'][getCurrentExtensionName()]))) {
// Set the array
$GLOBALS['ext_sqls'][getCurrentExtensionName()] = array();
}
// Setter for dry-run
-function enableExtensionDryRun ($isDryRun = true) {
+function enableExtensionDryRun ($isDryRun = TRUE) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getCurrentExtensionName()='.getCurrentExtensionName().',isDryRun='.intval($isDryRun));
$GLOBALS['ext_isDryRun'] = (bool) $isDryRun;
}
$key = array_search($ext_name, $cacheArray);
// Is it there?
- if ($key !== false) {
+ if ($key !== FALSE) {
// Found, so remove it
unset($cacheArray[$key]);
$GLOBALS['cache_array']['extension'][$cacheName] = $cacheArray;
addExtensionSql('DROP TABLE `{?_MYSQL_PREFIX?}_' . $tableName . '`');
// Mark it as gone
- $GLOBALS['ifSqlTableExists'][$tableName] = false;
+ $GLOBALS['ifSqlTableExists'][$tableName] = FALSE;
} // END - if
}
addExtensionSql('RENAME TABLE `{?_MYSQL_PREFIX?}_' . $fromTable . '` TO `{?_MYSQL_PREFIX?}_' . $toTable . '`');
// Mark both tables
- $GLOBALS['ifSqlTableExists'][$fromTable] = false;
- $GLOBALS['ifSqlTableExists'][$toTable] = true;
+ $GLOBALS['ifSqlTableExists'][$fromTable] = FALSE;
+ $GLOBALS['ifSqlTableExists'][$toTable] = TRUE;
} // END - if
}
// Is the 'subject' there?
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ifSqlTableExists(points_data)=' . ifSqlTableExists('points_data') . ',getExtensionMode()=' . getExtensionMode() . ',add=' . $add);
- if (((!ifSqlTableExists('points_data')) && ((getExtensionMode() == 'register') || (getExtensionMode() == 'update'))) || (countSumTotalData($subject, 'points_data', 'id', 'subject', true, $add) == 0)) {
+ if (((!ifSqlTableExists('points_data')) && ((getExtensionMode() == 'register') || (getExtensionMode() == 'update'))) || (countSumTotalData($subject, 'points_data', 'id', 'subject', TRUE, $add) == 0)) {
// Not found so:
if ((isset($GLOBALS['previous_extension'][getCurrentExtensionName()])) && (!ifSqlTableExists('points_data'))) {
$dummy = $GLOBALS['previous_extension'][getCurrentExtensionName()];
} // END - if
// Is the 'subject' there?
- if (countSumTotalData($subject, 'points_data', 'id', 'subject', true, $add) == 1) {
+ if (countSumTotalData($subject, 'points_data', 'id', 'subject', TRUE, $add) == 1) {
// Found one or more, so add an SQL query
addExtensionSql(sprintf("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_points_data` WHERE `subject`='%s'" . $add . " LIMIT 1",
$subject
// Enables/disables productive mode for current extension (used only while
// registration).
// @TODO This should be rewrittten to allow, more development states, e.g. 'planing','alpha','beta','beta2','stable'
-function enableExtensionProductive ($isProductive = true) {
+function enableExtensionProductive ($isProductive = TRUE) {
// Log debug message
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . getCurrentExtensionName() . ',isProductive=', intval($isProductive));
} // END - if
// Determine it
- $GLOBALS[__FUNCTION__][$ext_name] = ((isset($GLOBALS['ext_productive'][$ext_name])) && ($GLOBALS['ext_productive'][$ext_name] === true));
+ $GLOBALS[__FUNCTION__][$ext_name] = ((isset($GLOBALS['ext_productive'][$ext_name])) && ($GLOBALS['ext_productive'][$ext_name] === TRUE));
} // END - if
// Return result
// Mark it
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',ext_loaded=true');
- $GLOBALS['ext_loaded']['ext_name'][$ext_name] = true;
+ $GLOBALS['ext_loaded']['ext_name'][$ext_name] = TRUE;
}
// Determine whether the given extension is already loaded
function isExtensionLoaded ($ext_name) {
// Is it there?
- return ((isset($GLOBALS['ext_loaded']['ext_name'][$ext_name])) && ($GLOBALS['ext_loaded']['ext_name'][$ext_name] === true));
+ return ((isset($GLOBALS['ext_loaded']['ext_name'][$ext_name])) && ($GLOBALS['ext_loaded']['ext_name'][$ext_name] === TRUE));
}
// Mark extension's library file as loaded
} // END - if
// Mark it
- $GLOBALS['ext_loaded']['library'][$ext_name] = true;
+ $GLOBALS['ext_loaded']['library'][$ext_name] = TRUE;
}
// Determine whether the given extension's library is already loaded
function isExtensionLibraryLoaded ($ext_name) {
// Is it there?
- return ((isset($GLOBALS['ext_loaded']['library'][$ext_name])) && ($GLOBALS['ext_loaded']['library'][$ext_name] === true));
+ return ((isset($GLOBALS['ext_loaded']['library'][$ext_name])) && ($GLOBALS['ext_loaded']['library'][$ext_name] === TRUE));
}
// [EOF]
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_active'");
// Unregister filter
- unregisterFilter(__FILE__, __LINE__, 'online_extra_links', 'ADD_LINK_ACTIVE_LIST', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'online_extra_links', 'ADD_LINK_ACTIVE_LIST', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
addExtensionDependency('online');
// Register filter
- registerFilter(__FILE__, __LINE__, 'online_extra_links', 'ADD_LINK_ACTIVE_LIST', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'online_extra_links', 'ADD_LINK_ACTIVE_LIST', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter für den "Wer ist Online" Block hinzugefügt und ist von <strong>online</strong> abhängig.");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` DROP `default_acl`");
// Remove filters
- unregisterFilter(__FILE__, __LINE__, 'sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'do_admin_login_done', 'RESET_ADMINS_LOGIN_FAILURES', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'do_admin_login_pass', 'COUNT_ADMINS_LOGIN_FAILURE', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'do_admin_login_done', 'REHASH_ADMINS_PASSWORD', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'do_admin_login_done', 'RESET_ADMINS_LOGIN_FAILURES', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'do_admin_login_pass', 'COUNT_ADMINS_LOGIN_FAILURE', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'do_admin_login_done', 'REHASH_ADMINS_PASSWORD', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
addExtensionDependency('sql_patches');
// Add filters
- registerFilter(__FILE__, __LINE__, 'sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter hinzugefügt und ist von <strong>sql_patches</strong> abhängig.");
case '0.7.4': // SQL queries for v0.7.4
// Add filter
- registerFilter(__FILE__, __LINE__, 'do_admin_login_done', 'RESET_ADMINS_LOGIN_FAILURES', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'do_admin_login_pass', 'COUNT_ADMINS_LOGIN_FAILURE', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'do_admin_login_done', 'RESET_ADMINS_LOGIN_FAILURES', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'do_admin_login_pass', 'COUNT_ADMINS_LOGIN_FAILURE', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter hinzugefuegt.");
case '0.7.5': // SQL queries for v0.7.5
// Add filter
- registerFilter(__FILE__, __LINE__, 'do_admin_login_done', 'REHASH_ADMINS_PASSWORD', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'do_admin_login_done', 'REHASH_ADMINS_PASSWORD', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter zum Rehashen des Adminpassworts nach erfolgtem Login hinzugefügt.");
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `module`='beg' LIMIT 1");
// Unregister filter
- unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'BEG_RALLYE_USER_REGISTRATION_ADD_SQL_COLUMNS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'init', 'BEG_PURGE_IPS_NOTIFY_USER', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'BEG_RALLYE_USER_REGISTRATION_ADD_SQL_COLUMNS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'init', 'BEG_PURGE_IPS_NOTIFY_USER', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
case '0.3.3': // SQL queries for v0.3.3
// Register a filter
- registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'BEG_RALLYE_USER_REGISTRATION_ADD_SQL_COLUMNS', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'init', 'BEG_PURGE_IPS_NOTIFY_USER', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'BEG_RALLYE_USER_REGISTRATION_ADD_SQL_COLUMNS', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'init', 'BEG_PURGE_IPS_NOTIFY_USER', FALSE, TRUE, isExtensionDryRun());
// This depends on ext-register
addExtensionDependency('register');
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
unregisterExtensionPointsData('monthly_bonus');
// Unregister filter
- unregisterFilter(__FILE__, __LINE__, 'member_login_check', 'ADD_LOGIN_BONUS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'generate_admin_mail_links', 'GENERATE_BONUS_MAIL_LINKS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'add_bonus_points_user_columns', 'ADD_BONUS_POINTS_USER_COLUMNS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'BONUS_USER_REGISTRATION_ADD_SQL_COLUMNS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'init', 'SEND_BONUS_NOTIFICATIONS', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'member_login_check', 'ADD_LOGIN_BONUS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'generate_admin_mail_links', 'GENERATE_BONUS_MAIL_LINKS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'add_bonus_points_user_columns', 'ADD_BONUS_POINTS_USER_COLUMNS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'BONUS_USER_REGISTRATION_ADD_SQL_COLUMNS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'init', 'SEND_BONUS_NOTIFICATIONS', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
case '0.9.0': // SQL queries for v0.9.0
// Register filter
- registerFilter(__FILE__, __LINE__, 'member_login_check', 'ADD_LOGIN_BONUS', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'member_login_check', 'ADD_LOGIN_BONUS', FALSE, TRUE, isExtensionDryRun());
// Update notes
setExtensionUpdateNotes("Filter hinzugefügt der den Login-Bonus aktualisiert (bzw. soll) (internes TODO).");
case '0.9.5': // SQL queries for v0.9.5
// Register filter
- registerFilter(__FILE__, __LINE__, 'generate_admin_mail_links', 'GENERATE_BONUS_MAIL_LINKS', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'generate_admin_mail_links', 'GENERATE_BONUS_MAIL_LINKS', FALSE, TRUE, isExtensionDryRun());
// Update notes
setExtensionUpdateNotes("Filter zum Generieren von Admin-Links für Bonus-Mails hinzugefügt.");
addConfigChangeSql('bonus_click_yn', 'include_bonus_click', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
// Register filter
- registerFilter(__FILE__, __LINE__, 'add_bonus_points_user_columns', 'ADD_BONUS_POINTS_USER_COLUMNS', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'add_bonus_points_user_columns', 'ADD_BONUS_POINTS_USER_COLUMNS', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Konfigurationseinträge umbenannt.");
case '0.9.8': // SQL queries for v0.9.8
// Register filter
- registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'BONUS_USER_REGISTRATION_ADD_SQL_COLUMNS', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'BONUS_USER_REGISTRATION_ADD_SQL_COLUMNS', FALSE, TRUE, isExtensionDryRun());
// Add dependency to ext-register
addExtensionDependency('register');
case '0.9.9': // SQL queries for v0.9.9
// Register filter
- registerFilter(__FILE__, __LINE__, 'init', 'SEND_BONUS_NOTIFICATIONS', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'init', 'SEND_BONUS_NOTIFICATIONS', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter zum Hinzufügen von SQL-Spalten bei der Mitgliederanmeldung.");
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
addMemberMenuSql('main', 'booking', '{OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Kontoauszug', 5);
// Add the filters
- registerFilter(__FILE__, __LINE__, 'post_add_points', 'ADD_BOOKING_RECORD', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'post_sub_points', 'ADD_BOOKING_RECORD', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'member_admin_actions', 'ADD_BOOKING_MEMBER_ACTION', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'post_add_points', 'ADD_BOOKING_RECORD', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'post_sub_points', 'ADD_BOOKING_RECORD', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'member_admin_actions', 'ADD_BOOKING_MEMBER_ACTION', FALSE, TRUE, isExtensionDryRun());
break;
case 'remove': // Do stuff when removing extension
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='booking'");
// Remove the filters
- unregisterFilter(__FILE__, __LINE__, 'post_add_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'post_sub_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'member_admin_actions', 'ADD_BOOKING_MEMBER_ACTION', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_add_points', 'ADD_BOOKING_RECORD', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_sub_points', 'ADD_BOOKING_RECORD', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'member_admin_actions', 'ADD_BOOKING_MEMBER_ACTION', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('cache_stats','config_config')");
// Unregister all filters
- unregisterFilter(__FILE__, __LINE__, 'extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'post_extension_installed', 'CACHE_DESTROY_ON_EXT_CHANGE', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'post_extension_run_sql', 'CACHE_DESTROY_ON_EXT_CHANGE', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'post_admin_added', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'post_form_submited', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'post_form_deleted', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'post_form_reset_pass', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'extension_remove', 'CACHE_DESTROY_ALL', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'shutdown', 'CACHE_DESTROY_FILTER', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_extension_installed', 'CACHE_DESTROY_ON_EXT_CHANGE', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_extension_run_sql', 'CACHE_DESTROY_ON_EXT_CHANGE', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_admin_added', 'CACHE_DESTROY_ON_ADMIN_CHANGE', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_form_submited', 'CACHE_DESTROY_ON_ADMIN_CHANGE', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_form_deleted', 'CACHE_DESTROY_ON_ADMIN_CHANGE', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_form_reset_pass', 'CACHE_DESTROY_ON_ADMIN_CHANGE', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'extension_remove', 'CACHE_DESTROY_ALL', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'shutdown', 'CACHE_DESTROY_FILTER', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
case '0.2.1': // SQL queries for v0.2.1
// Register the new filter
- registerFilter(__FILE__, __LINE__, 'extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'post_extension_installed', 'CACHE_DESTROY_ON_EXT_CHANGE', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'post_extension_run_sql', 'CACHE_DESTROY_ON_EXT_CHANGE', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'post_admin_added', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'post_form_submited', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'post_form_deleted', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'post_form_reset_pass', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'extension_remove', 'CACHE_DESTROY_ALL', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'post_extension_installed', 'CACHE_DESTROY_ON_EXT_CHANGE', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'post_extension_run_sql', 'CACHE_DESTROY_ON_EXT_CHANGE', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'post_admin_added', 'CACHE_DESTROY_ON_ADMIN_CHANGE', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'post_form_submited', 'CACHE_DESTROY_ON_ADMIN_CHANGE', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'post_form_deleted', 'CACHE_DESTROY_ON_ADMIN_CHANGE', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'post_form_reset_pass', 'CACHE_DESTROY_ON_ADMIN_CHANGE', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'extension_remove', 'CACHE_DESTROY_ALL', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter für Erweiterungsmanagement hinzugefügt.");
setExtensionUpdateNotes("Cachen von Filtern hinzugefügt.");
// Register a new filter
- registerFilter(__FILE__, __LINE__, 'shutdown', 'CACHE_DESTROY_FILTER', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'shutdown', 'CACHE_DESTROY_FILTER', FALSE, TRUE, isExtensionDryRun());
break;
case '0.2.4': // SQL queries for v0.2.4
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='country'");
// Unregister filter
- unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'COUNTRY_USER_REGISTRATION_ADD_SQL_COLUMNS', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'COUNTRY_USER_REGISTRATION_ADD_SQL_COLUMNS', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
case '0.0.5': // SQL queries for v0.0.5
// Register a filter
- registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'COUNTRY_USER_REGISTRATION_ADD_SQL_COLUMNS', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'COUNTRY_USER_REGISTRATION_ADD_SQL_COLUMNS', FALSE, TRUE, isExtensionDryRun());
// This depends on ext-register
addExtensionDependency('register');
addMemberMenuSql('coupon', 'list_coupon', 'Eingelöste auflisten', 2);
// Add filter (for changing user_points column dynamically
- registerFilter(__FILE__, __LINE__, 'determine_points_column_name', 'COUPON_CHANGE_POINTS_COLUMN_NAME', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'determine_points_column_name', 'COUPON_CHANGE_POINTS_COLUMN_NAME', FALSE, TRUE, isExtensionDryRun());
break;
case 'remove': // Do stuff when removing extension
unregisterExtensionPointsData('coupon_cashed');
// Remove all filters
- unregisterFilter(__FILE__, __LINE__, 'determine_points_column_name', 'COUPON_CHANGE_POINTS_COLUMN_NAME', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'post_cash_coupon', 'POST_CASH_COUPON', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'determine_points_column_name', 'COUPON_CHANGE_POINTS_COLUMN_NAME', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_cash_coupon', 'POST_CASH_COUPON', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
break;
case '0.0.3': // SQL queries for v0.0.3
- registerFilter(__FILE__, __LINE__, 'post_cash_coupon', 'POST_CASH_COUPON', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'post_cash_coupon', 'POST_CASH_COUPON', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes('Filter zum Post- und Pre-Filter hinzugefügt.');
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
setExtensionAlwaysActive('Y');
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
setExtensionVersionHistory(array('0.0.0', '0.0.1'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
'User->Earning connections');
// Register filter
- registerFilter(__FILE__, __LINE__, 'member_footer_extras', 'ADD_EARNING_GROUP_POPUP', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'member_footer_extras', 'ADD_EARNING_GROUP_POPUP', FALSE, TRUE, isExtensionDryRun());
break;
case 'remove': // Do stuff when removing extension
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='list_earning' LIMIT 1");
// Unregister filter
- unregisterFilter(__FILE__, __LINE__, 'member_footer_extras', 'ADD_EARNING_GROUP_POPUP', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'member_footer_extras', 'ADD_EARNING_GROUP_POPUP', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_earning_data` (`earning_group`, `earning_provider`, `earning_sorting`) VALUES ('POPUP','FORCED_POPUP',1)");
// Register filters
- registerFilter(__FILE__, __LINE__, 'add_forced_ads_types', 'FORCED_AD_TYPE_DEFAULTS', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'member_earning_table_data', 'FORCED_POPUP_TABLE_DATA', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'post_change_forced_campaign_status', 'FORCED_CHANGE_CAMPAIGN_STATUS', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'pre_change_forced_campaign_status', 'FORCED_CHANGE_CAMPAIGN_VALIDATE_DATA', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'add_forced_ads_types', 'FORCED_AD_TYPE_DEFAULTS', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'member_earning_table_data', 'FORCED_POPUP_TABLE_DATA', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'post_change_forced_campaign_status', 'FORCED_CHANGE_CAMPAIGN_STATUS', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'pre_change_forced_campaign_status', 'FORCED_CHANGE_CAMPAIGN_VALIDATE_DATA', FALSE, TRUE, isExtensionDryRun());
break;
case 'remove': // Do stuff when removing extension
} // END - if
// Remove filter
- unregisterFilter(__FILE__, __LINE__, 'add_forced_ads_types', 'FORCED_AD_TYPE_DEFAULTS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'member_earning_table_data', 'FORCED_POPUP_TABLE_DATA', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'post_change_forced_campaign_status', 'FORCED_CHANGE_CAMPAIGN_STATUS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'pre_change_forced_campaign_status', 'FORCED_CHANGE_CAMPAIGN_VALIDATE_DATA', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'add_forced_ads_types', 'FORCED_AD_TYPE_DEFAULTS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'member_earning_table_data', 'FORCED_POPUP_TABLE_DATA', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_change_forced_campaign_status', 'FORCED_CHANGE_CAMPAIGN_STATUS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'pre_change_forced_campaign_status', 'FORCED_CHANGE_CAMPAIGN_VALIDATE_DATA', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
addExtensionSql('');
// Add the filters
- registerFilter(__FILE__, __LINE__, 'post_add_points', 'UPDATE_MEDIADATA_ENTRY', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'post_sub_points', 'UPDATE_MEDIADATA_ENTRY', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'post_add_points', 'UPDATE_MEDIADATA_ENTRY', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'post_sub_points', 'UPDATE_MEDIADATA_ENTRY', FALSE, TRUE, isExtensionDryRun());
break;
case 'remove': // Do stuff when removing extension
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='mediadata'");
// Remove the filters
- unregisterFilter(__FILE__, __LINE__, 'post_add_points', 'UPDATE_MEDIADATA_ENTRY', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'post_sub_points', 'UPDATE_MEDIADATA_ENTRY', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_add_points', 'UPDATE_MEDIADATA_ENTRY', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_sub_points', 'UPDATE_MEDIADATA_ENTRY', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.2.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='online'");
// Unregister filter
- unregisterFilter(__FILE__, __LINE__, 'init', 'UPDATE_ONLINE_LIST', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'init', 'UPDATE_ONLINE_LIST', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
addGuestMenuSql('online', NULL, 'Jetzt Online', 2);
// Register filter
- registerFilter(__FILE__, __LINE__, 'init', 'UPDATE_ONLINE_LIST', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'init', 'UPDATE_ONLINE_LIST', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Hinzufügen des Menüpunktes "Jetzt Online" wird nun von dieser Erweiterung erledigt. Filter hinzugefügt.");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='order'");
// Remove these filters
- unregisterFilter(__FILE__, __LINE__, 'get_total_points', 'ORDER_POINTS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'get_own_points', 'ORDER_POINTS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'get_locked_points', 'LOCKED_ORDER_POINTS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'get_all_point_columns', 'GET_ALL_ORDER_POINTS_COLUMN_NAMES', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'user_exclusion_sql', 'ORDER_ZIP_CODE_SQL', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'locked_points_columns_array', 'ORDER_POINTS_COLUMNS', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'get_total_points', 'ORDER_POINTS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'get_own_points', 'ORDER_POINTS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'get_locked_points', 'LOCKED_ORDER_POINTS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'get_all_point_columns', 'GET_ALL_ORDER_POINTS_COLUMN_NAMES', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'user_exclusion_sql', 'ORDER_ZIP_CODE_SQL', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'locked_points_columns_array', 'ORDER_POINTS_COLUMNS', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
addExtensionDependency('user');
// Register filters for gathering points
- registerFilter(__FILE__, __LINE__, 'get_total_points', 'ORDER_POINTS', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'get_own_points', 'ORDER_POINTS', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'get_total_points', 'ORDER_POINTS', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'get_own_points', 'ORDER_POINTS', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Weiteres Verwendungszwecke "Werbeguthaben" hinzugefügt (verschoben von ext-user) und neue Filter zum Zurückliefern des Werbeguthabens hinzugefügt.");
case '0.5.4': // SQL queries for v0.5.4
// Register filter for handling locked points
- registerFilter(__FILE__, __LINE__, 'get_locked_points', 'LOCKED_ORDER_POINTS', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'get_locked_points', 'LOCKED_ORDER_POINTS', FALSE, TRUE, isExtensionDryRun());
// Register filter for all column names
- registerFilter(__FILE__, __LINE__, 'get_all_point_columns', 'GET_ALL_ORDER_POINTS_COLUMN_NAMES', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'get_all_point_columns', 'GET_ALL_ORDER_POINTS_COLUMN_NAMES', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter für gesperrtes Werbeguthaben hinzugefügt.");
case '0.5.5': // SQL queries for v0.5.5
// Register filter
- registerFilter(__FILE__, __LINE__, 'user_exclusion_sql', 'ORDER_ZIP_CODE_SQL', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'user_exclusion_sql', 'ORDER_ZIP_CODE_SQL', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter für gesperrtes Werbeguthaben hinzugefügt.");
case '0.5.6': // SQL queries for v0.5.6
// Register filter
- registerFilter(__FILE__, __LINE__, 'locked_points_columns_array', 'ORDER_POINTS_COLUMNS', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'locked_points_columns_array', 'ORDER_POINTS_COLUMNS', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter für Spaltenname des gesperrten Werbeguthabens hinzugefügt.");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_other'");
// Unregister filter
- unregisterFilter(__FILE__, __LINE__, 'page_footer', 'DISPLAY_DEBUG_SQL', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'page_footer', 'DISPLAY_DEBUG_SQL', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
case '0.2.4': // SQL queries for v0.2.4
// Register filter
- registerFilter(__FILE__, __LINE__, 'page_footer', 'DISPLAY_DEBUG_SQL', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'page_footer', 'DISPLAY_DEBUG_SQL', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter zum Anzeigen (Debug) von ausgeführten SQL-Anweisungen hinzugefügt.");
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
addAdminMenuSql('config','config_politician_stop','Politiker-Stopp-Aktion','Einstellungen zur Satire-Aktion "Politiker-Stopp - Jetzt wird zurück zensiert."', 7);
// Register filter
- registerFilter(__FILE__, __LINE__, 'outside_masterbox', 'DISPLAY_POLITICIAN_STOP_SNIPPET', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'outside_masterbox', 'DISPLAY_POLITICIAN_STOP_SNIPPET', FALSE, TRUE, isExtensionDryRun());
break;
case 'remove': // Do stuff when removing extension
// Unregister filter
- unregisterFilter(__FILE__, __LINE__, 'outside_masterbox', 'DISPLAY_POLITICIAN_STOP_SNIPPET', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'outside_masterbox', 'DISPLAY_POLITICIAN_STOP_SNIPPET', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
unregisterExtensionPointsData('rallye_winner');
// Unregister filter
- unregisterFilter(__FILE__, __LINE__, 'extra_autopurge', 'RALLYE_EXTRA_AUTOPURGE', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'init', 'RALLYE_NOTIFY_USERS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'add_rallye_notify_sqls', 'ADD_RALLYE_SQL_COLUMNS', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'extra_autopurge', 'RALLYE_EXTRA_AUTOPURGE', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'init', 'RALLYE_NOTIFY_USERS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'add_rallye_notify_sqls', 'ADD_RALLYE_SQL_COLUMNS', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
addExtensionDependency('sql_patches');
// Register filter
- registerFilter(__FILE__, __LINE__, 'extra_autopurge', 'RALLYE_EXTRA_AUTOPURGE', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'extra_autopurge', 'RALLYE_EXTRA_AUTOPURGE', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter hinzugefügt und ist von <strong>sql_patches</strong> abhängig.");
case '0.3.7': // SQL queries for v0.3.7
// Register filter
- registerFilter(__FILE__, __LINE__, 'init', 'RALLYE_NOTIFY_USERS', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'add_rallye_notify_sqls', 'ADD_RALLYE_SQL_COLUMNS', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'init', 'RALLYE_NOTIFY_USERS', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'add_rallye_notify_sqls', 'ADD_RALLYE_SQL_COLUMNS', FALSE, TRUE, isExtensionDryRun());
// Update notes
setExtensionUpdateNotes("Weitere Filter hinzugefügt.");
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
unregisterExtensionPointsData('referral_bonus_ref');
// Unregister filter
- unregisterFilter(__FILE__, __LINE__, 'register_must_fillout', 'REGISTER_MUST_FILLOUT', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'PRE_USER_REGISTRATION_GENERIC', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'register_must_fillout', 'REGISTER_MUST_FILLOUT', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'PRE_USER_REGISTRATION_GENERIC', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
case '0.5.3': // SQL queries for v0.5.3
// Register a filter
- registerFilter(__FILE__, __LINE__, 'register_must_fillout', 'REGISTER_MUST_FILLOUT', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'register_must_fillout', 'REGISTER_MUST_FILLOUT', FALSE, TRUE, isExtensionDryRun());
// Run these SQLs
addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('gender','Y')");
case '0.5.7': // SQL queries for v0.5.7
// Register a filter
- registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'PRE_USER_REGISTRATION_GENERIC', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'PRE_USER_REGISTRATION_GENERIC', FALSE, TRUE, isExtensionDryRun());
// Register points data
registerExtensionPointsData('referral_bonus', 'points', 'LOCKED', 'DIRECT');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_removeip' LIMIT 1");
// Remove filters
- unregisterFilter(__FILE__, __LINE__, 'post_youhere_line', 'ADD_ANONYMITY_NOTICE', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_youhere_line', 'ADD_ANONYMITY_NOTICE', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
addExtensionDependency('sql_patches');
// Add filters
- registerFilter(__FILE__, __LINE__, 'post_youhere_line', 'ADD_ANONYMITY_NOTICE', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'post_youhere_line', 'ADD_ANONYMITY_NOTICE', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter hinzugefügt und ist von <strong>sql_patches</strong> abhängig.");
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
case 'register': // Do stuff when installation is running
// Check if mod_rewrite is loadeded
if (!isApacheModuleLoaded('mod_rewrite')) {
- enableExtensionReportingFailure(true);
+ enableExtensionReportingFailure(TRUE);
addFatalMessage(__FILE__, __LINE__, '{--MOD_REWRITE_ERROR--}');
} // END - if
// Check if mod_rewrite is loadeded
if (!isApacheModuleLoaded('mod_rewrite')) {
SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='N' WHERE `ext_name`='rewrite' LIMIT 1", __FILE__, __LINE__);
- enableExtensionReportingFailure(true);
+ enableExtensionReportingFailure(TRUE);
addFatalMessage(__FILE__, __LINE__, '{--MOD_REWRITE_ERROR--}');
} // END - if
case '0.1.3':
// Check if mod_rewrite is loadeded
if (!isApacheModuleLoaded('mod_rewrite')) {
- enableExtensionReportingFailure(true);
+ enableExtensionReportingFailure(TRUE);
//addFatalMessage(__FILE__, __LINE__, '{--MOD_REWRITE_ERROR--}');
} // END - if
setExtensionUpdateNotes("Es wird beim Registrieren und aktivieren geprüft, ob im Apache das Modul mod_rewrite geladen wurde. Wenn mod_rewrite nicht gefunden werden konnte, wird abgebrochen.");
case 'init': // Do stuff when extension is initialized
// Check if mod_rewrite is loadeded
if (!isApacheModuleLoaded('mod_rewrite')) {
- enableExtensionReportingFailure(true);
+ enableExtensionReportingFailure(TRUE);
SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='N' WHERE `ext_name`='rewrite' LIMIT 1", __FILE__, __LINE__);
if (!isAdmin()) {
addFatalMessage(__FILE__, __LINE__, '{--MOD_REWRITE_ERROR--}');
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installtion is running
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installtion is running
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
unregisterExtensionPointsData('admin_add_all_ref');
// Unregister filter
- unregisterFilter(__FILE__, __LINE__, 'member_login_check', 'RESET_USER_LOGIN_FAILURE', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'add_history_entry', 'ADD_HISTORY_ENTRY', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'init', 'GENERATE_FILE_SECRET_HASH', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'member_login_check', 'RESET_USER_LOGIN_FAILURE', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'add_history_entry', 'ADD_HISTORY_ENTRY', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'init', 'GENERATE_FILE_SECRET_HASH', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
case '0.6.9': // SQL queries for 0.6.9
// Register filter
- registerFilter(__FILE__, __LINE__, 'member_login_check', 'RESET_USER_LOGIN_FAILURE', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'member_login_check', 'RESET_USER_LOGIN_FAILURE', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter zum Zurücksetzens des fehlgeschlagenen Mitgliederlogins hinzugefügt (internes TODO).");
addConfigAddSql('dns_cache_timeout', 'BIGINT(20) NOT NULL DEFAULT ' . (60*60*24));
// Register filter
- registerFilter(__FILE__, __LINE__, 'reset', 'CLEANUP_DNS_CACHE', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'reset', 'CLEANUP_DNS_CACHE', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("IP-Resolver-Klasse hinzugefügt, um bei der Erweiterung ext-network DNS-Anfragen einzusparen.");
'History of used data');
// Register filter
- registerFilter(__FILE__, __LINE__, 'add_history_entry', 'ADD_HISTORY_ENTRY', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'add_history_entry', 'ADD_HISTORY_ENTRY', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Allgemeine Historie-Tabelle hinzugefügt.");
case '0.9.0': // SQL queries for v0.9.0
// Register filter
- registerFilter(__FILE__, __LINE__, 'init', 'GENERATE_FILE_SECRET_HASH', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'init', 'GENERATE_FILE_SECRET_HASH', FALSE, TRUE, isExtensionDryRun());
// Register points data
registerExtensionPointsData('admin_add_single', 'points', 'LOCKED', 'DIRECT');
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
addExtensionDependency('sql_patches');
// Register filters
- registerFilter(__FILE__, __LINE__, 'post_change_surfbar_url_status', 'SURFBAR_CHANGE_URL_STATUS', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'pre_change_surfbar_url_status', 'SURFBAR_CHANGE_URL_VALIDATE_DATA', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'post_change_surfbar_url_status', 'SURFBAR_CHANGE_URL_STATUS', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'pre_change_surfbar_url_status', 'SURFBAR_CHANGE_URL_VALIDATE_DATA', FALSE, TRUE, isExtensionDryRun());
break;
case 'remove': // Do stuff when removing extension
unregisterExtensionPointsData('monthly_surfbar');
// Unregister filter
- unregisterFilter(__FILE__, __LINE__, 'post_change_surfbar_url_status', 'SURFBAR_CHANGE_URL_STATUS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'pre_change_surfbar_url_status', 'SURFBAR_CHANGE_URL_VALIDATE_DATA', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_change_surfbar_url_status', 'SURFBAR_CHANGE_URL_STATUS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'pre_change_surfbar_url_status', 'SURFBAR_CHANGE_URL_VALIDATE_DATA', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='themes' OR `what`='themes'");
// Unregister filters
- unregisterFilter(__FILE__, __LINE__, 'init', 'HANDLE_THEME_CHANGE', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'member_login_check', 'SET_USERS_THEME', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'THEME_USER_REGISTRATION_ADD_SQL_COLUMNS', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'init', 'HANDLE_THEME_CHANGE', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'member_login_check', 'SET_USERS_THEME', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'THEME_USER_REGISTRATION_ADD_SQL_COLUMNS', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
case '0.1.0': // SQL queries for v0.1.0
// Register filter
- registerFilter(__FILE__, __LINE__, 'init', 'HANDLE_THEME_CHANGE', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'init', 'HANDLE_THEME_CHANGE', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Ändern des Designs nun im Filter (internes TODO).");
case '0.1.1': // SQL queries for v0.1.1
// Register filter
- registerFilter(__FILE__, __LINE__, 'member_login_check', 'SET_USERS_THEME', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'member_login_check', 'SET_USERS_THEME', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Setzen des Mitgliedes' eigener Design-Auswahl per Filter (internes TODO).");
case '0.1.3': // SQL queries for v0.1.3
// Register filter
- registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'THEME_USER_REGISTRATION_ADD_SQL_COLUMNS', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'THEME_USER_REGISTRATION_ADD_SQL_COLUMNS', FALSE, TRUE, isExtensionDryRun());
// This depends on ext-register
addExtensionDependency('register');
addAdminMenuSql('setup', 'config_timezone', 'Zeitzone', 'Einstellungen an der Zeitzone können hier konfiguriert werden.', 10);
// Register filter
- registerFilter(__FILE__, __LINE__, 'init', 'INIT_TIMEZONE', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'init', 'INIT_TIMEZONE', FALSE, TRUE, isExtensionDryRun());
break;
case 'remove': // Do stuff when removing extension
addExtensionSQL("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_timezone' LIMIT 1");
// Unregister filter
- unregisterFilter(__FILE__, __LINE__, 'init', 'INIT_TIMEZONE', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'init', 'INIT_TIMEZONE', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_uberwach' LIMIT 1");
// Unregister filter
- unregisterFilter(__FILE__, __LINE__, 'page_footer', 'DISPLAY_UBERWACH_SNIPPET', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'page_footer', 'DISPLAY_UBERWACH_SNIPPET', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
case 'update': // Update an extension
switch (getCurrentExtensionVersion()) {
case '0.0.1': // SQL queries for v0.0.1
- registerFilter(__FILE__, __LINE__, 'page_footer', 'DISPLAY_UBERWACH_SNIPPET', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'page_footer', 'DISPLAY_UBERWACH_SNIPPET', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter zum Anzeigen des Snippets hinzugefügt");
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what` IN ('subids')");
// Register new filters for gathering points
- unregisterFilter(__FILE__, __LINE__, 'get_total_points', 'USER_POINTS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'get_own_points', 'USER_POINTS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'get_locked_points', 'LOCKED_USER_POINTS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'get_all_point_columns', 'GET_ALL_USER_POINTS_COLUMN_NAMES', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'user_exclusion_sql', 'TESTER_USER_EXCLUSION_SQL', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'user_inclusion_sql', 'TESTER_USER_INCLUSION_SQL', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'TESTER_USER_REGISTRATION_ADD_SQL_COLUMNS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'convert_user_data_columns', 'ADD_USER_DATA_CONVERT_SQL_COLUMNS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'post_refid_validation', 'HANDLE_USER_SUBID', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'SUBID_USER_REGISTRATION_ADD_SQL_COLUMNS', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'update_referral_data', 'GENERIC_UPDATE_USER_REFERRAL', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'update_referral_data', 'UPDATE_USER_SUBID', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'member_admin_actions', 'ADD_USER_SUBID_MEMBER_ACTION', true, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'member_reflink_extra_content', 'MEMBER_REFLINK_USER_SUBIDS_CONTENT', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'get_total_points', 'USER_POINTS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'get_own_points', 'USER_POINTS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'get_locked_points', 'LOCKED_USER_POINTS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'get_all_point_columns', 'GET_ALL_USER_POINTS_COLUMN_NAMES', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'user_exclusion_sql', 'TESTER_USER_EXCLUSION_SQL', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'user_inclusion_sql', 'TESTER_USER_INCLUSION_SQL', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'TESTER_USER_REGISTRATION_ADD_SQL_COLUMNS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'convert_user_data_columns', 'ADD_USER_DATA_CONVERT_SQL_COLUMNS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_refid_validation', 'HANDLE_USER_SUBID', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'SUBID_USER_REGISTRATION_ADD_SQL_COLUMNS', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'update_referral_data', 'GENERIC_UPDATE_USER_REFERRAL', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'update_referral_data', 'UPDATE_USER_SUBID', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'member_admin_actions', 'ADD_USER_SUBID_MEMBER_ACTION', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'member_reflink_extra_content', 'MEMBER_REFLINK_USER_SUBIDS_CONTENT', TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
case '0.4.0': // SQL queries for v0.4.0
// Register new filters for gathering points
- registerFilter(__FILE__, __LINE__, 'get_total_points', 'USER_POINTS', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'get_own_points', 'USER_POINTS', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'get_total_points', 'USER_POINTS', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'get_own_points', 'USER_POINTS', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter registriert, die das eigene {?POINTS?}-Guthaben des Mitgliedes zurückliefern.");
addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `last_module` `last_what` VARCHAR(255) NULL DEFAULT NULL');
// Register filter locked points
- registerFilter(__FILE__, __LINE__, 'get_locked_points', 'LOCKED_USER_POINTS', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'get_locked_points', 'LOCKED_USER_POINTS', FALSE, TRUE, isExtensionDryRun());
// Register filter for all column names
- registerFilter(__FILE__, __LINE__, 'get_all_point_columns', 'GET_ALL_USER_POINTS_COLUMN_NAMES', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'get_all_point_columns', 'GET_ALL_USER_POINTS_COLUMN_NAMES', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Die Spalte <strong>last_module</strong> ist nach <strong>last_what</strong> umbenannt und hat nun NULL als Ausgangswert und Filter für gesperrtes Guthaben hinzugefügt.");
addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `zip` `zip` INT(6) NOT NULL DEFAULT 0');
// Register filter for WHERE/AND exclusion/inclusion statements
- registerFilter(__FILE__, __LINE__, 'user_exclusion_sql', 'TESTER_USER_EXCLUSION_SQL', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'user_inclusion_sql', 'TESTER_USER_INCLUSION_SQL', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'user_exclusion_sql', 'TESTER_USER_EXCLUSION_SQL', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'user_inclusion_sql', 'TESTER_USER_INCLUSION_SQL', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Es können nun Test-Benutzer angelegt werden. Noch müssen diese überall ausgeschlossen werden, damit die Mediadaten nicht unnötig verfälscht werden.");
case '0.5.1': // SQL queries for v0.5.1
// Register a filter
- registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'TESTER_USER_REGISTRATION_ADD_SQL_COLUMNS', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'TESTER_USER_REGISTRATION_ADD_SQL_COLUMNS', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter zum Hinzufügen von SQL-Spalten für die Mitgliederanmeldung hinzugefügt.");
case '0.5.2': // SQL queries for v0.5.2
// Register a filter
- registerFilter(__FILE__, __LINE__, 'convert_user_data_columns', 'ADD_USER_DATA_CONVERT_SQL_COLUMNS', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'convert_user_data_columns', 'ADD_USER_DATA_CONVERT_SQL_COLUMNS', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter zum Hinzufügen von SQL-Spalten für die Mitgliederanmeldung hinzugefügt.");
case '0.5.3': // SQL queries for v0.5.3
// Register filter
- registerFilter(__FILE__, __LINE__, 'post_refid_validation', 'HANDLE_USER_SUBID', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'SUBID_USER_REGISTRATION_ADD_SQL_COLUMNS', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'post_refid_validation', 'HANDLE_USER_SUBID', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'SUBID_USER_REGISTRATION_ADD_SQL_COLUMNS', FALSE, TRUE, isExtensionDryRun());
// Admin menu
addAdminMenuSql('user', 'list_user_subid', 'Sub-Ids', 'Listet alle pro vom Mitglied eingegebenen Sub-Ids und ermittelten Referral-URLs auf.', 7);
case '0.5.4': // SQL queries for v0.5.4
// Register filter
- registerFilter(__FILE__, __LINE__, 'update_referral_data', 'GENERIC_UPDATE_USER_REFERRAL', false, true, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'update_referral_data', 'UPDATE_USER_SUBID', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'update_referral_data', 'GENERIC_UPDATE_USER_REFERRAL', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'update_referral_data', 'UPDATE_USER_SUBID', FALSE, TRUE, isExtensionDryRun());
// Add user agent
addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_subid_log` ADD `user_agent` TINYTEXT NOT NULL AFTER `remote_address`');
case '0.5.5': // SQL queries for v0.5.5
// Register filter
- registerFilter(__FILE__, __LINE__, 'member_admin_actions', 'ADD_USER_SUBID_MEMBER_ACTION', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'member_admin_actions', 'ADD_USER_SUBID_MEMBER_ACTION', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Weiteren Filter für Mitglieder-Aktionen im Adminbereich hinzugefügt.");
case '0.5.6': // SQL queries for v0.5.6
// Register filter
- registerFilter(__FILE__, __LINE__, 'member_reflink_extra_content', 'MEMBER_REFLINK_USER_SUBIDS_CONTENT', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'member_reflink_extra_content', 'MEMBER_REFLINK_USER_SUBIDS_CONTENT', FALSE, TRUE, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Weiteren Filter für Mitglieder-Aktionen im Adminbereich hinzugefügt.");
setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
-enableExtensionProductive(false);
+enableExtensionProductive(FALSE);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
prepareFilterArray();
// Mark it as initialized
- $GLOBALS['filter_init'] = true;
+ $GLOBALS['filter_init'] = TRUE;
} elseif ((!isInstallationPhase()) && (isExtensionInstalledAndNewer('sql_patches', '0.5.9'))) {
// Init add
$add = '';
$GLOBALS['cache_array']['filter']['counter'][$filterName][$filterFunction] = '0';
// Mark this filter as loaded (from database)
- $GLOBALS['cache_array']['filter']['loaded'][$filterName][$filterFunction] = true;
+ $GLOBALS['cache_array']['filter']['loaded'][$filterName][$filterFunction] = TRUE;
// Set this filter
$GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = $filterArray['filter_active'];
}
// "Registers" a new filter function
-function registerFilter ($F, $L, $filterName, $filterFunction, $silentAbort = true, $force = false, $isDryRun = false) {
+function registerFilter ($F, $L, $filterName, $filterFunction, $silentAbort = TRUE, $force = FALSE, $isDryRun = FALSE) {
// Extend the filter function name
$filterFunction = 'FILTER_' . strtoupper($filterFunction);
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',F=' . basename($F) . ',L=' . $L . ' - ENTERED!');
// Is that filter already there?
- if ((isset($GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction])) && ($force === false)) {
+ if ((isset($GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction])) && ($force === FALSE)) {
// In installation phase we always want to abort
- if (($silentAbort === false) || (isInstallationPhase())) {
+ if (($silentAbort === FALSE) || (isInstallationPhase())) {
// Add fatal message
reportBug(__FUNCTION__, __LINE__, sprintf("Filter chain %s has already filter function %s registered! F=%s,L=%s,force=%d", $filterName, $filterFunction, basename($F), $L, intval($force)));
} // END - if
// Abort here
- return false;
+ return FALSE;
} // END - if
// Shall we add it?
- if ($isDryRun === false) {
+ if ($isDryRun === FALSE) {
// Is the function there?
if (!function_exists($filterFunction)) {
// Then abort here
addFatalMessage(__FUNCTION__, __LINE__, sprintf("Filter function %s could not be added to filter chain %s. F=%s,L=%s,force=%d", $filterFunction, $filterName, basename($F), $L, intval($force)));
- return false;
+ return FALSE;
} // END - if
// Simply add it to the array
}
// "Unregisters" a filter from the given chain
-function unregisterFilter ($F, $L, $filterName, $filterFunction, $force = false, $isDryRun = false) {
+function unregisterFilter ($F, $L, $filterName, $filterFunction, $force = FALSE, $isDryRun = FALSE) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',isDryRun=' . intval($isDryRun) . ' - ENTERED!');
// Extend the filter function name only if not loaded from database
} // END - if
// Is that filter there?
- if ((!isset($GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction])) && ($force === false)) {
+ if ((!isset($GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction])) && ($force === FALSE)) {
// Not found, so abort here
addFatalMessage(__FUNCTION__, __LINE__, sprintf(getMessage('FILTER_FAILED_NOT_REMOVED'), $filterFunction, $filterName));
- return false;
+ return FALSE;
} // END - if
// Shall we remove? (default, not while just showing an extension removal)
- if ($isDryRun === false) {
+ if ($isDryRun === FALSE) {
// Mark for filter removal
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ' - REMOVE!');
$GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = 'R';
// Abort here if array is absend (e.g. not cached)
if (!isset($GLOBALS['cache_array']['filter']['filter_name'])) {
// Abort silently
- return false;
+ return FALSE;
} // END - if
// Init dummy array
// Add the element with mapped index
$filterArray['counter'][$filterName][$filterFunction] = $GLOBALS['cache_array']['filter']['filter_counter'][$idx];
- $filterArray['loaded'][$filterName][$filterFunction] = true;
+ $filterArray['loaded'][$filterName][$filterFunction] = TRUE;
$filterArray['chains'][$filterName][$filterFunction] = $GLOBALS['cache_array']['filter']['filter_active'][$idx];
} // END - foreach
// Is there a cache entry?
if (!isset($GLOBALS[__FUNCTION__][$ext_name])) {
// Default is not found
- $GLOBALS[__FUNCTION__][$ext_name] = false;
+ $GLOBALS[__FUNCTION__][$ext_name] = FALSE;
// Construct include file name
$incFileName = sprintf("inc/filter/%s_filter.php", $ext_name);
loadIncludeOnce($incFileName);
// Mark the file as loaded
- $GLOBALS[__FUNCTION__][$ext_name] = true;
+ $GLOBALS[__FUNCTION__][$ext_name] = TRUE;
} elseif (isDebugModeEnabled()) {
// Log missing file
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Filter include file ' . $incFileName . ' for extension ' . $ext_name . ' is missing.');
);
// Add link to "we were active today" page
- $GLOBALS['rows'] .= loadTemplate('guest_menu_bottom', true, $content);
+ $GLOBALS['rows'] .= loadTemplate('guest_menu_bottom', TRUE, $content);
} // END - if
// Return data
// Return filter data
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
- //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,true).'</pre>';
+ //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,TRUE).'</pre>';
return $filterData;
}
} // END - if
// Bonus is not given by default ;-)
- $bonus = false;
+ $bonus = FALSE;
if ((isExtensionInstalledAndNewer('sql_patches', '0.2.8')) && (isBonusRallyeActive()) && (getConfig('include_bonus_login') == 'Y')) {
// Update last login if far enougth away
// @TODO This query isn't right, it will only update if the user was for a longer time away!
$bonus = (!SQL_HASZEROAFFECTED());
} // END - if
- if (($bonus === true) && (getRequestElement('do') == 'bonus')) {
+ if (($bonus === TRUE) && (getRequestElement('do') == 'bonus')) {
// Output message with added points
$GLOBALS['message'] .= '<div class="tiny">{--MEMBER_BONUS_LOGIN_BONUS_ADDED--}</div>';
} else {
// Is the type 'bid'?
if ($filterData['type'] == 'bid') {
// Load template
- $filterData['__output'] .= loadTemplate('admin_links_bonus_mail', true, $filterData);
+ $filterData['__output'] .= loadTemplate('admin_links_bonus_mail', TRUE, $filterData);
} // END - if
// Return data
// Return filter data
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
- //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,true).'</pre>';
+ //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,TRUE).'</pre>';
return $filterData;
}
// Return filter data
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
- //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,true).'</pre>';
+ //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,TRUE).'</pre>';
return $filterData;
}
// Return the data anyway if there is no cache extension
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
if (!isCacheInstanceValid()) {
- return false;
+ return FALSE;
} // END - if
// Remove cache
// Skip this step if the cache instance is not there
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
if (!isCacheInstanceValid()) {
- return false;
+ return FALSE;
} // END - if
// Remove cache
// Skip this step if the cache instance is not there
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
if (!isCacheInstanceValid()) {
- return false;
+ return FALSE;
} // END - if
// Remove cache files
// Skip this step if the cache instance is not there
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
if ((!isCacheInstanceValid()) || ((isConfigEntrySet('update_filter_usage')) && (getConfig('update_filter_usage') != 'Y'))) {
- return false;
+ return FALSE;
} // END - if
// Remove cache files
// Return filter data
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
- //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,true).'</pre>';
+ //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,TRUE).'</pre>';
return $filterData;
}
if ((!is_string($filterData['new_status'])) || (empty($filterData['new_status']))) {
// Abort here, not fine
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'newStatus[' . gettype($filterData['new_status']) . ']=' . $filterData['new_status'] . ' - EXIT!');
- $filterData['abort'] = false;
+ $filterData['abort'] = FALSE;
} elseif ($filterData['data']['forced_campaign_status'] != $filterData['prev_status']) {
// Status is not like prevStatus
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $filterData['data']['forced_campaign_status'] . '!=' . $filterData['prev_status'] . ' - EXIT!');
- $filterData['abort'] = false;
+ $filterData['abort'] = FALSE;
} // END - if
// Return filter data
function FILTER_UPDATE_MEDIADATA_ENTRY ($filterData) {
// Execute the filter function
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added[' . gettype($filterData['added']) . ']=' . intval($filterData['added']) . ' - Called!');
- $filterData['added'] = ($filterData['added'] === true && updateMediadataEntry(array('total_points'), $filterData['points_mode'], $filterData['points']));
+ $filterData['added'] = ($filterData['added'] === TRUE && updateMediadataEntry(array('total_points'), $filterData['points_mode'], $filterData['points']));
// Return data
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added[' . gettype($filterData['added']) . ']=' . intval($filterData['added']) . ' - Done!');
$userid = NULL;
$isMember = convertBooleanToYesNo(isMember());
$isAdmin = convertBooleanToYesNo(isAdmin());
- $action = getActionFromModuleWhat(getModule(), getWhat(false));
+ $action = getActionFromModuleWhat(getModule(), getWhat(FALSE));
// Valid userid?
if (isMember()) {
array(
getModule(),
$action,
- getWhat(false),
+ getWhat(FALSE),
convertZeroToNull($userid),
convertZeroToNull(determineReferralId()),
$isMember,
array(
getModule(),
$action,
- getWhat(false),
+ getWhat(FALSE),
convertZeroToNull($userid),
convertZeroToNull(determineReferralId()),
$isMember,
if ((isFullPage()) && (isExtensionActive('politician-stop')) && (getModule() != 'admin') && ($GLOBALS['__header_sent'] == 2)) {
// Then display it here
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Going to load template ...');
- $filterData .= loadTemplate('politician_stop_snippet', true);
+ $filterData .= loadTemplate('politician_stop_snippet', TRUE);
} // END - if
// Return data
setPostRequestElement('remote_addr', detectRemoteAddr());
// Generic initialization is done
- $filterData['init_done'] = true;
+ $filterData['init_done'] = TRUE;
// Return it
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
- //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,true).'</pre>';
+ //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,TRUE).'</pre>';
return $filterData;
}
if ((!is_string($filterData['new_status'])) || (empty($filterData['new_status']))) {
// Abort here, but fine!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'newStatus[' . gettype($filterData['new_status']) . ']=' . $filterData['new_status'] . ' - EXIT!');
- $filterData['abort'] = true;
+ $filterData['abort'] = TRUE;
} elseif ($filterData['data'][$filterData['url_id']]['url_status'] != $filterData['prev_status']) {
// Status is not like prevStatus
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $filterData['data'][$filterData['url_id']]['url_status'] . '!=' . $filterData['prev_status'] . ' - EXIT!');
- $filterData['abort'] = false;
+ $filterData['abort'] = FALSE;
} // END - if
// Return filter data
// Return filter data
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
- //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,true).'</pre>';
+ //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,TRUE).'</pre>';
return $filterData;
}
// Return filter data
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
- //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,true).'</pre>';
+ //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,TRUE).'</pre>';
return $filterData;
}
// Return filter data
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
- //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,true).'</pre>';
+ //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,TRUE).'</pre>';
return $filterData;
}
$subId = SQL_ESCAPE(getRequestElement('subid'));
// Is the sub id available and registered with referral id?
- if (countSumTotalData(getReferralId(), 'user_subids', 'id', 'userid', true, sprintf(" AND `subid`='%s'", $subId)) == 1) {
+ if (countSumTotalData(getReferralId(), 'user_subids', 'id', 'userid', TRUE, sprintf(" AND `subid`='%s'", $subId)) == 1) {
// Sub id is assigned to referral id, so add a record
SQL_QUERY_ESC("INSERT INTO
`{?_MYSQL_PREFIX?}_subid_log`
$out = '';
while ($row = SQL_FETCHARRAY($result)) {
// Load row template
- $out .= loadTemplate('member_list_reflink_user_subids_row', true, $row);
+ $out .= loadTemplate('member_list_reflink_user_subids_row', TRUE, $row);
} // END - while
// Load main template
- $content .= loadTemplate('member_list_reflink_user_subids', true, $out);
+ $content .= loadTemplate('member_list_reflink_user_subids', TRUE, $out);
// Free result
SQL_FREERESULT($result);
} // END - if
// Abort silently here
- return false;
+ return FALSE;
} // END - if
// Nothing is added/remove by default
adminSolveTask($filterData['task_id']);
} else {
// Not detectable!
- reportBug(__FUNCTION__, __LINE__, sprintf("Cannot resolve task. data[%s]=<pre>%s</pre>", gettype($filterData), print_r($filterData, true)));
+ reportBug(__FUNCTION__, __LINE__, sprintf("Cannot resolve task. data[%s]=<pre>%s</pre>", gettype($filterData), print_r($filterData, TRUE)));
}
// Return the data
$count = 0;
// Debug message
- //* DEBUG: */ die('getSqls()=<pre>'.print_r(getSqls(), true).'</pre>ext_update_depends=<pre>'.print_r($GLOBALS['ext_update_depends'], true).'</pre>');
+ //* DEBUG: */ die('getSqls()=<pre>'.print_r(getSqls(), TRUE).'</pre>ext_update_depends=<pre>'.print_r($GLOBALS['ext_update_depends'], TRUE).'</pre>');
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '- Entered!');
// Is the array there?
- if ((isSqlsValid()) && ((!isset($filterData['dry_run'])) || ($filterData['dry_run'] == false))) {
+ if ((isSqlsValid()) && ((!isset($filterData['dry_run'])) || ($filterData['dry_run'] == FALSE))) {
// Run SQL commands
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '- Found ' . countSqls() . ' queries to run.');
foreach (getSqls() as $mode => $sqls) {
// Is 'enable_codes' not set? Then set it to true
if (!isset($filterData['enable_codes'])) {
- $filterData['enable_codes'] = true;
+ $filterData['enable_codes'] = TRUE;
} // END - if
// Is there still a query left?
// Recheck if logged in
if ((!isMember()) || ((isAdmin()) && (!isDebugModeEnabled()))) {
- return false;
+ return FALSE;
} // END - if
// Secure user id
}
// Filter for compiling config entries
-function FILTER_COMPILE_CONFIG ($code, $compiled = false) {
+function FILTER_COMPILE_CONFIG ($code, $compiled = FALSE) {
// Save the uncompiled code
$uncompiled = $code;
} // END - if
// Should we compile it?
- if ($compiled === true) {
+ if ($compiled === TRUE) {
// Run the code
$eval = "\$GLOBALS['compiled_config'][\$uncompiled] = \"" . $GLOBALS['compiled_config'][$uncompiled] . '";';
//* DEBUG: */ debugOutput(__FUNCTION__.'['.__LINE__.']:<pre>' . encodeEntities($eval) . '</pre>');
// Compile {%cmd,callback,extraFunction=some_value%} to get expression code snippets
// See switch() command below for supported commands
preg_match_all('/\{%(([a-zA-Z0-9-_,]+)(=([^\}]+)){0,1})*%\}/', $filterData, $matches);
- //* DEBUG: */ debugOutput(__FUNCTION__.'['.__LINE__.']:<pre>'.print_r($matches, true).'</pre>');
+ //* DEBUG: */ debugOutput(__FUNCTION__.'['.__LINE__.']:<pre>'.print_r($matches, TRUE).'</pre>');
// Default is from outputHtml()
$outputMode = getScriptOutputMode();
// Filter for checking admin ACL
function FILTER_CHECK_ADMIN_ACL () {
// Extension not installed so it's always allowed to access everywhere!
- $ret = true;
+ $ret = TRUE;
// Ok, Cookie-Update done
if ((isExtensionInstalledAndNewer('admins', '0.3.0')) && (isExtensionActive('admins'))) {
// Is there errors to handle and right output mode?
if ((!ifFatalErrorsDetected()) || (!isHtmlOutputMode())) {
// Abort executing here
- return false;
+ return FALSE;
} // END - if
// Set content type
);
// Load row template
- $OUT .= loadTemplate('install_fatal_row', true, $content);
+ $OUT .= loadTemplate('install_fatal_row', TRUE, $content);
}
// Load main template
- $content = loadTemplate('install_fatal_table', true, $OUT);
+ $content = loadTemplate('install_fatal_table', TRUE, $OUT);
} elseif (isInstalled()) {
// Display all runtime fatal errors
$OUT = '';
);
// Load row template
- $OUT .= loadTemplate('runtime_fatal_row', true, $content);
+ $OUT .= loadTemplate('runtime_fatal_row', TRUE, $content);
}
// Load main template
- $content = loadTemplate('runtime_fatal_table', true, $OUT);
+ $content = loadTemplate('runtime_fatal_table', TRUE, $OUT);
}
// Message to regular users (non-admin)
loadIncludeOnce('inc/header.php');
// Load main template
- loadTemplate('fatal_errors', false, $content);
+ loadTemplate('fatal_errors', FALSE, $content);
// Delete all to prevent double-display
initFatalMessages();
// Backlink enabled?
if (((isConfigEntrySet('ENABLE_BACKLINK')) && (getConfig('ENABLE_BACKLINK') == 'Y')) || (isInstalling())) {
// Copyright with backlink, thanks! :-)
- $GLOBALS['__page_footer'] .= loadTemplate('copyright_backlink', true);
+ $GLOBALS['__page_footer'] .= loadTemplate('copyright_backlink', TRUE);
} else {
// No backlink in Copyright note
- $GLOBALS['__page_footer'] .= loadTemplate('copyright', true);
+ $GLOBALS['__page_footer'] .= loadTemplate('copyright', TRUE);
}
} // END - if
}
// Filter for loading page header, this should be ran first!
function FILTER_LOAD_PAGE_HEADER () {
// Output page header code
- $GLOBALS['__page_header'] = loadTemplate('page_header', true);
+ $GLOBALS['__page_header'] = loadTemplate('page_header', TRUE);
// Include meta data in 'guest' module
if ((isModuleSet()) && (getModule() == 'index')) {
// Load meta data template
- $GLOBALS['__page_header'] .= loadTemplate('metadata', true);
+ $GLOBALS['__page_header'] .= loadTemplate('metadata', TRUE);
// Add meta description to header
if ((isInstalled()) && (isAdminRegistered()) && (SQL_IS_LINK_UP())) {
// Filter for marking extension as installed
function FILTER_EXTENSION_MARK_INSTALLED ($filterData) {
// Mark it as installed
- $GLOBALS['ext_is_installed'][$filterData['ext_name']] = true;
+ $GLOBALS['ext_is_installed'][$filterData['ext_name']] = TRUE;
}
// Filter for generating mails links for 'pool' mails
// Is type 'mid'?
if ($filterData['type'] == 'mid') {
// Load template
- $filterData['__output'] .= loadTemplate('admin_links_' . strtolower($filterData['mail_status']) . '_pool_mail', true, $filterData);
+ $filterData['__output'] .= loadTemplate('admin_links_' . strtolower($filterData['mail_status']) . '_pool_mail', TRUE, $filterData);
} // END - if
// Return data
// Is the extension 'user' there?
if ((!isExtensionActive('user')) || (getActivateXchange() == '0')) {
// Silently abort here
- return false;
+ return FALSE;
} // END - if
// Check total amount of users
// 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'])));
+ $count = countSumTotalData($filter['filter_name'], 'filters', 'filter_id', 'filter_name', TRUE, sprintf(" AND `filter_function`='%s'", SQL_ESCAPE($filter['filter_function'])));
// Is there more than one entry?
if ($count > 1) {
// Double entry, so get count
if (is_null($entry['what'])) {
// Main menu
- $entries = countSumTotalData($entry['action'], $menu . '_menu', 'action', 'action', true, " AND `what` IS NULL");
+ $entries = countSumTotalData($entry['action'], $menu . '_menu', 'action', 'action', TRUE, " AND `what` IS NULL");
} else {
// Sub menu
- $entries = countSumTotalData($entry['action'], $menu . '_menu', 'action', 'action', true, sprintf(" AND `what`='%s'", $entry['what']));
+ $entries = countSumTotalData($entry['action'], $menu . '_menu', 'action', 'action', TRUE, sprintf(" AND `what`='%s'", $entry['what']));
}
//* DEBUG: */ debugOutput('menu='.$menu.',action='.$entry['action'].',what='.$entry['what'].',entries='.$entries);
runFilterChain('page_footer');
// Load page footer
- $GLOBALS['__page_footer'] .= loadTemplate('page_footer', true);
+ $GLOBALS['__page_footer'] .= loadTemplate('page_footer', TRUE);
} // END - if
// Footer has been reached
// Translates the american decimal dot into a german comma
// OPPOMENT: convertCommaToDot()
-function translateComma ($dotted, $cut = true, $max = '0') {
+function translateComma ($dotted, $cut = TRUE, $max = '0') {
// First, cast all to double, due to PHP changes
$dotted = (double) $dotted;
} // END - if
// Cut zeros off?
- if (($cut === true) && ($max == '0')) {
+ if (($cut === TRUE) && ($max == '0')) {
// Test for commata if in cut-mode
$com = explode('.', $dotted);
if (count($com) < 2) {
break;
default: // Please report this
- reportBug(__FUNCTION__, __LINE__, 'Unsupported visible value detected. content=<pre>' . print_r($content, true) . '</pre>');
+ reportBug(__FUNCTION__, __LINE__, 'Unsupported visible value detected. content=<pre>' . print_r($content, TRUE) . '</pre>');
break;
} // END - switch
break;
default: // Please report this
- reportBug(__FUNCTION__, __LINE__, 'Unsupported locked value detected. content=<pre>' . print_r($content, true) . '</pre>');
+ reportBug(__FUNCTION__, __LINE__, 'Unsupported locked value detected. content=<pre>' . print_r($content, TRUE) . '</pre>');
break;
} // END - switch
}
// Redirects to an URL and if neccessarry extends it with own base URL
-function redirectToUrl ($url, $allowSpider = true) {
+function redirectToUrl ($url, $allowSpider = TRUE) {
// Is the output mode -2?
if (isAjaxOutputMode()) {
// This is always (!) an AJAX request and shall not be redirected
// We should not sent a redirect if headers are already sent
if (!headers_sent()) {
// Load URL when headers are not sent
- sendRawRedirect(doFinalCompilation(str_replace('&', '&', $url), false));
+ sendRawRedirect(doFinalCompilation(str_replace('&', '&', $url), FALSE));
} else {
// Output error message
loadInclude('inc/header.php');
- loadTemplate('redirect_url', false, str_replace('&', '&', $url));
+ loadTemplate('redirect_url', FALSE, str_replace('&', '&', $url));
loadInclude('inc/footer.php');
}
* $a_sort - Array, das die Sortiereihenfolge der ersten Elementeben *
* $primary_key - Primaerschl.ssel aus $a_sort, nach dem sortiert wird *
* $order - Sortiereihenfolge: -1 = a-Z, 0 = keine, 1 = Z-a *
- * $nums - true = Als Zahlen sortieren, false = Als Zeichen sortieren *
+ * $nums - TRUE = Als Zahlen sortieren, FALSE = Als Zeichen sortieren *
* *
* $a_sort muss Elemente enthalten, deren Wert Schluessel von $array *
* sind... Klingt kompliziert, suchen Sie mal mein Beispiel, dann sehen *
* Sie, dass es doch nicht so schwer ist! :-) *
* *
************************************************************************/
-function array_pk_sort (&$array, $a_sort, $primary_key = '0', $order = -1, $nums = false) {
+function array_pk_sort (&$array, $a_sort, $primary_key = '0', $order = -1, $nums = FALSE) {
$temporaryArray = $array;
while ($primary_key < count($a_sort)) {
foreach ($temporaryArray[$a_sort[$primary_key]] as $key => $value) {
foreach ($temporaryArray[$a_sort[$primary_key]] as $key2 => $value2) {
- $match = false;
- if ($nums === false) {
+ $match = FALSE;
+ if ($nums === FALSE) {
// Sort byte-by-byte (also numbers will be interpreted as chars! E.g.: "9" > "10")
- if (($key != $key2) && (strcmp(strtolower($temporaryArray[$a_sort[$primary_key]][$key]), strtolower($temporaryArray[$a_sort[$primary_key]][$key2])) == $order)) $match = true;
+ if (($key != $key2) && (strcmp(strtolower($temporaryArray[$a_sort[$primary_key]][$key]), strtolower($temporaryArray[$a_sort[$primary_key]][$key2])) == $order)) $match = TRUE;
} elseif ($key != $key2) {
// Sort numbers (E.g.: 9 < 10)
- if (($temporaryArray[$a_sort[$primary_key]][$key] < $temporaryArray[$a_sort[$primary_key]][$key2]) && ($order == -1)) $match = true;
- if (($temporaryArray[$a_sort[$primary_key]][$key] > $temporaryArray[$a_sort[$primary_key]][$key2]) && ($order == 1)) $match = true;
+ if (($temporaryArray[$a_sort[$primary_key]][$key] < $temporaryArray[$a_sort[$primary_key]][$key2]) && ($order == -1)) $match = TRUE;
+ if (($temporaryArray[$a_sort[$primary_key]][$key] > $temporaryArray[$a_sort[$primary_key]][$key2]) && ($order == 1)) $match = TRUE;
}
if ($match) {
}
// Does only allow numbers
-function bigintval ($num, $castValue = true, $abortOnMismatch = true) {
+function bigintval ($num, $castValue = TRUE, $abortOnMismatch = TRUE) {
//* DEBUG: */ debugOutput('[' . __FUNCTION__ . ':' . __LINE__ . '] ' . 'num=' . $num . ',castValue=' . intval($castValue) . ',abortOnMismatch=' . intval($abortOnMismatch) . ' - ENTERED!');
// Filter all numbers out
$ret = preg_replace('/[^0123456789]/', '', $num);
// Shall we cast?
- if ($castValue === true) {
+ if ($castValue === TRUE) {
// Cast to biggest numeric type
$ret = (double) $ret;
} // END - if
// Has the whole value changed?
- if (('' . $ret . '' != '' . $num . '') && ($abortOnMismatch === true) && (!is_null($num))) {
+ if (('' . $ret . '' != '' . $num . '') && ($abortOnMismatch === TRUE) && (!is_null($num))) {
// Log the values
reportBug(__FUNCTION__, __LINE__, 'Problem with number found. ret[' . gettype($ret) . ']=' . $ret . ', num[' . gettype($num) . ']='. $num);
} // END - if
// Creates a 'fancy' human-readable timestamp from a Uni* stamp
function createFancyTime ($stamp) {
// Get data array with years/months/weeks/days/...
- $data = createTimeSelections($stamp, '', '', '', true);
+ $data = createTimeSelections($stamp, '', '', '', TRUE);
$ret = '';
foreach ($data as $k => $v) {
if ($v > 0) {
}
// Function taken from user comments on www.php.net / function isInStringIgnoreCase()
-function isUrlValid ($url, $compile = true) {
+function isUrlValid ($url, $compile = TRUE) {
// Trim URL a little
$url = trim(urldecode($url));
//* DEBUG: */ debugOutput($url);
// Compile some chars out...
- if ($compile === true) {
- $url = compileUriCode($url, false, false, false);
+ if ($compile === TRUE) {
+ $url = compileUriCode($url, FALSE, FALSE, FALSE);
} // END - if
//* DEBUG: */ debugOutput($url);
// Check for the extension filter
if (isExtensionActive('filter')) {
// Use the extension's filter set
- return FILTER_VALIDATE_URL($url, false);
+ return FILTER_VALIDATE_URL($url, FALSE);
} // END - if
/*
}
// Generate a hash for extra-security for all passwords
-function generateHash ($plainText, $salt = '', $hash = true) {
+function generateHash ($plainText, $salt = '', $hash = TRUE) {
// Debug output
//* DEBUG: */ debugOutput('plainText('.strlen($plainText).')=' . $plainText . ',salt('.strlen($salt).')=' . $salt . ',hash=' . intval($hash));
// 123 4 43 3 4 432 2 3 32 2 3 32 2 3 3 21
if (((isExtensionInstalledAndOlder('sql_patches', '0.3.6')) && (empty($salt))) || (!isExtensionActive('sql_patches')) || (!isExtensionInstalledAndNewer('other', '0.2.5')) || (strlen($salt) == 32)) {
// Extension ext-sql_patches is missing/outdated so we hash the plain text with MD5
- if ($hash === true) {
+ if ($hash === TRUE) {
// Is plain password
return md5($plainText);
} else {
$keys = getSiteKey() . getEncryptSeparator() . getDateKey() . getEncryptSeparator() . getSecretKey() . getEncryptSeparator() . getFileHash() . getEncryptSeparator() . getDateFromRepository() . getEncryptSeparator() . getMasterSalt();
// Additional data
- $data = $plainText . getEncryptSeparator() . uniqid(mt_rand(), true) . getEncryptSeparator() . time();
+ $data = $plainText . getEncryptSeparator() . uniqid(mt_rand(), TRUE) . getEncryptSeparator() . time();
// Calculate number for generating the code
$a = time() + getConfig('_ADD') - 1;
// Generates a ***weak*** seed
function generateSeed () {
- return microtime(true) * 100000;
+ return microtime(TRUE) * 100000;
}
// Converts a message code to a human-readable message
case getCode('LOGIN_EMPTY_PASSWORD'): $message = '{--LOGIN_PASSWORD_IS_EMPTY--}'; break;
case getCode('ERROR_MAILID'):
- if (isExtensionActive('mailid', true)) {
+ if (isExtensionActive('mailid', TRUE)) {
$message = '{--ERROR_CONFIRMING_MAIL--}';
} else {
$message = '{%pipe,generateExtensionInactiveNotInstalledMessage=mailid%}';
$content['seconds'] = round(getUrlTlock() - $content['hours'] * 60 * 60 - $content['minutes'] * 60);
// Finally contruct the message
- $message = loadTemplate('tlock_message', true, $content);
+ $message = loadTemplate('tlock_message', TRUE, $content);
break;
default:
$pattern['ipg12'] = $http . $ip . $getstring1;
// Test all patterns
- $reg = false;
+ $reg = FALSE;
foreach ($pattern as $key => $pat) {
// Debug regex?
if (isDebugRegularExpressionEnabled()) {
$reg = ($reg || preg_match(('^' . $pat . '^'), $url));
// Does it match?
- if ($reg === true) {
+ if ($reg === TRUE) {
break;
} // END - if
} // END - foreach
// @TODO Rewrite this function to use readFromFile() and writeToFile()
function changeDataInFile ($FQFN, $comment, $prefix, $suffix, $inserted, $seek=0) {
// Initialize some variables
- $done = false;
+ $done = FALSE;
$seek++;
$next = -1;
- $found = false;
+ $found = FALSE;
// Is the file there and read-/write-able?
if ((isFileReadable($FQFN)) && (is_writeable($FQFN))) {
// Is the resource again valid?
if (is_resource($fp_tmp)) {
// Mark temporary file as readable
- $GLOBALS['file_readable'][$tmp] = true;
+ $GLOBALS['file_readable'][$tmp] = TRUE;
// Start reading
while (!feof($fp)) {
if (isInString($search, $line)) {
$next = '0';
- $found = true;
+ $found = TRUE;
} // END - if
if ($next > -1) {
fclose($fp_tmp);
// Finished writing tmp file
- $done = true;
+ $done = TRUE;
} // END - if
// Close source file
fclose($fp);
- if (($done === true) && ($found === true)) {
+ if (($done === TRUE) && ($found === TRUE)) {
// Copy back tmp file and delete tmp :-)
copyFileVerified($tmp, $FQFN, 0644);
return removeFile($tmp);
- } elseif ($found === false) {
+ } elseif ($found === FALSE) {
outputHtml('<strong>CHANGE:</strong> 404!');
} else {
outputHtml('<strong>TMP:</strong> UNDONE!');
}
// An error was detected!
- return false;
+ return FALSE;
}
// Debug message logger
function logDebugMessage ($funcFile, $line, $message, $force=true) {
// Is debug mode enabled?
- if ((isDebugModeEnabled()) || ($force === true)) {
+ if ((isDebugModeEnabled()) || ($force === TRUE)) {
// Remove CRLF
$message = str_replace(array(chr(13), chr(10)), array('', ''), $message);
// Log this message away
- appendLineToFile(getPath() . getCachePath() . 'debug.log', generateDateTime(time(), '4') . '|' . getModule(false) . '|' . basename($funcFile) . '|' . $line . '|' . $message);
+ appendLineToFile(getPath() . getCachePath() . 'debug.log', generateDateTime(time(), '4') . '|' . getModule(FALSE) . '|' . basename($funcFile) . '|' . $line . '|' . $message);
} // END - if
}
// Does the filter function exist?
if (function_exists($filterFunction)) {
// Is there extra parameters here?
- if (!empty($extraValue)) {
+ if ((!is_null($extraValue)) && (!empty($extraValue))) {
// Put both parameters in one new array by default
$args = array($value, $extraValue);
$ret = call_user_func_array($filterFunction, $args);
// Is $ret 'true'?
- if ($ret === true) {
+ if ($ret === TRUE) {
// Test passed, so write direct value
$ret = $args;
} // END - if
} else {
// One parameter call
$ret = call_user_func($filterFunction, $value);
+ //* BUG */ die('ret['.gettype($ret).']=' . $ret . ',value=' . $value.',filterFunction=' . $filterFunction);
// Is $ret 'true'?
- if ($ret === true) {
+ if ($ret === TRUE) {
// Test passed, so write direct value
$ret = $value;
} // END - if
// Converts timestamp selections into a timestamp
function convertSelectionsToEpocheTime (array &$postData, array &$content, &$id, &$skip) {
// Init test variable
- $skip = false;
+ $skip = FALSE;
$test2 = '';
// Get last three chars
// Generate timestamp
$postData[$test] = createEpocheTimeFromSelections($test, $postData);
array_push($content, sprintf("`%s`='%s'", $test, $postData[$test]));
- $GLOBALS['skip_config'][$test] = true;
+ $GLOBALS['skip_config'][$test] = TRUE;
// Remove data from array
foreach (array('ye', 'mo', 'we', 'da', 'ho', 'mi', 'se') as $rem) {
// Skip adding
unset($id);
- $skip = true;
+ $skip = TRUE;
$test2 = $test;
} // END - if
} // END - if
// OPPOMENT: translateComma()
function convertCommaToDot ($str) {
// Default float is not a float... ;-)
- $float = false;
+ $float = FALSE;
// Which language is selected?
switch (getLanguage()) {
);
// Load template
- $OUT = loadTemplate('login_failures', true, $content);
+ $OUT = loadTemplate('login_failures', TRUE, $content);
} // END - if
// Reset session data
}
// Rebuild cache
-function rebuildCache ($cache, $inc = '', $force = false) {
+function rebuildCache ($cache, $inc = '', $force = FALSE) {
// Debug message
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("cache=%s, inc=%s, force=%s", $cache, $inc, intval($force)));
}
// Determines the real remote address
-function determineRealRemoteAddress ($remoteAddr = false) {
+function determineRealRemoteAddress ($remoteAddr = FALSE) {
// Default is 127.0.0.1
$address = '127.0.0.1';
// Adds a bonus mail to the queue
// This is a high-level function!
-function addNewBonusMail ($data, $mode = '', $output = true) {
+function addNewBonusMail ($data, $mode = '', $output = TRUE) {
// Use mode from data if not set and availble ;-)
if ((empty($mode)) && (isset($data['mail_mode']))) {
$mode = $data['mail_mode'];
);
// Mail inserted into bonus pool
- if ($output === true) {
+ if ($output === TRUE) {
displayMessage('{--ADMIN_BONUS_SEND--}');
} // END - if
- } elseif ($output === true) {
+ } elseif ($output === TRUE) {
// More entered than can be reached!
displayMessage('{--ADMIN_MORE_SELECTED--}');
} else {
// Enables the reset mode and runs it
function doReset () {
// Enable the reset mode
- $GLOBALS['reset_enabled'] = true;
+ $GLOBALS['reset_enabled'] = TRUE;
// Run filters
runFilterChain('reset');
// Enables the reset mode (hourly, weekly and monthly) and runs it
function doHourly () {
// Enable the hourly reset mode
- $GLOBALS['hourly_enabled'] = true;
+ $GLOBALS['hourly_enabled'] = TRUE;
// Run filters (one always!)
runFilterChain('hourly');
* @param $suffix Suffix for positive matches ($extension will be appended, too)
* @return $foundMatches All found positive matches for above criteria
*/
-function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = false, $addBaseDir = true, $excludeArray = array(), $extension = '.php', $excludePattern = '@(\.|\.\.)$@', $recursive = true, $suffix = '') {
+function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = FALSE, $addBaseDir = TRUE, $excludeArray = array(), $extension = '.php', $excludePattern = '@(\.|\.\.)$@', $recursive = TRUE, $suffix = '') {
// Add default entries we should always exclude
array_unshift($excludeArray, '.', '..', '.svn', '.htaccess');
// Read all entries
while ($baseFile = readdir($dirPointer)) {
// Exclude '.', '..' and entries in $excludeArray automatically
- if (in_array($baseFile, $excludeArray, true)) {
+ if (in_array($baseFile, $excludeArray, TRUE)) {
// Exclude them
//* DEBUG: */ debugOutput('excluded=' . $baseFile);
continue;
} // END - if
// Skip also files with non-matching prefix genericly
- if (($recursive === true) && (isDirectory($FQFN))) {
+ if (($recursive === TRUE) && (isDirectory($FQFN))) {
// Is a redirectory so read it as well
$foundMatches = merge_array($foundMatches, getArrayFromDirectory($baseDir . $baseFile . '/', $prefix, $fileIncludeDirs, $addBaseDir, $excludeArray, $extension, $excludePattern, $recursive));
// Is the file a PHP script or other?
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'baseDir=' . $baseDir . ',prefix=' . $prefix . ',baseFile=' . $baseFile);
- if (($fileExtension == '.php') || (($fileIncludeDirs === true) && (isDirectory($FQFN)))) {
+ if (($fileExtension == '.php') || (($fileIncludeDirs === TRUE) && (isDirectory($FQFN)))) {
// Is this a valid include file?
if ($extension == '.php') {
// Remove both for extension name
$extName = substr($baseFile, strlen($prefix), -4);
// Add file with or without base path
- if ($addBaseDir === true) {
+ if ($addBaseDir === TRUE) {
// With base path
array_push($foundMatches, $fileName);
} else {
} // END - if
// Don't execute anything here if we don't need or ext-other is missing
- if ($GLOBALS['debug_sql_available'] === false) {
+ if ($GLOBALS['debug_sql_available'] === FALSE) {
return;
} // END - if
} // END - if
// Remeber this as profiled (or not, but we don't care here)
- $GLOBALS['debug_sqls'][$F][$L][$sqlString] = true;
+ $GLOBALS['debug_sqls'][$F][$L][$sqlString] = TRUE;
// Generate record
$record = array(
} // END - if
// Is there a valid session?
- if (((!isset($GLOBALS['valid_session'])) || ($GLOBALS['valid_session'] === false) || (!isset($_COOKIE[session_name()]))) && (isSpider() === false)) {
+ if (((!isset($GLOBALS['valid_session'])) || ($GLOBALS['valid_session'] === FALSE) || (!isset($_COOKIE[session_name()]))) && (isSpider() === FALSE)) {
// Determine right separator
$separator = '&';
if (!isInString('?', $url)) {
// Simple check for spider
function isSpider () {
// Get the UA and trim it down
- $userAgent = trim(detectUserAgent(true));
+ $userAgent = trim(detectUserAgent(TRUE));
// It should not be empty, if so it is better a spider/bot
if (empty($userAgent)) {
// It is a spider/bot
- return true;
+ return TRUE;
} // END - if
// Is it a spider?
// RegexPattern to exclude ., .., .revision, .svn, debug.log or .cache in the filenames
$excludePattern = '@(\.revision|\.svn|debug\.log|\.cache|config\.php)$@';
- $ds = getArrayFromDirectory($dir, '', false, true, array(), '.php', $excludePattern);
+ $ds = getArrayFromDirectory($dir, '', FALSE, TRUE, array(), '.php', $excludePattern);
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'count(ds)='.count($ds));
// Walk through all entries
$mbPrefix = '';
// Detect multi-byte (strictly)
- if (mb_detect_encoding($str, 'auto', true) !== false) {
+ if (mb_detect_encoding($str, 'auto', TRUE) !== FALSE) {
// With multi-byte encoded string
$mbPrefix = 'mb_';
} // END - if
foreach ($needles as $key => $needle) {
// Is there found a partial string?
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'heystack='.$heystack.',key='.$key.',needle='.$needle.',offset='.$offset);
- if (strpos($heystack, $needle, $offset) !== false) {
+ if (strpos($heystack, $needle, $offset) !== FALSE) {
// Add the found key
array_push($keys, $key);
} // END - if
$pointsColumn = 'points';
// Which points, locked or normal?
- if ($locked === true) {
+ if ($locked === TRUE) {
$pointsColumn = 'locked_points';
} // END - if
function convertBooleanToYesNo ($boolean) {
// Default is 'N'
$converted = 'N';
- if ($boolean === true) {
+ if ($boolean === TRUE) {
// Set 'Y'
$converted = 'Y';
} // END - if
// Is it a member?
if (!isMember()) {
// Then abort here
- return false;
+ return FALSE;
} // END - if
// Set POST data generic userid
doGenericAddEntries($tableName, $columns, $filterFunctions, $extraValues, $timeColumns, $columnIndex);
// Entry has been added?
- if ((!SQL_HASZEROAFFECTED()) && ($GLOBALS['__XML_PARSE_RESULT'] === true)) {
+ if ((!SQL_HASZEROAFFECTED()) && ($GLOBALS['__XML_PARSE_RESULT'] === TRUE)) {
// Display success message
displayMessage('{--MEMBER_ENTRY_ADDED--}');
} else {
}
// Edit rows by given id numbers
-function memberEditEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $editNow = array(false), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array()) {
+function memberEditEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array()) {
// $tableName must be an array
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
} // END - if
// Shall we change here or list for editing?
- if ($editNow[0] === true) {
+ if ($editNow[0] === TRUE) {
// Add generic userid field
setPostRequestElement('userid', getMemberId());
}
// Delete rows by given id numbers
-function memberDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = array(false), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array()) {
+function memberDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array()) {
// Do this only for members
assert(isMember());
} // END - if
// Shall we delete here or list for deletion?
- if ($deleteNow[0] === true) {
+ if ($deleteNow[0] === TRUE) {
// Add generic userid field
setPostRequestElement('userid', getMemberId());
// Check for bonus extension
if (isExtensionActive('bonus')) {
// Count bonus mails
- $bcount = countSumTotalData('', 'bonus', 'id', '', true);
+ $bcount = countSumTotalData('', 'bonus', 'id', '', TRUE);
// Check for bonus mails
$result_media = SQL_QUERY('SELECT
// Insert info to database
updateMediadataEntry(array('total_send' , 'normal_send') , 'init', $content['normal_send']);
updateMediadataEntry(array('total_clicks', 'normal_clicks'), 'init', $content['normal_clicks']);
-updateMediadataEntry(array('total_orders', 'normal_orders'), 'init', countSumTotalData('', 'user_stats', 'id', '', true));
+updateMediadataEntry(array('total_orders', 'normal_orders'), 'init', countSumTotalData('', 'user_stats', 'id', '', TRUE));
updateMediadataEntry(array('total_send' , 'bonus_send' ) , 'init', $content['bonus_send']);
updateMediadataEntry(array('total_clicks', 'bonus_clicks') , 'init', $content['bonus_clicks']);
updateMediadataEntry(array('total_orders', 'bonus_orders') , 'init', $bcount);
// Init error handler
function initErrorHandler () {
- enableExitOnError(false);
+ enableExitOnError(FALSE);
}
// Enable exit on error
}
// Sends a HTTP request (GET, POST, HEAD are currently supported)
-function sendHttpRequest ($requestType, $baseUrl, $requestData = array(), $removeHeader = false) {
+function sendHttpRequest ($requestType, $baseUrl, $requestData = array(), $removeHeader = FALSE) {
// Init response
$response = array();
$host = extractHostnameFromUrl($baseUrl);
// Generate HEAD request header
- $request = 'HEAD ' . (isProxyUsed() === true ? $baseUrl : '') . trim($getUrl) . ' HTTP/1.1' . getConfig('HTTP_EOL');
+ $request = 'HEAD ' . (isProxyUsed() === TRUE ? $baseUrl : '') . trim($getUrl) . ' HTTP/1.1' . getConfig('HTTP_EOL');
$request .= 'Host: ' . $host . getConfig('HTTP_EOL');
$request .= 'Referer: ' . getUrl() . '/admin.php' . getConfig('HTTP_EOL');
if (isConfigEntrySet('FULL_VERSION')) {
}
// Send a GET request
-function sendGetRequest ($baseUrl, $requestData = array(), $removeHeader = false) {
+function sendGetRequest ($baseUrl, $requestData = array(), $removeHeader = FALSE) {
// Generate full GET URL
$getUrl = generateGetUrlFromBaseUrlData($baseUrl, $requestData);
$host = extractHostnameFromUrl($baseUrl);
// Generate GET request header
- $request = 'GET ' . (isProxyUsed() === true ? $baseUrl : '') . trim($getUrl) . ' HTTP/1.1' . getConfig('HTTP_EOL');
+ $request = 'GET ' . (isProxyUsed() === TRUE ? $baseUrl : '') . trim($getUrl) . ' HTTP/1.1' . getConfig('HTTP_EOL');
$request .= 'Host: ' . $host . getConfig('HTTP_EOL');
$request .= 'Referer: ' . getUrl() . '/admin.php' . getConfig('HTTP_EOL');
if (isConfigEntrySet('FULL_VERSION')) {
$response = sendRawRequest($host, $request);
// Should we remove header lines?
- if ($removeHeader === true) {
+ if ($removeHeader === TRUE) {
// Okay, remove them
$response = removeHttpHeaderFromResponse($response);
} // END - if
}
// Send a POST request, sometimes even POST requests have no parameters
-function sendPostRequest ($baseUrl, $requestData = array(), $removeHeader = false) {
+function sendPostRequest ($baseUrl, $requestData = array(), $removeHeader = FALSE) {
// Copy baseUrl to getUrl
$getUrl = $baseUrl;
$body = http_build_query($requestData, '', '&');
// Generate POST request header
- $request = 'POST ' . (isProxyUsed() === true ? $baseUrl : '') . trim($baseUrl) . ' HTTP/1.0' . getConfig('HTTP_EOL');
+ $request = 'POST ' . (isProxyUsed() === TRUE ? $baseUrl : '') . trim($baseUrl) . ' HTTP/1.0' . getConfig('HTTP_EOL');
$request .= 'Host: ' . $host . getConfig('HTTP_EOL');
$request .= 'Referer: ' . getUrl() . '/admin.php' . getConfig('HTTP_EOL');
if (isConfigEntrySet('FULL_VERSION')) {
$response = sendRawRequest($host, $request);
// Should we remove header lines?
- if ($removeHeader === true) {
+ if ($removeHeader === TRUE) {
// Okay, remove them
$response = removeHttpHeaderFromResponse($response);
} // END - if
$response = array('', '', '');
// Default is non-broken HTTP server implementation
- $GLOBALS['is_http_server_broken'] = false;
+ $GLOBALS['is_http_server_broken'] = FALSE;
// Load include
loadIncludeOnce('inc/classes/resolver.class.php');
$proxyHost = compileRawCode(getProxyHost());
// Open connection
- if (isProxyUsed() === true) {
+ if (isProxyUsed() === TRUE) {
// Resolve hostname into IP address
$ip = $resolver->resolveHostname($proxyHost);
}
// Shall proxy be used?
- if (isProxyUsed() === true) {
+ if (isProxyUsed() === TRUE) {
// Setup proxy tunnel
$response = setupProxyTunnel($host, $proxyHost, $port, $resource);
fwrite($resource, $request);
// Start counting
- $start = microtime(true);
+ $start = microtime(TRUE);
// Read response
while (!feof($resource)) {
$info = stream_get_meta_data($resource);
// Is it timed out? 15 seconds is a really patient...
- if (($info['timed_out'] == true) || (microtime(true) - $start) > 15) {
+ if (($info['timed_out'] == TRUE) || (microtime(TRUE) - $start) > 15) {
// Timeout
logDebugMessage(__FUNCTION__, __LINE__, 'Timed out to get data from host ' . $host);
// Time request if debug-mode is enabled
if (isDebugModeEnabled()) {
// Add debug message...
- logDebugMessage(__FUNCTION__, __LINE__, 'Request took ' . (microtime(true) - $start) . ' seconds and returned ' . count($response) . ' line(s).');
+ logDebugMessage(__FUNCTION__, __LINE__, 'Request took ' . (microtime(TRUE) - $start) . ' seconds and returned ' . count($response) . ' line(s).');
} // END - if
// Skip first empty lines
}
} // END - foreach
- //* DEBUG: */ debugOutput('<strong>Request:</strong><pre>'.print_r($request, true).'</pre>');
- //* DEBUG: */ debugOutput('<strong>Response:</strong><pre>'.print_r($response, true).'</pre>');
+ //* DEBUG: */ debugOutput('<strong>Request:</strong><pre>'.print_r($request, TRUE).'</pre>');
+ //* DEBUG: */ debugOutput('<strong>Response:</strong><pre>'.print_r($response, TRUE).'</pre>');
// Proxy agent found or something went wrong?
if (!isset($response[0])) {
// No response, maybe timeout
$response = array('', '', '');
logDebugMessage(__FUNCTION__, __LINE__, 'Invalid empty response array, maybe timed out?');
- } elseif ((substr(strtolower($response[0]), 0, 11) == 'proxy-agent') && (isProxyUsed() === true)) {
+ } elseif ((substr(strtolower($response[0]), 0, 11) == 'proxy-agent') && (isProxyUsed() === TRUE)) {
// Proxy header detected, so remove two lines
array_shift($response);
array_shift($response);
// Check array for chuncked encoding
function unchunkHttpResponse ($response) {
// Default is not chunked
- $isChunked = false;
+ $isChunked = FALSE;
// Check if we have chunks
foreach ($response as $line) {
// Entry found?
if ((isInStringIgnoreCase('transfer-encoding', $line)) && (isInStringIgnoreCase('chunked', $line))) {
// Found!
- $isChunked = true;
+ $isChunked = TRUE;
break;
} // END - if
} // END - foreach
// Is it chunked?
- if ($isChunked === true) {
+ if ($isChunked === TRUE) {
// Good, we still have the HTTP headers in there, so we need to get rid
// of them temporarly
- //* DEBUG: */ die('<pre>'.htmlentities(print_r(removeHttpHeaderFromResponse($response), true)).'</pre>');
+ //* DEBUG: */ die('<pre>'.htmlentities(print_r(removeHttpHeaderFromResponse($response), TRUE)).'</pre>');
$tempResponse = http_chunked_decode(implode('', removeHttpHeaderFromResponse($response)));
// We got a string back from http_chunked_decode(), so we need to convert it back to an array
// Returns the flag if a broken HTTP server implementation was detected
function isBrokenHttpServerImplentation () {
// Determine it
- $isBroken = ((isset($GLOBALS['is_http_server_broken'])) && ($GLOBALS['is_http_server_broken'] === true));
+ $isBroken = ((isset($GLOBALS['is_http_server_broken'])) && ($GLOBALS['is_http_server_broken'] === TRUE));
// ... and return it
return $isBroken;
$key = array_search($inc, getIncludePool($pool));
// Is it valid?
- if ($key !== false) {
+ if ($key !== FALSE) {
// Then remove it
unset($GLOBALS['inc_pool'][$pool][$key]);
// Adds a given template with content to install output stream
function addTemplateToInstallContent ($template, $content = array()) {
// Load the template
- $out = loadTemplate($template, true, $content);
+ $out = loadTemplate($template, TRUE, $content);
// Add it to output
addToInstallContent($out);
$content = $GLOBALS['install_content'];
} else {
// Nothing found, this needs fixing
- $content = displayMessage('{--INSTALLER_CONTENT_404--}', true);
+ $content = displayMessage('{--INSTALLER_CONTENT_404--}', TRUE);
}
// Return content
// Generates the installer menu by simply loading another template
function generateInstallerMenu () {
// Load installer menu template
- $OUT = loadTemplate('install_menu', true);
+ $OUT = loadTemplate('install_menu', TRUE);
// Return loaded content
return $OUT;
// Generate the install footer navigation by simply loading another template
function generateInstallerFooterNavigation () {
// Load installer menu template
- $OUT = loadTemplate('install_footer', true);
+ $OUT = loadTemplate('install_footer', TRUE);
// Return loaded content
return $OUT;
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Call-back function ' . $callbackName . ' not found. saveStatus[status]=' . $saveStatus['status'] . ', key=' . $key . ', value=' . $value);
// All fine (CAREFULL!)
- return true;
+ return TRUE;
} // END - if
// Then call it back
// Is it not valid?
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',value=' . $value . ',isValid=' . intval($isValid));
- if ($isValid === false) {
+ if ($isValid === FALSE) {
// Then add it to saveStatus
array_push($saveStatus['failed_fields'], $key);
} // END - if
$isValid = (bool) call_user_func($callbackName, $currentTab);
// Is it not valid?
- if (($isValid === false) || (count($GLOBALS['installer_failed_fields'][$currentTab]) > 0)) {
+ if (($isValid === FALSE) || (count($GLOBALS['installer_failed_fields'][$currentTab]) > 0)) {
// Then change status and message
$saveStatus['status'] = 'failed';
$saveStatus['message'] = '{%message,INSTALLER_POST_CHECK_' . strtoupper($currentTab) . '_FAILED=' . $GLOBALS['installer_post_error'][$currentTab] . '%}';
// Call-back function to check if database configuration in POST is valid
function isInstallerPostDatabaseConfigValid ($currentTab) {
// By default nothing is valid
- $isValid = false;
- $engineValid = false;
+ $isValid = FALSE;
+ $engineValid = FALSE;
$missingTables = 0;
// Do both passwords match?
// Password 1 not set
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_PASSWORD1_EMPTY--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_password1');
- return false;
+ return FALSE;
} elseif ((isPostRequestElementSet('mysql_password1')) && (!isPostRequestElementSet('mysql_password2'))) {
// Password 2 not set
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_PASSWORD2_EMPTY--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_password2');
- return false;
+ return FALSE;
} elseif (postRequestElement('mysql_password1') != postRequestElement('mysql_password2')) {
// Passwords mismatch
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_PASSWORDS_MISMATCH--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_password1', 'mysql_password2');
- return false;
+ return FALSE;
} // END - if
// Restore PHP's own error handler
// Cannot connect to database
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_CONNECT_ERROR--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_login', 'mysql_password1', 'mysql_password2');
- return false;
+ return FALSE;
} // END - if
// Then attempt to select the database
// Could not find database
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_SELECT_FAILED--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_dbase');
- return false;
+ return FALSE;
} // END - if
// Set database name and prefix
// Something bad happened
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_ENGINES_SQL_ERROR--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_type');
- return false;
+ return FALSE;
} elseif (count($engines) == 0) {
// Restore own error handler again
set_error_handler('__errorHandler');
// No engine is active
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_NO_ENGINES_ACTIVE--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_type');
- return false;
+ return FALSE;
}
// Then check all, if the requested is working
foreach ($engines as $engineArray) {
// By default the selected engine is not valid
- $engineValid = false;
+ $engineValid = FALSE;
// Is the engine there?
if (strtolower($engineArray['Engine']) == strtolower(postRequestElement('mysql_type'))) {
// Okay, engine is found
- $engineValid = true;
+ $engineValid = TRUE;
break;
} // END - if
} // END - foreach
// So, is the engine found?
- if ($engineValid === false) {
+ if ($engineValid === FALSE) {
// Restore own error handler again
set_error_handler('__errorHandler');
// Requested engine is not active
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_ENGINE_UNSUPPORTED--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_type');
- return false;
+ return FALSE;
} // END - if
// Init some known tables
$tables = array(
// Admins
- 'admins' => true,
+ 'admins' => TRUE,
// Admin menu
- 'admin_menu' => true,
+ 'admin_menu' => TRUE,
// Categories
- 'cats' => true,
+ 'cats' => TRUE,
// Configuration
- 'config' => true,
+ 'config' => TRUE,
// Extensions
- 'extensions' => true,
+ 'extensions' => TRUE,
// Guest menu
- 'guest_menu' => true,
+ 'guest_menu' => TRUE,
// Max receive
- 'max_receive' => true,
+ 'max_receive' => TRUE,
// Member menu
- 'member_menu' => true,
+ 'member_menu' => TRUE,
// Module registry
- 'mod_reg' => true,
+ 'mod_reg' => TRUE,
// Payments
- 'payments' => true,
+ 'payments' => TRUE,
// Sending pool
- 'pool' => true,
+ 'pool' => TRUE,
// Referral banner
- 'refbanner' => true,
+ 'refbanner' => TRUE,
// Referral levels
- 'refdepths' => true,
+ 'refdepths' => TRUE,
// Referral system
- 'refsystem' => true,
+ 'refsystem' => TRUE,
// Task system
- 'task_system' => true,
+ 'task_system' => TRUE,
);
// So check if all tables are not there
$tables[$tableName] = ifSqlTableExists($tableName);
// Is it (hopefully not) there?
- if ($tables[$tableName] === false) {
+ if ($tables[$tableName] === FALSE) {
// This does not exist
$missingTables++;
} // END - if
set_error_handler('__errorHandler');
// If the status is true, disconnect the database
- if ($isValid === false) {
+ if ($isValid === FALSE) {
// Still something bad happened (e.g. tables found)
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_IN_USE--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_dbase');
// Is the link up?
if (SQL_IS_LINK_UP()) {
// Seems to work, also right database?
- if (SQL_SELECT_DB($GLOBALS['install_mysql']['dbase'], __FILE__, __LINE__) === true) {
+ if (SQL_SELECT_DB($GLOBALS['install_mysql']['dbase'], __FILE__, __LINE__) === TRUE) {
// Check for dumps
if ((!isFileReadable(postRequestElement('spath') . 'install/tables.sql')) || (!isFileReadable(postRequestElement('spath') . 'install/menu-'.getLanguage().'.sql'))) {
// Installation area not found
reportBug(__FILE__, __LINE__, sprintf("SQL dump %s is not readable.", $dump));
}
} // END - foreach
- //* DEBUG: */ die(__FUNCTION__.'['.__LINE__.']:'<pre>'.print_r(getSqls(), true).'</pre>');
+ //* DEBUG: */ die(__FUNCTION__.'['.__LINE__.']:'<pre>'.print_r(getSqls(), TRUE).'</pre>');
// Are some SQLs found?
if (countSqls() == 0) {
);
// Simply load the JavaScript here
-loadTemplate('js_admin_ajax', false, $content);
+loadTemplate('js_admin_ajax', FALSE, $content);
// [EOF]
?>
);
// Simply load the JavaScript here
-loadTemplate('js_install_ajax', false, $content);
+loadTemplate('js_install_ajax', FALSE, $content);
// [EOF]
?>
);
// Load template
-loadTemplate('js_surfbar_frame_top', false, $content);
+loadTemplate('js_surfbar_frame_top', FALSE, $content);
// [EOF]
?>
);
// Simply load the JavaScript here
-loadTemplate('js_surfbar_member_edit', false, $content);
+loadTemplate('js_surfbar_member_edit', FALSE, $content);
// [EOF]
?>
} // END - if
// *Does* match by default
- $matches = true;
+ $matches = TRUE;
// Is one not readable?
if (!isIncludeReadable($source)) {
$GLOBALS['messages'][$backupLang] = array();
// Both are readable so include current language file
- $GLOBALS['count'] = false;
+ $GLOBALS['count'] = FALSE;
loadInclude($source);
$GLOBALS['msgs'][$source] = $GLOBALS['messages'][$backupLang];
unset($GLOBALS['count']);
// Do they mismatch?
if ((count($GLOBALS['msgs'][$source])) != (count($GLOBALS['msgs'][$target]))) {
// Does not match
- $matches = false;
+ $matches = FALSE;
// Check all differences
foreach ($GLOBALS['msgs'][$source] as $key => $value) {
}
// Checks whether the given message is masked
-function isMessageMasked ($messageId, $strict = true) {
+function isMessageMasked ($messageId, $strict = TRUE) {
// Is the message id valid?
- if (($strict === true) && (!isMessageIdValid($messageId))) {
+ if (($strict === TRUE) && (!isMessageIdValid($messageId))) {
// No, then abort here
reportBug(__FUNCTION__, __LINE__, 'Invalid message id ' . $messageId . ' detected.');
} // END - if
if (($action == 'login') || ($action == 'logout')) {
// If action is login or logout allow allways!
- return true;
+ return TRUE;
} elseif (isset($GLOBALS[__FUNCTION__][$adminId][$action][$what])) {
// If we have cache, use it
return $GLOBALS[__FUNCTION__][$adminId][$action][$what];
}
// But default result is failed
- $GLOBALS[__FUNCTION__][$action][$what] = false;
+ $GLOBALS[__FUNCTION__][$action][$what] = FALSE;
// Get admin's defult access right
$default = getAdminDefaultAcl($adminId);
$parent = isAdminsAllowedByAcl($parent_action, '');
} else {
// Anything else is true!
- $parent = false;
+ $parent = FALSE;
}
// Shall I test for a main or sub menu? (action or what?)
}
} elseif (!isExtensionActive('cache')) {
// Extension ext-cache is absent, so load it from database
- $result = false;
+ $result = FALSE;
if (!empty($action)) {
// Main menu
$result = SQL_QUERY_ESC("SELECT `access_mode` FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE `admin_id`=%s AND `action_menu`='%s' LIMIT 1",
// Check ACL and (maybe) allow
//* DEBUG: */ debugOutput('default='.$default.',acl_mode='.$aclMode.',parent='.intval($parent));
- if ((($default == 'allow') && ($aclMode != 'deny')) || (($default == 'deny') && ($aclMode == 'allow')) || ($parent === true) || (($default == 'NO-ACL') && ($aclMode == 'failed') && ($parent === false))) {
+ if ((($default == 'allow') && ($aclMode != 'deny')) || (($default == 'deny') && ($aclMode == 'allow')) || ($parent === TRUE) || (($default == 'NO-ACL') && ($aclMode == 'failed') && ($parent === FALSE))) {
// Access is granted
- $GLOBALS[__FUNCTION__][$adminId][$action][$what] = true;
+ $GLOBALS[__FUNCTION__][$adminId][$action][$what] = TRUE;
} // END - if
// Return value
}
// Change a lot admin account
-function adminsChangeAdminAccount ($postData, $element = '', $displayMessage = true) {
+function adminsChangeAdminAccount ($postData, $element = '', $displayMessage = TRUE) {
// Begin the update
$cache_update = '0';
$message = '';
} // END - foreach
// Display message if not empty and allowed
- if ((!empty($message)) && ($displayMessage === true)) {
+ if ((!empty($message)) && ($displayMessage === TRUE)) {
// Display it
displayMessage($message);
} // END - if
}
// Load row template and switch color
- $OUT .= loadTemplate('admin_edit_admins_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_admins_row', TRUE, $content);
} // END - if
// Free result
} // END - foreach
// Load template
- loadTemplate('admin_edit_admins', false, $OUT);
+ loadTemplate('admin_edit_admins', FALSE, $OUT);
}
// Generate access mode selection box for given admin id
// Delete given admin accounts
function adminsDeleteAdminAccount ($postData) {
// Check if this account is the last one which cannot be deleted...
- if (countSumTotalData('', 'admins', 'id', '', true) > 1) {
+ if (countSumTotalData('', 'admins', 'id', '', TRUE) > 1) {
// Delete accounts
$OUT = '';
foreach ($postData['sel'] as $id => $selected) {
$content['id'] = $id;
// Load row template and switch color
- $OUT .= loadTemplate('admin_delete_admins_row', true, $content);
+ $OUT .= loadTemplate('admin_delete_admins_row', TRUE, $content);
} // END - if
// Free result
} // END - foreach
// Load template
- loadTemplate('admin_delete_admins', false, $OUT);
+ loadTemplate('admin_delete_admins', FALSE, $OUT);
} else {
// Cannot delete last account!
displayMessage('{--ADMIN_ADMINS_CANNOT_DELETE_LAST--}');
$content['la_mode'] = '{--ADMIN_ADMINS_LA_MODE_' . strtoupper($content['la_mode']) . '--}';
// Load row template and switch color
- $OUT .= loadTemplate('admin_list_admins_row', true, $content);
+ $OUT .= loadTemplate('admin_list_admins_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load template
- loadTemplate('admin_list_admins', false, $OUT);
+ loadTemplate('admin_list_admins', FALSE, $OUT);
}
// Sends out mail to all administrators
SQL_FREERESULT($result);
// Init result
- $result = false;
+ $result = FALSE;
// "implode" ids and query string
$adminId = implode(',', $adminIds);
// Add points to user or begging rallye account
function addPointsBeg ($userid, $points) {
// Default is not added
- $added = false;
+ $added = FALSE;
// Is begging rallye active?
if (isBegRallyeEnabled()) {
}
// Subtract begged points from member account if the admin has selected one
- if (($added === true) && (isValidUserId(getBegUserid()))) {
+ if (($added === TRUE) && (isValidUserId(getBegUserid()))) {
// Subtract from this account
$added = ($added && subtractPoints('beg_payout', getBegUserid(), $points));
} // END - if
//-----------------------------------------------------------------------------
// Outputs points which a member can get
-function doTemplateOutputBegPoints ($templateName, $clear = false) {
+function doTemplateOutputBegPoints ($templateName, $clear = FALSE) {
// Default is not the same
$return = '{--BEG_POINTS_MIN_MAX--}';
function addTurboBonus ($mid, $userid, $type) {
// Shall we add bonus points?
if (!isBonusRallyeActive()) {
- return false;
+ return FALSE;
} // END - if
// Init variables
// Is a column name set?
if (empty($column)) {
// No, then abort here
- return false;
+ return FALSE;
} // END - if
// Check for entry
- $rank = countSumTotalData($mid, 'bonus_turbo', 'id', $column, true) + 1;
+ $rank = countSumTotalData($mid, 'bonus_turbo', 'id', $column, TRUE) + 1;
// Which rank?
if ($rank == 1) {
//
function addBonusRanks ($data, $type, $userid) {
// Init variables
- $self = false; $OUT = ''; $GLOBALS['ranking_content'] = array();
+ $self = FALSE; $OUT = ''; $GLOBALS['ranking_content'] = array();
// Clear rankings by default
$GLOBALS['ranking_content']['rankings'] = '';
$GLOBALS['ranking_content'] = merge_array($GLOBALS['ranking_content'], SQL_FETCHARRAY($result));
// Remember all values for later use
- $self = true;
+ $self = TRUE;
// Transfer data to template
$GLOBALS['ranking_content']['timemark'] = generateDateTime($GLOBALS['ranking_content']['timemark'], 1);
// Load template
- $GLOBALS['ranking_content']['own'] = loadTemplate('show_bonus_yr', true, $GLOBALS['ranking_content']);
+ $GLOBALS['ranking_content']['own'] = loadTemplate('show_bonus_yr', TRUE, $GLOBALS['ranking_content']);
} // END - if
// Load rankings
$rows['rank'] = $rank;
// Load row template
- $OUT .= loadTemplate('member_bonus_turbo_row', true, $rows);
+ $OUT .= loadTemplate('member_bonus_turbo_row', TRUE, $rows);
} // END - for
- if ($self === false) {
+ if ($self === FALSE) {
// If current user was not found set constant
$GLOBALS['ranking_content']['rankings'] = '{--MEMBER_BONUS_RANK_YOU_ARE_404--}';
} // END - if
} // END - if
// Default is not working
- $return = false;
+ $return = FALSE;
// Switch to jackpot-mode when no UID is supplied but userid-mode is selected
if ((getBonusMode() == 'UID') && ($userid == '0') && (isExtensionActive('jackpot'))) {
break;
case 'JACKPOT': // ... jackpot
- if ((isExtensionActive('jackpot')) && (subtractPointsFromJackpot($points) === false) && (isValidUserId($userid))) {
+ if ((isExtensionActive('jackpot')) && (subtractPointsFromJackpot($points) === FALSE) && (isValidUserId($userid))) {
if ($total >= $points) {
// Subtract points from userid's account
$return = subtractPointsFromJackpot('bonus_payout_jackpot', $userid, $points);
if (SQL_NUMROWS($result) == 1) {
// Load entry
$content = SQL_FETCHARRAY($result);
- //* DEBUG: */ print($id.'=<pre>'.print_r($content, true).'</pre>');
+ //* DEBUG: */ print($id.'=<pre>'.print_r($content, TRUE).'</pre>');
// Construct human-readable description
$ret = sprintf("%s (%s)", $content['descr'], $content['code']);
$content['timemark'] = generateDateTime($content['timemark'], $DT_MODE);
// Load template and switch color
- $OUT .= loadTemplate($mode . '_doubler_list_rows', true, $content);
+ $OUT .= loadTemplate($mode . '_doubler_list_rows', TRUE, $content);
} // END - while
// Free memory
// List no entries
$OUT = '<tr>
<td colspan="' . $COLS . '" align="center" class="bottom">
- ' . displayMessage($message, true) . '
+ ' . displayMessage($message, TRUE) . '
</td>
</tr>';
}
// Return template
- return loadTemplate($mode . '_doubler_list', true, $OUT);
+ return loadTemplate($mode . '_doubler_list', TRUE, $OUT);
}
// Get total points left in doubler pot
$filterData = runFilterChain('member_earning_table_data', $filterData);
// Load the proper template and return it
- $output = loadTemplate('member_earning_data_' . strtolower($filterData['earning_group']), true, $filterData);
+ $output = loadTemplate('member_earning_data_' . strtolower($filterData['earning_group']), TRUE, $filterData);
// Return it
return $output;
$status = (!SQL_HASZEROAFFECTED());
// Has the record changed?
- if ($status === true) {
+ if ($status === TRUE) {
// Prepare content
$content = array(
'earning_id' => bigintval($earningId),
// "Getter" for an array of data from all Forced-PopUps except user's
function getForcedPopupDataByEarningArray ($content) {
- die('content=<pre>' . print_r($content, true) . '</pre>' . debug_get_printable_backtrace());
+ die('content=<pre>' . print_r($content, TRUE) . '</pre>' . debug_get_printable_backtrace());
// Finally return the content
return $content;
// Do some sanity checks
if (!isAdmin()) {
// Not allowed to call
- return false;
+ return FALSE;
} elseif (countPostSelection('forced_campaign_id') == 0) {
// No selections made
- return false;
+ return FALSE;
}
// Get an array from all pending campaigns
$forcedCampaigns = getArrayFromForcedCampaignsByArray(array_keys(postRequestElement('forced_campaign_id')), 'PENDING');
// By default all worked (at this point)
- $activated = true;
+ $activated = TRUE;
// Run through all entries
foreach ($forcedCampaigns as $campaignId => $campaignData) {
// Change the status of this campaign
if (!changeForcedCampaignStatus($campaignId, 'PENDING', 'ACTIVE', $campaignData)) {
// One didn't work, but continue with others
- $activated = false;
+ $activated = FALSE;
} // END - if
} // END - foreach
// ---------- Comment out for debugging/developing member actions! ---------
if (SQL_AFFECTEDROWS() != 1) {
// No, something went wrong
- return false;
+ return FALSE;
} // END - if
// ---------- Comment out for debugging/developing member actions! ---------
// All done!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'campaignId=' . $campaignId . ',prevStatus=' . $prevStatus . ',newStatus=' . $newStatus . ' - EXIT!');
- return true;
+ return TRUE;
}
// Notify admin(s) with a selected message and content
// Skip notification if userid is NULL
if (is_null($content['forced_campaign_userid'])) {
// NULL is silently ignored
- return true;
+ return TRUE;
} // END - if
// Prepare template name
// ----------------------------------------------------------------------------
// Template helper function to create selection box for all forced-ad types
-function doTemplateForcedAdTypeSelectionBox ($templateName, $clear = false, $default = NULL) {
+function doTemplateForcedAdTypeSelectionBox ($templateName, $clear = FALSE, $default = NULL) {
// Add all types through the filter
$forcedAdTypes = runFilterChain('add_forced_ads_types', array());
}
// Template helper function to create selection box for costs visibility
-function doTemplateForcedCostsVisiblitySelectionBox ($templateName, $clear = false, $default = NULL) {
+function doTemplateForcedCostsVisiblitySelectionBox ($templateName, $clear = FALSE, $default = NULL) {
// Init array
$costsVisibility = array(
0 => array('visibility' => 'ALL'),
$forcedCosts = getArrayFromForcedCostsByVisibility();
// Handle it over to generateSelectionBoxFromArray()
- $content = generateSelectionBoxFromArray($forcedCosts, 'forced_costs_id', 'forced_costs_id', '', '', '', $default, '', true);
+ $content = generateSelectionBoxFromArray($forcedCosts, 'forced_costs_id', 'forced_costs_id', '', '', '', $default, '', TRUE);
// Return prepared content
return $content;
// Template helper function to create selection box for foreced campaign userid
function doTemplateForcedCampaignUseridSelectionBox ($templateName, $clear, $default = NULL) {
// Generate the selection box without all
- $content = addMemberSelectionBox($default, false, true, true, 'forced_campaign_userid');
+ $content = addMemberSelectionBox($default, FALSE, TRUE, TRUE, 'forced_campaign_userid');
// Return prepared content
return $content;
while ($content = SQL_FETCHARRAY($result_stop)) {
// Stop holiday
addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_holidays` WHERE `userid`=%s LIMIT 1",
- array(bigintval($content['userid'])), __FUNCTION__, __LINE__, false));
+ array(bigintval($content['userid'])), __FUNCTION__, __LINE__, FALSE));
// Unlock account
addSql(SQL_QUERY_ESC("UPDATE
WHERE
`userid`=%s
LIMIT 1",
- array(bigintval($content['userid'])), __FUNCTION__, __LINE__, false));
+ array(bigintval($content['userid'])), __FUNCTION__, __LINE__, FALSE));
// Prepare array
$content = merge_array($content, array(
// Subtracts points from the jackpot
function subtractPointsFromJackpot ($points) {
// First failed
- $ret = false;
+ $ret = FALSE;
// Get jackpot points for dummy
$jackpot = getJackpotPoints();
function updateMediadataEntry ($keys_array, $mode, $value) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'keys_array[]=' . gettype($keys_array) . ',mode=' . $mode . ',value=' . $value . ' - ENTERED!');
// Default is nothing added/updated
- $added = false;
+ $added = FALSE;
// Are there entries?
if (is_array($keys_array) && ($value > 0)) {
// Zero entries are always added
if ($value == 0) {
// Is zero value, so we need to set $added here to avoid wrong false result
- $added = true;
+ $added = TRUE;
} // END - if
// Return result
// Is the function valid?
if (!function_exists($functionName)) {
// Invalid function name
- reportBug(__FUNCTION__, __LINE__, 'Invalid do ' . getRequestElement('do') . ', function ' . $functionName .' does not exist.', false);
+ reportBug(__FUNCTION__, __LINE__, 'Invalid do ' . getRequestElement('do') . ', function ' . $functionName .' does not exist.', FALSE);
} // END - if
// Init global arrays
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$name])) {
// Does it exist?
- $GLOBALS[__FUNCTION__][$name] = (countSumTotalData($name, 'network_data', 'network_id', 'network_short_name', true) == 1);
+ $GLOBALS[__FUNCTION__][$name] = (countSumTotalData($name, 'network_data', 'network_id', 'network_short_name', TRUE) == 1);
} // END - if
// Return result
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$name])) {
// Does it exist?
- $GLOBALS[__FUNCTION__][$name] = ((isNetworkNameValid($name)) && (countSumTotalData($name, 'network_data', 'network_id', 'network_short_name', true, " AND `network_active`='Y'") == 1));
+ $GLOBALS[__FUNCTION__][$name] = ((isNetworkNameValid($name)) && (countSumTotalData($name, 'network_data', 'network_id', 'network_short_name', TRUE, " AND `network_active`='Y'") == 1));
} // END - if
// Return result
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$networkId])) {
// Does it exist?
- $GLOBALS[__FUNCTION__][$networkId] = (countSumTotalData(bigintval($networkId), 'network_data', 'network_id', 'network_id', true, " AND `network_active`='Y'") == 1);
+ $GLOBALS[__FUNCTION__][$networkId] = (countSumTotalData(bigintval($networkId), 'network_data', 'network_id', 'network_id', TRUE, " AND `network_active`='Y'") == 1);
} // END - if
// Return result
} // END - if
// Just call our inner method
- return adminSaveSettings($networkData, '_network_data', sprintf("`network_id`=%s", bigintval($networkId)), array(), false, false);
+ return adminSaveSettings($networkData, '_network_data', sprintf("`network_id`=%s", bigintval($networkId)), array(), FALSE, FALSE);
}
// Updates given network type handler (id) with data from array
} // END - if
// Just call our inner method
- return adminSaveSettings($networkTypeData, '_network_types', sprintf("`network_type_id`=%s", bigintval($networkTypeId)), array(), false, false);
+ return adminSaveSettings($networkTypeData, '_network_types', sprintf("`network_type_id`=%s", bigintval($networkTypeId)), array(), FALSE, FALSE);
}
// Updates given network request parameters (id) with data from array
} // END - if
// Just call our inner method
- return adminSaveSettings($networkParamsData, '_network_request_params', sprintf("`network_request_param_id`=%s", bigintval($networkParamsId)), array(), false, false);
+ return adminSaveSettings($networkParamsData, '_network_request_params', sprintf("`network_request_param_id`=%s", bigintval($networkParamsId)), array(), FALSE, FALSE);
}
// Updates given network array translations (id) with data from array
} // END - if
// Just call our inner method
- return adminSaveSettings($networkTranslationsData, '_network_array_translation', sprintf("`network_array_id`=%s", bigintval($networkTranslationsId)), array(), false, false);
+ return adminSaveSettings($networkTranslationsData, '_network_array_translation', sprintf("`network_array_id`=%s", bigintval($networkTranslationsId)), array(), FALSE, FALSE);
}
// Removes given network entry
$content = generateSelectionBoxFromArray($rows, 'network_id', 'network_id', '', '', 'network');
} else {
// Nothing selected
- $content = loadTemplate('admin_settings_unsaved', false, '{--ADMIN_ENTRIES_404--}');
+ $content = loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_ENTRIES_404--}');
}
// Free the result
$content = generateSelectionBoxFromArray($rows, 'network_type', 'network_type_id');
} else {
// Nothing selected
- $content = loadTemplate('admin_settings_unsaved', false, '{--ADMIN_ENTRIES_404--}');
+ $content = loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_ENTRIES_404--}');
}
// Free the result
$content = generateSelectionBoxFromArray($rows, 'network_type', 'network_type_id', '', '_title');
} else {
// Nothing selected
- $content = loadTemplate('admin_settings_unsaved', false, '{--ADMIN_ENTRIES_404--}');
+ $content = loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_ENTRIES_404--}');
}
// Free the result
// We can say here, the form is sent, so check if the network is already added
if (isNetworkNameValid(postRequestElement('network_short_name'))) {
// Already there
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_ALREADY_ADDED=' . postRequestElement('network_short_name') . '%}');
- return false;
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_ALREADY_ADDED=' . postRequestElement('network_short_name') . '%}');
+ return FALSE;
} elseif (!isNetworkActiveByShortName(postRequestElement('network_short_name'))) {
// Network is not active
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_NOT_ACTIVE=' . postRequestElement('network_short_name') . '%}');
- return false;
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_NOT_ACTIVE=' . postRequestElement('network_short_name') . '%}');
+ return FALSE;
}
// Remove the 'ok' part
// Output message
if (!SQL_HASZEROAFFECTED()) {
// Successfully added
- loadTemplate('admin_network_added', false, postRequestArray());
+ loadTemplate('admin_network_added', FALSE, postRequestArray());
} else {
// Not added
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_DATA_NOT_ADDED=' . postRequestElement('network_short_name') . '%}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_DATA_NOT_ADDED=' . postRequestElement('network_short_name') . '%}');
}
}
// 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);
+ $OUT .= loadTemplate('admin_' . $GLOBALS['network_form_name'] . '_networks_row', TRUE, $networkData);
} // END - if
} // END - if
} // END - foreach
// If we have no rows, we don't need to display the edit form
if (!empty($OUT)) {
// Output main template
- loadTemplate('admin_' . $GLOBALS['network_form_name'] . '_networks', false, $OUT);
+ loadTemplate('admin_' . $GLOBALS['network_form_name'] . '_networks', FALSE, $OUT);
// Don't display the list/add new form
- $GLOBALS['network_display'] = false;
+ $GLOBALS['network_display'] = FALSE;
} else {
// Nothing selected/found
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_NOTHING_FOUND--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_NOTHING_FOUND--}');
}
} // END - if
}
if (count($networkTypeData) > 0) {
if (isFormSent('edit')) {
// Add row template for deleting
- $OUT .= loadTemplate('admin_edit_network_types_row', true, $networkTypeData);
+ $OUT .= loadTemplate('admin_edit_network_types_row', TRUE, $networkTypeData);
} elseif (isFormSent('delete')) {
// Add row template for deleting
- $OUT .= loadTemplate('admin_delete_network_types_row', true, $networkTypeData);
+ $OUT .= loadTemplate('admin_delete_network_types_row', TRUE, $networkTypeData);
} else {
// Problem!
reportBug(__FUNCTION__, __LINE__, 'Cannot detect edit/delete.');
if (!empty($OUT)) {
// Output main template
if (isFormSent('edit')) {
- loadTemplate('admin_edit_network_types', false, $OUT);
+ loadTemplate('admin_edit_network_types', FALSE, $OUT);
} elseif (isFormSent('delete')) {
- loadTemplate('admin_delete_network_types', false, $OUT);
+ loadTemplate('admin_delete_network_types', FALSE, $OUT);
} else {
// Problem!
reportBug(__FUNCTION__, __LINE__, 'Cannot detect edit/delete.');
}
// Don't display the list/add new form
- $GLOBALS['network_display'] = false;
+ $GLOBALS['network_display'] = FALSE;
} else {
// Nothing selected/found
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_TYPE_HANDLER_NOTHING_FOUND--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_TYPE_HANDLER_NOTHING_FOUND--}');
}
} // END - if
}
if (count($networkRequestData) > 0) {
if (isFormSent('edit')) {
// Add row template for deleting
- $OUT .= loadTemplate('admin_edit_network_request_params_row', true, $networkRequestData);
+ $OUT .= loadTemplate('admin_edit_network_request_params_row', TRUE, $networkRequestData);
} elseif (isFormSent('delete')) {
// Get type data
$networkRequestData['network_type_data'] = getNetworkTypeDataById($networkRequestData['network_type_id']);
// Add row template for deleting
- $OUT .= loadTemplate('admin_delete_network_request_params_row', true, $networkRequestData);
+ $OUT .= loadTemplate('admin_delete_network_request_params_row', TRUE, $networkRequestData);
} else {
// Problem!
reportBug(__FUNCTION__, __LINE__, 'Cannot detect edit/delete.');
if (!empty($OUT)) {
// Output main template
if (isFormSent('edit')) {
- loadTemplate('admin_edit_network_request_params', false, $OUT);
+ loadTemplate('admin_edit_network_request_params', FALSE, $OUT);
} elseif (isFormSent('delete')) {
- loadTemplate('admin_delete_network_request_params', false, $OUT);
+ loadTemplate('admin_delete_network_request_params', FALSE, $OUT);
} else {
// Problem!
reportBug(__FUNCTION__, __LINE__, 'Cannot detect edit/delete.');
}
// Don't display the list/add new form
- $GLOBALS['network_display'] = false;
+ $GLOBALS['network_display'] = FALSE;
} else {
// Nothing selected/found
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_FOUND--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_FOUND--}');
}
} // END - if
}
displayMessage('{%message,ADMIN_NETWORK_UPDATED=' . $updated . '%}');
} else {
// Nothing changed
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_NOTHING_CHANGED--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_NOTHING_CHANGED--}');
}
} // END - if
}
displayMessage('{%message,ADMIN_NETWORK_REMOVED=' . $removed . '%}');
} else {
// Nothing removed
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_NOTHING_REMOVED--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_NOTHING_REMOVED--}');
}
} // END - if
}
// Is the network type handle already used with given network?
if (isNetworkTypeHandleValid(postRequestElement('network_type_handler'), getRequestElement('network_id'))) {
// Already added
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_TYPE_HANDLER_ALREADY_ADDED=' . postRequestElement('network_type_handler') . '%}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_TYPE_HANDLER_ALREADY_ADDED=' . postRequestElement('network_type_handler') . '%}');
// ... so abort here
- return false;
+ return FALSE;
} // END - if
// Remove the 'ok' part
// Output message
if (!SQL_HASZEROAFFECTED()) {
// Successfully added
- loadTemplate('admin_network_type_added', false, postRequestArray());
+ loadTemplate('admin_network_type_added', FALSE, postRequestArray());
} else {
// Not added
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_TYPE_HANDLER_NOT_ADDED=' . postRequestElement('network_type_handler') . '%}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_TYPE_HANDLER_NOT_ADDED=' . postRequestElement('network_type_handler') . '%}');
}
}
displayMessage('{%message,ADMIN_NETWORK_TYPE_HANDLER_UPDATED=' . $updated . '%}');
} else {
// Nothing changed
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_TYPE_HANDLER_NOTHING_CHANGED--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_TYPE_HANDLER_NOTHING_CHANGED--}');
}
} // END - if
}
displayMessage('{%message,ADMIN_NETWORK_REQUEST_PARAMETER_UPDATED=' . $updated . '%}');
} else {
// Nothing changed
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_CHANGED--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_CHANGED--}');
}
} // END - if
}
displayMessage('{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_UPDATED=' . $updated . '%}');
} else {
// Nothing changed
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_ARRAY_TRANSLATION_NOTHING_CHANGED--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_ARRAY_TRANSLATION_NOTHING_CHANGED--}');
}
} // END - if
}
displayMessage('{%message,ADMIN_NETWORK_TYPE_HANDLER_REMOVED=' . $removed . '%}');
} else {
// Nothing removed
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_TYPE_HANDLER_NOTHING_REMOVED--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_TYPE_HANDLER_NOTHING_REMOVED--}');
}
} // END - if
}
displayMessage('{%message,ADMIN_NETWORK_REQUEST_PARAMETER_REMOVED=' . $removed . '%}');
} else {
// Nothing removed
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_REMOVED--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_REMOVED--}');
}
} // END - if
}
displayMessage('{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_REMOVED=' . $removed . '%}');
} else {
// Nothing removed
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_ARRAY_TRANSLATION_NOTHING_REMOVED--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_ARRAY_TRANSLATION_NOTHING_REMOVED--}');
}
} // END - if
}
// Is the request parameter already used with given network?
if (isNetworkRequestElementValid(postRequestElement('network_request_param_key'), postRequestElement('network_type_id'), getRequestElement('network_id'))) {
// Already added
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_REQUEST_PARAMETER_ALREADY_ADDED=' . postRequestElement('network_request_param_key') . '%}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_REQUEST_PARAMETER_ALREADY_ADDED=' . postRequestElement('network_request_param_key') . '%}');
// ... so abort here
- return false;
+ return FALSE;
} // END - if
// Remove the 'ok' part
// Output message
if (!SQL_HASZEROAFFECTED()) {
// Successfully added
- loadTemplate('admin_network_request_param_added', false, postRequestArray());
+ loadTemplate('admin_network_request_param_added', FALSE, postRequestArray());
} else {
// Not added
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_REQUEST_PARAMETER_NOT_ADDED=' . postRequestElement('network_request_param_key') . '%}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_REQUEST_PARAMETER_NOT_ADDED=' . postRequestElement('network_request_param_key') . '%}');
}
}
// Is the request parameter already used with given network?
if (isNetworkVcheckElementValid(postRequestElement('network_vcheck_param_key'), getRequestElement('network_id'))) {
// Already added
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_VCHECK_PARAMETER_ALREADY_ADDED=' . postRequestElement('network_vcheck_param_key') . '%}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_VCHECK_PARAMETER_ALREADY_ADDED=' . postRequestElement('network_vcheck_param_key') . '%}');
// ... so abort here
- return false;
+ return FALSE;
} // END - if
// Remove the 'ok' part
// Output message
if (!SQL_HASZEROAFFECTED()) {
// Successfully added
- loadTemplate('admin_network_vcheck_param_added', false, postRequestArray());
+ loadTemplate('admin_network_vcheck_param_added', FALSE, postRequestArray());
} else {
// Not added
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_VCHECK_PARAMETER_NOT_ADDED=' . postRequestElement('network_vcheck_param_key') . '%}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_VCHECK_PARAMETER_NOT_ADDED=' . postRequestElement('network_vcheck_param_key') . '%}');
}
}
// Is the request parameter already used with given network?
if (isNetworkArrayTranslationValid(postRequestElement('network_array_index'), postRequestElement('network_type_id'), getRequestElement('network_id'))) {
// Already added
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_ALREADY_ADDED=' . postRequestElement('network_array_index') . '%}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_ALREADY_ADDED=' . postRequestElement('network_array_index') . '%}');
// ... so abort here
- return false;
+ return FALSE;
} // END - if
// Remove the 'ok' part
// Output message
if (!SQL_HASZEROAFFECTED()) {
// Successfully added
- loadTemplate('admin_network_array_translation_added', false, postRequestArray());
+ loadTemplate('admin_network_array_translation_added', FALSE, postRequestArray());
} else {
// Not added
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_NOT_ADDED=' . postRequestElement('network_array_index') . '%}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_NOT_ADDED=' . postRequestElement('network_array_index') . '%}');
}
}
if (count($networkTranslationsData) > 0) {
if (isFormSent('edit')) {
// Add row template for deleting
- $OUT .= loadTemplate('admin_edit_network_array_translation_row', true, $networkTranslationsData);
+ $OUT .= loadTemplate('admin_edit_network_array_translation_row', TRUE, $networkTranslationsData);
} elseif (isFormSent('delete')) {
// Get type data
$networkTranslationsData['network_type_data'] = getNetworkTypeDataById($networkTranslationsData['network_type_id']);
// Add row template for deleting
- $OUT .= loadTemplate('admin_delete_network_array_translation_row', true, $networkTranslationsData);
+ $OUT .= loadTemplate('admin_delete_network_array_translation_row', TRUE, $networkTranslationsData);
} else {
// Problem!
reportBug(__FUNCTION__, __LINE__, 'Cannot detect edit/delete.');
if (!empty($OUT)) {
// Output main template
if (isFormSent('edit')) {
- loadTemplate('admin_edit_network_array_translation', false, $OUT);
+ loadTemplate('admin_edit_network_array_translation', FALSE, $OUT);
} elseif (isFormSent('delete')) {
- loadTemplate('admin_delete_network_array_translation', false, $OUT);
+ loadTemplate('admin_delete_network_array_translation', FALSE, $OUT);
} else {
// Problem!
reportBug(__FUNCTION__, __LINE__, 'Cannot detect edit/delete.');
}
// Don't display the list/add new form
- $GLOBALS['network_display'] = false;
+ $GLOBALS['network_display'] = FALSE;
} else {
// Nothing selected/found
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_FOUND--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_FOUND--}');
}
} // END - if
}
displayMessage('{--ADMIN_CONFIG_NETWORK_API_SAVED--}');
} else {
// Not added
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_CONFIG_NETWORK_API_NOT_SAVED--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CONFIG_NETWORK_API_NOT_SAVED--}');
}
}
// Only adds network type configuration if not yet present
-function doAdminNetworkProcessAddHandlerTypesConfig ($displayMessage = true) {
+function doAdminNetworkProcessAddHandlerTypesConfig ($displayMessage = TRUE) {
// Remove the 'ok' part
unsetPostRequestElement('ok');
unsetPostRequestElement('set_all');
// Shall we set for all?
- if ($setAll === true) {
+ if ($setAll === TRUE) {
// Get all handlers
$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__);
setGetRequestElement('network_type_id', $typeId);
// Call this function again
- $numRows += doAdminNetworkProcessAddHandlerTypesConfig(false);
+ $numRows += doAdminNetworkProcessAddHandlerTypesConfig(FALSE);
} // END - while
// Free result
displayMessage('{%message,ADMIN_CONFIG_NETWORK_HANDLER_TYPE_ALL_HANDLER_SAVED=' . bigintval($numRows) . '%}');
} else {
// Nothing has been saved
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}');
}
} else {
// Get SQL query for new entry
SQL_QUERY($SQL, __FUNCTION__, __LINE__);
// Shall we display the message?
- if ($displayMessage === true) {
+ if ($displayMessage === TRUE) {
// Output message
if (!SQL_HASZEROAFFECTED()) {
// Successfully added
displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_SAVED--}');
} else {
// Not added
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_SAVED--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_SAVED--}');
}
} else {
// Return amount of affected rows (1 or 2)
}
// Only changes network type configuration if not yet present
-function doAdminNetworkProcessEditHandlerTypesConfig ($displayMessage = true) {
+function doAdminNetworkProcessEditHandlerTypesConfig ($displayMessage = TRUE) {
// Remove the 'ok' part
unsetPostRequestElement('ok');
unsetPostRequestElement('set_all');
// Shall we set for all?
- if ($setAll === true) {
+ if ($setAll === TRUE) {
// Get all data entries
$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__);
setPostRequestElement('network_data_id', $dataId);
// Call this function again
- $numRows += doAdminNetworkProcessEditHandlerTypesConfig(false);
+ $numRows += doAdminNetworkProcessEditHandlerTypesConfig(FALSE);
} // END - while
// Free result
displayMessage('{%message,ADMIN_CONFIG_NETWORK_HANDLER_TYPE_ALL_HANDLER_SAVED=' . bigintval($numRows) . '%}');
} else {
// Nothing has been saved
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}');
}
} else {
// Get SQL query for new entry
SQL_QUERY($SQL, __FUNCTION__, __LINE__);
// Shall we display the message?
- if ($displayMessage === true) {
+ if ($displayMessage === TRUE) {
// Output message
if (!SQL_HASZEROAFFECTED()) {
// Successfully added
displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_SAVED--}');
} else {
// Not added
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}');
}
} else {
// Return amount of affected rows (1 or 2)
call_user_func($callbackName);
// Mark it as called
- $GLOBALS[__FUNCTION__][$callbackName] = true;
+ $GLOBALS[__FUNCTION__][$callbackName] = TRUE;
// Don't display the list/add new form
- $GLOBALS['network_display'] = false;
+ $GLOBALS['network_display'] = FALSE;
}
// Exports (and displays) the table 'network_data'
SQL_FREERESULT($result);
// Output the SQL query
- loadTemplate('admin_export_network_data', false, $SQL);
+ loadTemplate('admin_export_network_data', FALSE, $SQL);
}
// Exports (and displays) the table 'network_types'
SQL_FREERESULT($result);
// Output the SQL query
- loadTemplate('admin_export_network_types', false, $SQL);
+ loadTemplate('admin_export_network_types', FALSE, $SQL);
}
// Exports (and displays) the table 'network_request_params'
SQL_FREERESULT($result);
// Output the SQL query
- loadTemplate('admin_export_network_request_params', false, $SQL);
+ loadTemplate('admin_export_network_request_params', FALSE, $SQL);
}
// Exports (and displays) the table 'network_vcheck_params'
SQL_FREERESULT($result);
// Output the SQL query
- loadTemplate('admin_export_network_vcheck_params', false, $SQL);
+ loadTemplate('admin_export_network_vcheck_params', FALSE, $SQL);
}
// Exports (and displays) the table 'network_array_translation'
SQL_FREERESULT($result);
// Output the SQL query
- loadTemplate('admin_export_network_array_translation', false, $SQL);
+ loadTemplate('admin_export_network_array_translation', FALSE, $SQL);
}
// [EOF]
// Checks whether the nickname is active
function isNicknameOrUserid ($useridNick) {
// By default nothing is found...
- $ret = false;
+ $ret = FALSE;
// Found in cache?
if (isset($GLOBALS['nickname_active'][$useridNick])) {
$ret = $GLOBALS['nicknames'][$userid];
} else {
// Init result
- $result = false;
+ $result = FALSE;
// Nickname or userid used?
- if ('' . bigintval($userid, true, false) . '' === '' . $userid . '') {
+ if ('' . bigintval($userid, TRUE, FALSE) . '' === '' . $userid . '') {
// Userid given, so try to load user data
if (fetchUserData($userid)) {
// Load nickname from database
$content['timing'] = translateComma($content['timing'] * 1000);
// Load row template
- $OUT .= loadTemplate('admin_other_sqls_row', true, $content);
+ $OUT .= loadTemplate('admin_other_sqls_row', TRUE, $content);
// Count one up
$i++;
} // END - foreach
// Load main template
- $GLOBALS['__page_footer'] .= loadTemplate('admin_other_sqls', true, $OUT);
+ $GLOBALS['__page_footer'] .= loadTemplate('admin_other_sqls', TRUE, $OUT);
}
// [EOF]
$content['points'] = translateComma($points * $content['rate'] - 0.5);
// Load row template
- $OUT .= loadTemplate('member_payout_li', true, $content);
+ $OUT .= loadTemplate('member_payout_li', TRUE, $content);
} // END - if
} // END - while
// Load main template
- loadTemplate('member_payout_list', true, $OUT);
+ loadTemplate('member_payout_list', TRUE, $OUT);
} else {
// No payout types setup so far
- loadTemplate('admin_settings_unsaved', false, '{--MEMBER_PAYOUT_SETUP_INCOMPLETE--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_PAYOUT_SETUP_INCOMPLETE--}');
}
// Free memory
SQL_FREERESULT($result);
} else {
// Points is empty
- loadTemplate('admin_settings_unsaved', false, '{--MEMBER_PAYOUT_NO_POINTS_ENTERED--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_PAYOUT_NO_POINTS_ENTERED--}');
}
}
// Merge both arrays
$content = merge_array($content, $row);
- $un = false;
+ $un = FALSE;
// Get refs by userid
$count = getReferralRallyeRefsCount($content['userid']);
bigintval($count),
$cpoints
), __FUNCTION__, __LINE__);
- $un = true;
+ $un = TRUE;
} // END - if
// Free memory
$content['refs'] = $count;
// Shall I notify this member?
- if (($content['send_notify'] == 'Y') && ($un === true)) {
+ if (($content['send_notify'] == 'Y') && ($un === TRUE)) {
// Load email template and send it to the user
$message = loadEmailTemplate('member_rallye_notify', $content, $content['userid']);
sendEmail($content['userid'], '{%message,MEMBER_RALLYE_NOTIFY_SUBJECT=' . $content['title'] . '%}', $message);
SQL_FREERESULT($result);
// Sort whole array
- array_pk_sort($content, array('cpoints', 'ref'), 0, 1, true);
+ array_pk_sort($content, array('cpoints', 'ref'), 0, 1, TRUE);
// Generate table
$OUT = '';
);
// Load row template and switch color
- $OUT .= loadTemplate($mode . '_list_rallye_row', true, $row);
+ $OUT .= loadTemplate($mode . '_list_rallye_row', TRUE, $row);
} // END - for
// Add min_prices/users
$content['min_users'] = bigintval($min_users);
// And finnally return the output
- return loadTemplate($mode . '_list_rallye', true, $content);
+ return loadTemplate($mode . '_list_rallye', TRUE, $content);
}
// Sends out a notification about the rallye
// "Walk" through all entries
foreach ($prices['userid'] as $key => $userid) {
// Check for userid
- $active = countSumTotalData($userid, 'user_data', 'userid', 'userid', true, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
+ $active = countSumTotalData($userid, 'user_data', 'userid', 'userid', TRUE, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
// Allow valid and active users with at least one ref
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'rallyeId=' . $rallyeId . ',userid=' . $userid . ',ref=' . $prices['ref'][$key] . ',cpoints=' . $prices['cpoints'][$key]);
* active = 1: account is still confirmed
* active = 0: account is deleted or locked
*/
- $active = countSumTotalData($userid, 'user_data', 'userid', 'userid', true, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
+ $active = countSumTotalData($userid, 'user_data', 'userid', 'userid', TRUE, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
$prices['active'][$key] = $active;
SQL_FREERESULT($result_user);
// Sort array for refs (descending)
- array_pk_sort($users, array('cpoints', 'ref'), 0, 1, true);
+ array_pk_sort($users, array('cpoints', 'ref'), 0, 1, TRUE);
// Load prices array (!)
$prices = getArrayFromReferralRallyePrices($rallye);
* active = 1: account is still confirmed
* active = 0: account is deleted or locked
*/
- $active = countSumTotalData($content['userid'][$idx], 'user_data', 'userid', 'userid', true, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
+ $active = countSumTotalData($content['userid'][$idx], 'user_data', 'userid', 'userid', TRUE, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
if ((empty($content['ref'][$idx])) || ($content['ref'][$idx] == '0') || ($active == '0') || ('' . round($content['cpoints'][$idx]) . '' == '0') || (empty($content['cpoints'][$idx]))) {
// Allow valid and active users with at least one ref to get points
);
// Load row template
- $OUT .= loadTemplate($mode . '_list_rallye_row', true, $row);
+ $OUT .= loadTemplate($mode . '_list_rallye_row', TRUE, $row);
} // END - for
// Prepare content
);
// Load main template and finnally return the output
- return loadTemplate($mode . '_list_rallye', true, $content);
+ return loadTemplate($mode . '_list_rallye', TRUE, $content);
}
//
// Purge whole rallye
addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_data` WHERE `id`=%s LIMIT 1",
- array(bigintval($content['id'])), __FUNCTION__, __LINE__, false));
+ array(bigintval($content['id'])), __FUNCTION__, __LINE__, FALSE));
addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s LIMIT 1",
- array(bigintval($content['id'])), __FUNCTION__, __LINE__, false));
+ array(bigintval($content['id'])), __FUNCTION__, __LINE__, FALSE));
addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_users` WHERE `rallye_id`=%s LIMIT 1",
- array(bigintval($content['id'])), __FUNCTION__, __LINE__, false));
+ array(bigintval($content['id'])), __FUNCTION__, __LINE__, FALSE));
// Add task (we ignore the task id here
createNewTask('{--ADMIN_RALLYE_PURGED_TASK--}: ' . $content['title'], '{--ADMIN_RALLYE_PURGED_TEXT--}', 'RALLYE_PURGED');
$basePath = sprintf("templates/%s/html/rallye/", getLanguage());
// Read the directory
- $templates = getArrayFromDirectory($basePath, 'rallye_', false, true, array(), '.tpl');
+ $templates = getArrayFromDirectory($basePath, 'rallye_', FALSE, TRUE, array(), '.tpl');
// And walk through
foreach ($templates as $read) {
} // END - if
} // END - foreach
- //* DEBUG: */ debugOutput('<pre>'.print_r($GLOBALS['cache_array']['refsystem'], true).'</pre>');
+ //* DEBUG: */ debugOutput('<pre>'.print_r($GLOBALS['cache_array']['refsystem'], TRUE).'</pre>');
//* DEBUG: */ doShutdown();
if ($count > 0) {
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$rallyeId])) {
// Determine it
- $GLOBALS[__FUNCTION__][$rallyeId] = countSumTotalData($rallyeId, 'rallye_prices', 'id', 'rallye_id', true);
+ $GLOBALS[__FUNCTION__][$rallyeId] = countSumTotalData($rallyeId, 'rallye_prices', 'id', 'rallye_id', TRUE);
} // END - if
// Return it
sendAdminNotification('{--ADMIN_REFBACK_SUBJECT--}', 'admin_refback', $content, $content['refid']);
// All fine!
- $status['ok'] = true;
+ $status['ok'] = TRUE;
// Return status array
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'id=' . $id . ',percents=' . $percents . ' - EXIT!');
// Checks whether all required registration fields are set
function ifRequiredRegisterFieldsAreSet (&$array) {
// By default all is fine
- $ret = true;
+ $ret = TRUE;
foreach ($array as $key => $value) {
// Check all fields that must register
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_must_register` WHERE `field_name`='%s' AND `field_required`='Y' LIMIT 1",
// if extensions is present check if country code was selected
// 01 2 21 12 3 32 234 5 54 4 43 34 4 4 5 5432 2 3 3210
$country = ((!isExtensionActive('country')) || ((isExtensionActive('country')) && (((empty($value)) && ($key == 'cntry')) || (($key == 'country_code') && (!empty($value)))) && (!empty($array['country_code']))));
- if ((empty($value)) && ($country === false)) {
+ if ((empty($value)) && ($country === FALSE)) {
// Required field not set
$array[$key] = '!';
- $ret = false;
+ $ret = FALSE;
} // END - if
} // END - if
}
// Load template and switch color
- $OUT .= loadTemplate('guest_cat_row', true, $content);
+ $OUT .= loadTemplate('guest_cat_row', TRUE, $content);
} // END - while
$OUT .= '</table>';
SQL_FREERESULT($result);
} else {
// No categories setted up so far...
- $OUT .= displayMessage('{--NO_CATEGORIES_VISIBLE--}', true);
+ $OUT .= displayMessage('{--NO_CATEGORIES_VISIBLE--}', TRUE);
}
// Return generated HTML code
// Checks whether the registration data is complete
function isRegistrationDataComplete () {
// Init elements
- $GLOBALS['registration_ip_timeout'] = false;
- $GLOBALS['registration_short_password'] = false;
+ $GLOBALS['registration_ip_timeout'] = FALSE;
+ $GLOBALS['registration_short_password'] = FALSE;
$GLOBALS['registration_selected_cats'] = '0';
// Default is okay
- $isOkay = true;
+ $isOkay = TRUE;
// First we only check the submitted data then we continue... :)
//
if (postRequestElement('agree') != 'Y') {
setPostRequestElement('agree', '!');
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'agree=N - User did not agree with terms of usage.');
- $isOkay = false;
+ $isOkay = FALSE;
} // END - if
// Did he enter a valid email address? (we really don't care about
if ((!isAdmin()) && ((!isPostRequestElementSet('email')) || (!isEmailValid(postRequestElement('email'))))) {
setPostRequestElement('email', '!');
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'User did not enter proper email address.');
- $isOkay = false;
+ $isOkay = FALSE;
} // END - if
// And what about surname and family's name?
if (!isPostRequestElementSet('surname')) {
setPostRequestElement('surname', '!');
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'User did not enter surname.');
- $isOkay = false;
+ $isOkay = FALSE;
} // END - if
if (!isPostRequestElementSet('family')) {
setPostRequestElement('family', '!');
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'User did not enter family name.');
- $isOkay = false;
+ $isOkay = FALSE;
} // END - if
// Get temporary array for modification
setPostRequestArray($postArray);
// Are both passwords zero length?
- if ((strlen(postRequestElement('pass1')) == 0) && (strlen(postRequestElement('pass2')) == 0) && ($isOkay === true)) {
+ if ((strlen(postRequestElement('pass1')) == 0) && (strlen(postRequestElement('pass2')) == 0) && ($isOkay === TRUE)) {
// Is the extension 'register' newer or equal 0.5.5?
if ((isExtensionInstalledAndNewer('register', '0.5.5')) && (isRegisterGeneratePasswordEmptyEnabled())) {
// Generate a random password
// ... which is both not okay
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Random password generation not possible, isExtensionInstalledAndNewer(register, 0.5.5)=' . intval(isExtensionInstalledAndNewer('register', '0.5.5')) . ',isRegisterGeneratePasswordEmptyEnabled()=' . intval(isRegisterGeneratePasswordEmptyEnabled()));
- $isOkay = false;
+ $isOkay = FALSE;
}
} // END - if
setPostRequestElement('pass2', '');
}
}
- $isOkay = false;
+ $isOkay = FALSE;
} // END - if
// Is the password long enouth?
- if ((strlen(postRequestElement('pass1')) < getPassLen()) && ($isOkay === true)) {
- $GLOBALS['registration_short_password'] = true;
+ if ((strlen(postRequestElement('pass1')) < getPassLen()) && ($isOkay === TRUE)) {
+ $GLOBALS['registration_short_password'] = TRUE;
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'User did enter a short password.');
- $isOkay = false;
+ $isOkay = FALSE;
} // END - if
// Do this check only when no admin is logged in
if ((isEmailTaken(postRequestElement('email'))) && (!isAdmin())) {
setPostRequestElement('email', '?');
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'User did enter a already used email address.');
- $isOkay = false;
+ $isOkay = FALSE;
} // END - if
} // END - if
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay=' . intval($isOkay));
if ((!isAdmin()) && (getIpTimeout() > 0)) {
// Check his IP number
- $GLOBALS['registration_ip_timeout'] = (countSumTotalData(detectRemoteAddr() , 'user_data', 'userid', 'REMOTE_ADDR', true, ' AND ((UNIX_TIMESTAMP() - `joined`) < {?ip_timeout?} OR (UNIX_TIMESTAMP() - `last_update`) < {?ip_timeout?})') == 1);
+ $GLOBALS['registration_ip_timeout'] = (countSumTotalData(detectRemoteAddr() , 'user_data', 'userid', 'REMOTE_ADDR', TRUE, ' AND ((UNIX_TIMESTAMP() - `joined`) < {?ip_timeout?} OR (UNIX_TIMESTAMP() - `last_update`) < {?ip_timeout?})') == 1);
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay=' . intval($isOkay).',timeout='.intval($GLOBALS['registration_ip_timeout']));
$isOkay = (($isOkay) && (!$GLOBALS['registration_ip_timeout']));
} // END - if
// Init filter data
$filterData = array(
// Initialization not done by default
- 'init_done' => false
+ 'init_done' => FALSE
);
// Init extra SQL data
$filterData = runFilterChain('pre_user_registration', $filterData);
// Did the initialization work?
- if ($filterData['init_done'] === false) {
+ if ($filterData['init_done'] === FALSE) {
// Something bad happened!
displayMessage('{--PRE_USER_REGISTRATION_FAILED--}');
// Stop here
- return false;
+ return FALSE;
} // END - if
// Create user's account...
displayMessage('{--USER_NOT_REGISTERED--}');
// Stop here
- return false;
+ return FALSE;
} // END - if
// Shall we reset random refid? Only possible with latest ext-user
// Registration phase is done here, so for tester accounts we end here
if (((getExtensionVersion('user') >= '0.5.0')) && (isTesterUserName(postRequestElement('surname'))) && (ifTesterAccountsAllowed())) {
// All fine here
- return true;
+ return TRUE;
} // END - if
// ... rewrite a zero referral id to the main title
} // END - switch
// Display information to the user that he got mail and send it away
- $messageGuest = loadEmailTemplate('guest_register_done', $content, $filterData['register_insert_id'], false);
+ $messageGuest = loadEmailTemplate('guest_register_done', $content, $filterData['register_insert_id'], FALSE);
// Send mail to user (confirmation link!)
sendEmail($filterData['register_insert_id'], '{--GUEST_CONFIRM_LINK_SUBJECT--}', $messageGuest);
sendAdminNotification('{--ADMIN_NEW_ACCOUNT_SUBJECT--}', 'admin_register_done', $content, $filterData['register_insert_id']);
// All fine
- return true;
+ return TRUE;
}
// Initialize extra registration SQL
// ----------------------------------------------------------------------------
// Template helper for generating a category selection table for admin area with given configuration entry
-function doTemplateAdminRegisterCategoryTable ($templateName, $clear = false, $configEntry) {
+function doTemplateAdminRegisterCategoryTable ($templateName, $clear = FALSE, $configEntry) {
// Call the inner function
return registerGenerateCategoryTable('admin', $configEntry);
}
$message = sprintf("{--REMOVEIP_LEVEL_%s--}", strtoupper($suffix));
// Output message in template
- return loadTemplate('removeip_level', true, $message);
+ return loadTemplate('removeip_level', TRUE, $message);
}
// [EOF]
// Rewrite links in HTML for better SEO (ugly part of mx!)
function rewriteLinksInCode ($code) {
// Skip rewriting for configured or empty modules
- if ((getModule() == '') || (isInStringIgnoreCase(getModule(), getConfig('rewrite_skip')) !== false)) {
+ if ((getModule() == '') || (isInStringIgnoreCase(getModule(), getConfig('rewrite_skip')) !== FALSE)) {
return $code;
} // END - if
} // END - if
// Some security stuff...
-if (strpos($_SERVER['PHP_SELF'], basename(__FILE__)) !== false) {
+if (strpos($_SERVER['PHP_SELF'], basename(__FILE__)) !== FALSE) {
die();
} // END - if
* @param $stripTags Strip tags
* @return $str A (hopefully) secured string against XSS and other bad things
*/
-function secureString ($str, $stripTags = true, $encode = false) {
+function secureString ($str, $stripTags = TRUE, $encode = FALSE) {
// Shall we strip HTML code?
- if ($stripTags === true) {
+ if ($stripTags === TRUE) {
$str = strip_tags($str);
} // END - if
$str = trim($str);
// Encode in entities if requested
- if ($encode === true) {
+ if ($encode === TRUE) {
// Encode in entities (this breakes UTF-8!)
$str = htmlentities($str, ENT_QUOTES);
} // END - if
$phpSelfFile = basename($_SERVER['PHP_SELF']);
// Check for a .php inside the $phpSelfDirectory...
- while (strpos($phpSelfDirectory, '.php') !== false) {
+ while (strpos($phpSelfDirectory, '.php') !== FALSE) {
// Correct the dirname
$phpSelfDirectory = substr($phpSelfDirectory, 0, (strpos($phpSelfDirectory, '.php') + 4));
// Rewrite filename...
$_SERVER['PHP_SELF'] = $phpSelfDirectory . '/' . $phpSelfFile;
// Did run...
- $GLOBALS['php_self_secured'] = true;
+ $GLOBALS['php_self_secured'] = TRUE;
// Remove uneccessary variables
unset($phpSelfDirectory);
}
// Runtime/GPC quoting is off now...
-ini_set('magic_quotes_runtime', false);
-ini_set('magic_quotes_gpc', false); // This may not work on some systems
+ini_set('magic_quotes_runtime', FALSE);
+ini_set('magic_quotes_gpc', FALSE); // This may not work on some systems
/*
* No compatibility with Zend Engine 1, else an error like 'Implicit cloning'
//
function handleSponsorRequest ($postData, $update=false, $messageArray = array(), $RET_STATUS=false) {
// Init a lot variables
- $SAVE = true;
- $UPDATE = false;
- $skip = false;
- $ALREADY = false;
+ $SAVE = TRUE;
+ $UPDATE = FALSE;
+ $skip = FALSE;
+ $ALREADY = FALSE;
$ret = 'unused';
// Skip these entries
// Check only posted input entries not the submit button
switch ($k) {
case 'email':
- $ALREADY = false;
+ $ALREADY = FALSE;
if (!isEmailValid($v)) {
// Email address is not valid
- $SAVE = false;
+ $SAVE = FALSE;
} else {
// Add a new sponsor or update his data?
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE email='%s' LIMIT 1",
// Yes, he is!
if ((getWhat() == 'add_sponsor') || ($update)) {
// Already found
- $ALREADY = true;
+ $ALREADY = TRUE;
} else {
// Update his data
- $UPDATE = true;
+ $UPDATE = TRUE;
}
}
case 'url':
if (!isUrlValid($v)) {
// Don't save the URL
- $SAVE = false;
+ $SAVE = FALSE;
} // END - if
break;
break;
} // END - switch
- if ((!empty($k)) && ($skip == false)) {
+ if ((!empty($k)) && ($skip == FALSE)) {
// Add data
array_push($DATA['keys'] , $k);
array_push($DATA['values'], $v);
} // END - foreach
// Save sponsor?
- if ($SAVE === true) {
+ if ($SAVE === TRUE) {
// Default is no force even when a guest want to abuse this force switch
if ((empty($postData['force'])) || (!isAdmin())) $postData['force'] = '0';
// Generate message
$message = getMessageFromIndexedArray('{--ADMIN_SPONSOR_UPDATED--}', 'updated', $messageArray);
$ret = 'updated';
- } elseif (($ALREADY === false) || (($postData['force'] == 1) && (isAdmin()))) {
+ } elseif (($ALREADY === FALSE) || (($postData['force'] == 1) && (isAdmin()))) {
// Add new sponsor, first add more data
array_push($DATA['keys'], 'status');
- if (($update === true) && (isAdmin()) && (getWhat() == 'add_sponsor')) {
+ if (($update === TRUE) && (isAdmin()) && (getWhat() == 'add_sponsor')) {
// Only allowed for admin
array_push($DATA['values'], 'PENDING');
// Generate message
$message = getMessageFromIndexedArray('{--ADMIN_SPONSOR_ADDED--}', 'added', $messageArray);
$ret = 'added';
- } elseif (($update === true) && (isAdmin())) {
+ } elseif (($update === TRUE) && (isAdmin())) {
// Add all data as hidden data
$OUT = '';
foreach ($postData as $k => $v) {
$content['email'] = $postData['email'];
// Ask for adding a sponsor with same email address
- loadTemplate('admin_add_sponsor_already', false, $content);
+ loadTemplate('admin_add_sponsor_already', FALSE, $content);
return;
} else {
// Already added!
// Search for an email address in the database
function isSponsorRegisteredWithEmail ($email) {
// Is there already the provided email address in database?
- $ret = (countSumTotalData($email, 'sponsor_data', 'id', 'email', true) == 1);
+ $ret = (countSumTotalData($email, 'sponsor_data', 'id', 'email', TRUE) == 1);
// Return result
return $ret;
// Wether the current user is a sponsor
function isSponsor () {
// Failed is default
- $ret = false;
+ $ret = FALSE;
// Determine it
$ret = (
if ($current == $content2['sub_what']) $content2['sub_title'] = '<strong>' . $content2['sub_title'] . '</strong>';
// Load row template
- $SUB .= loadTemplate('sponsor_what', true, $content2);
+ $SUB .= loadTemplate('sponsor_what', TRUE, $content2);
} // END - while
// Prepare data for the main template
$content['menu'] = $SUB;
// Load menu template
- $OUT .= loadTemplate('sponsor_action', true, $content);
+ $OUT .= loadTemplate('sponsor_action', TRUE, $content);
} else {
// No sub menus active
- $OUT .= displayMessage('{--SPONSOR_NO_SUB_MENUS_ACTIVE--}', true);
+ $OUT .= displayMessage('{--SPONSOR_NO_SUB_MENUS_ACTIVE--}', TRUE);
}
// Free memory
} // END - while
} else {
// No main menus active
- $OUT .= displayMessage('{--SPONSOR_NO_MAIN_MENUS_ACTIVE--}', true);
+ $OUT .= displayMessage('{--SPONSOR_NO_MAIN_MENUS_ACTIVE--}', TRUE);
}
// Free memory
loadIncludeOnce($INC);
} else {
// File not found
- $GLOBALS['sponsor_output'] .= displayMessage('{%message,SPONSOR_CONTENT_404=' . $what . '%}', true);
+ $GLOBALS['sponsor_output'] .= displayMessage('{%message,SPONSOR_CONTENT_404=' . $what . '%}', TRUE);
}
// Return content
//
function updateSponsorLogin () {
// Failed by default
- $login = false;
+ $login = FALSE;
// Is sponsor?
if (isSponsor()) {
// Saves sponsor's data
function saveSponsorData ($postData, $content) {
- $EMAIL = false;
+ $EMAIL = FALSE;
// Unsecure data which we don't want
$UNSAFE = array('password', 'id', 'remote_addr', 'sponsor_created', 'last_online', 'status', 'ref_count',
if ((!empty($content['email'])) && (!empty($postData['email']))) {
if ($content['email'] != $postData['email']) {
// Change email address
- $EMAIL = true;
+ $EMAIL = TRUE;
// Okay, has changed then add status with UNCONFIRMED and new hash code
$sql .= " `status`='EMAIL',`hash`='%s',";
// Saving data was completed... ufff...
switch (getWhat()) {
case 'account': // Change account data
- if ($EMAIL === true) {
+ if ($EMAIL === TRUE) {
$message = '{--SPONSOR_ACCOUNT_EMAIL_CHANGED--}';
$templ = 'admin_sponsor_change_email';
$subject = '{--ADMIN_SPONSOR_ACC_EMAIL_SUBJECT--}';
$email_msg = loadEmailTemplate('sponsor_change_data', $content);
sendEmail($content['email'], '{--SPONSOR_ACC_DATA_SUBJECT--}', $email_msg);
- if ($EMAIL === true) {
+ if ($EMAIL === TRUE) {
// Add hash code to content array
$content['hash'] = $HASH;
$message = '';
// Handle the request
- $status = handleSponsorRequest(postRequestArray(), true, $messageArray, true);
+ $status = handleSponsorRequest(postRequestArray(), TRUE, $messageArray, TRUE);
// Check the status of the registration process
switch ($status) {
reportBug(__FUNCTION__, __LINE__, 'Sponsor id ' . $sponsor_id . ' is invalid.');
} elseif (isSponsorDataValid()) {
// Use cache, so it is fine
- return true;
+ return TRUE;
}
} elseif (isSponsorDataValid()) {
// Use cache, so it is fine
- return true;
+ return TRUE;
}
// By default none was found
- $found = false;
+ $found = FALSE;
// Extra statements
$ADD = '';
// in, but you should use isMember() if you want to find that out.
function isSponsorDataValid () {
// Sponsor id should not be zero so abort here
- if (!isCurrentSponsorIdSet()) return false;
+ if (!isCurrentSponsorIdSet()) return FALSE;
// Is it cached?
if (!isset($GLOBALS['is_sponsor_data_valid'][getCurrentSponsorId()])) {
if (!isAdmin()) {
// Not an admin
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: Not admin.", $url, $limit, $reload));
- return false;
+ return FALSE;
} elseif (!isUrlValid($url)) {
// URL invalid
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: Invalid URL.", $url, $limit, $reload));
- return false;
+ return FALSE;
} elseif (ifSurfbarHasUrlUserId($url, 0)) {
// URL already found in surfbar!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: Already added.", $url, $limit, $reload));
- return false;
+ return FALSE;
} elseif (!ifSurfbarMemberAllowedMoreUrls()) {
// No more allowed!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: No more URLs allowed.", $url, $limit, $reload));
- return false;
+ return FALSE;
} elseif ('' . ($limit + 0) . '' != '' . $limit . '') {
// Invalid limit entered
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: Invalid limit entered.", $url, $limit, $reload));
- return false;
+ return FALSE;
} elseif ('' . ($reload + 0) . '' != '' . $reload . '') {
// Invalid amount entered
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: Invalid reload entered.", $url, $limit, $reload));
- return false;
+ return FALSE;
}
// Register the new URL
if (!isAdmin()) {
// Not an admin
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot migrate URL: Not admin, url=' . $url . ',userid=' . $userid);
- return false;
+ return FALSE;
} elseif (!isUrlValid($url)) {
// URL invalid
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot migrate URL: Invalid URL, url=' . $url . ',userid=' . $userid);
- return false;
+ return FALSE;
} elseif (ifSurfbarHasUrlUserId($url, $userid)) {
// URL already found in surfbar!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot migrate URL: Already added, url=' . $url . ',userid=' . $userid);
- return false;
+ return FALSE;
} elseif (!ifSurfbarMemberAllowedMoreUrls($userid)) {
// No more allowed!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot migrate URL: Maximum exceeded, url=' . $url . ',userid=' . $userid);
- return false;
+ return FALSE;
}
// Register the new URL
if (!isAdmin()) {
// Not admin or invalid ids array
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Not admin');
- return false;
+ return FALSE;
} elseif (!is_array($IDs)) {
// No array
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: IDs type ' . gettype($IDs) . '!=array');
- return false;
+ return FALSE;
} elseif (count($IDs) == 0) {
// Empty array
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: IDs is empty');
- return false;
+ return FALSE;
}
// Set to true to make AND expression valid if first URL got unlocked
- $done = true;
+ $done = TRUE;
// Update the status for all ids
foreach ($IDs as $id => $dummy) {
if (!isAdmin()) {
// Not admin or invalid ids array
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Not admin');
- return false;
+ return FALSE;
} elseif (!is_array($IDs)) {
// No array
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: IDs type ' . gettype($IDs) . '!=array');
- return false;
+ return FALSE;
} elseif (count($IDs) == 0) {
// Empty array
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: IDs is empty');
- return false;
+ return FALSE;
}
// Set to true to make AND expression valid if first URL got unlocked
- $done = true;
+ $done = TRUE;
// Update the status for all ids
foreach ($IDs as $id => $dummy) {
if (!isMember()) {
// Not a member
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: isMember()=false');
- return false;
+ return FALSE;
} elseif ((!isUrlValid($url)) && (!isAdmin())) {
// URL invalid
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Invalid, url=' . $url . ',limit=' . $limit);
- return false;
+ return FALSE;
} elseif (ifSurfbarHasUrlUserId($url, getMemberId())) {
// URL already found in surfbar!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Already found, url=' . $url . ',limit=' . $limit);
- return false;
+ return FALSE;
} elseif (!ifSurfbarMemberAllowedMoreUrls(getMemberId())) {
// No more allowed!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Maximum exceeded, url=' . $url . ',limit=' . $limit);
- return false;
+ return FALSE;
} elseif (''.($limit + 0).'' != ''.$limit.'') {
// Invalid amount entered
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Invalid limit, url=' . $url . ',limit=' . $limit);
- return false;
+ return FALSE;
}
// Register the new URL
$OUT = '';
foreach ($actionArray as $actionId => $action) {
// Add form for this action
- $OUT .= loadTemplate('member_list_surfbar_form', true, array(
+ $OUT .= loadTemplate('member_list_surfbar_form', TRUE, array(
'width' => $width,
'url_id' => bigintval($urlId),
'action' => strtolower($action)
} // END - foreach
// Load main template
- $output = loadTemplate('member_list_surfbar_table', true, $OUT);
+ $output = loadTemplate('member_list_surfbar_table', TRUE, $OUT);
// Return code
return $output;
// Do the member form request
function doSurfbarMemberByFormData ($formData, $urlArray) {
// By default no action is performed
- $performed = false;
+ $performed = FALSE;
// Is this a member?
if (!isMember()) {
// No member!
/* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: isMember()=false');
- return false;
+ return FALSE;
} elseif ((!isset($formData['url_id'])) || (!isset($formData['action']))) {
// Important form elements are missing!
/* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Invalid form data, required field id/action not found');
- return false;
+ return FALSE;
} elseif (!isset($urlArray[$formData['url_id']])) {
// Id not found in cache
/* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Field url_id not found in cache');
- return false;
+ return FALSE;
} elseif (!isSurfbarMemberActionStatusValid($formData['action'], $urlArray[$formData['url_id']]['url_status'])) {
// Action not allowed for current URL status
/* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Action not allowed to perform. action=' . $formData['action'] . ',url_status=' . $urlArray[$formData['url_id']]['url_status'] . ',url_id=' . $formData['url_id']);
- return false;
+ return FALSE;
}
// Secure action
// Has it changed?
if ($action != $formData['action']) {
// Invalid data in action found
- return false;
+ return FALSE;
} // END - if
// Create the function name for selected action
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'action=' . $action . ',status=' . $status . ',isValid=' . intval($isValid));
// Fetch the new status if found
- if ($isValid === true) {
+ if ($isValid === TRUE) {
// Load new status
list($GLOBALS['surfbar_cache']['new_status']) = SQL_FETCHROW($result);
} // END - if
} // END - if
// Load the form and display it
- loadTemplate(sprintf("member_surfbar_%s_action_form", $action), false, $urlData);
+ loadTemplate(sprintf("member_surfbar_%s_action_form", $action), FALSE, $urlData);
// All fine by default ... ;-)
- return true;
+ return TRUE;
}
// Execute choosen action
function executeSurfbarMemberAction ($action, $urlData) {
// By default nothing is executed
- $executed = false;
+ $executed = FALSE;
// Is limitation "no" and "limit" is > 0?
if ((isset($urlData[$action]['limited'])) && ($urlData[$action]['limited'] != 'Y') && ((isset($urlData[$action]['limit'])) && ($urlData[$action]['limit'] > 0)) || (!isset($urlData[$action]['limit']))) {
// Is that function there?
if (function_exists($functionName)) {
// Execute the function
- if (call_user_func_array($functionName, array($urlData)) == true) {
+ if (call_user_func_array($functionName, array($urlData)) == TRUE) {
// Update status as well
$executed = changeSurfbarUrlStatus($urlData['url_id'], $urlData['url_status'], $urlData['new_status'], array($urlData['url_id'] => $urlData));
} // END - if
// "Execute edit" function: Update changed data
function executeSurfbarMemberEditAction ($urlData) {
// Default is nothing done
- $status = false;
+ $status = FALSE;
// Has the URL or limit changed?
- if (true) {
+ if (TRUE) {
//if (($urlData['url_views_allowed'] != $urlData['edit']['limit']) || ($url1 != $url2)) {
// Run the query
SQL_QUERY_ESC("UPDATE
), __FUNCTION__, __LINE__);
// All fine
- $status = true;
+ $status = TRUE;
} // END - if
// Return status
// "Execute delete" function: Does nothing...
function executeSurfbarMemberDeleteAction ($urlData) {
// Nothing special to do (see above function for such "special actions" to perform)
- return true;
+ return TRUE;
}
//------------------------------------------------------------------------------
// Is this id valid?
if ($content['insert_id'] == '0') {
// INSERT did not insert any data!
- return false;
+ return FALSE;
} // END - if
// If in reg-mode we notify admin
function doSurfbarNotifyMember ($messageType, $content) {
// Skip notification if userid is zero
if ($content['url_userid'] == '0') {
- return false;
+ return FALSE;
} // END - if
// Prepare template name
}
// Determine reward
-function determineSurfbarReward ($onlyMin = false) {
+function determineSurfbarReward ($onlyMin = FALSE) {
// Static values are default
$reward = getConfig('surfbar_static_reward');
// Is there static or dynamic?
if (getSurfbarPaymentModel() == 'DYNAMIC') {
// "Calculate" dynamic reward
- if ($onlyMin === true) {
+ if ($onlyMin === TRUE) {
$reward += calculateSurfbarDynamicMininumValue();
} else {
$reward += calculateSurfbarDynamicAddValue();
function isSurfbarReloadFull () {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Fixed surf lock is ' . getConfig('surfbar_static_lock') . ' - ENTERED!');
// Default is full!
- $isFull = true;
+ $isFull = TRUE;
// Cache static reload lock
$GLOBALS['surfbar_cache']['surf_lock'] = getConfig('surfbar_static_lock');
}
// Get amount from database
- $count = countSumTotalData($userid, 'surfbar_urls', 'url_id', 'url_userid', true, $add);
+ $count = countSumTotalData($userid, 'surfbar_urls', 'url_id', 'url_userid', TRUE, $add);
// Return result
return $count;
if (empty($salt)) {
// Generate random hashed string
$GLOBALS['surfbar_cache']['salt'] = sha1(generatePassword(mt_rand(200, 255)));
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'newSalt='.gerSurfbarSalt().'', false);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'newSalt='.gerSurfbarSalt().'', FALSE);
} else {
// Use this as salt!
$GLOBALS['surfbar_cache']['salt'] = $salt;
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'oldSalt='.gerSurfbarSalt().'', false);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'oldSalt='.gerSurfbarSalt().'', FALSE);
}
// Hash it with md5() and salt it with the random string
function addSurfbarReloadLockById ($urlId) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',getMemberId()=' . getMemberId() . ' - ENTERED!');
// Search for an entry
- $countLock = countSumTotalData(getMemberId(), 'surfbar_locks', 'locks_id', 'locks_userid', true, ' AND `locks_url_id`=' . bigintval($urlId));
+ $countLock = countSumTotalData(getMemberId(), 'surfbar_locks', 'locks_id', 'locks_userid', TRUE, ' AND `locks_url_id`=' . bigintval($urlId));
// Is there no record?
if ($countLock == 0) {
// ---------- Comment out for debugging/developing member actions! ---------
if (SQL_AFFECTEDROWS() != 1) {
// No, something went wrong
- return false;
+ return FALSE;
} // END - if
// ---------- Comment out for debugging/developing member actions! ---------
// All done!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',prevStatus=' . $prevStatus . ',newStatus=' . $newStatus . ' - EXIT!');
- return true;
+ return TRUE;
}
// Calculate minimum value for dynamic payment model
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'lastQuery='.getConfig('db_last_query').'|numRows='.SQL_NUMROWS($result).'|Affected='.SQL_AFFECTEDROWS());
if (SQL_NUMROWS($result) == 1) {
// Load/cache data
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'count('.count($GLOBALS['surfbar_cache']).') - BEFORE', false);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'count('.count($GLOBALS['surfbar_cache']).') - BEFORE', FALSE);
$GLOBALS['surfbar_cache'] = merge_array($GLOBALS['surfbar_cache'], SQL_FETCHARRAY($result));
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'count('.count($GLOBALS['surfbar_cache']).') - AFTER', false);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'count('.count($GLOBALS['surfbar_cache']).') - AFTER', FALSE);
// Determine waiting time
$GLOBALS['surfbar_cache']['time'] = determineSurfbarWaitingTime();
// Is the last salt there?
if (is_null($GLOBALS['surfbar_cache']['salts_last_salt'])) {
// Then repair it wit the static!
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'last_salt - FIXED!', false);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'last_salt - FIXED!', FALSE);
$GLOBALS['surfbar_cache']['salts_last_salt'] = '';
} // END - if
// Fix missing last_surfed
if ((!isset($GLOBALS['surfbar_cache']['last_surfed'])) || (is_null($GLOBALS['surfbar_cache']['last_surfed']))) {
// Fix it here
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'last_surfed - FIXED!', false);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'last_surfed - FIXED!', FALSE);
$GLOBALS['surfbar_cache']['last_surfed'] = '0';
} // END - if
//------------------------------------------------------------------------------
// Template helper to generate a selection box for surfbar actions
-function doTemplateSurfbarActionsActionSelectionBox ($templateName, $clear = false, $default = NULL) {
+function doTemplateSurfbarActionsActionSelectionBox ($templateName, $clear = FALSE, $default = NULL) {
// Init array
$actionsAction = array(
0 => array('actions_action' => 'EDIT'),
);
// Handle it over to generateSelectionBoxFromArray()
- $content = generateSelectionBoxFromArray($actionsAction, 'surfbar_actions_action', 'actions_action', '', '', '', $default, '', false, true);
+ $content = generateSelectionBoxFromArray($actionsAction, 'surfbar_actions_action', 'actions_action', '', '', '', $default, '', FALSE, TRUE);
// Return prepared content
return $content;
}
// Template helper to generate a selection box for surfbar status
-function doTemplateSurfbarActionsStatusSelectionBox ($templateName, $clear = false, $default = NULL) {
+function doTemplateSurfbarActionsStatusSelectionBox ($templateName, $clear = FALSE, $default = NULL) {
// Init array
$status = array(
0 => array('actions_status' => 'PENDING'),
);
// Handle it over to generateSelectionBoxFromArray()
- $content = generateSelectionBoxFromArray($status, 'surfbar_actions_status', 'actions_status', '', '', '', $default, '', false, true);
+ $content = generateSelectionBoxFromArray($status, 'surfbar_actions_status', 'actions_status', '', '', '', $default, '', FALSE, TRUE);
// Return prepared content
return $content;
}
// Template helper to generate a selection box for surfbar status
-function doTemplateSurfbarActionsNewStatusSelectionBox ($templateName, $clear = false, $default = NULL) {
+function doTemplateSurfbarActionsNewStatusSelectionBox ($templateName, $clear = FALSE, $default = NULL) {
// Init array
$status = array(
0 => array('actions_new_status' => 'PENDING'),
);
// Handle it over to generateSelectionBoxFromArray()
- $content = generateSelectionBoxFromArray($status, 'surfbar_actions_new_status', 'actions_new_status', '', '', '', $default, '', true, true);
+ $content = generateSelectionBoxFromArray($status, 'surfbar_actions_new_status', 'actions_new_status', '', '', '', $default, '', TRUE, TRUE);
// Return prepared content
return $content;
} // END - foreach
// Extension updates found
- $value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, " AND `status`='NEW' AND `task_type`='EXTENSION_UPDATE'");
+ $value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', TRUE, " AND `status`='NEW' AND `task_type`='EXTENSION_UPDATE'");
if ($value > 0) {
$content['update_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=updates%}">' . $value . '</a>';
//
// Unassigned tasks
//
- $value = countSumTotalData(0, 'task_system', 'id', 'assigned_admin', true, " AND `status` != 'DELETED'");
+ $value = countSumTotalData(0, 'task_system', 'id', 'assigned_admin', TRUE, " AND `status` != 'DELETED'");
if ($value > 0) {
$content['new_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=unassigned%}">' . $value . '</a>';
//
// Closed tasks
//
- $value = countSumTotalData('CLOSED', 'task_system', 'id', 'status', true);
+ $value = countSumTotalData('CLOSED', 'task_system', 'id', 'status', TRUE);
if ($value > 0) {
$content['closed_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=closed%}">' . $value . '</a>';
//
// Deleted tasks
//
- $value = countSumTotalData('DELETED', 'task_system', 'id', 'status', true);
+ $value = countSumTotalData('DELETED', 'task_system', 'id', 'status', TRUE);
if ($value > 0) {
$content['deleted_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=deleted%}">' . $value . '</a>';
//
// Solved tasks
//
- $value = countSumTotalData('SOLVED', 'task_system', 'id', 'status', true, sprintf(" AND `assigned_admin`=%s", getCurrentAdminId()));
+ $value = countSumTotalData('SOLVED', 'task_system', 'id', 'status', TRUE, sprintf(" AND `assigned_admin`=%s", getCurrentAdminId()));
if ($value > 0) {
$content['solved_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=solved%}">' . $value . '</a>';
//
// Your tasks
//
- $value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, " AND `status`='NEW' AND task_type != 'EXTENSION_UPDATE'");
+ $value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', TRUE, " AND `status`='NEW' AND task_type != 'EXTENSION_UPDATE'");
if ($value > 0) {
$content['your_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task%}">' . $value . '</a>';
//
// Mails waiting to be approved
//
- $value = countSumTotalData('ADMIN', 'pool', 'id', 'data_type', true);
+ $value = countSumTotalData('ADMIN', 'pool', 'id', 'data_type', TRUE);
if ($value > 0) {
$content['pending_mails'] = '<a href="{%url=modules.php?module=admin&what=unlock_emails%}">' . $value . '</a>';
//
// Unfinished mail orders
//
- $value = countSumTotalData('TEMP', 'pool', 'id', 'data_type', true);
+ $value = countSumTotalData('TEMP', 'pool', 'id', 'data_type', TRUE);
if ($value > 0) {
$content['canceled_mails'] = '<a href="{%url=modules.php?module=admin&what=email_details%}">' . $value . '</a>';
//
// Sent mail orders
//
- $value = countSumTotalData('SEND', 'pool', 'id', 'data_type', true);
+ $value = countSumTotalData('SEND', 'pool', 'id', 'data_type', TRUE);
if ($value > 0) {
$content['send_emails'] = '<a href="{%url=modules.php?module=admin&what=email_archiv%}">' . $value . '</a>';
//
if (isExtensionActive('autopurge')) {
// Get auto-purged mails
- $value = countSumTotalData('DELETED', 'pool', 'id', 'data_type', true);
+ $value = countSumTotalData('DELETED', 'pool', 'id', 'data_type', TRUE);
if ($value > 0) {
$content['purged_mails'] = '<a href="{%url=modules.php?module=admin&what=email_details%}">' . $value . '</a>';
//
if (isExtensionInstalledAndNewer('bonus', '0.1.8')) {
// Get auto-purged bonus mails
- $value = countSumTotalData('DELETED', 'bonus', 'id', 'data_type', true);
+ $value = countSumTotalData('DELETED', 'bonus', 'id', 'data_type', TRUE);
if ($value > 0) {
$content['purged_bonus_mails'] = '<a href="{%url=modules.php?module=admin&what=email_details%}">' . $value . '</a>';
//
if (isExtensionInstalledAndNewer('bonus', '0.1.8')) {
// Get sent bonus mails (but not notifications)
- $value = countSumTotalData('SEND', 'bonus', 'id', 'data_type', true, " AND `is_notify`='N'");
+ $value = countSumTotalData('SEND', 'bonus', 'id', 'data_type', TRUE, " AND `is_notify`='N'");
if ($value > 0) {
$content['send_bonus_mails'] = '<a href="{%url=modules.php?module=admin&what=email_details%}">' . $value . '</a>';
$content['extra_table'] = $EXTRAS;
// Simply load the template... :-)
- loadTemplate('admin_overview_task', false, $content);
+ loadTemplate('admin_overview_task', FALSE, $content);
}
//
SQL_FREERESULT($result);
// And insert the final string into extras template
- $OUT .= loadTemplate('admin_overview_task_rows', true, $content);
+ $OUT .= loadTemplate('admin_overview_task_rows', TRUE, $content);
} // END- foreach
} // END - foreach
// Return output in the template
- return loadTemplate('admin_overview_task_extras', true, $OUT);
+ return loadTemplate('admin_overview_task_extras', TRUE, $OUT);
}
// [EOF]
);
// Return generated selection
- return loadTemplate('theme_select_form', true, $content);
+ return loadTemplate('theme_select_form', TRUE, $content);
}
// Get version from name
// Is the extension 'theme' installed?
if (!isExtensionActive('theme')) {
// Then abort here
- return false;
+ return FALSE;
} // END - if
// Default is nothing active
- $active = false;
+ $active = FALSE;
// Is the cache entry there?
if (isset($GLOBALS['cache_array']['themes']['theme_active'][$name])) {
// Set default theme
setMailerTheme($ret);
} elseif ((isMailerThemeSet()) && (isExtensionInstalledAndNewer('sql_patches', '0.1.4'))) {
- //die("<pre>".print_r($GLOBALS['cache_array']['themes'], true)."</pre>");
+ //die("<pre>".print_r($GLOBALS['cache_array']['themes'], TRUE)."</pre>");
// Get theme from cookie
$ret = getSession('mailer_theme');
// Loads the snippet for the uberwach action
function loadUberwachSnippet () {
// Simply load the template here
- $GLOBALS['__page_footer'] .= loadTemplate('uberwach_snippet', true);
+ $GLOBALS['__page_footer'] .= loadTemplate('uberwach_snippet', TRUE);
}
// [EOF]
);
// Load template
- $OUT = loadTemplate('admin_list_user_alpha', true, $content);
+ $OUT = loadTemplate('admin_list_user_alpha', TRUE, $content);
// Return generated code
return $OUT;
$content['list'] = substr($OUT, 0, -1);
// Load template
- $OUT = loadTemplate('admin_list_user_sort', true, $content);
+ $OUT = loadTemplate('admin_list_user_sort', TRUE, $content);
// Return code
return $OUT;
$content['list'] = $OUT;
// Load template
- $OUT = loadTemplate('admin_list_user_pagenav', true, $content);
+ $OUT = loadTemplate('admin_list_user_pagenav', TRUE, $content);
} // END - if
// Return code
// Is the extension version fine?
if ((isRandomReferralIdEnabled()) && (isExtensionInstalledAndNewer('user', '0.3.4'))) {
// Get all user ids
- $totalUsers = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true, runFilterChain('user_exclusion_sql', ' AND `rand_confirmed` >= {?user_min_confirmed?}'));
+ $totalUsers = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', TRUE, runFilterChain('user_exclusion_sql', ' AND `rand_confirmed` >= {?user_min_confirmed?}'));
// Is there at least one?
if ($totalUsers > 0) {
$add = '';
$errorCode = '0';
$ext = '';
- $isFound = false;
+ $isFound = FALSE;
// Init array
$content = array(
}
// No error found?
- if (($errorCode == '0') && ($isFound === true)) {
+ if (($errorCode == '0') && ($isFound === TRUE)) {
// Get user data array and set userid (e.g. important if we login with nickname)
$content = getUserDataArray();
if (!empty($content['userid'])) {
array($content['hash'], $userid), __FUNCTION__, __LINE__);
// No login bonus by default
- $GLOBALS['bonus_payed'] = false;
+ $GLOBALS['bonus_payed'] = FALSE;
// Is bonus up-to-date?
if (isExtensionInstalledAndNewer('bonus', '0.2.2')) {
if ($probe >= getConfig('login_timeout')) {
// Add login bonus to user's account
$add = ',`login_bonus`=`login_bonus`+{?login_bonus?}';
- $GLOBALS['bonus_payed'] = true;
+ $GLOBALS['bonus_payed'] = TRUE;
// Subtract login bonus from userid's account or jackpot
if ((isExtensionInstalledAndNewer('bonus', '0.3.5')) && (getBonusMode() != 'ADD')) {
// Is a success URL set?
if (empty($successUrl)) {
// Procedure to checking for login data
- if (($GLOBALS['bonus_payed'] === true) && (isExtensionActive('bonus'))) {
+ if (($GLOBALS['bonus_payed'] === TRUE) && (isExtensionActive('bonus'))) {
// Bonus added (just displaying!)
$url = 'modules.php?module=chk_login&do=bonus';
} else {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'email=' . $email . ',userid=' . $userid . ' - ENTERED!');
// Init found-status and error
$errorCode = '';
- $accountFound = false;
+ $accountFound = FALSE;
// Probe userid/nickname
if (!empty($email)) {
}
// Any entry found?
- if ($accountFound === true) {
+ if ($accountFound === TRUE) {
// Is the account confirmed
if (getUserData('status') == 'CONFIRMED') {
// Generate new password
// Is the extension installed and updated?
if ((!isExtensionActive('sql_patches')) || (isExtensionInstalledAndOlder('sql_patches', '0.5.6'))) {
// Return zero here
- return false;
+ return FALSE;
} // END - if
// Default is not working
- $return = false;
+ $return = FALSE;
// Does it exist?
if ((!getEpocheTimeFromUserStats($statsType, $statsData, $userid)) && (!is_array($statsData))) {
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
- $GLOBALS[__FUNCTION__] = countSumTotalData('', 'user_data', 'userid', '', true, runFilterChain('user_inclusion_sql'));
+ $GLOBALS[__FUNCTION__] = countSumTotalData('', 'user_data', 'userid', '', TRUE, runFilterChain('user_inclusion_sql'));
} // END - if
// Return cache
// Wrapper function to return a selection box for tester user default referral id
function addTesterUserDefaultRefidSelectionBox ($fieldName = 'tester_user_default_refid') {
// Return it
- return addMemberSelectionBox(getConfig('tester_user_default_refid'), false, true, true, $fieldName, " WHERE `surname` LIKE '{?tester_user_surname_prefix?}%'");
+ return addMemberSelectionBox(getConfig('tester_user_default_refid'), FALSE, TRUE, TRUE, $fieldName, " WHERE `surname` LIKE '{?tester_user_surname_prefix?}%'");
}
// Checks whether given surname is a test user name
if (!isRegistrationDataComplete()) {
// Then abort here
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isRegistrationDataComplete()=false, please check if you e.g. have selected the required minimum of categories.');
- return false;
+ return FALSE;
} // END - if
// Do registration
assert(isMember());
// Check it
- $isFree = (countSumTotalData(getMemberId(), 'user_subids', 'id', 'userid', true, sprintf(" AND `subid`='%s'", $subId)) == 0);
+ $isFree = (countSumTotalData(getMemberId(), 'user_subids', 'id', 'userid', TRUE, sprintf(" AND `subid`='%s'", $subId)) == 0);
// Return result
return $isFree;
}
-// Prepares given sub id for storage in database
-function prepareSubId ($subId) {
+// Checks whether the sub id is valid
+function isValidSubId ($subId) {
// First convert any spaces/dashes to underscores
$subId = str_replace(' ', '_', str_replace('-', '_', $subId));
// Then filter out any unwanted characters
- $subId = preg_replace('/([^a-zA-Z0-9_])/', '', $subId);
+ $subIdTest = preg_replace('/([^a-zA-Z0-9_])/', '', $subId);
+
+ // Is it valid?
+ return ($subId == $subIdTest);
+} // END - if
+
+// Prepares found sub id for updating in database
+function prepareFoundSubId ($subId) {
+ // Then check if it is valid and available
+ if ((!isValidSubId($subId)) || (isMemberSubIdFree($subId))) {
+ // Is not free or invalid
+ $subId = FALSE;
+ } // END - if
+
+ // Return prepared sub id
+ return $subId;
+}
+
+// Validates sub id and returns FALSE if not valid
+function validateSubId ($subId) {
+ // Then check if it is valid and available
+ if (!isValidSubId($subId)) {
+ // Is not free or invalid
+ $subId = FALSE;
+ } // END - if
+
+ // Return prepared sub id
+ return $subId;
+}
- // Then Check if it is available
- if (!isMemberSubIdFree($subId)) {
- // Is not free
- $subId = false;
+// Prepares given sub id for inserting into database
+function prepareSubId ($subId) {
+ // Then check if it is valid and available
+ if ((!isValidSubId($subId)) || (!isMemberSubIdFree($subId))) {
+ // Is not free or invalid
+ $subId = FALSE;
} // END - if
// Return prepared sub id
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
- $GLOBALS[__FUNCTION__] = countSumTotalData(getMemberId(), 'user_subids', 'id', 'userid', true);
+ $GLOBALS[__FUNCTION__] = countSumTotalData(getMemberId(), 'user_subids', 'id', 'userid', TRUE);
} // END - if
// Return cache
//-----------------------------------------------------------------------------
// Template call-back function for list_user admin function
-function doTemplateAdminListUserTitle ($template, $clear = false) {
+function doTemplateAdminListUserTitle ($template, $clear = FALSE) {
// Init title with "all accounts"
$code = '{--ADMIN_LIST_ALL_ACCOUNTS--}';
}
// Template call-back function for displaying "username"
-function doTemplateDisplayUsername ($template, $clear = false, $userid = NULL) {
+function doTemplateDisplayUsername ($template, $clear = FALSE, $userid = NULL) {
// Is a userid set?
if (!isValidUserId($userid)) {
// Please don't call this without a valid userid
// Is a purpose there?
if (isset($requestData['purpose'])) {
// Eval the purpose
- eval('$purpose = "' . doFinalCompilation($requestData['purpose'], false) . '";');
+ eval('$purpose = "' . doFinalCompilation($requestData['purpose'], FALSE) . '";');
// Prepare the purpose, it needs encoding
$requestData['purpose'] = encodeString($purpose);
// Tests the function by calling balance.php on the API
function WERNIS_TEST_API () {
// Result is always failed
- $result = false;
+ $result = FALSE;
// Return the result from the lower functions
$return = WERNIS_SEND_REQUEST('balance.php');
// Did it went smoothly?
if ($return['status'] == 'OK') {
// All fine!
- $result = true;
+ $result = TRUE;
} else {
// Status failure text
WERNIS_STATUS_MESSAGE($return['message'], $return['status']);
if (!isWernisWithdrawActive()) {
if (!isExtensionActive('sponsor')) {
// No, abort here
- return false;
+ return FALSE;
} elseif (!isSponsor()) {
// No sponsor, not allowed to withdraw!
- return false;
+ return FALSE;
}
} // END - if
// Default is failed attempt
- $result = false;
+ $result = FALSE;
// Prepare the request data
$requestData = array(
if ($return['status'] == 'OK') {
// All fine!
- $result = true;
+ $result = TRUE;
// Log the transfer
WERNIS_LOG_TRANSFER($wdsId, $amount, 'WITHDRAW');
// Payout this amount
function WERNIS_EXECUTE_PAYOUT ($wdsId, $amount) {
// Default is failed attempt
- $result = false;
+ $result = FALSE;
// Prepare the request data
$requestData = array(
if ($return['status'] == 'OK') {
// All fine!
- $result = true;
+ $result = TRUE;
// Log the transfer
WERNIS_LOG_TRANSFER($wdsId, $amount, 'PAYOUT');
if (!in_array($mode, array('payout', 'withdraw'))) {
// Log error and abort
logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . getMemberId() . ',mode=' . $mode . ',points=' . $points . ' - unknown mode detected.');
- return false;
+ return FALSE;
} // END - if
// Is there a percentage or fixed fee?
} // END - if
// Queries the given Yoo!Media API 2.0 script
-function YOOMEDIA_QUERY_API ($script, $countQuery = true) {
+function YOOMEDIA_QUERY_API ($script, $countQuery = TRUE) {
// Init response array
$response = array();
// Enougth queries left?
- if ((getConfig('yoomedia_requests_remain') > 0) || ($countQuery === false)) {
+ if ((getConfig('yoomedia_requests_remain') > 0) || ($countQuery === FALSE)) {
// Prepare request array
$requestData = array(
'id' => getConfig('yoomedia_id'),
);
// Run the query
- $response = sendGetRequest('http://www.yoomedia.de/interface_2.0/' . $script, $requestData, true);
+ $response = sendGetRequest('http://www.yoomedia.de/interface_2.0/' . $script, $requestData, TRUE);
// Convert from ISO to UTF-8 only if count is > 3 because <= 3 means timeout
if (count($response) > 3) {
} // END - if
// Shall we count the query as used?
- if ($countQuery === true) {
+ if ($countQuery === TRUE) {
// Then update the config!
updateConfiguration('yoomedia_requests_remain', 1, '-');
} // END - if
// Is this admin?
if (!isAdmin()) {
// No admin!
- return false;
+ return FALSE;
} // END - if
// Remove 'ok'
// Query the API with a test request without couting it
// If zero reply comes back the data is invalid!
- $response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script
+ $response = YOOMEDIA_QUERY_API('out_textmail.php', TRUE); // @TODO Ask Yoo!Media for test script
// Default error code is 0 = all fine!
$errorCode = YOOMEDIA_GET_ERRORCODE_FROM_RESULT($response);
// Is this an admin?
if (!isAdmin()) {
// Abort here
- return false;
+ return FALSE;
} elseif (!isExtensionActive('bonus')) {
// Abort here
- return false;
+ return FALSE;
}
// Is the waiting time below one second? Then fix it to one (zero seconds are not yet supported!)
} // END - if
// Load template
- loadTemplate('admin_send_yoomedia', false, $data);
+ loadTemplate('admin_send_yoomedia', FALSE, $data);
}
// Adds the mail to the bonus mail pool
// Is this an admin?
if (!isAdmin()) {
// Abort here
- return false;
+ return FALSE;
} elseif (!isExtensionActive('bonus')) {
// Abort here
- return false;
+ return FALSE;
}
// Add dummy receiver to avoid notice
// Lockdown given id
function YOOMEDIA_EXCLUDE_MAIL ($data, $mailMode) {
// Search for the entry
- if (YOOMEDIA_CHECK_RELOAD($data['id'], $data['reload'], $mailMode) === false) {
+ if (YOOMEDIA_CHECK_RELOAD($data['id'], $data['reload'], $mailMode) === FALSE) {
// Convert mode for mails
$mailMode = YOOMEDIA_CONVERT_MODE($mailMode);
// Checks if the mail id is in reload lock
function YOOMEDIA_CHECK_RELOAD ($id, $reload, $type) {
// Default is not in reload lock
- $reloaded = false;
+ $reloaded = FALSE;
// Query database
$result = SQL_QUERY_ESC("SELECT `id`, UNIX_TIMESTAMP(`inserted`) AS inserted FROM `{?_MYSQL_PREFIX?}_yoomedia_reload` WHERE `type`='%s' AND `y_id`=%s LIMIT 1",
// Lock given mail down for reload lock
function YOOMEDIA_RELOAD_LOCK ($data, $mailMode) {
// Search for the entry
- if (YOOMEDIA_CHECK_RELOAD($data['id'], $data['reload'], $mailMode) === false) {
+ if (YOOMEDIA_CHECK_RELOAD($data['id'], $data['reload'], $mailMode) === FALSE) {
// Convert mode for mails
$mailMode = YOOMEDIA_CONVERT_MODE($mailMode);
$code = '0';
} else {
// Should not happen!
- reportBug(__FUNCTION__, __LINE__, 'Cannot parse response. Raw response:<pre>' . print_r($response, true) . '</pre>');
+ reportBug(__FUNCTION__, __LINE__, 'Cannot parse response. Raw response:<pre>' . print_r($response, TRUE) . '</pre>');
}
// Return error code
setConfigEntry('_DB_TYPE' , 'mysql3');
// Mark configuration as NOT loaded which is the default
-$GLOBALS['config_local_loaded'] = false;
+$GLOBALS['config_local_loaded'] = FALSE;
// Is the local configuration there?
if ((isIncludeReadable(getCachePath() . 'config-local.php')) && (isIncludeReadable('inc/config.php'))) {
// We are better in installation mode
- $GLOBALS['__mailer_installing'] = true;
+ $GLOBALS['__mailer_installing'] = TRUE;
// Define default main_title here
setConfigEntry('MAIN_TITLE', 'Your mail-exchange title');
loadIncludeOnce(getCachePath() . 'config-local.php');
// Mark configuration as loaded
- $GLOBALS['config_local_loaded'] = true;
+ $GLOBALS['config_local_loaded'] = TRUE;
} elseif (isIncludeReadable('inc/config.php')) {
// Out-dated inc/config.php found, falling back to load and "wrap" it
updateOldConfigFile();
unset($EXT_DUMMY);
// No database load needed
- $res_ext_crt = false;
+ $res_ext_crt = FALSE;
// Load all extension files in test-mode (we initialize them later)
foreach ($EXT_POOL as $ext) {
array($content['ext_name']), __FILE__, __LINE__);
} else {
// Didn't load so deactivate it
- doDeactivateExtension($content['ext_name'], true);
+ doDeactivateExtension($content['ext_name'], TRUE);
}
// ... and skip it
} // END - if
// Get menu entry
- $content['ext_menu'] = convertBooleanToYesNo(ifModuleHasMenu($content['ext_name'], true));
+ $content['ext_menu'] = convertBooleanToYesNo(ifModuleHasMenu($content['ext_name'], TRUE));
// Get language entry
$content['ext_lang'] = convertBooleanToYesNo(isLanguageIncludeReadable($content['ext_name']));
$GLOBALS['cache_instance']->removeCacheFile();
// We should fix this
- reportBug(__FILE__, __LINE__, 'modArray=<pre>' . print_r($modArray, true) . '</pre>Please try to reload to fix this.');
+ reportBug(__FILE__, __LINE__, 'modArray=<pre>' . print_r($modArray, TRUE) . '</pre>Please try to reload to fix this.');
} // END - if
// Rewrite some parts
return;
} elseif (!isExtensionActive('theme')) {
// Skip this loader
- return false;
+ return FALSE;
}
// Next cached table are the themes
), __FILE__, __LINE__);
// Load email template and send it to the user!
- if ($sentBonusMails === true) {
+ if ($sentBonusMails === TRUE) {
// Add userid to queue
array_push($userids, $content['userid']);
} else {
} // END - while
// Shall I send out bonus mails?
- if ($sentBonusMails === true) {
+ if ($sentBonusMails === TRUE) {
// Okay, make array to string
$receiver = implode(';', $userids);
), __FILE__, __LINE__);
// Load email template and send it to the user!
- if ($sentBonusMails === true) {
+ if ($sentBonusMails === TRUE) {
// Add userid to queue
array_push($userids, $content['userid']);
} else {
} // END - while
// Shall I send out bonus mails?
- if ($sentBonusMails === true) {
+ if ($sentBonusMails === TRUE) {
// Okay, make array to string
$receiver = implode(';', $userids);
// Only double when points are enougth!
if ($DOUBLER_POINTS >= $content['points']) {
// Check for his ref points
- $refPoints = countSumTotalData($content['userid'], 'doubler', 'points', 'refid', false, " AND `completed`='N' AND `is_ref`='Y'");
+ $refPoints = countSumTotalData($content['userid'], 'doubler', 'points', 'refid', FALSE, " AND `completed`='N' AND `is_ref`='Y'");
// Zero refid when empty (might be helpful!)
if (empty($refPoints)) {
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_doubler` SET `completed`='Y' WHERE `id`=%s LIMIT 1",
array(bigintval($content['id'])), __FILE__, __LINE__);
- $okay = false;
+ $okay = FALSE;
// Check for jackpot inclusion in doubling process
if (($jackpotPoints > 0) && ($jackpotPoints >= $content['points']) && (getConfig('doubler_jackpot') == 'Y')) {
} // END - if
// Exclude also webmaster's id in taking points from webmaster's account
- if (($userPoints > 0) && ($userPoints >= $content['points']) && ($okay === false) && (getConfig('doubler_userid') > 0) && ($content['userid'] != getConfig('doubler_userid'))) {
+ if (($userPoints > 0) && ($userPoints >= $content['points']) && ($okay === FALSE) && (getConfig('doubler_userid') > 0) && ($content['userid'] != getConfig('doubler_userid'))) {
// Subtract points
$okay = subtractPoints('doubler_payout', getConfig('doubler_userid'), $content['points']);
} // END - if
// Update doubler's account only when others are not updated
- if ($okay === false) {
+ if ($okay === FALSE) {
// Add points to used doubler points
updateConfiguration('doubler_used', $content['points'], '+');
} // END - if
if (!isset($GLOBALS[__FUNCTION__][$module])) {
// Init variables
$data['title'] = '';
- $result = false;
+ $result = FALSE;
// Is the script installed?
if ((isInstalled()) && ($module != 'error')) {
// Checks whether the given module is registered
function isModuleRegistered ($module) {
// By default nothing is found
- $found = false;
+ $found = FALSE;
// Check if cache is latest version
if (isExtensionInstalledAndNewer('cache', '0.1.2')) {
incrementStatsEntry('cache_hits');
// Is found
- $found = true;
+ $found = TRUE;
} else {
// No, then we have to update it!
setModuleStatus($module, 'cache_miss');
} // END - foreach
// Mark as found
- $found = true;
+ $found = TRUE;
} elseif (isDebugModeEnabled()) {
// Debug message only in debug-mode...
logDebugMessage(__FUNCTION__, __LINE__, 'Module ' . $module . ' not found.');
$found = isModuleRegistered($module_chk);
// Is the module found?
- if ($found === true) {
+ if ($found === TRUE) {
// Check returned values against current access permissions
//
// Admin access ----- Guest access ----- --- Guest or member? ---
} // END - if
// Still no luck or not found?
- if (($found === false) && (!isExtensionActive('cache')) && (getModuleStatus($module_chk) != 'done')) {
+ if (($found === FALSE) && (!isExtensionActive('cache')) && (getModuleStatus($module_chk) != 'done')) {
// ----- Default module ----- ---- Module in base folder ---- --- Module with extension's name ---
if ((isIncludeReadable(sprintf("inc/modules/%s.php", $module))) || (isIncludeReadable(sprintf("%s.php", $module))) || (isIncludeReadable(sprintf("%s/%s.php", $extension, $module)))) {
// Data is missing so we add it
} elseif ((getModuleStatus($module_chk) == 'cache_miss') && (isHtmlOutputMode())) {
// Rebuild the cache files
rebuildCache('modules', 'modules');
- } elseif ($found === false) {
+ } elseif ($found === FALSE) {
// Problem with module detected
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Problem in module %s detected. getModuleStatus()=%s,locked=%d,hidden=%d,mem=%d,admin=%d,output_mode=%s",
$module_chk,
}
// Checks if the module has a menu
-function ifModuleHasMenu ($module, $forceDb = false) {
+function ifModuleHasMenu ($module, $forceDb = FALSE) {
// All is false by default
- $ret = false;
+ $ret = FALSE;
// Extension installed and newer than or has version 0.1.2?
if (isExtensionInstalledAndNewer('cache', '0.1.2')) {
// Admin/guest/member/sponsor modules have always a menu!
$ret = in_array($module, array('admin', 'index', 'login', 'sponsor'));
}
- } elseif ((isExtensionInstalledAndNewer('sql_patches', '0.3.6')) && ((!isExtensionActive('cache')) || ($forceDb === true))) {
+ } elseif ((isExtensionInstalledAndNewer('sql_patches', '0.3.6')) && ((!isExtensionActive('cache')) || ($forceDb === TRUE))) {
// Check database for entry
$result = SQL_QUERY_ESC("SELECT `has_menu` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `module`='%s' LIMIT 1",
array($module), __FUNCTION__, __LINE__);
// Load the currently set module
function loadModule () {
// By default all modules are invalid
- $isModuleValid = false;
+ $isModuleValid = FALSE;
// Construct module name
$GLOBALS['module_inc'] = sprintf("inc/modules/%s.php", getModule());
// Does the module exists on local file system?
if ((isIncludeReadable($GLOBALS['module_inc'])) && (!ifFatalErrorsDetected())) {
// Module is valid, active and located on the local disk...
- $isModuleValid = true;
+ $isModuleValid = TRUE;
} elseif (!ifFatalErrorsDetected()) {
// Set HTTP status
setHttpStatus('404');
loadIncludeOnce('inc/header.php');
// Modules are by default not valid!
- $isModuleValid = false;
+ $isModuleValid = FALSE;
// By default NULL is used
$GLOBALS['module_inc'] = NULL;
}
// Is the module valid?
- if (($isModuleValid === true) && (!is_null($GLOBALS['module_inc']))) {
+ if (($isModuleValid === TRUE) && (!is_null($GLOBALS['module_inc']))) {
// Run pre-filter
runFilterChain('pre_module_load');
$hashedPass = md5(postRequestElement('admin_pass1'));
// Kill maybe existing session variables
- destroyAdminSession(false);
+ destroyAdminSession(FALSE);
// Do registration
$ret = addAdminAccount(postRequestElement('admin_login'), $hashedPass, getWebmaster());
$done = changeDataInLocalConfigurationFile('ADMIN-SETUP', "setConfigEntry('ADMIN_REGISTERED', '", "');", 'Y', 0);
// Was it successfull?
- if ($done === true) {
+ if ($done === TRUE) {
// Registering is done
redirectToUrl('modules.php?module=admin&register=done');
} else {
} // END - if
// Output error messages
- $content['login_message'] = loadTemplate('admin_login_msg', true, $loginMessage);
- $content['pass1_message'] = loadTemplate('admin_login_msg', true, $pass1Message);
- $content['pass2_message'] = loadTemplate('admin_login_msg', true, $pass2Message);
- $content['error_message'] = loadTemplate('admin_login_msg', true, $errorMessage);
+ $content['login_message'] = loadTemplate('admin_login_msg', TRUE, $loginMessage);
+ $content['pass1_message'] = loadTemplate('admin_login_msg', TRUE, $pass1Message);
+ $content['pass2_message'] = loadTemplate('admin_login_msg', TRUE, $pass2Message);
+ $content['error_message'] = loadTemplate('admin_login_msg', TRUE, $errorMessage);
} // END - if
// Output message in seperate template
displayMessage('{--ADMIN_ACCOUNT_NOT_REGISTERED_YET--}');
// Load register template
- loadTemplate('admin_reg_form', false, $content);
+ loadTemplate('admin_reg_form', FALSE, $content);
} // END - if
} elseif (isGetRequestElementSet('reset_pass')) {
// Is the form submitted?
displayMessage(sendAdminPasswordResetLink(postRequestElement('email')));
} elseif (isGetRequestElementSet('hash')) {
// Output form for hash validation
- loadTemplate('admin_validate_reset_hash_form', false, getRequestElement('hash'));
+ loadTemplate('admin_validate_reset_hash_form', FALSE, getRequestElement('hash'));
} elseif ((isPostRequestElementSet('validate_hash')) && (isPostRequestElementSet('admin_login')) && (isPostRequestElementSet('hash'))) {
// Validate the login data and hash
$valid = adminResetValidateHashLogin(postRequestElement('hash'), postRequestElement('admin_login'));
// Valid?
- if ($valid === true) {
+ if ($valid === TRUE) {
// Prepare content first
$content = array(
'hash' => postRequestElement('hash'),
);
// Validation okay so display form for final password change
- loadTemplate('admin_reset_password_form', false, $content);
+ loadTemplate('admin_reset_password_form', FALSE, $content);
} else {
// Cannot validate the login data and hash
displayMessage('{--ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED--}');
// Okay, we shall the admin password here. So first revalidate the hash
if (adminResetValidateHashLogin(postRequestElement('hash'), postRequestElement('admin_login'))) {
// Output result
- loadTemplate('admin_reset_password_done', false, doResetAdminPassword(postRequestElement('admin_login'), postRequestElement('admin_pass1')));
+ loadTemplate('admin_reset_password_done', FALSE, doResetAdminPassword(postRequestElement('admin_login'), postRequestElement('admin_pass1')));
} else {
// Validation failed
displayMessage('{--ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED2--}');
// Load message templates if the messages have been set
if (!empty($loginMessage)) {
- $content['login_message'] = loadTemplate('admin_login_msg', true, $loginMessage);
+ $content['login_message'] = loadTemplate('admin_login_msg', TRUE, $loginMessage);
} // END - if
if (!empty($passwdMessage)) {
- $content['pass_message'] = loadTemplate('admin_login_msg', true, $passwdMessage);
+ $content['pass_message'] = loadTemplate('admin_login_msg', TRUE, $passwdMessage);
} // END - if
} // END - if
$content['all_parameter'] = addAllGetRequestParameters();
// Load login form template
- loadTemplate('admin_login_form', false, $content);
+ loadTemplate('admin_login_form', FALSE, $content);
} // END - if
} elseif (isGetRequestElementSet('logout')) {
// Only try to remove cookies
}
} else {
// Something went wrong here...
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_LOGOUT_FAILED--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_LOGOUT_FAILED--}');
// Add fatal message
addFatalMessage(__FILE__, __LINE__, '{--CANNOT_UNREG_SESS--}');
// Load welcome template
if (isExtensionActive('admins')) {
// @TODO This and the next getCurrentAdminId() call might be moved into the templates?
- $content['welcome'] = loadTemplate('admin_welcome_admins', true, getCurrentAdminId());
+ $content['welcome'] = loadTemplate('admin_welcome_admins', TRUE, getCurrentAdminId());
} else {
- $content['welcome'] = loadTemplate('admin_welcome', true, getCurrentAdminId());
+ $content['welcome'] = loadTemplate('admin_welcome', TRUE, getCurrentAdminId());
}
// Load header, footer, render menu
- $content['header'] = loadTemplate('admin_header' , true, $content);
- $content['footer'] = loadTemplate('admin_footer' , true, $content);
+ $content['header'] = loadTemplate('admin_header' , TRUE, $content);
+ $content['footer'] = loadTemplate('admin_footer' , TRUE, $content);
$content['menu'] = addAdminMenu($action, $what);
// Load main template
- loadTemplate('admin_main', false, $content);
+ loadTemplate('admin_main', FALSE, $content);
// Check if action/what pair is valid
$result_action = SQL_QUERY_ESC("SELECT
if (SQL_NUMROWS($result_action) == 1) {
// Is valid but does the inlcude file exists?
$inc = sprintf("inc/modules/admin/action-%s.php", $action);
- if ((isIncludeReadable($inc)) && (isMenuActionValid('admin', $action, $what)) && ($GLOBALS['acl_allow'] === true)) {
+ if ((isIncludeReadable($inc)) && (isMenuActionValid('admin', $action, $what)) && ($GLOBALS['acl_allow'] === TRUE)) {
// Ok, we finally load the admin action module
loadInclude($inc);
- } elseif ($GLOBALS['acl_allow'] === false) {
+ } elseif ($GLOBALS['acl_allow'] === FALSE) {
// Access denied
- loadTemplate('admin_menu_failed', false, '{%message,ADMIN_ACCESS_DENIED=' . $what . '%}');
+ loadTemplate('admin_menu_failed', FALSE, '{%message,ADMIN_ACCESS_DENIED=' . $what . '%}');
} else {
// Include file not found :-(
- loadTemplate('admin_menu_failed', false, '{%message,ADMIN_ACTION_404=' . $action . '%}');
+ loadTemplate('admin_menu_failed', FALSE, '{%message,ADMIN_ACTION_404=' . $action . '%}');
}
} else {
// Invalid action/what pair found
- loadTemplate('admin_menu_failed', false, '{%message,ADMIN_ACTION_INVALID=' . $action . '/' . $what . '%}');
+ loadTemplate('admin_menu_failed', FALSE, '{%message,ADMIN_ACTION_INVALID=' . $action . '/' . $what . '%}');
}
// Free memory
SQL_FREERESULT($result_action);
// Tableset footer
- loadTemplate('admin_main_footer', false, $content);
+ loadTemplate('admin_main_footer', FALSE, $content);
}
/**
// Adds an admin menu
function addAdminMenu ($action, $what) {
// Init variables
- $SUB = false;
+ $SUB = FALSE;
$OUT = '';
// Menu descriptions
// Is the current admin allowed to access this 'action' menu?
if (isAdminAllowedAccessMenu($mainContent['main_action'])) {
- if ($SUB === false) {
+ if ($SUB === FALSE) {
// Insert compiled menu title and description
$GLOBALS['menu']['title'][$mainContent['main_action']] = $mainContent['main_title'];
$GLOBALS['menu']['description'][$mainContent['main_action']] = $mainContent['main_descr'];
// Are there entries?
if (ifAdminMenuHasEntries($mainContent['main_action'])) {
// Sub menu has been called
- $SUB = true;
+ $SUB = TRUE;
// Are there entries?
if (!SQL_HASZERONUMS($result_what)) {
// Load all entries
while ($content = SQL_FETCHARRAY($result)) {
// Add the entry
- $OUT .= loadTemplate('select_admins_option', true, $content);
+ $OUT .= loadTemplate('select_admins_option', TRUE, $content);
} // END - if
// Free memory
$content['form_selection'] = $OUT;
// Output form
- loadTemplate('select_admins_box', false, $content);
+ loadTemplate('select_admins_box', FALSE, $content);
}
// Create a member selection box
-function addMemberSelectionBox ($userid = NULL, $add_all = false, $return = false, $none = false, $field = 'userid', $whereStatement = " WHERE `surname` NOT LIKE '{?tester_user_surname_prefix?}%'") {
+function addMemberSelectionBox ($userid = NULL, $add_all = FALSE, $return = FALSE, $none = FALSE, $field = 'userid', $whereStatement = " WHERE `surname` NOT LIKE '{?tester_user_surname_prefix?}%'") {
// Output selection form with all confirmed user accounts listed
$result = SQL_QUERY('SELECT
`userid`,
$OUT = '';
// USe this only for adding points (e.g. adding refs really makes no sence ;-) )
- if ($add_all === true) {
+ if ($add_all === TRUE) {
$OUT = ' <option value="all">{--ALL_MEMBERS--}</option>';
- } elseif ($none === true) {
+ } elseif ($none === TRUE) {
$OUT = ' <option value="0">{--SELECT_NONE--}</option>';
}
// Free memory
SQL_FREERESULT($result);
- if ($return === false) {
+ if ($return === FALSE) {
// Remeber options in constant
$content['form_selection'] = $OUT;
$content['what'] = '{%pipe,getWhat%}';
// Load template
- loadTemplate('admin_form_selection_box', false, $content);
+ loadTemplate('admin_form_selection_box', FALSE, $content);
} else {
// Return content in selection frame
return '<select class="form_select" name="' . handleFieldWithBraces($field) . '" size="1">' . $OUT . '</select>';
}
// Wrapper for $_POST and adminSaveSettings
-function adminSaveSettingsFromPostData ($tableName = '_config', $whereStatement = '`config`=0', $translateComma = array(), $alwaysAdd = false, $displayMessage = true) {
+function adminSaveSettingsFromPostData ($tableName = '_config', $whereStatement = '`config`=0', $translateComma = array(), $alwaysAdd = FALSE, $displayMessage = TRUE) {
// Get the array
$postData = postRequestArray();
}
// Save settings to the database
-function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement = '`config`=0', $translateComma = array(), $alwaysAdd = false, $displayMessage = true) {
+function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement = '`config`=0', $translateComma = array(), $alwaysAdd = FALSE, $displayMessage = TRUE) {
// Prepare all arrays, variables
$tableData = array();
- $skip = false;
+ $skip = FALSE;
// Now, walk through all entries and prepare them for saving
foreach ($postData as $id => $val) {
convertSelectionsToEpocheTime($postData, $tableData, $id, $skip);
// Shall we process this id? It muss not be empty, of course
- if (($skip === false) && (!empty($id)) && ((!isset($GLOBALS['skip_config'][$id]))) || ($tableName != '_config')) {
+ if (($skip === FALSE) && (!empty($id)) && ((!isset($GLOBALS['skip_config'][$id]))) || ($tableName != '_config')) {
// Translate the value? (comma to dot!)
if ((is_array($translateComma)) && (in_array($id, $translateComma))) {
// Then do it here... :)
}
// Do not add a config entry twice
- $GLOBALS['skip_config'][$id] = true;
+ $GLOBALS['skip_config'][$id] = TRUE;
// Update current configuration
setConfigEntry($id, $val);
} // END - foreach
// Check if entry does exist
- $result = false;
- if ($alwaysAdd === false) {
+ $result = FALSE;
+ if ($alwaysAdd === FALSE) {
if (!empty($whereStatement)) {
$result = SQL_QUERY("SELECT * FROM `{?_MYSQL_PREFIX?}" . $tableName . "` WHERE " . $whereStatement . " LIMIT 1", __FUNCTION__, __LINE__);
} else {
rebuildCache('config', 'config');
// Settings saved, so display message?
- if ($displayMessage === true) displayMessage('{--SETTINGS_SAVED--}');
+ if ($displayMessage === TRUE) displayMessage('{--SETTINGS_SAVED--}');
// Return affected rows
return $affected;
// Generate a selection box
function adminAddMenuSelectionBox ($menu, $type, $name, $default = '') {
// Open the requested menu directory
- $menuArray = getArrayFromDirectory(sprintf("inc/modules/%s/", $menu), $type . '-', false, false);
+ $menuArray = getArrayFromDirectory(sprintf("inc/modules/%s/", $menu), $type . '-', FALSE, FALSE);
// Init the selection box
$OUT = '<select name="' . $name . '" class="form_select" size="1"><option value="">{--ADMIN_IS_TOP_MENU--}</option>';
}
// Delete rows by given id numbers
-function adminDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = array(false), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array()) {
+function adminDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array()) {
// $tableName must be an array
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
} // END - if
// Shall we delete here or list for deletion?
- if ($deleteNow[0] === true) {
+ if ($deleteNow[0] === TRUE) {
// Call generic function
$affected = doGenericDeleteEntriesConfirm($tableName, $columns, $filterFunctions, $extraValues, $deleteNow, $idColumn, $userIdColumn, $rawUserId, $cacheFiles);
}
// Edit rows by given id numbers
-function adminEditEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $editNow = array(false), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array()) {
+function adminEditEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array()) {
// $tableName must be an array
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
} // END - if
// Shall we change here or list for editing?
- if ($editNow[0] === true) {
+ if ($editNow[0] === TRUE) {
// Call generic change method
$affected = doGenericEditEntriesConfirm($tableName, $columns, $filterFunctions, $extraValues, $timeColumns, $editNow, $idColumn, $userIdColumn, $rawUserId, $cacheFiles);
}
// Un-/lock rows by given id numbers
-function adminLockEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $statusArray = array(), $lockNow = array(false), $idColumn = array('id'), $userIdColumn = array('userid')) {
+function adminLockEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $statusArray = array(), $lockNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid')) {
// $tableName must be an array
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
} // END - if
// Shall we un-/lock here or list for locking?
- if ($lockNow[0] === true) {
+ if ($lockNow[0] === TRUE) {
// Un-/lock entries
adminBuilderStatusHandler('lock', $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray);
} else {
}
// Undelete rows by given id numbers
-function adminUndeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $statusArray = array(), $undeleteNow = array(false), $idColumn = array('id'), $userIdColumn = array('userid')) {
+function adminUndeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $statusArray = array(), $undeleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid')) {
// $tableName must be an array
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
} // END - if
// Shall we un-/lock here or list for locking?
- if ($undeleteNow[0] === true) {
+ if ($undeleteNow[0] === TRUE) {
// Undelete entries
adminBuilderStatusHandler('undelete', $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray);
} else {
doGenericAddEntries($tableName, $columns, $filterFunctions, $extraValues, $timeColumns, $columnIndex);
// Entry has been added?
- if ((!SQL_HASZEROAFFECTED()) && ($GLOBALS['__XML_PARSE_RESULT'] === true)) {
+ if ((!SQL_HASZEROAFFECTED()) && ($GLOBALS['__XML_PARSE_RESULT'] === TRUE)) {
// Display success message
displayMessage('{--ADMIN_ENTRY_ADDED--}');
} else {
// Validate hash and login for password reset
function adminResetValidateHashLogin ($hash, $login) {
// By default nothing validates... ;)
- $valid = false;
+ $valid = FALSE;
// Then try to find that user
$result = SQL_QUERY_ESC("SELECT `id`, `password`, `email` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `login`='%s' LIMIT 1",
);
// Update database
- $message = adminsChangeAdminAccount($postData, '', false);
+ $message = adminsChangeAdminAccount($postData, '', FALSE);
// Run filters
runFilterChain('post_form_reset_pass', array('login' => $login, 'hash' => $passHash, 'message' => $message));
isset($GLOBALS['admin_menu_has_entries'][$action])
) && (
// And do we have a menu for this action?
- $GLOBALS['admin_menu_has_entries'][$action] === true
+ $GLOBALS['admin_menu_has_entries'][$action] === TRUE
)) || (
// Login has always a menu
$action == 'login'
} // END - if
$TOP = '';
- if ($show_form === false) {
+ if ($show_form === FALSE) {
$TOP = ' top';
} // END - if
$content['top'] = $TOP;
// Load navigation template
- $OUT = loadTemplate('admin_email_nav_row', true, $content);
+ $OUT = loadTemplate('admin_email_nav_row', TRUE, $content);
- if ($return === true) {
+ if ($return === TRUE) {
// Return generated HTML-Code
return $OUT;
} else {
// We currently don't want to install an extension so let's find out if we need...
setExtensionMode('test');
- $jobsDone = true;
+ $jobsDone = TRUE;
// Open the extension directory
- $extensionList = getArrayFromDirectory('inc/extensions/', 'ext-', false, false);
+ $extensionList = getArrayFromDirectory('inc/extensions/', 'ext-', FALSE, FALSE);
foreach ($extensionList as $file) {
// Only file name is required... :(
$file = basename($file);
$ext_name = strtolower(substr($file, 4, -4)); // Keep always extension names on lower case!!!
// Init variables
- $result = false;
+ $result = FALSE;
// Check if extension is installed or not
$extInstalled = (isExtensionInstalled($ext_name) && (isExtensionActive($ext_name)));
// Is the extension not yet installed?
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',extInstalled=' . intval($extInstalled));
- if ($extInstalled === false) {
+ if ($extInstalled === FALSE) {
// We maybe want to install an extension so let's test-drive it...
- if (loadExtension($ext_name, 'test', '0.0.0', true)) {
+ if (loadExtension($ext_name, 'test', '0.0.0', TRUE)) {
// Create a task for newly installed extension (we ignore the task id here)
createNewExtensionTask($ext_name);
} // END - if
if (!SQL_HASZERONUMS($result_tasks)) {
// New jobs found
- $jobsDone = false;
+ $jobsDone = FALSE;
} // END - if
// Free the result
$taskData['text'] = decodeEntities($taskData['text']);
// Compile and insert text from task into table template
- $taskData['text'] = loadTemplate('admin_extensions_text', true, $taskData['text']);
+ $taskData['text'] = loadTemplate('admin_extensions_text', TRUE, $taskData['text']);
// Initialize variables (no title for SQL commands by default)
$ext_name = ''; $ext_ver = '';
// Update task or extension task?
if (($taskData['task_type'] == 'EXTENSION') && (!isExtensionInstalled($ext_name))) {
// Load SQL commands for registering in dry-run
- registerExtension($ext_name, $taskId, true);
+ registerExtension($ext_name, $taskId, TRUE);
// Is this non-productive?
- if (isExtensionProductive() === false) {
+ if (isExtensionProductive() === FALSE) {
// Issue warning
- $taskData['text'] = displayMessage('{%message,ADMIN_EXTENSION_IS_NON_PRODUCTIVE=' . $ext_name . '%}', true) . $taskData['text'];
+ $taskData['text'] = displayMessage('{%message,ADMIN_EXTENSION_IS_NON_PRODUCTIVE=' . $ext_name . '%}', TRUE) . $taskData['text'];
} // END - if
// Set current extension name
$ext_ver = substr($ext_ver, 0, strpos($ext_ver, ':'));
// Load SQLs from file
- updateExtension($ext_name, $ext_ver, true);
+ updateExtension($ext_name, $ext_ver, TRUE);
// Set current extension name
setCurrentExtensionName($ext_name);
} // END - if
} elseif ((!empty($ext_name)) && (!empty($ext_ver))) {
// Run SQL commands in dry mode but only return the notes
- updateExtension($ext_name, $ext_ver, true);
+ updateExtension($ext_name, $ext_ver, TRUE);
// Set current extension name
setCurrentExtensionName($ext_name);
);
// Load template
- $OUT .= loadTemplate('admin_overview_row', true, $content);
+ $OUT .= loadTemplate('admin_overview_row', TRUE, $content);
// Which task do we actually have here?
// @TODO Rewrite this to something with include files and/or filter
$ext_name = substr($taskData['subject'], 1, strpos($taskData['subject'], ':') - 1);
if (!isExtensionInstalled($ext_name)) {
// New (not yet installed) extension found
- $OUT .= loadTemplate('admin_extension_reg_form', true, array(
+ $OUT .= loadTemplate('admin_extension_reg_form', TRUE, array(
'id' => bigintval($taskId),
'ext_name' => $ext_name
));
);
// Load template
- $OUT .= loadTemplate('admin_payout_overview_form', true, $content);
+ $OUT .= loadTemplate('admin_payout_overview_form', TRUE, $content);
} else {
// Problem obtaining payout id
$OUT .= '<div class="notice medium">{--ADMIN_PAYOUT_OBTAIN_ID_FAILED--}</div>';
'pid' => $pid,
'tid' => $taskData['id'],
);
- $OUT .= loadTemplate('admin_wernis_overview_form', true, $content);
+ $OUT .= loadTemplate('admin_wernis_overview_form', TRUE, $content);
} else {
// Problem obtaining wernis id
$OUT .= '<div class="notice medium">{--WERNIS_OBTAIN_ID_FAILED--}</div>';
break;
case 'HOLIDAY_REQUEST': // Holiday requests
- $OUT .= loadTemplate('admin_task_holiday', true, $taskData['userid']);
+ $OUT .= loadTemplate('admin_task_holiday', TRUE, $taskData['userid']);
break;
case 'MEMBER_ORDER': // Member mail orders
- $OUT .= loadTemplate('admin_task_order', true, $taskId);
+ $OUT .= loadTemplate('admin_task_order', TRUE, $taskId);
break;
default: // Unknown task type
} // END - foreach
// Load final template
- loadTemplate('admin_overview_list', false, $OUT);
+ loadTemplate('admin_overview_list', FALSE, $OUT);
} else {
if ((isset($postData['sel'])) && ((count($postData['sel']) > 0) || ($postData['sel'][0] == 1))) {
// Only unassign / delete tasks when there are selected tasks posted
} // END - foreach
} else {
// Unknown action
- reportBug(__FILE__, __LINE__, sprintf("Unknown task action performed. data=<pre>%s</pre>", print_r($postData, true)));
+ reportBug(__FILE__, __LINE__, sprintf("Unknown task action performed. data=<pre>%s</pre>", print_r($postData, TRUE)));
}
// Update query
// Is there extension task?
if (isExtensionTask($content)) {
// Load extension row template
- $OUT .= loadTemplate('admin_overview_list_ext_rows', true, $content);
+ $OUT .= loadTemplate('admin_overview_list_ext_rows', TRUE, $content);
} else {
// Load default row template
- $OUT .= loadTemplate('admin_overview_list_rows', true, $content);
+ $OUT .= loadTemplate('admin_overview_list_rows', TRUE, $content);
}
} // END - while
SQL_FREERESULT($result_tasks);
// Load footer template
- loadTemplate('admin_overview_table', false, $OUT);
+ loadTemplate('admin_overview_table', FALSE, $OUT);
}
}
// Is the formular sent?
if (isFormSent()) {
// Save the row to the database
- adminSaveSettingsFromPostData('_bank_packages', '', array('account_fee', 'interest_plus', 'interest_minus', 'first_payment'), true);
+ adminSaveSettingsFromPostData('_bank_packages', '', array('account_fee', 'interest_plus', 'interest_minus', 'first_payment'), TRUE);
} else {
// Display form
loadTemplate('admin_add_bank_package');
$content['userid'] = bigintval(getRequestElement('userid'));
// Output template
- loadTemplate('admin_add_points', false, $content);
+ loadTemplate('admin_add_points', FALSE, $content);
}
} else {
// User not found
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}');
}
} else {
// Output selection form with all confirmed user accounts listed
- addMemberSelectionBox(0, true);
+ addMemberSelectionBox(0, TRUE);
}
// [EOF]
$content['end_year'] = addSelectionBox('year' , getYear($endingStamp) , 'end_time');
// Load template
-loadTemplate('admin_add_rallye', false, $content);
+loadTemplate('admin_add_rallye', FALSE, $content);
// [EOF]
?>
);
// Load template
-loadTemplate('admin_add_surfbar_url', false, $content);
+loadTemplate('admin_add_surfbar_url', FALSE, $content);
//
?>
} // END - if
// Display form
-loadTemplate('admin_add_tester_user', false, $content);
+loadTemplate('admin_add_tester_user', FALSE, $content);
// [EOF]
?>
$content['action_selection'] = adminAddMenuSelectionBox('admin', 'action', 'menu');
// Display form
- loadTemplate('admin_add_admin_menu', false, $content);
+ loadTemplate('admin_add_admin_menu', FALSE, $content);
} elseif (!isDemoModeActive()) {
// Insert new menu entry
if (isPostRequestElementSet('menu')) {
);
// Load row template
- $OUT .= loadTemplate('admin_edit_admin_menu_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_admin_menu_row', TRUE, $content);
} else {
// Entry not found?
$content = array(
);
// Load row template
- $OUT .= loadTemplate('admin_menu_404_row', true, $content);
+ $OUT .= loadTemplate('admin_menu_404_row', TRUE, $content);
}
// Free result and switch color
$content['count'] = $count;
// Load template
- loadTemplate('admin_edit_admin_menu_form', false, $content);
+ loadTemplate('admin_edit_admin_menu_form', FALSE, $content);
} elseif ((isFormSent('delete')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Prepare misc content
$content['sub'] = $subMenu;
'count' => $count,
'sel' => $sel,
);
- $OUT .= loadTemplate('admin_delete_admin_menu_row', true, $content);
+ $OUT .= loadTemplate('admin_delete_admin_menu_row', TRUE, $content);
} else {
// Entry not found?
$content = array(
'sel' => $sel
);
- $OUT .= loadTemplate('admin_menu_404_row', true, $content);
+ $OUT .= loadTemplate('admin_menu_404_row', TRUE, $content);
}
SQL_FREERESULT($result);
} // END - if
$content['count'] = $count;
// Load template
- loadTemplate('admin_delete_admin_menu', false, $content);
+ loadTemplate('admin_delete_admin_menu', FALSE, $content);
} elseif ((isFormSent()) && (!isDemoModeActive())) {
// An action is done...
switch (postRequestElement('ok')) {
$content['do'] = 'admin';
// Load row template and switch colors
- $OUT .= loadTemplate('admin_menu_overview_row', true, $content);
+ $OUT .= loadTemplate('admin_menu_overview_row', TRUE, $content);
} // END - switch
// Remember all rows
SQL_FREERESULT($result);
// Load template
- loadTemplate('admin_edit_admin_menu', false, $content);
+ loadTemplate('admin_edit_admin_menu', FALSE, $content);
} else {
// Menu entries are missing... (???)
displayMessage('{--ADMIN_NO_MENUS_FOUND--}');
addYouAreHereLink('admin', __FILE__);
// Display form is default
-$FORM = true;
+$FORM = TRUE;
// Is the form sent?
if (isFormSent('add')) {
// Add admin when not added already
if (addAdminAccount(postRequestElement('login'), generateHash(postRequestElement('pass1')), postRequestElement('email')) == 'done') {
// Do not ouput any form!
- $FORM = false;
+ $FORM = FALSE;
// Admin login saved
displayMessage('{--ADMIN_ADMINS_ADD_DONE--}');
} // END - if
// Shall we display the form?
-if ($FORM === true) {
+if ($FORM === TRUE) {
// Prepare content
$content = merge_array(
array('login' => '', 'email' => ''),
);
// Load form from template
- loadTemplate('admin_add_admins', false, $content);
+ loadTemplate('admin_add_admins', FALSE, $content);
} // END - if
// [EOF]
$content['id'] = getRequestElement('id');
// Load main form
- loadTemplate('admin_admins_contct_form', false, $content);
+ loadTemplate('admin_admins_contct_form', FALSE, $content);
} else {
// Please select an admin!
addAdminSelectionBox();
if (isValidUserId($adminId2)) {
// Add form for an additional admin
- $OUT .= loadTemplate('admin_admins_mails_edit_form', true, $content);
+ $OUT .= loadTemplate('admin_admins_mails_edit_form', TRUE, $content);
} // END - if
// Save full rendered content
$content['content'] = $OUT;
// Start outputing line
- $rows .= loadTemplate('admin_admins_mails_edit_row', true, $content);
+ $rows .= loadTemplate('admin_admins_mails_edit_row', TRUE, $content);
} // END - foreach
// Edit checked entries
- loadTemplate('admin_admins_mails_edit', false, $rows);
+ loadTemplate('admin_admins_mails_edit', FALSE, $rows);
} else {
// Nothing selected
displayMessage('{--ADMINS_NO_MAIL_CHECKED--}');
// Update entry
addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins_mails` SET `admin_id`=%s WHERE `id`=%s ORDER BY `id` LIMIT 1",
- array($content['admin_id'], $id), __FILE__, __LINE__, false));
+ array($content['admin_id'], $id), __FILE__, __LINE__, FALSE));
if ((!isValidUserId($content['admin_id'])) && (isPostRequestElementSet('template', $id))) {
// Remove any other admin entries
addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admins_mails` WHERE mail_template='%s' AND id != '%s'",
- array(postRequestElement('template', $id), $id), __FILE__, __LINE__, false));
+ array(postRequestElement('template', $id), $id), __FILE__, __LINE__, FALSE));
} // END - if
if (postRequestElement('admin_new', postRequestElement('template', $id)) > 0) {
// Add new admin
addSql(SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_admins_mails` (admin_id, mail_template) VALUES ('%s','%s')",
- array($content['admin_id'], postRequestElement('template', $id)), __FILE__, __LINE__, false));
+ array($content['admin_id'], postRequestElement('template', $id)), __FILE__, __LINE__, FALSE));
} // END - if
} // END - foreach
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Load row template
- $OUT .= loadTemplate('admin_admins_mails_list_row', true, $content);
+ $OUT .= loadTemplate('admin_admins_mails_list_row', TRUE, $content);
} // END - while
// Free result
SQL_FREERESULT($result);
// Load template
- loadTemplate('admin_admins_mails_list', false, $OUT);
+ loadTemplate('admin_admins_mails_list', FALSE, $OUT);
} else {
// No entries found
displayMessage('{--ADMIN_ADMINS_MAILS_NO_ENTRIES--}');
$content['cache_perc'] = (getStatsEntry('cache_hits') / $content['total_hits'] * 100);
// Load template
- loadTemplate('admin_cache_stats', false, $content);
+ loadTemplate('admin_cache_stats', FALSE, $content);
} else {
// Deactivated, which is good for performance
displayMessage('{--ADMIN_CACHE_DB_STATS_DEACTIVATED--}');
$content['admin_menu_' . strtolower(getAdminMenu())] = ' checked="checked"';
// Display form
- loadTemplate('admin_config_admin', false, $content);
+ loadTemplate('admin_config_admin', FALSE, $content);
}
// [EOF]
$content['auto_purge'] = createConfigurationTimeSelections('auto_purge', 'MWD');
// Output template
- loadTemplate('admin_config_autopurge', false, $content);
+ loadTemplate('admin_config_autopurge', FALSE, $content);
}
// [EOF]
$content['pay_mode_' . strtolower(getBegPayMode())] = ' selected="selected"';
// Member selection box
- $content['beg_userid'] = addMemberSelectionBox(getBegUserid(), false, true, true, 'beg_userid');
+ $content['beg_userid'] = addMemberSelectionBox(getBegUserid(), FALSE, TRUE, TRUE, 'beg_userid');
// Load form template
- loadTemplate('admin_config_beg', false, $content);
+ loadTemplate('admin_config_beg', FALSE, $content);
}
// [EOF]
setConfigEntry('bonus_disable_notify', postRequestElement('bonus_disable_notify'));
} else {
// Transfer options to template
- $content['bonus_userid'] = addMemberSelectionBox(getBonusUserid(), false, true, true, 'bonus_userid');
+ $content['bonus_userid'] = addMemberSelectionBox(getBonusUserid(), FALSE, TRUE, TRUE, 'bonus_userid');
// Initialize array for the points list
$RANKS = explode(';', getTurboRates());
$content['wait_selection'] = createConfigurationTimeSelections('bonus_notify_wait', 'ms' );
// Load final template
- loadTemplate('admin_config_bonus', false, $content);
+ loadTemplate('admin_config_bonus', FALSE, $content);
}
// [EOF]
$OUT = '';
foreach (postRequestElement('sel') as $id => $value) {
// Load row template and switch colors
- $OUT .= loadTemplate('admin_delete_cats_row', true, $id);
+ $OUT .= loadTemplate('admin_delete_cats_row', TRUE, $id);
} // END - foreach
// Load main template
- loadTemplate('admin_delete_cats', false, $OUT);
+ loadTemplate('admin_delete_cats', FALSE, $OUT);
} elseif ((isFormSent('edit')) && (ifPostContainsSelections())) {
// Edit categories
$OUT = '';
$content['visible_selection'] = addSelectionBox('yn', $content['visible'], 'visible', $content['id']);
// Load row template and switch colors
- $OUT .= loadTemplate('admin_edit_cats_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_cats_row', TRUE, $content);
} // END - foreach
// Load main template
- loadTemplate('admin_edit_cats', false, $OUT);
+ loadTemplate('admin_edit_cats', FALSE, $OUT);
} else {
// Init variable here
$CATS = '';
$CATS .= '<option value="' . $content['sort'] . '">' . $cat . '</option>';
// Load row template and switch color
- $OUT .= loadTemplate('admin_list_cats_row', true, $content);
+ $OUT .= loadTemplate('admin_list_cats_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load main template
- loadTemplate('admin_list_cats', false, $OUT);
+ loadTemplate('admin_list_cats', FALSE, $OUT);
} // END - if
// Remember in array
$content['cats'] = $CATS;
// Form to add a new category
- loadTemplate('admin_add_cat', false, $content);
+ loadTemplate('admin_add_cat', FALSE, $content);
}
// [EOF]
adminSaveSettingsFromPostData();
} else {
// Add userid selection
- $content['coupon_userid'] = addMemberSelectionBox(getCouponUserid(), false, true, true, 'coupon_userid');
+ $content['coupon_userid'] = addMemberSelectionBox(getCouponUserid(), FALSE, TRUE, TRUE, 'coupon_userid');
// Prepare some template data
$content['coupon_default_time_selection'] = createConfigurationTimeSelections('coupon_default_time' , 'WDh');
$content['coupon_autopurge_time_selection'] = createConfigurationTimeSelections('coupon_autopurge_time', 'WDh');
// Load template
- loadTemplate('admin_config_coupon', false, $content);
+ loadTemplate('admin_config_coupon', FALSE, $content);
}
// [EOF]
} // END - foreach
// Transfer options
- $content['doubler_userid'] = addMemberSelectionBox(getConfig('doubler_userid'), false, true, true, 'doubler_userid');
+ $content['doubler_userid'] = addMemberSelectionBox(getConfig('doubler_userid'), FALSE, TRUE, TRUE, 'doubler_userid');
// Number of rows to display (option lines!!!)
foreach (array('new','pay','old') as $entry) {
$content['timeout_selection'] = createConfigurationTimeSelections('doubler_timeout', 'WDh');
// Load template
- loadTemplate('admin_config_doubler', false, $content);
+ loadTemplate('admin_config_doubler', FALSE, $content);
}
// [EOF]
} // END - if
// Load form template
- loadTemplate('admin_config_holiday', false, $content);
+ loadTemplate('admin_config_holiday', FALSE, $content);
}
// [EOF]
$content['cookie_selection'] = createConfigurationTimeSelections('index_cookie', 'YMWD');
// Output form
- loadTemplate('admin_config_home', false, $content);
+ loadTemplate('admin_config_home', FALSE, $content);
}
break;
$content['link'] = $newHomeLink;
// Load row template
- $OUT .= loadTemplate('admin_list_home_row', true, $content);
+ $OUT .= loadTemplate('admin_list_home_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load template
- loadTemplate('admin_list_home', false, $OUT);
+ loadTemplate('admin_list_home', FALSE, $OUT);
break;
default: // Output selection table
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Load row template
- $OUT .= loadTemplate('admin_list_imprint_row', true, $content);
+ $OUT .= loadTemplate('admin_list_imprint_row', TRUE, $content);
} // END - while
// Transfer all rows to $content
$content = $OUT;
} else {
// None found
- $content = loadTemplate('admin_list_imprint_row_none', true);
+ $content = loadTemplate('admin_list_imprint_row_none', TRUE);
}
// Load template
- loadTemplate('admin_list_imprint', false, $content);
+ loadTemplate('admin_list_imprint', FALSE, $content);
}
// [EOF]
}
// Load template
- loadTemplate('admin_config_mediadata', false, $content);
+ loadTemplate('admin_config_mediadata', FALSE, $content);
}
//
$content['mem_only'] = addSelectionBox('yn', $content['mem_only'] , 'member', $id);
// Load row template
- $OUT .= loadTemplate('admin_edit_mods_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_mods_row', TRUE, $content);
} // END - foreach
// Load main template
- loadTemplate('admin_edit_mods', false, $OUT);
+ loadTemplate('admin_edit_mods', FALSE, $OUT);
} else {
// Nothing selected
displayMessage('{--ADMIN_MODS_NOTHING_SELECTED--}');
postRequestElement('admin', $id),
postRequestElement('member', $id),
$id
- ), __FILE__, __LINE__, false));
+ ), __FILE__, __LINE__, FALSE));
}
// Run all sqls
} // END - if
// Load row template
- $OUT .= loadTemplate('admin_list_mods_row', true, $content);
+ $OUT .= loadTemplate('admin_list_mods_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load main template
- loadTemplate('admin_list_mods', false, $OUT);
+ loadTemplate('admin_list_mods', FALSE, $OUT);
} // END - if
// [EOF]
addYouAreHereLink('admin', __FILE__);
// By default we should display list/add new forms
-$GLOBALS['network_display'] = true;
+$GLOBALS['network_display'] = TRUE;
// Handle form here
doNetworkHandleForm();
// Display forms?
-if ($GLOBALS['network_display'] === false) {
+if ($GLOBALS['network_display'] === FALSE) {
// Abort here
return;
} // END - if
SQL_FREERESULT($result_config);
// Load main template
- loadTemplate('admin_config_network_api', false, $content);
+ loadTemplate('admin_config_network_api', FALSE, $content);
} else {
// Please setup some networks first
displayMessage('{--ADMIN_NETWORK_DATA_MISSING--}');
addYouAreHereLink('admin', __FILE__);
// By default we should display list/add new forms
-$GLOBALS['network_display'] = true;
+$GLOBALS['network_display'] = TRUE;
// Handle form here
doNetworkHandleForm();
// Display forms?
-if ($GLOBALS['network_display'] === false) {
+if ($GLOBALS['network_display'] === FALSE) {
// Abort here
return;
} // END - if
$content['network_max_reload_time'] = createTimeSelections($content['network_max_reload_time'], 'network_max_reload_time', 'WDhms');
// Load template
- loadTemplate($templateName, false, $content);
+ loadTemplate($templateName, FALSE, $content);
// Abort here
return;
$content = merge_array($content, SQL_FETCHARRAY($result_config));
// Add it with extra template
- $content['network_type_config_content'] = loadTemplate('admin_show_config_network_type', true, $content);
+ $content['network_type_config_content'] = loadTemplate('admin_show_config_network_type', TRUE, $content);
} else {
// No configuration found, so display form
- $content['network_type_config_content'] = loadTemplate('admin_add_config_network_type', true, $content);
+ $content['network_type_config_content'] = loadTemplate('admin_add_config_network_type', TRUE, $content);
}
// Free result
SQL_FREERESULT($result_config);
// Load row template
- $OUT .= loadTemplate('admin_config_network_types_row', true, $content);
+ $OUT .= loadTemplate('admin_config_network_types_row', TRUE, $content);
} // END - while
// Prepare array for main template
);
// Load main template
- loadTemplate('admin_config_network_types', false, $content);
+ loadTemplate('admin_config_network_types', FALSE, $content);
} else {
// No entries found
displayMessage('{%message,ADMIN_CONFIG_NETWORK_HANDLER_TYPES_404=' . bigintval(getRequestElement('network_id')) . '%}');
$content['order_selection'] = addOrderSelectionOptions(getConfig('order_select'));
// Load template
- loadTemplate('admin_config_order', false, $content);
+ loadTemplate('admin_config_order', FALSE, $content);
}
// [EOF]
$content['comma_def_' . getConfig('max_comma')] = ' selected="selected"';
// Load template
- loadTemplate('admin_config_other', false, $content);
+ loadTemplate('admin_config_other', FALSE, $content);
}
// [EOF]
// Payout requests by your members
$result_mem = SQL_QUERY("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `status`='NEW' ORDER BY payout_timestamp DESC", __FILE__, __LINE__);
-$display = true;
+$display = TRUE;
if ((isFormSent('edit')) && (ifPostContainsSelections())) {
// Make payouts configurable
- $display = false; //Suppress any other outputs
+ $display = FALSE; //Suppress any other outputs
$OUT = '';
foreach (postRequestElement('sel') as $id => $sel) {
// Load data
$content['allow_url'] = addSelectionBox('yn', $content['allow_url'], 'allow_url[' . $content['id'] . ']');
// Load row template and switch color
- $OUT .= loadTemplate('admin_edit_payouts_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_payouts_row', TRUE, $content);
} // END - foreach
// Load main template
- loadTemplate('admin_edit_payouts', false, $OUT);
+ loadTemplate('admin_edit_payouts', FALSE, $OUT);
} elseif ((isFormSent('do_edit')) && (ifPostContainsSelections())) {
// Change them now
// Init SQLs
convertCommaToDot(postRequestElement('min_points' , $id)),
postRequestElement('allow_url', $id),
$id
- ),__FILE__, __LINE__, false));
+ ),__FILE__, __LINE__, FALSE));
}
}
// Get message
$message = '{--ADMIN_PAYOUT_ENTRIES_CHANGED--}';
} elseif ((isFormSent('delete')) && (ifPostContainsSelections())) {
- $display = false; //Suppress any other outputs
+ $display = FALSE; //Suppress any other outputs
$OUT = '';
foreach (postRequestElement('sel') as $id => $sel) {
// Secure id number
SQL_FREERESULT($result);
// Load row template and switch color
- $OUT .= loadTemplate('admin_delete_payouts_row', true, $content);
+ $OUT .= loadTemplate('admin_delete_payouts_row', TRUE, $content);
} // END - foreach
// Load main template
- loadTemplate('admin_delete_payouts', false, $OUT);
+ loadTemplate('admin_delete_payouts', FALSE, $OUT);
} elseif ((isFormSent('do_delete')) && (ifPostContainsSelections())) {
// Init SQLs
initSqls();
// Delete entries
foreach (postRequestElement('sel') as $id => $sel) {
addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE `id`=%s LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__, false));
+ array(bigintval($id)), __FILE__, __LINE__, FALSE));
} // END - foreach
// Run all SQLs
$OUT = '';
while ($content = SQL_FETCHARRAY($result_type)) {
// Load row template and switch color
- $OUT .= loadTemplate('admin_config_payouts_row', true, $content);
+ $OUT .= loadTemplate('admin_config_payouts_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result_type);
// Load main template
- loadTemplate('admin_config_payouts', false, $OUT);
+ loadTemplate('admin_config_payouts', FALSE, $OUT);
} // END - if
// Does your members request payouts?
-if ((!SQL_HASZERONUMS($result_mem)) && ($display === true)) {
+if ((!SQL_HASZERONUMS($result_mem)) && ($display === TRUE)) {
// Members has requested payouts
displayMessage('<a href="{%url=modules.php?module=admin&what=list_payouts%}">{--ADMIN_PAYOUT_LIST_REQUESTS--}</a>');
-} elseif ($display === true) {
+} elseif ($display === TRUE) {
// No member requests so far
displayMessage('{--ADMIN_PAYOUT_NO_MEMBER_REQUESTS--}');
}
SQL_FREERESULT($result_mem);
// Add new payout type
-if ($display === true) {
+if ($display === TRUE) {
loadTemplate('admin_add_payout');
} // END - if
} // END - foreach
// Load template
- loadTemplate('admin_config_point_settings', false, $content);
+ loadTemplate('admin_config_point_settings', FALSE, $content);
} elseif (getRequestElement('sub') == 'ref') {
// 12 3 32 2 3321
if ((isFormSent('delete')) && (ifPostContainsSelections())) {
SQL_FREERESULT($result);
// Load row template and switch color
- $OUT .= loadTemplate('admin_delete_reflevel_row', true, $content);
+ $OUT .= loadTemplate('admin_delete_reflevel_row', TRUE, $content);
} // END - foreach
// Load main template
- loadTemplate('admin_delete_reflevel', false, $OUT);
+ loadTemplate('admin_delete_reflevel', FALSE, $OUT);
} elseif ((isFormSent('edit')) && (ifPostContainsSelections())) {
// Edit entries
$OUT = '';
SQL_FREERESULT($result);
// Load row template and switch color
- $OUT .= loadTemplate('admin_edit_reflevel_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_reflevel_row', TRUE, $content);
} // END - foreach
// Load main template
- loadTemplate('admin_edit_reflevel', false, $OUT);
+ loadTemplate('admin_edit_reflevel', FALSE, $OUT);
} else {
// Referral levels
$result = SQL_QUERY("SELECT `id`, `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY `level` ASC", __FILE__, __LINE__);
// List already existing categories for editing
while ($content = SQL_FETCHARRAY($result)) {
// Load row template and switch color
- $OUT .= loadTemplate('admin_list_reflevel_row', true, $content);
+ $OUT .= loadTemplate('admin_list_reflevel_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load main template
- loadTemplate('admin_list_reflevel', false, $OUT);
+ loadTemplate('admin_list_reflevel', FALSE, $OUT);
}
// Form for adding new referral levels
$content['rallye_content'] = generateOptions('rallye_data', 'id', 'title', $content['rallye_id']);
// Load row template and switch color
- $OUT .= loadTemplate('admin_edit_rallye_prices_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_rallye_prices_row', TRUE, $content);
} // END - foreach
// Remember row content
$content['rallye_id'] = bigintval(getRequestElement('rallye_id'));
// Load main template
- loadTemplate('admin_edit_rallye_prices', false, $content);
+ loadTemplate('admin_edit_rallye_prices', FALSE, $content);
} else {
// Nothing selected
displayMessage('{%message,ADMIN_RALLYE_NO_PRICES_SELECTED=' . getRequestElement('rallye_id') . '%}');
SQL_FREERESULT($result);
// Load row template and switch color
- $OUT .= loadTemplate('admin_delete_rallye_prices_row', true, $content);
+ $OUT .= loadTemplate('admin_delete_rallye_prices_row', TRUE, $content);
} // END - foreach
$content['rows'] = $OUT;
$content['rallye_id'] = bigintval(getRequestElement('rallye_id'));
// Load main template
- loadTemplate('admin_delete_rallye_prices', false, $content);
+ loadTemplate('admin_delete_rallye_prices', FALSE, $content);
} else {
// Nothing selected
$content = '{--RALLYE_NO_PRICES_SELECTED_1--}<a href="{%url=modules.php?module=admin&what=config_rallye_prices&rallye_id=' . getRequestElement('rallye_id') . '%}">{--RALLYE_NO_PRICES_SELECTED_2--}</a>{--RALLYE_NO_PRICES_SELECTED_3--}';
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Load row template and switch color
- $OUT .= loadTemplate('admin_list_rallye_prices_simple_row', true, $content);
+ $OUT .= loadTemplate('admin_list_rallye_prices_simple_row', TRUE, $content);
} // END - while
// Free memory
$content['rallye_id'] = bigintval(getRequestElement('rallye_id'));
// Load main template
- loadTemplate('admin_list_rallye_prices_simple', false, $content);
+ loadTemplate('admin_list_rallye_prices_simple', FALSE, $content);
} // END - if
}
// Add form for adding new price level
if ((!isFormSent('edit')) && (!isFormSent('delete'))) {
- loadTemplate('admin_add_rallye_prices', false, getRequestElement('rallye_id'));
+ loadTemplate('admin_add_rallye_prices', FALSE, getRequestElement('rallye_id'));
} // END - if
} else {
// No rallye selected so display all available without prices
$content['end_time'] = generateDateTime($content['end_time'] , '3');
// Load row template and switch color
- $OUT .= loadTemplate('admin_list_rallye_prices_row', true, $content);
+ $OUT .= loadTemplate('admin_list_rallye_prices_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load main template
- loadTemplate('admin_list_rallye_prices', false, $OUT);
+ loadTemplate('admin_list_rallye_prices', FALSE, $OUT);
} else {
// No rallyes setup so far
displayMessage('{--ADMIN_RALLYE_NO_RALLYES_SETUP--}');
adminSaveSettingsFromPostData();
} else {
// Prepare member selection
- $content['def_refid'] = addMemberSelectionBox(getDefRefid(), false, true, true, 'def_refid');
+ $content['def_refid'] = addMemberSelectionBox(getDefRefid(), FALSE, TRUE, TRUE, 'def_refid');
// Prepare contants for the template
foreach (array('refid_target_index','refid_target_register','select_user_zero_refid_y','select_user_zero_refid_n') as $entry) {
} // END - foreach
// Load template
- loadTemplate('admin_config_refid', false, $content);
+ loadTemplate('admin_config_refid', FALSE, $content);
}
// [EOF]
$content['selection'] = addSelectionBox('yn', $content['field_required'], 'sel[' . $content['id'] . ']');
// @TODO Move this HTML code into a template
- $OUT .= loadTemplate('admin_config_register_row', true, $content);
+ $OUT .= loadTemplate('admin_config_register_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load template
-loadTemplate('admin_config_register', false, $OUT);
+loadTemplate('admin_config_register', FALSE, $OUT);
// [EOF]
?>
$content['register_generate_password_empty'] = addSelectionBox('yn', getRegisterGeneratePasswordEmpty(), 'register_generate_password_empty');
// Load normal template
- loadTemplate('admin_config_register2', false, $content);
+ loadTemplate('admin_config_register2', FALSE, $content);
}
// [EOF]
} // END - foreach
// Load template
- loadTemplate('admin_config_removeip', false, $content);
+ loadTemplate('admin_config_removeip', FALSE, $content);
}
// [EOF]
$content['n_default'] = $n;
// Load template and switch colors
- $OUT .= loadTemplate('admin_config_rewrite_rows', true, $content);
+ $OUT .= loadTemplate('admin_config_rewrite_rows', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load main template
- loadTemplate('admin_config_rewrite', false, $OUT);
+ loadTemplate('admin_config_rewrite', FALSE, $OUT);
}
// [EOF]
$content['guest_stats_' . strtolower(getConfig('guest_stats'))] = ' selected="selected"';
// Load template
- loadTemplate('admin_config_stats', false, $content);
+ loadTemplate('admin_config_stats', FALSE, $content);
}
// [EOF]
} // END - foreach
// Load template
- loadTemplate('admin_config_surfbar', false, $content);
+ loadTemplate('admin_config_surfbar', FALSE, $content);
}
// [EOF]
$content['enable_what_title'] = addSelectionBox('yn', getConfig('enable_what_title'), 'enable_what_title');
// Load template
- loadTemplate('admin_config_title', false, $content);
+ loadTemplate('admin_config_title', FALSE, $content);
}
// [EOF]
$content['timeout_selection'] = createConfigurationTimeSelections('transfer_timeout', 'MWDh');
// Load template
- loadTemplate('admin_config_transfer', false, $content);
+ loadTemplate('admin_config_transfer', FALSE, $content);
}
// [EOF]
$content['tester_user_gender_selection'] = generateGenderSelectionBox(getConfig('tester_user_gender'), 'tester_user_gender');
// Load form template
- loadTemplate('admin_config_user', false, $content);
+ loadTemplate('admin_config_user', FALSE, $content);
}
// [EOF]
} // END - foreach
// Load template
- loadTemplate('admin_config_yoomedia', false, $content);
+ loadTemplate('admin_config_yoomedia', FALSE, $content);
}
// [EOF]
$content['timestamp'] = generateDateTime($content['timestamp'], 0);
// Load template
- loadTemplate('admin_delete_email_normal', false, $content);
+ loadTemplate('admin_delete_email_normal', FALSE, $content);
// Load email template and send the email away
$message_user = loadEmailTemplate('member_order_deleted', $content, $content['sender']);
list($stats_id) = SQL_FETCHROW($result_pool);
// Get all user links
- $links = countSumTotalData($stats_id, 'user_links', 'userid', 'stats_id', true);
+ $links = countSumTotalData($stats_id, 'user_links', 'userid', 'stats_id', TRUE);
// Reset sent mails for recipient(s)
reduceRecipientReceivedMails('stats_id', getRequestElement('mid'), $links);
$content['count'] = $count;
// Load template
- loadTemplate('admin_delete_email_bonus', false, $content);
+ loadTemplate('admin_delete_email_bonus', FALSE, $content);
} else {
// Mail already deleted!
displayMessage('{--ADMIN_BONUS_MAIL_ALREADY_DELETED--}');
$content['count'] = $count;
// Load template
- loadTemplate('admin_delete_email_notify', false, $content);
+ loadTemplate('admin_delete_email_notify', FALSE, $content);
} else {
// Mail already deleted!
displayMessage('{--ADMIN_NOTIFY_MAIL_ALREADY_DELETED--}');
$content['userid'] = bigintval(getRequestElement('id'));
// Display form
- loadTemplate('admin_delete_sponsor', false, $content);
+ loadTemplate('admin_delete_sponsor', FALSE, $content);
}
} else {
// Sponsor not found
// Delete entries...
foreach (postRequestElement('sel') as $id => $sel) {
addSql(SQL_QUERY_ESC('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `trans_id`=%s LIMIT 1',
- array(bigintval($id)), __FILE__, __LINE__, false));
+ array(bigintval($id)), __FILE__, __LINE__, FALSE));
addSql(SQL_QUERY_ESC('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `trans_id`=%s LIMIT 1',
- array(bigintval($id)), __FILE__, __LINE__, false));
+ array(bigintval($id)), __FILE__, __LINE__, FALSE));
} // END - foreach
// Run all SQLs
$content['time_trans'] = generateDateTime($content['time_trans'], 3);
// Load row template
- $OUT .= loadTemplate('admin_delete_transfer_row', true, $content);
+ $OUT .= loadTemplate('admin_delete_transfer_row', TRUE, $content);
// Sum points and switch colors
$total += $content['points'];
// Nothing for in and out
$OUT = '<tr>
<td colspan="6" align="center" class="bottom">
- ' . displayMessage('{--TRANSFER_NO_INOUT_TRANSFERS--}', true) . '
+ ' . displayMessage('{--TRANSFER_NO_INOUT_TRANSFERS--}', TRUE) . '
</td>
</tr>';
}
<input type="submit" name="delete" class="form_delete" value="{--ADMIN_DELETE_TRANSFERS_SUBMIT--}" />';
// Load final template
-loadTemplate('admin_list_transfer', false, $content);
+loadTemplate('admin_list_transfer', FALSE, $content);
// [EOF]
?>
displayMessage('{--ADMIN_DELETE_COMPLETED--}');
} else {
// Account does not exists!
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}');
}
} elseif (isPostRequestElementSet('no')) {
// Do not delete him...
);
// Display form
- loadTemplate('admin_delete_user', false, $content);
+ loadTemplate('admin_delete_user', FALSE, $content);
} else {
// Account does not exists!
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')), '%}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')), '%}');
}
}
SQL_FREERESULT($result);
// Load template
- loadTemplate('admin_edit_email', false, $content);
+ loadTemplate('admin_edit_email', FALSE, $content);
} elseif (isGetRequestElementSet('mid')) {
// Make also this email editable
$result = SQL_QUERY_ESC('SELECT
SQL_FREERESULT($result);
// Load template
- loadTemplate('admin_edit_email', false, $content);
+ loadTemplate('admin_edit_email', FALSE, $content);
} elseif (isGetRequestElementSet('bid')) {
// Make also this email editable
$result = SQL_QUERY_ESC('SELECT
SQL_FREERESULT($result);
// Load template
- loadTemplate('admin_edit_bonus_email', false, $content);
+ loadTemplate('admin_edit_bonus_email', FALSE, $content);
} elseif (isFormSent('save')) {
// Save changes
if (isPostRequestElementSet('mid')) {
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Load row template and switch colors
- $OUT .= loadTemplate('admin_edit_email_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_email_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load email template
- loadTemplate('admin_edit_email_select', false, $OUT);
+ loadTemplate('admin_edit_email_select', FALSE, $OUT);
} else {
// No mail orders left in pool
displayMessage('{--ADMIN_NO_MAILS_IN_POOL--}');
break;
case 'edit': // Edit sponsor account
- $PASS = true;
+ $PASS = TRUE;
if ((postRequestElement('pass1') != postRequestElement('pass2')) || ((!isPostRequestElementSet('pass1')) && (!isPostRequestElementSet('pass1')))) {
// Remove passwords
unsetPostRequestElement('pass1');
unsetPostRequestElement('pass2');
- $PASS = false;
+ $PASS = FALSE;
} // END - if
// Convert time selection
postRequestElement('gender' , '{%pipe,translateGender=' . postRequestElement('gender') . '%}');
postRequestElement('warning_interval', '{%pipe,createFancyTime=' . postRequestElement('warning_interval') . '%}');
- if ($PASS === false) setPostRequestElement('pass1', '{--SPONSOR_PASS_UNCHANGED--}');
+ if ($PASS === FALSE) setPostRequestElement('pass1', '{--SPONSOR_PASS_UNCHANGED--}');
// Load email template and send the mail away
- $message = loadEmailTemplate('admin_sponsor_edit', postRequestArray(), false);
+ $message = loadEmailTemplate('admin_sponsor_edit', postRequestArray(), FALSE);
sendEmail(postRequestElement('email'), '{--ADMIN_SPONSOR_EDIT_SUBJECT--}', $message);
break;
$content['contact'] = '<a href="' . generateSponsorEmailLink($content['email'], 'sponsor_data') . '">' . $content['surname'] . ' ' . $content['family'] . '</a>';
// Load mode template
- loadTemplate($TPL, false, $content);
+ loadTemplate($TPL, FALSE, $content);
} else {
// Template not found
displayMessage('{%message,ADMIN_SPONSOR_MODUS_TPL_404', getRequestElement('do') . '%}');
addYouAreHereLink('admin', __FILE__);
// Fix a notice
-$result_main = false;
+$result_main = FALSE;
if (isGetRequestElementSet('userid')) {
// Load user entry
$result_main = SQL_QUERY_ESC("SELECT
addMemberSelectionBox();
} elseif (isFormSent('edit')) {
// Ok, change the account...
- $updateUser = false; $add = '';
+ $updateUser = FALSE; $add = '';
if ((!isPostRequestElementSet('pass1')) && (!isPostRequestElementSet('pass2'))) {
// Don't change the password
- $updateUser = true;
+ $updateUser = TRUE;
} elseif ((postRequestElement('pass1') == postRequestElement('pass2'))) {
// Change the password
- $updateUser = true;
+ $updateUser = TRUE;
$add = ",`password`='" . generateHash(postRequestElement('pass1')) . "'";
}
- if ($updateUser === true) {
+ if ($updateUser === TRUE) {
// We have to add the following things: birthday and max receive mails
SQL_QUERY_ESC("UPDATE
`{?_MYSQL_PREFIX?}_user_data`
$content = SQL_FETCHARRAY($result_main);
// Load template
- loadTemplate('admin_edit_user', false, $content);
+ loadTemplate('admin_edit_user', FALSE, $content);
}
} else {
// Account does not exists!
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}');
}
// Free the result
// Mail orders are in pool so we can display them
// Add navigation table rows
- $content['top_email_nav'] = addEmailNavigation($numPages, getMailsPage(), true , 3, true);
- $content['bottom_email_nav'] = addEmailNavigation($numPages, getMailsPage(), false, 3, true);
+ $content['top_email_nav'] = addEmailNavigation($numPages, getMailsPage(), TRUE , 3, TRUE);
+ $content['bottom_email_nav'] = addEmailNavigation($numPages, getMailsPage(), FALSE, 3, TRUE);
// List all entries
$OUT = '';
$content = merge_array($content, $pool);
// Load row template and switch colors
- $OUT .= loadTemplate('admin_email_archiv_row', true, $content);
+ $OUT .= loadTemplate('admin_email_archiv_row', TRUE, $content);
} // END - while
// Remmber generated rows in array
$content['rows'] = $OUT;
// Load main template
- loadTemplate('admin_email_archiv', false, $content);
+ loadTemplate('admin_email_archiv', FALSE, $content);
} else {
// No mail orders fond
displayMessage('{--ADMIN_NO_MAILS_IN_POOL--}');
if (!isExtensionInstalledAndNewer('sql_patches', '0.7.4')) {
// No, abort here
displayMessage(generateExtensionOutdatedMessage('sql_patches', '0.7.4'));
- return false;
+ return FALSE;
} // END - if
// Normal mails ordered by your members
}
// Init result_bonus
-$result_bonus = false;
+$result_bonus = FALSE;
if ((isExtensionActive('bonus')) && (empty($WHO))) {
// Check for maximum pages
// Free result
SQL_FREERESULT($result_normal);
-$MAIL = false;
+$MAIL = FALSE;
if (!SQL_HASZERONUMS($result_list)) {
// Init rows
$OUT = '';
$content['timestamp'] = generateDateTime($content['timestamp'], 0);
// Load row template
- $OUT .= loadTemplate('admin_list_emails_row', true, $content);
+ $OUT .= loadTemplate('admin_list_emails_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result_list);
// Add navigation (with change box and colspan=3)
- $content['nav'] = addEmailNavigation($numPages, getMailsPage(), false, 3, true);
+ $content['nav'] = addEmailNavigation($numPages, getMailsPage(), FALSE, 3, TRUE);
// Prepare content
$content['rows'] = $OUT;
$content['who'] = $WHO;
// Mail orders are in pool so we can display them
- loadTemplate('admin_list_emails', false, $content);
+ loadTemplate('admin_list_emails', FALSE, $content);
- $MAIL = true;
+ $MAIL = TRUE;
if ((isExtensionActive('bonus')) && (empty($WHO))) {
// Only check if bonus extension is active
if (!SQL_HASZERONUMS($result_bonus)) outputHtml('<br /><br />');
$content['timestamp'] = generateDateTime($content['timestamp'], 0);
// Load row template
- $OUT .= loadTemplate('admin_list_bonus_emails_row', true, $content);
+ $OUT .= loadTemplate('admin_list_bonus_emails_row', TRUE, $content);
} // END - while
// Add navigation (without change box but with colspan=3)
- $content['nav'] = addEmailNavigation($numPages, getMailsPage(), false, 3, true);
+ $content['nav'] = addEmailNavigation($numPages, getMailsPage(), FALSE, 3, TRUE);
// Prepare content
$content['rows'] = $OUT;
// Load main template
- loadTemplate('admin_list_bonus_emails', false, $content);
- $MAIL = true;
+ loadTemplate('admin_list_bonus_emails', FALSE, $content);
+ $MAIL = TRUE;
} // END - if
} // END - if
-if ($MAIL === false) {
+if ($MAIL === FALSE) {
// No mail orders fond
displayMessage('{--ADMIN_NO_MAILS_IN_POOL--}');
} // END - if
);
// Load row template and switch color
- $OUT .= loadTemplate('admin_edit_extensions_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_extensions_row', TRUE, $content);
} // END - if
} // END - foreach
// Load template
- loadTemplate('admin_edit_extensions', false, $OUT);
+ loadTemplate('admin_edit_extensions', FALSE, $OUT);
$do = 'edit';
}
} elseif ((isPostRequestElementSet('delete')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Listing of SQLs enabled?
if (isVerboseSqlEnabled()) {
// Load SQL commands in remove mode
- if (loadExtension($ext_name, 'remove', '0.0.0', true)) {
+ if (loadExtension($ext_name, 'remove', '0.0.0', TRUE)) {
// Generate extra table with loaded SQL commands
$VERBOSE_OUT = addExtensionVerboseSqlTable();
} // END - if
);
// Load row template and switch color
- $OUT .= loadTemplate('admin_delete_extensions_row', true, $content);
+ $OUT .= loadTemplate('admin_delete_extensions_row', TRUE, $content);
} else {
// Prepare data for the row template
$content = array(
);
// Not valid!
- $OUT .= loadTemplate('admin_delete_extensions_row_404', true, $content);
+ $OUT .= loadTemplate('admin_delete_extensions_row_404', TRUE, $content);
}
} // END - foreach
// Load template
- loadTemplate('admin_delete_extensions', false, $OUT);
+ loadTemplate('admin_delete_extensions', FALSE, $OUT);
$do = 'delete';
} elseif ((isFormSent('do_delete')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Remove extensions from DB (you have to delete all files manually!)
// Show next link
if (isExtensionActive('task')) {
- loadTemplate('admin_next_link', false, array(
+ loadTemplate('admin_next_link', FALSE, array(
'url' => 'modules.php?module=admin&what=list_task',
'title' => '{--ADMIN_EXTENSION_REGISTER_NEXT_LINK--}'
));
} else {
- loadTemplate('admin_next_link', false, array(
+ loadTemplate('admin_next_link', FALSE, array(
'url' => 'modules.php?module=admin',
'title' => '{--ADMIN_EXTENSION_REGISTER_NEXT_LINK--}'
));
$content['ext_css'] = $cssSelection;
// Load row template and switch color
- $OUT .= loadTemplate('admin_list_extensions_row', true, $content);
+ $OUT .= loadTemplate('admin_list_extensions_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load template
- loadTemplate('admin_list_extensions', false, $OUT);
+ loadTemplate('admin_list_extensions', FALSE, $OUT);
} else {
// No extensions are registered
displayMessage('{--ADMIN_NO_EXTENSION_REGISTERED--}');
case 'register': // Register new extension
// Are there some tasks?
- $numTasks = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, "AND `task_type`='EXTENSION'");
+ $numTasks = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', TRUE, "AND `task_type`='EXTENSION'");
// Is the id number valid and the task was found?
if (($taskId > 0) && ($numTasks > 0)) {
$content['action_selection'] = adminAddMenuSelectionBox('guest', 'action', 'menu');
// Display form
- loadTemplate('admin_add_guest_menu', false, $content);
+ loadTemplate('admin_add_guest_menu', FALSE, $content);
} elseif (!isDemoModeActive()) {
// Insert new menu entry
if (isPostRequestElementSet('menu')) {
);
// Load row template
- $OUT .= loadTemplate('admin_edit_guest_menu_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_guest_menu_row', TRUE, $content);
} else {
// Entry not found
$content = array(
'sel' => $sel
);
- $OUT .= loadTemplate('admin_menu_404_row', true, $content);
+ $OUT .= loadTemplate('admin_menu_404_row', TRUE, $content);
}
// Free result and switch color
$content['count'] = $count;
// Load template
- loadTemplate('admin_edit_guest_menu_form', false, $content);
+ loadTemplate('admin_edit_guest_menu_form', FALSE, $content);
} elseif ((isFormSent('delete')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Del menu entries with or without confirmation
$content['sub'] = $subMenu;
'menu' => $content['title'],
'sel' => $sel,
);
- $OUT .= loadTemplate('admin_delete_guest_menu_row', true, $content);
+ $OUT .= loadTemplate('admin_delete_guest_menu_row', TRUE, $content);
} else {
// Entry not found?
$content = array(
'sel' => $sel
);
- $OUT .= loadTemplate('admin_menu_404_row', true, $content);
+ $OUT .= loadTemplate('admin_menu_404_row', TRUE, $content);
}
SQL_FREERESULT($result);
} // END - if
$content['count'] = $count;
// Load template
- loadTemplate('admin_delete_guest_menu', false, $content);
+ loadTemplate('admin_delete_guest_menu', FALSE, $content);
} elseif ((isPostRequestElementSet('status')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Change status (visible / locked)
$content['sub'] = $subMenu;
);
// Load template
- $OUT .= loadTemplate('admin_menu_status_row', true, $content);
+ $OUT .= loadTemplate('admin_menu_status_row', TRUE, $content);
} else {
// Entry not found?
$content = array(
'sel' => $sel
);
- $OUT .= loadTemplate('admin_menu_404_row', true, $content);
+ $OUT .= loadTemplate('admin_menu_404_row', TRUE, $content);
}
SQL_FREERESULT($result);
$content['count'] = $count;
// Load template
- loadTemplate('admin_guest_menu_status', false, $content);
+ loadTemplate('admin_guest_menu_status', FALSE, $content);
} elseif ((isFormSent()) && (!isDemoModeActive())) {
// An action is done...
adminProcessMenuEditForm('guest', $subMenu);
);
// Load row template
- $OUT .= loadTemplate('admin_menu_overview_row', true, $content);
+ $OUT .= loadTemplate('admin_menu_overview_row', TRUE, $content);
} // END - while
// Add rows/sub
SQL_FREERESULT($result);
// Load template
- loadTemplate('admin_edit_guest_menu', false, $content);
+ loadTemplate('admin_edit_guest_menu', FALSE, $content);
} else {
// Menu entries are missing... (???)
displayMessage('{--ADMIN_NO_MENUS_FOUND--}');
addYouAreHereLink('admin', __FILE__);
// By default show the list...
-$show = true;
+$show = TRUE;
// Check for '???_id' element
if ((countRequestPost() > 0) && (!ifPostContainsSelections('???_id'))) {
showEntriesByXmlCallback('admin_edit_show_!!!s');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_edit')) {
// Change data of entries
showEntriesByXmlCallback('admin_edit_do_!!!s');
showEntriesByXmlCallback('admin_delete_show_!!!s');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_delete')) {
// Remove entries from database
showEntriesByXmlCallback('admin_delete_do_!!!s');
showEntriesByXmlCallback('admin_lock_show_!!!s');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_lock')) {
// Un-/lock selected URLs. This does not work for pending URLs
showEntriesByXmlCallback('admin_lock_do_!!!s');
showEntriesByXmlCallback('admin_undelete_show_!!!s');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_undelete')) {
// Undelete selected URLs. This does only work for deleted URLs... ;-)
showEntriesByXmlCallback('admin_undelete_do_!!!s');
}
// Show entries?
-if ($show === false) {
+if ($show === FALSE) {
// No, a form has already been show
- return false;
+ return FALSE;
} // END - if
// List all !!!
);
// Load row template
- $OUT .= loadTemplate('admin_edit_admins_acls_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_admins_acls_row', TRUE, $content);
} // END - foreach
// Load main template
- loadTemplate('admin_edit_admins_acls', false, $OUT);
+ loadTemplate('admin_edit_admins_acls', FALSE, $OUT);
} elseif ((isFormSent('do_edit')) && (ifPostContainsSelections())) {
// Change entries
foreach (postRequestElement('sel') as $id => $selected) {
$content['access_mode'] = '{--ADMIN_ADMINS_ACCESS_MODE_' . strtoupper($content['access_mode']) . '--}';
// Load row template and switch colors
- $OUT .= loadTemplate('admin_delete_admins_acls_row', true, $content);
+ $OUT .= loadTemplate('admin_delete_admins_acls_row', TRUE, $content);
} // END - foreach
// Load main template
- loadTemplate('admin_delete_admins_acls', false, $OUT);
+ loadTemplate('admin_delete_admins_acls', FALSE, $OUT);
} elseif ((isFormSent('do_delete')) && (ifPostContainsSelections())) {
// Remove entries
// @TODO Rewrite this to filter 'run_sqls'
$mode = getAdminDefaultAcl(bigintval(postRequestElement('admin_id')));
// Default ACL is false
- $ACL = false;
+ $ACL = FALSE;
if (isPostRequestElementSet('what_menu')) {
// Check parent ACL
$ACL = isAdminsAllowedByAcl(getActionFromModuleWhat('admin', postRequestElement('what_menu')), '');
} // END - if
- if (($mode != postRequestElement('do')) || (($ACL === true) && (postRequestElement('do') == 'deny'))) {
+ if (($mode != postRequestElement('do')) || (($ACL === TRUE) && (postRequestElement('do') == 'deny'))) {
// Mode is fine
$BOTH = ((isPostRequestElementSet('action_menu')) && (isPostRequestElementSet('what_menu')) && (postRequestElement('action_menu') != '') && (postRequestElement('what_menu') != ''));
// Check if one has been selected
- if ((((isPostRequestElementSet('action_menu')) && (postRequestElement('action_menu') != '')) || ((isPostRequestElementSet('what_menu')) && (postRequestElement('what_menu') != ''))) && ($BOTH === false)) {
+ if ((((isPostRequestElementSet('action_menu')) && (postRequestElement('action_menu') != '')) || ((isPostRequestElementSet('what_menu')) && (postRequestElement('what_menu') != ''))) && ($BOTH === FALSE)) {
// Main or sub menu selected
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE `admin_id`=%s AND `action_menu`='%s' AND `what_menu`='%s' LIMIT 1",
array(
$content['access_mode'] = '{--ADMIN_ADMINS_ACCESS_MODE_' . strtoupper($content['access_mode']) . '--}';
// Load row template and switch colors
- $OUT .= loadTemplate('admin_list_admins_acls_row', true, $content);
+ $OUT .= loadTemplate('admin_list_admins_acls_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load main template
- loadTemplate('admin_list_admins_acls', false, $OUT);
+ loadTemplate('admin_list_admins_acls', FALSE, $OUT);
} // END - if
// Prepare some constants for the template
$content['what_selection'] = adminMenuSelectionBox_DEPRECATED('what');
// Load template for adding new ACL
- loadTemplate('admin_add_admins_acl', false, $content);
+ loadTemplate('admin_add_admins_acl', FALSE, $content);
}
// [EOF]
);
// Load row template
- $OUT .= loadTemplate('admin_list_autopurge_row', true, $content);
+ $OUT .= loadTemplate('admin_list_autopurge_row', TRUE, $content);
} // END - while
// Free memory
$content['rows'] = $OUT;
// Load main template
- loadTemplate('admin_list_autopurge', false, $content);
+ loadTemplate('admin_list_autopurge', FALSE, $content);
} else {
// All members are active or you don't have any registered
displayMessage('{--ADMIN_AUTOPURGE_ALL_ACTIVE--}');
addYouAreHereLink('admin', __FILE__);
// Check if there is enougth selected
-$show = true;
+$show = TRUE;
if (ifPostContainsSelections('id')) {
// Okay, which button was pressed?
if (isFormSent('change')) {
''
)
);
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_edit')) {
// Delete entries (with confirmation)
adminEditEntriesConfirm(
array(),
array(),
array(),
- array(true)
+ array(TRUE)
);
} elseif (isFormSent('delete')) {
// Delete entries (with confirmation)
''
)
);
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_delete')) {
// Delete entries (with confirmation)
adminDeleteEntriesConfirm(
array(),
array(),
array(),
- array(true)
+ array(TRUE)
);
}
} // END - if
// Skip showing old entries?
-if ($show === false) return;
+if ($show === FALSE) return;
// Load all banking packages from DB
$result = SQL_QUERY('SELECT
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Load row template
- $OUT .= loadTemplate('admin_list_bank_package_row', true, $content);
+ $OUT .= loadTemplate('admin_list_bank_package_row', TRUE, $content);
} // END - while
// Load main template
- loadTemplate('admin_list_bank_package', false, $OUT);
+ loadTemplate('admin_list_bank_package', FALSE, $OUT);
} else {
// No packages found
displayMessage('{--ADMIN_BANK_NO_PACKAGES_FOUND--}');
);
// Load template and add it
- $OUT .= loadTemplate('admin_list_beg_rows', true, $row);
+ $OUT .= loadTemplate('admin_list_beg_rows', TRUE, $row);
$count++;
$total += $content['beg_points'];
} // END - while
// Check if we need to display form or not with manuel withdraw
if (getLastMonth() == getMonth()) {
// Load form
- $content['withdraw_form'] = loadTemplate('admin_list_beg_form', true);
+ $content['withdraw_form'] = loadTemplate('admin_list_beg_form', TRUE);
} else {
// Display message "no manual withdraw possible"
- $content['withdraw_form'] = displayMessage('{--ADMIN_BEG_ALREADY_WITHDRAW--}', true);
+ $content['withdraw_form'] = displayMessage('{--ADMIN_BEG_ALREADY_WITHDRAW--}', TRUE);
}
// Prepare constant for timemark
if (isExtensionActive('autopurge')) {
$content['autopurge_timeout'] = generateDateTime(time() - getApInactiveSince(), 2);
} else {
- $content['autopurge_timeout'] = displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=autopurge%}', true);
+ $content['autopurge_timeout'] = displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=autopurge%}', TRUE);
}
// Load final template
- loadTemplate('admin_list_beg', false, $content);
+ loadTemplate('admin_list_beg', FALSE, $content);
} else {
// No one has joined the begging rallye...
displayMessage('{--ADMIN_BEG_NO_RALLYE--}');
$content['count'] = $count;
// Load template and add it
- $OUT .= loadTemplate('admin_list_bonus_rows', true, $content);
+ $OUT .= loadTemplate('admin_list_bonus_rows', TRUE, $content);
$count++;
} // END - while
// Check if we need to display form or not with manuel withdraw
if (getLastMonth() == getMonth()) {
// Load form
- $content['withdraw_form'] = loadTemplate('admin_list_bonus_form', true);
+ $content['withdraw_form'] = loadTemplate('admin_list_bonus_form', TRUE);
} else {
// Display message "no manual withdraw possible"
- $content['withdraw_form'] = loadTemplate('admin_settings_unsaved', true, '{--ADMIN_BONUS_ALREADY_WITHDRAW--}');
+ $content['withdraw_form'] = loadTemplate('admin_settings_unsaved', TRUE, '{--ADMIN_BONUS_ALREADY_WITHDRAW--}');
}
// Prepare constant for timemark
}
// Load final template
- loadTemplate('admin_list_bonus', false, $content);
+ loadTemplate('admin_list_bonus', FALSE, $content);
} else {
// No one has become an "activity bonus"...
displayMessage('{--ADMIN_BONUS_NO_ACTIVE_RALLYE--}');
$content['sel'] = $selection;
// Load row template and count up
- $OUT .= loadTemplate('admin_list_user_cats_row', true, $content);
+ $OUT .= loadTemplate('admin_list_user_cats_row', TRUE, $content);
$count++;
} // END - while
$content['rows'] = $OUT;
// Load main template
- loadTemplate('admin_list_user_cats', false, $content);
+ loadTemplate('admin_list_user_cats', FALSE, $content);
} else {
// No categories selected! :-(
- loadTemplate('admin_list_user_cats_404', false, $content);
+ loadTemplate('admin_list_user_cats_404', FALSE, $content);
}
} else {
// User not found
adminChangeActivationStatus(postRequestElement('id'), 'countries', 'is_active');
// Show next link
- loadTemplate('admin_next_link', false, array(
+ loadTemplate('admin_next_link', FALSE, array(
'url' => 'modules.php?module=admin&what=list_country',
'title' => '{--ADMIN_COUNTRY_ACTIVATION_NEXT_LINK--}'
));
$content['is_active'] = $isActive;
// Insert row template and switch color
- $OUT .= loadTemplate($row, true, $content);
+ $OUT .= loadTemplate($row, TRUE, $content);
} // END - if
// Free result
);
// Load main template
- loadTemplate('admin_list_country_form', false, $content);
+ loadTemplate('admin_list_country_form', FALSE, $content);
} // END - if
} else {
// Shall we modify / remove entries now?
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Load row template and switch colors
- $OUT .= loadTemplate('admin_list_country_row', true, $content);
+ $OUT .= loadTemplate('admin_list_country_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
} else {
// No code setup so far (not possible by this software! 'DE' for 'Deutschland' is default
- $OUT = loadTemplate('admin_list_country_no_row', true);
+ $OUT = loadTemplate('admin_list_country_no_row', TRUE);
}
// Add list to constant for the template
$content['rows'] = $OUT;
// Include add template
- $content['add_form'] = loadTemplate('admin_add_country', true);
+ $content['add_form'] = loadTemplate('admin_add_country', TRUE);
// Load main template
- loadTemplate('admin_list_country', false, $content);
+ loadTemplate('admin_list_country', FALSE, $content);
}
// [EOF]
$content['coupon_expired'] = generateDateTime($content['coupon_expired'], '2');
// Add the row template
- $OUT .= loadTemplate('admin_list_coupon_usr_row', true, $content);
+ $OUT .= loadTemplate('admin_list_coupon_usr_row', TRUE, $content);
} // END - while
// Load main template
- loadTemplate('admin_list_coupon_usr', false, $OUT);
+ loadTemplate('admin_list_coupon_usr', FALSE, $OUT);
} else {
// No cashed coupons found
displayMessage('{--ADMIN_LIST_COUPON_404--}');
$content['coupon_expired'] = generateDateTime($content['coupon_expired'], '2');
// Add the row template
- $OUT .= loadTemplate('admin_list_coupon_row', true, $content);
+ $OUT .= loadTemplate('admin_list_coupon_row', TRUE, $content);
} // END - while
// Load main template
- loadTemplate('admin_list_coupon', false, $OUT);
+ loadTemplate('admin_list_coupon', FALSE, $OUT);
} else {
// No cashed coupons found
displayMessage('{--ADMIN_LIST_COUPON_404--}');
$sumAlready = '0'; $sumWaiting = '0';
// Number of direct already payouts and referral
- $count = countSumTotalData('Y','doubler','id','completed',true, " AND `is_ref`='N'");
+ $count = countSumTotalData('Y', 'doubler', 'id', 'completed', TRUE, " AND `is_ref`='N'");
if ($count > 0) {
// Something was payed out
$content['already_direct_link'] = '<a href="{%url=modules.php?module=admin&what=list_doubler&do=already&select=direct%}">' . $count . '</a>';
} // END - if
- $count = countSumTotalData('Y','doubler','id','completed',true, " AND `is_ref`='Y'");
+ $count = countSumTotalData('Y', 'doubler', 'id', 'completed', TRUE, " AND `is_ref`='Y'");
if ($count > 0) {
// Something was payed out
} // END - if
// And the same for waiting pouts (direct and referral)
- $count = countSumTotalData('N','doubler','id','completed',true, " AND `is_ref`='N'");
+ $count = countSumTotalData('N', 'doubler', 'id', 'completed', TRUE, " AND `is_ref`='N'");
if ($count > 0) {
// Something was payed out
$content['waiting_direct_link'] = '<a href="{%url=modules.php?module=admin&what=list_doubler&do=waiting&select=direct%}">' . $count . '</a>';
} // END - if
- $count = countSumTotalData('N','doubler','id','completed',true, " AND `is_ref`='Y'");
+ $count = countSumTotalData('N', 'doubler', 'id', 'completed', TRUE, " AND `is_ref`='Y'");
if ($count > 0) {
// Something was payed out
} // END - switch
// Load mode template
-loadTemplate('admin_list_doubler_' . getRequestElement('do'), false, $content);
+loadTemplate('admin_list_doubler_' . getRequestElement('do'), FALSE, $content);
// [EOF]
?>
SQL_FREERESULT($result);
// Load row template and switch color
- $OUT .= loadTemplate('admin_delete_email_max_rec_row', true, $content);
+ $OUT .= loadTemplate('admin_delete_email_max_rec_row', TRUE, $content);
} // END - foreach
$content['rows'] = $OUT;
// Load main template
- loadTemplate('admin_delete_email_max_rec', false, $content);
+ loadTemplate('admin_delete_email_max_rec', FALSE, $content);
} elseif ((isFormSent('edit')) && (ifPostContainsSelections())) {
// Edit entries
$OUT = '';
SQL_FREERESULT($result);
// Load row template and switch color
- $OUT .= loadTemplate('admin_edit_email_max_rec_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_email_max_rec_row', TRUE, $content);
} // END - foreach
$content['rows'] = $OUT;
// Load main template
- loadTemplate('admin_edit_email_max_rec', false, $content);
+ loadTemplate('admin_edit_email_max_rec', FALSE, $content);
} else {
$result = SQL_QUERY("SELECT `id`, `value`, `comment` FROM `{?_MYSQL_PREFIX?}_max_receive` ORDER BY `value` ASC",
__FILE__, __LINE__);
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Load row template and switch color
- $OUT .= loadTemplate('admin_list_email_max_rec_row', true, $content);
+ $OUT .= loadTemplate('admin_list_email_max_rec_row', TRUE, $content);
} // END - while
// Free memory
$content['rows'] = $OUT;
// Load main template
- loadTemplate('admin_list_email_max_rec', false, $content);
+ loadTemplate('admin_list_email_max_rec', FALSE, $content);
} // END - if
// Display form
addYouAreHereLink('admin', __FILE__);
// By default show the list...
-$show = true;
+$show = TRUE;
// Check for 'url_id' element
if ((!isFormSent('add')) && (countRequestPost() > 0) && (!ifPostContainsSelections('forced_ads_id'))) {
showEntriesByXmlCallback('admin_edit_show_forced_ads');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_edit')) {
// Change data of entries
showEntriesByXmlCallback('admin_edit_do_forced_ads');
showEntriesByXmlCallback('admin_delete_show_forced_ads');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_delete')) {
// Remove entries from database
showEntriesByXmlCallback('admin_delete_do_forced_ads');
}
// Show entries?
-if ($show === false) {
+if ($show === FALSE) {
// No, a form has already been show
- return false;
+ return FALSE;
} // END - if
// List all URLs
addYouAreHereLink('admin', __FILE__);
// By default show the list...
-$show = true;
+$show = TRUE;
// Check for 'url_id' element
if ((!isFormSent('add')) && (countRequestPost() > 0) && (!ifPostContainsSelections('forced_campaign_id'))) {
showEntriesByXmlCallback('admin_edit_show_forced_campaigns');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_edit')) {
// Change data of entries
showEntriesByXmlCallback('admin_edit_do_forced_campaigns');
showEntriesByXmlCallback('admin_delete_show_forced_campaigns');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_delete')) {
// Remove entries from database
showEntriesByXmlCallback('admin_delete_do_forced_campaigns');
showEntriesByXmlCallback('admin_lock_show_forced_campaigns');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_lock')) {
// Un-/lock selected campaigns. This does not work for pending campaigns
showEntriesByXmlCallback('admin_lock_do_forced_campaigns');
}
// Show entries?
-if ($show === false) {
+if ($show === FALSE) {
// No, a form has already been show
- return false;
+ return FALSE;
} // END - if
// List all campaigns
);
// Display form for adding a forced-ad
-loadTemplate('admin_add_forced_campaign', false, $content);
+loadTemplate('admin_add_forced_campaign', FALSE, $content);
// [EOF]
?>
addYouAreHereLink('admin', __FILE__);
// By default show the list...
-$show = true;
+$show = TRUE;
// Check for 'url_id' element
if ((!isFormSent('add')) && (countRequestPost() > 0) && (!ifPostContainsSelections('forced_costs_id'))) {
showEntriesByXmlCallback('admin_edit_show_forced_costs');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_edit')) {
// Change data of entries
showEntriesByXmlCallback('admin_edit_do_forced_costs');
showEntriesByXmlCallback('admin_delete_show_forced_costs');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_delete')) {
// Remove entries from database
showEntriesByXmlCallback('admin_delete_do_forced_costs');
}
// Show entries?
-if ($show === false) {
+if ($show === FALSE) {
// No, a form has already been show
- return false;
+ return FALSE;
} // END - if
// List all URLs
addYouAreHereLink('admin', __FILE__);
// By default show the list...
-$show = true;
+$show = TRUE;
// Check for '???_id' element
if ((countRequestPost() > 0) && (!ifPostContainsSelections('grade_id'))) {
showEntriesByXmlCallback('admin_edit_show_grade_data');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_edit')) {
// Change data of entries
showEntriesByXmlCallback('admin_edit_do_grade_data');
showEntriesByXmlCallback('admin_delete_show_grade_data');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_delete')) {
// Remove entries from database
showEntriesByXmlCallback('admin_delete_do_grade_data');
}
// Show entries?
-if ($show === false) {
+if ($show === FALSE) {
// No, a form has already been show
- return false;
+ return FALSE;
} // END - if
// List all URLs
);
// Load row template and switch color
- $OUT .= loadTemplate('admin_list_holiday_row', true, $content);
+ $OUT .= loadTemplate('admin_list_holiday_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load main template
- loadTemplate('admin_list_holiday', false, $OUT);
+ loadTemplate('admin_list_holiday', FALSE, $OUT);
} else {
// No holiday requests found
displayMessage('{--ADMIN_HOLIDAY_NOTHING_FOUND--}');
// Initializes all other elements
$linkData['mail_id'] = '';
$linkData['problem'] = '{--ADMIN_GENERAL_MAIL_PROBLEM--}';
- $result_data = false;
+ $result_data = FALSE;
// Load data from stats table...
// @TODO Rewrite this to includes/filter
$mailData['timestamp'] = generateDateTime($mailData['timestamp'], 0);
// Load row template
- $OUT .= loadTemplate('admin_list_links_row', true, $mailData);
+ $OUT .= loadTemplate('admin_list_links_row', TRUE, $mailData);
} else {
// Load template for error
- $OUT .= loadTemplate('admin_list_links_problem', true, $linkData);
+ $OUT .= loadTemplate('admin_list_links_problem', TRUE, $linkData);
}
// Free result
SQL_FREERESULT($result);
// Load final template
- loadTemplate('admin_list_links', false, $content);
+ loadTemplate('admin_list_links', FALSE, $content);
}
} else {
// No mails left to confirm
} // END - if
// By default we should display list/add new forms
-$GLOBALS['network_display'] = true;
+$GLOBALS['network_display'] = TRUE;
// Handle form here
doNetworkHandleForm();
// Display forms?
-if ($GLOBALS['network_display'] === false) {
+if ($GLOBALS['network_display'] === FALSE) {
// Abort here
return;
} // END - if
// Add it to network if the type matches selected
if ($row['network_type_id'] == postRequestElement('network_type_id')) {
// Matches, then add it for disabling this entry
- $GLOBALS['network_array_translation_disabled'][$row['network_array_index']] = true;
+ $GLOBALS['network_array_translation_disabled'][$row['network_array_index']] = TRUE;
} // END - if
// Add row template and switch color
- $OUT .= loadTemplate('admin_list_network_array_translation_row', true, $row);
+ $OUT .= loadTemplate('admin_list_network_array_translation_row', TRUE, $row);
} // END - while
// Load main template
- loadTemplate('admin_list_network_array_translation', false, $OUT);
+ loadTemplate('admin_list_network_array_translation', FALSE, $OUT);
} else {
// No entries found
displayMessage('{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_404=' . $networkData['network_title'] . '%}');
SQL_FREERESULT($result);
// Add form for adding new array_translation pair
- loadTemplate('admin_add_network_array_translation', false, $networkData);
+ loadTemplate('admin_add_network_array_translation', FALSE, $networkData);
} else {
// Generate network list for this script
outputHtml(generateAdminNetworkList());
} // END - if
// By default we should display list/add new forms
-$GLOBALS['network_display'] = true;
+$GLOBALS['network_display'] = TRUE;
// Handle form here
doNetworkHandleForm();
// Display forms?
-if ($GLOBALS['network_display'] === false) {
+if ($GLOBALS['network_display'] === FALSE) {
// Abort here
return;
} // END - if
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Load row template
- $OUT .= loadTemplate('admin_list_network_data_row', true, $content);
+ $OUT .= loadTemplate('admin_list_network_data_row', TRUE, $content);
} // END - while
// Load main template
- loadTemplate('admin_list_network_data', false, $OUT);
+ loadTemplate('admin_list_network_data', FALSE, $OUT);
} else {
// Display a message that there are sponsor networks supported, yet
displayMessage('{--ADMIN_NETWORK_NONE_SUPPORTED--}');
} // END - if
// By default we should display list/add new forms
-$GLOBALS['network_display'] = true;
+$GLOBALS['network_display'] = TRUE;
// Handle form here
doNetworkHandleForm();
// Display forms?
-if ($GLOBALS['network_display'] === false) {
+if ($GLOBALS['network_display'] === FALSE) {
// Abort here
return;
} // END - if
// Add it to network if the type matches selected
if ($row['network_type_id'] == postRequestElement('network_type_id')) {
// Matches, then add it for disabling this entry
- $GLOBALS['network_request_params_disabled'][$row['network_request_param_key']] = true;
+ $GLOBALS['network_request_params_disabled'][$row['network_request_param_key']] = TRUE;
} // END - if
// Add row template and switch color
- $OUT .= loadTemplate('admin_list_network_request_params_row', true, $row);
+ $OUT .= loadTemplate('admin_list_network_request_params_row', TRUE, $row);
} // END - while
// Load main template
- loadTemplate('admin_list_network_request_params', false, $OUT);
+ loadTemplate('admin_list_network_request_params', FALSE, $OUT);
} else {
// No entries found
displayMessage('{%message,ADMIN_NETWORK_REQUEST_PARAMETER_404=' . $networkData['network_title'] . '%}');
SQL_FREERESULT($result);
// Add form for adding new params
- loadTemplate('admin_add_network_request_param', false, $networkData);
+ loadTemplate('admin_add_network_request_param', FALSE, $networkData);
} else {
// Generate network list for this script
outputHtml(generateAdminNetworkList());
} // END - if
// By default we should display list/add new forms
-$GLOBALS['network_display'] = true;
+$GLOBALS['network_display'] = TRUE;
// Handle form here
doNetworkHandleForm();
// Display forms?
-if ($GLOBALS['network_display'] === false) {
+if ($GLOBALS['network_display'] === FALSE) {
// Abort here
return;
} // END - if
$OUT = '';
while ($row = SQL_FETCHARRAY($result)) {
// Set disabled entry
- $GLOBALS['network_types_disabled'][$row['network_type_handler']] = true;
+ $GLOBALS['network_types_disabled'][$row['network_type_handler']] = TRUE;
// Add row template and switch color
- $OUT .= loadTemplate('admin_list_network_types_row', true, $row);
+ $OUT .= loadTemplate('admin_list_network_types_row', TRUE, $row);
} // END - while
// Load main template
- loadTemplate('admin_list_network_types', false, $OUT);
+ loadTemplate('admin_list_network_types', FALSE, $OUT);
} else {
// No entries found
displayMessage('{%message,ADMIN_NETWORK_TYPE_HANDLER_404=' . $networkData['network_title'] . '%}');
$networkData['network_type_reload_time_unit'] = generateTimeUnitSelectionBox('h', 'network_type_reload_time_unit', array('W', 'D', 'h', 'm', 's'));
// Add form for adding new types
- loadTemplate('admin_add_network_type', false, $networkData);
+ loadTemplate('admin_add_network_type', FALSE, $networkData);
} else {
// Generate network list for this script
outputHtml(generateAdminNetworkList());
} // END - if
// By default we should display list/add new forms
-$GLOBALS['network_display'] = true;
+$GLOBALS['network_display'] = TRUE;
// Handle form here
doNetworkHandleForm();
// Display forms?
-if ($GLOBALS['network_display'] === false) {
+if ($GLOBALS['network_display'] === FALSE) {
// Abort here
return;
} // END - if
$OUT = '';
while ($row = SQL_FETCHARRAY($result)) {
// Add this entry
- $GLOBALS['network_vcheck_params_disabled'][$row['network_vcheck_param_key']] = true;
+ $GLOBALS['network_vcheck_params_disabled'][$row['network_vcheck_param_key']] = TRUE;
// Add row template and switch color
- $OUT .= loadTemplate('admin_list_network_vcheck_params_row', true, $row);
+ $OUT .= loadTemplate('admin_list_network_vcheck_params_row', TRUE, $row);
} // END - while
// Load main template
- loadTemplate('admin_list_network_vcheck_params', false, $OUT);
+ loadTemplate('admin_list_network_vcheck_params', FALSE, $OUT);
} else {
// No entries found
displayMessage('{%message,ADMIN_NETWORK_VCHECK_PARAMETER_404=' . $networkData['network_title'] . '%}');
SQL_FREERESULT($result);
// Add form for adding new params
- loadTemplate('admin_add_network_vcheck_param', false, $networkData);
+ loadTemplate('admin_add_network_vcheck_param', FALSE, $networkData);
} else {
// Generate network list for this script
outputHtml(generateAdminNetworkList());
// Init variables
$SQL2 = '';
-$result_max = false;
+$result_max = FALSE;
// Set offset an current page to default values
if (!isGetRequestElementSet('page')) setGetRequestElement('page' , 1);
$content['timestamp'] = generateDateTime($content['timestamp'], 0);
// Load row template
- $OUT .= loadTemplate('admin_list_notify_emails_row', true, $content);
+ $OUT .= loadTemplate('admin_list_notify_emails_row', TRUE, $content);
} // END - if
// Add navigation (without change box but with colspan=3)
- $content['nav'] = addEmailNavigation($numPages, getMailsPage(), false, 3, true);
+ $content['nav'] = addEmailNavigation($numPages, getMailsPage(), FALSE, 3, TRUE);
// Prepare content
$content['rows'] = $OUT;
// Load main template
- loadTemplate('admin_list_notify_emails', false, $content);
+ loadTemplate('admin_list_notify_emails', FALSE, $content);
}
} elseif ((SQL_NUMROWS($result_max) === 0) && (is_resource($result_max))) {
// No notifications found
} // END - switch
// Transfer variables...
- $reason = encodeString(getMessage('ADMIN_PAYOUT_REASON'), false);
+ $reason = encodeString(getMessage('ADMIN_PAYOUT_REASON'), FALSE);
// Execute transfer
$ret = sendGetRequest($data['engine_url']);
} else {
// Something goes wrong... :-(
$content = implode('<br />', $ret);
- loadTemplate('admin_payout_failed_transfer', false, $content);
+ loadTemplate('admin_payout_failed_transfer', FALSE, $content);
}
} else {
// Cannot load payout id
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_PAYOUT_FAILED_OBTAIN_PAYOUT_ID--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_PAYOUT_FAILED_OBTAIN_PAYOUT_ID--}');
}
} else {
// Prepare content
);
// Load template
- loadTemplate('admin_payout_accept_form', false, $content);
+ loadTemplate('admin_payout_accept_form', FALSE, $content);
}
} elseif ((getRequestElement('do') == 'reject') && (getUserData('email') != '')) {
// Ok, now we can output the form or execute rejecting
);
// Load template
- loadTemplate('admin_payout_reject_form', false, $content);
+ loadTemplate('admin_payout_reject_form', FALSE, $content);
}
} else {
// Cannot load user data
// Banner/Textlink views/clicks request
if (!empty($content['banner'])) {
// Load template for the banner
- $content['target_account'] = loadTemplate('admin_list_payouts_banner', true, $content);
+ $content['target_account'] = loadTemplate('admin_list_payouts_banner', TRUE, $content);
} else {
// Textlink
- $content['target_account'] = loadTemplate('admin_list_payouts_txt', true, $content);
+ $content['target_account'] = loadTemplate('admin_list_payouts_txt', TRUE, $content);
}
// Admins can addionally test the URL for framekillers
$content['payout_timestamp'] = generateDateTime($content['payout_timestamp'], 2);
// Add row and switch color
- $OUT .= loadTemplate('admin_list_payouts_row', true, $content);
+ $OUT .= loadTemplate('admin_list_payouts_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load final template
- loadTemplate('admin_list_payouts', false, $OUT);
+ loadTemplate('admin_list_payouts', FALSE, $OUT);
} else {
// No payout requests are sent so far
displayMessage('{--ADMIN_PAYOUT_NO_REQUESTS_FOUND--}');
addYouAreHereLink('admin', __FILE__);
// By default show the list...
-$show = true;
+$show = TRUE;
// Check for 'url_id' element
if ((!isFormSent('add')) && (countRequestPost() > 0) && (!ifPostContainsSelections('id'))) {
showEntriesByXmlCallback('admin_edit_show_point_accounts');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_edit')) {
// Change data of only custom entries
showEntriesByXmlCallback('admin_edit_do_point_accounts');
showEntriesByXmlCallback('admin_delete_show_point_accounts');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif ((isFormSent('do_delete')) && (ifPointsAccountTypeMatchesPost('CUSTOM'))) {
// Remove only custom entries
showEntriesByXmlCallback('admin_delete_do_point_accounts');
}
// Show entries?
-if ($show === false) {
+if ($show === FALSE) {
// No, a form has already been show
- return false;
+ return FALSE;
} // END - if
// List all campaigns
switch (getRequestElement('activate')) {
case '1': // Activate
addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `is_active`='Y' WHERE `id`=%s AND `is_active`='N' LIMIT 1",
- array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, false)
+ array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, FALSE)
);
break;
case '0': // Deactivate
addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `is_active`='N' WHERE `id`=%s AND `is_active`='Y' LIMIT 1",
- array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, false)
+ array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, FALSE)
);
break;
} // END - switch
switch (getRequestElement('notify')) {
case '1': // Activate
addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `send_notify`='Y' WHERE `id`=%s AND `send_notify`='N' LIMIT 1",
- array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, false)
+ array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, FALSE)
);
break;
case '0': // Deactivate
addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `send_notify`='N' WHERE `id`=%s AND `send_notify`='Y' LIMIT 1",
- array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, false)
+ array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, FALSE)
);
break;
} // END - switch
switch (getRequestElement('auto')) {
case '1': // Activate
addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `auto_add_new_user`='Y' WHERE `id`=%s AND `auto_add_new_user`='N' LIMIT 1",
- array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, false)
+ array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, FALSE)
);
break;
case '0': // Deactivate
addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `auto_add_new_user`='N' WHERE `id`=%s AND `auto_add_new_user`='Y' LIMIT 1",
- array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, false)
+ array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, FALSE)
);
break;
} // END - switch
foreach (postRequestElement('sel') as $id => $selected) {
// Remove selected rallye entirely...
addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_data` WHERE `id`=%s LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__, false));
+ array(bigintval($id)), __FILE__, __LINE__, FALSE));
addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s",
- array(bigintval($id)), __FILE__, __LINE__, false));
+ array(bigintval($id)), __FILE__, __LINE__, FALSE));
addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_users` WHERE `rallye_id`=%s",
- array(bigintval($id)), __FILE__, __LINE__, false));
+ array(bigintval($id)), __FILE__, __LINE__, FALSE));
} // END - foreach
// Run SQLS
bigintval(postRequestElement('min_users', $id)),
bigintval(postRequestElement('min_prices', $id)),
$id
- ), __FILE__, __LINE__, false));
+ ), __FILE__, __LINE__, FALSE));
}
// Run SQLS
$content['rallye_id'] = bigintval($id);
// Output row
- $OUT .= loadTemplate('admin_' . $mode . '_rallyes_row', true, $content);
+ $OUT .= loadTemplate('admin_' . $mode . '_rallyes_row', TRUE, $content);
} // END - foreach
// Load final template
- loadTemplate('admin_' . $mode . '_rallyes', false, $OUT);
+ loadTemplate('admin_' . $mode . '_rallyes', FALSE, $OUT);
} else {
// Nothing selected to edit
displayMessage('{--ADMIN_RALLYE_NO_RALLYES_SELECTED--}');
} // END - if
// Get user points
- $points = countSumTotalData($row['userid'], 'user_points', 'points', 'userid', false, " AND `ref_depth`=1");
+ $points = countSumTotalData($row['userid'], 'user_points', 'points', 'userid', FALSE, " AND `ref_depth`=1");
//* DEBUG: */ debugOutput(basename(__FILE__).':userid='.$row['userid'].',points='.$points.',opoints='.$row['curr_points']);
// Prepare content
);
// Load row template and switch color
- $OUT .= loadTemplate('admin_list_rallye_usr_row', true, $row);
+ $OUT .= loadTemplate('admin_list_rallye_usr_row', TRUE, $row);
} // END - while
// Remember rows
SQL_FREERESULT($result);
// Load template
- loadTemplate('admin_list_rallye_usr', false, $content);
+ loadTemplate('admin_list_rallye_usr', FALSE, $content);
} else {
// No entries found?
displayMessage('{--ADMIN_RALLYE_USERS_404--}');
$OUT = '';
while ($data = SQL_FETCHARRAY($result)) {
// Count joined userids
- $users = countSumTotalData($data['rallye_id'], 'rallye_users', 'rallye_id', 'rallye_id', true);
+ $users = countSumTotalData($data['rallye_id'], 'rallye_users', 'rallye_id', 'rallye_id', TRUE);
// Did some users joined this rallye?
if ($users > 0) {
'send_notify' => $data['send_notify'],
'auto_add_new_user' => $data['auto_add_new_user'],
'notified' => $data['notified'],
- 'prices_cnt' => countSumTotalData($data['rallye_id'], 'rallye_prices', 'rallye_id', 'rallye_id', true),
+ 'prices_cnt' => countSumTotalData($data['rallye_id'], 'rallye_prices', 'rallye_id', 'rallye_id', TRUE),
'descr' => $data['descr'],
'min_users' => $data['min_users'],
'min_prices' => $data['min_prices'],
} // END - switch
// Output row
- $OUT .= loadTemplate('admin_list_rallyes_row', true, $row);
+ $OUT .= loadTemplate('admin_list_rallyes_row', TRUE, $row);
} // END - while
// Free memory
$content['rows'] = $OUT;
// Load template
- loadTemplate('admin_list_rallyes', false, $content);
+ loadTemplate('admin_list_rallyes', FALSE, $content);
} else {
// No rallyes setup so far
displayMessage('{--ADMIN_RALLYE_NO_RALLYES_SETUP--}');
$userid = bigintval(getRequestElement('userid'));
// Fix missing variable
- $result_levels = false;
+ $result_levels = FALSE;
// User found?
if (fetchUserData($userid)) {
// Is the data there?
if (fetchUserData($content['refid'])) {
// Check for referrals
- $refs_cnt = countSumTotalData(getUserData('userid'), 'user_refs', 'id', 'userid', true);
+ $refs_cnt = countSumTotalData(getUserData('userid'), 'user_refs', 'id', 'userid', TRUE);
// Prepare data for the template
// @TODO Try to rewrite some to EL
} // END - if
// Load template for level one
- $OUT_REFS .= loadTemplate('admin_list_refs_row', true, $content);
+ $OUT_REFS .= loadTemplate('admin_list_refs_row', TRUE, $content);
} else {
// No refs found
- $OUT_REFS = loadTemplate('admin_list_refs_nodata', true, $content);
+ $OUT_REFS = loadTemplate('admin_list_refs_nodata', TRUE, $content);
}
// Add content
$levels['info'] = sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), generateUserProfileLink($userid), 0, 0);
// No refs found
- $levels['rows'] = loadTemplate('admin_list_refs_norefs', true, array('userid' => $userid));
+ $levels['rows'] = loadTemplate('admin_list_refs_norefs', TRUE, array('userid' => $userid));
}
// Free result
SQL_FREERESULT($result_refs);
// Load level template
- $OUT .= loadTemplate('admin_list_refs_level', true, $levels);
+ $OUT .= loadTemplate('admin_list_refs_level', TRUE, $levels);
} // END - while
// Prepare content
);
// Load main template
- loadTemplate('admin_list_refs', false, $content);
+ loadTemplate('admin_list_refs', FALSE, $content);
} else {
// No refs made so far
displayMessage('{--USER_REFERRAL_404--}');
$content['last_online'] = generateDateTime($content['last_online'], 2);
$content['last_change'] = generateDateTime($content['last_change'], 2);
// Orders total
- $content['orders'] = countSumTotalData(bigintval(getRequestElement('id')), 'sponsor_orders', 'id', 'sponsor_id', true);
+ $content['orders'] = countSumTotalData(bigintval(getRequestElement('id')), 'sponsor_orders', 'id', 'sponsor_id', TRUE);
// Load template
- loadTemplate('admin_list_sponsor_details', false, $content);
+ loadTemplate('admin_list_sponsor_details', FALSE, $content);
} else {
// Sponsor not found
displayMessage('{%message,ADMIN_SPONSOR_404=' . bigintval(getRequestElement('id')) . '%}');
$content['last_online'] = generateDateTime($content['last_online'], 2);
// Load row template
- $OUT .= loadTemplate('admin_list_sponsor_row', true, $content);
+ $OUT .= loadTemplate('admin_list_sponsor_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result_main);
// Load final template
- loadTemplate('admin_list_sponsor', false, $OUT);
+ loadTemplate('admin_list_sponsor', FALSE, $OUT);
} else {
// No sponsors registered so far
displayMessage('{--ADMIN_SPONSOR_NONE_REGISTERED--}');
if (isFormSent('edit')) {
// Edit entry
- $OUT .= loadTemplate('admin_list_sponsor_pay_edit_row', true, $content);
+ $OUT .= loadTemplate('admin_list_sponsor_pay_edit_row', TRUE, $content);
} else {
// Delete entry
- $OUT .= loadTemplate('admin_list_sponsor_pay_del_row', true, $content);
+ $OUT .= loadTemplate('admin_list_sponsor_pay_del_row', TRUE, $content);
}
} else {
// Entry invalid
- $OUT .= loadTemplate('admin_list_sponsor_pay_404', true, $id);
+ $OUT .= loadTemplate('admin_list_sponsor_pay_404', TRUE, $id);
}
// Free result
// Load main template depending on mode (edit/delete)
if (isFormSent('edit')) {
// Load main edit template
- loadTemplate('admin_list_sponsor_pay_edit', false, $OUT);
+ loadTemplate('admin_list_sponsor_pay_edit', FALSE, $OUT);
} else {
// Load main delete template
- loadTemplate('admin_list_sponsor_pay_del', false, $OUT);
+ loadTemplate('admin_list_sponsor_pay_del', FALSE, $OUT);
}
} else {
// Load all payment types
// List alle found payment types
while ($content = SQL_FETCHARRAY($result)) {
// Add row
- $OUT .= loadTemplate('admin_list_sponsor_pay_row', true, $content);
+ $OUT .= loadTemplate('admin_list_sponsor_pay_row', TRUE, $content);
} // END - while
// Load list template
- $content['list_out'] = loadTemplate('admin_list_sponsor_pay', true, $OUT);
+ $content['list_out'] = loadTemplate('admin_list_sponsor_pay', TRUE, $OUT);
} else {
// Noting setup so far!
- $content['list_out'] = displayMessage('{--ADMIN_SPONSOR_NO_PAYTYPES--}', true);
+ $content['list_out'] = displayMessage('{--ADMIN_SPONSOR_NO_PAYTYPES--}', TRUE);
}
// Free memory
SQL_FREERESULT($result);
// Add new payment types here
- $content['add_out'] = loadTemplate('admin_add_sponsor_paytype', true);
+ $content['add_out'] = loadTemplate('admin_add_sponsor_paytype', TRUE);
// Load final template
- loadTemplate('admin_sponsor_paytypes', false, $content);
+ loadTemplate('admin_sponsor_paytypes', FALSE, $content);
}
// [EOF]
addYouAreHereLink('admin', __FILE__);
// By default show the list...
-$show = true;
+$show = TRUE;
// Edit or delete button hit?
if (isFormSent('edit')) {
showEntriesByXmlCallback('admin_edit_show_surfbar_actions');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_edit')) {
// Change data of entries
showEntriesByXmlCallback('admin_edit_do_surfbar_actions');
}
// Show entries?
-if ($show === false) {
+if ($show === FALSE) {
// No, a form has already been show
- return false;
+ return FALSE;
} // END - if
// List all URLs
addYouAreHereLink('admin', __FILE__);
// By default show the list...
-$show = true;
+$show = TRUE;
// Check for 'url_id' element
if ((countRequestPost() > 0) && (!ifPostContainsSelections('url_id'))) {
showEntriesByXmlCallback('admin_edit_show_surfbar_urls');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_edit')) {
// Change data of entries
showEntriesByXmlCallback('admin_edit_do_surfbar_urls');
showEntriesByXmlCallback('admin_delete_show_surfbar_urls');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_delete')) {
// Remove entries from database
showEntriesByXmlCallback('admin_delete_do_surfbar_urls');
showEntriesByXmlCallback('admin_lock_show_surfbar_urls');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_lock')) {
// Un-/lock selected URLs. This does not work for pending URLs
showEntriesByXmlCallback('admin_lock_do_surfbar_urls');
showEntriesByXmlCallback('admin_undelete_show_surfbar_urls');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_undelete')) {
// Undelete selected URLs. This does only work for deleted URLs... ;-)
showEntriesByXmlCallback('admin_undelete_do_surfbar_urls');
}
// Show entries?
-if ($show === false) {
+if ($show === FALSE) {
// No, a form has already been show
- return false;
+ return FALSE;
} // END - if
// List all URLs
} // END - foreach
} else {
// Unknown action performed
- reportBug(__FILE__, __LINE__, sprintf("Unknown task action performed. data=<pre>%s</pre>", print_r(postRequestArray(), true)));
+ reportBug(__FILE__, __LINE__, sprintf("Unknown task action performed. data=<pre>%s</pre>", print_r(postRequestArray(), TRUE)));
}
// Update query
// Is there an extension task?
if (isExtensionTask($content)) {
// Load extension row template
- $OUT .= loadTemplate('admin_list_task_ext_rows', true, $content);
+ $OUT .= loadTemplate('admin_list_task_ext_rows', TRUE, $content);
} else {
// Load default row template
- $OUT .= loadTemplate('admin_list_task_rows', true, $content);
+ $OUT .= loadTemplate('admin_list_task_rows', TRUE, $content);
}
} // END - while
// Load footer template
if (getRequestElement('type') == 'deleted') {
// Delete now button
- loadTemplate('admin_list_task_delete', false, $content);
+ loadTemplate('admin_list_task_delete', FALSE, $content);
} else {
// Normal footer
- loadTemplate('admin_list_task', false, $content);
+ loadTemplate('admin_list_task', FALSE, $content);
}
}
} // END - if
$content['reason'] = wordwrap($content['reason'], 15);
// Load row template add points and switch color
- $OUT .= loadTemplate('admin_list_transfer_row', true, $content);
+ $OUT .= loadTemplate('admin_list_transfer_row', TRUE, $content);
$total += $content['points'];
} // END - while
// Nothing for in and out
$OUT = '<tr>
<td colspan="6" align="center" class="bottom">
- ' . displayMessage('{--TRANSFER_NO_INOUT_TRANSFERS--}', true) . '
+ ' . displayMessage('{--TRANSFER_NO_INOUT_TRANSFERS--}', TRUE) . '
</td>
</tr>';
}
$content['delete'] = ' ';
// Load final template
-loadTemplate('admin_list_transfer', false, $content);
+loadTemplate('admin_list_transfer', FALSE, $content);
// [EOF]
?>
} // END - if
// Don't load the admin_list_unconfirmed template by default
-$listed = false;
+$listed = FALSE;
// Init query
$sql = '';
$ID = -1;
// Load admin_list_unconfirmed template
- $listed = true;
+ $listed = TRUE;
$DATA = getRequestElement('mid');
$mailType = 'mailid';
} elseif ((isGetRequestElementSet('bid')) && (isExtensionActive('bonus'))) {
$ID = getRequestElement('bid');
// Load admin_list_unconfirmed template
- $listed = true;
+ $listed = TRUE;
$DATA = $ID;
$mailType = 'bonusid';
} else {
}
// Shall I display links or not?
-if (($listed === true) && (!empty($sql))) {
+if (($listed === TRUE) && (!empty($sql))) {
// Load mail data
$result_master = SQL_QUERY($sql, __FILE__, __LINE__);
);
// Load row template and switch colors
- $OUT .= loadTemplate('admin_list_unconfirmed_row', true, $row);
+ $OUT .= loadTemplate('admin_list_unconfirmed_row', TRUE, $row);
} else {
// No user data found
- $OUT .= loadTemplate('admin_list_unconfirmed_row_404', true, $row);
+ $OUT .= loadTemplate('admin_list_unconfirmed_row_404', TRUE, $row);
}
} // END - while
// Render it in our new listing
- $OUT = loadTemplate('admin_list_unconfirmed_list', true, $OUT);
+ $OUT = loadTemplate('admin_list_unconfirmed_list', TRUE, $OUT);
} else {
// All links are confirmed... strange, you shall normally not get a link to this place in this scenario... hmmm.
- $OUT = displayMessage('{--ADMIN_UNCONFIRMED_NO_LINK_LEFT--}', true);
+ $OUT = displayMessage('{--ADMIN_UNCONFIRMED_NO_LINK_LEFT--}', TRUE);
}
// Prepare content
SQL_FREERESULT($result);
// Load final template
- loadTemplate('admin_list_unconfirmed', false, $content);
+ loadTemplate('admin_list_unconfirmed', FALSE, $content);
} elseif (getRequestElement('mid') > 0) {
// Data in pool or in user_stats not found, so let's find out where data is missing
- if (countSumTotalData(bigintval($ID), 'pool', 'id', 'id', true) == 1) {
+ if (countSumTotalData(bigintval($ID), 'pool', 'id', 'id', TRUE) == 1) {
// pool table
displayMessage('{%message,ADMIN_UNCONFIRMED_POOL_MISSING=' . $ID . '%}');
- } elseif (countSumTotalData(bigintval($ID), 'user_stats', 'id', 'pool_id', true) == 1) {
+ } elseif (countSumTotalData(bigintval($ID), 'user_stats', 'id', 'pool_id', TRUE) == 1) {
// user_stats table
displayMessage('{%message,ADMIN_UNCONFIRMED_STATS_MISSING=' . $ID . '%}');
} else {
// Get count/sum of refs, selected categories, unconfirmed mails
// @TODO Refacture these old link generation to functions
$content['refs'] = countSumTotalData($userid, 'refsystem', 'counter');
- $content['cats'] = countSumTotalData($userid, 'user_cats', 'id', 'userid', true);
+ $content['cats'] = countSumTotalData($userid, 'user_cats', 'id', 'userid', TRUE);
$content['links'] = getTotalUnconfirmedMails($userid);
// Add links to the numbers
$content['userid'] = $userid;
// Load user-details template
- loadTemplate('admin_user_details', false, $content);
+ loadTemplate('admin_user_details', FALSE, $content);
} else {
// Account does not exist!
displayMessage('{%message,ADMIN_MEMBER_404=' . $userid . '%}');
// Transfer data to array
$content['email'] = '[<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . $content['email'] . '</a>]';
$content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], '2');
- $content['refs'] = countSumTotalData($content['userid'], 'user_refs', 'id', 'userid', true);
+ $content['refs'] = countSumTotalData($content['userid'], 'user_refs', 'id', 'userid', TRUE);
// Prepare array for filter
$data = array(
}
// Load row template and switch colors
- $OUT .= loadTemplate('admin_list_user_row', true, $content);
+ $OUT .= loadTemplate('admin_list_user_row', TRUE, $content);
} // END - while
// Free memory
$content = merge_array($content, $templateContent);
// Load main template
- loadTemplate('admin_list_user', false, $content);
+ loadTemplate('admin_list_user', FALSE, $content);
} else {
// No one as registered so far! :-(
displayMessage('{--ADMIN_NO_NONE_REGISTERED--}');
addYouAreHereLink('admin', __FILE__);
// By default show the list...
-$show = true;
+$show = TRUE;
// Check for 'id' element
if ((countRequestPost() > 0) && (!ifPostContainsSelections('id')) && (!ifPostContainsSelections('subid'))) {
showEntriesByXmlCallback('admin_edit_show_user_subid');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_edit')) {
// Change data of entries
showEntriesByXmlCallback('admin_edit_do_user_subid');
showEntriesByXmlCallback('admin_delete_show_user_subid');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_delete')) {
// Remove entries from database
showEntriesByXmlCallback('admin_delete_do_user_subid');
loadIncludeOnce($incFile);
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} else {
// Display error message
reportBug(__FILE__, __LINE__, 'Invalid include file ' . basename($incFile) . ' detected.');
}
// Show entries?
-if ($show === false) {
+if ($show === FALSE) {
// No, a form has already been show
- return false;
+ return FALSE;
} // END - if
// Is a user id sent?
} // END - if
// Append it and switch colors
- $OUT .= loadTemplate('admin_list_wernis_row', true, $content);
+ $OUT .= loadTemplate('admin_list_wernis_row', TRUE, $content);
} // END - while
// Load main template
- loadTemplate('admin_list_wernis_main', false, $OUT);
+ loadTemplate('admin_list_wernis_main', FALSE, $OUT);
} else {
// Nothing to display!
displayMessage('{--ADMIN_WERNIS_NO_TRANSFERS--}');
displayMessage('{--ADMIN_YOOMEDIA_REQUESTS_DEPLETED--}');
// Abort here!
- return false;
+ return FALSE;
} // END - if
// Get parsed array back
if ((!is_array($result)) || (count($result) == 0) || (!isset($result[0]['id']))) {
// Invalid result
displayMessage('{--ADMIN_YOOMEDIA_INVALID_RESULT--}');
- return false;
+ return FALSE;
} elseif (count($result[0]) < 7) {
// Error received so prepare error code
$code = YOOMEDIA_GET_ERRORCODE_FROM_RESULT($result);
// Output message
- loadTemplate('admin_yoomedia_error', false, sprintf("{--ADMIN_YOOMEDIA_ERROR_%s--}", strtoupper(translateYooMediaError($code))));
- return false;
+ loadTemplate('admin_yoomedia_error', FALSE, sprintf("{--ADMIN_YOOMEDIA_ERROR_%s--}", strtoupper(translateYooMediaError($code))));
+ return FALSE;
}
// Prepare all entries
$OUT = '';
foreach ($result as $entry) {
// Translate some data
- $entry['pay'] = translateComma($entry['pay'], true, 5);
+ $entry['pay'] = translateComma($entry['pay'], TRUE, 5);
// Check reload lock
$reload = YOOMEDIA_CHECK_RELOAD($entry['id'], $entry['reload'], 'textmail');
// Is this mail already sent?
- if ($reload !== false) {
+ if ($reload !== FALSE) {
// Init countdown
$countdown = '0';
}
// Load row template for displaying
- $OUT .= loadTemplate('admin_list_yoomedia_tm_already', true, $entry);
+ $OUT .= loadTemplate('admin_list_yoomedia_tm_already', TRUE, $entry);
} else {
// Load row template with buttons
- $OUT .= loadTemplate('admin_list_yoomedia_tm_row', true, $entry);
+ $OUT .= loadTemplate('admin_list_yoomedia_tm_row', TRUE, $entry);
}
} // END - foreach
// Load main template
-loadTemplate('admin_list_yoomedia_tm', false, $OUT);
+loadTemplate('admin_list_yoomedia_tm', FALSE, $OUT);
// [EOF]
?>
$content['email_link'] = '<a href="' . generateEmailLink($content['email'], 'sponsor_data') . '">' . $content['gender'] . ' ' . $content['surname'] . ' ' . $content['family'] . '</a>';
// Display form
- loadTemplate('admin_lock_sponsor', false, $content);
+ loadTemplate('admin_lock_sponsor', FALSE, $content);
}
} else {
// Cannot change status on unconfirmed or pending accounts!
// Is a userid set?
if (isGetRequestElementSet('userid')) {
// Action not performed by default
- $isActive = false;
+ $isActive = FALSE;
// Load user's data
if (fetchUserData(getRequestElement('userid'))) {
// Prepare message
$message = '{%message,ADMIN_USER_ACCOUNT_LOCKED=' . bigintval(getRequestElement('userid')) . '%}';
- $isActive = true;
+ $isActive = TRUE;
} elseif ((isPostRequestElementSet('unlock')) && (getUserData('status') == 'LOCKED')) {
// Ok, unlock the account!
if (isExtensionInstalledAndNewer('user', '0.3.5')) {
// Prepare message
$message = '{%message,ADMIN_USER_ACCOUNT_UNLOCKED=' . bigintval(getRequestElement('userid')) . '%}';
- $isActive = true;
+ $isActive = TRUE;
} elseif (isFormSent('delete')) {
// Delete the account
- $isActive = true;
+ $isActive = TRUE;
loadIncludeOnce('inc/modules/admin/what-del_user.php');
} elseif (isPostRequestElementSet('no')) {
// Do not lock him...
}
// Output form
- loadTemplate('admin_lock_user', false, $content);
+ loadTemplate('admin_lock_user', FALSE, $content);
} else {
// Account does not exists!
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')), '%}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')), '%}');
}
}
} elseif ($isActive) {
// An action was performed...
if (!empty($message)) {
- loadTemplate('admin_settings_unsaved', false, $message);
+ loadTemplate('admin_settings_unsaved', FALSE, $message);
} else {
displayMessage('{--ADMIN_USER_UPDATED--}');
}
}
} else {
// Account does not exists!
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')), '%}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')), '%}');
}
} else {
// List all users
} // END - switch
// Display form
- loadTemplate('admin_maintenance_form', false, $message);
+ loadTemplate('admin_maintenance_form', FALSE, $message);
}
// [EOF]
$content['action_selection'] = adminAddMenuSelectionBox('member', 'action', 'menu');
// Display form
- loadTemplate('admin_add_member_menu', false, $content);
+ loadTemplate('admin_add_member_menu', FALSE, $content);
} elseif (!isDemoModeActive()) {
// Insert new menu entry
if (isPostRequestElementSet('menu')) {
);
// Load template
- $OUT .= loadTemplate('admin_edit_member_menu_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_member_menu_row', TRUE, $content);
} else {
// Entry not found?
$content = array(
);
// Load template
- $OUT .= loadTemplate('admin_menu_404_row', true, $content);
+ $OUT .= loadTemplate('admin_menu_404_row', TRUE, $content);
}
SQL_FREERESULT($result);
} // END - if
$content['count'] = $count;
// Load template
- loadTemplate('admin_edit_member_menu', false, $content);
+ loadTemplate('admin_edit_member_menu', FALSE, $content);
} elseif ((isFormSent('delete')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Del menu entries with or without confirmation
$content['sub'] = $subMenu;
);
// Load template
- $OUT .= loadTemplate('admin_delete_member_menu_row', true, $content);
+ $OUT .= loadTemplate('admin_delete_member_menu_row', TRUE, $content);
} else {
// Entry not found?
$content = array(
);
// Load template
- $OUT .= loadTemplate('admin_menu_404_row', true, $content);
+ $OUT .= loadTemplate('admin_menu_404_row', TRUE, $content);
}
SQL_FREERESULT($result);
} // END - if
$content['count'] = $count;
// Load template
- loadTemplate('admin_delete_member_menu', false, $content);
+ loadTemplate('admin_delete_member_menu', FALSE, $content);
} elseif ((isPostRequestElementSet('status')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Change status (visible / locked)
$content['sub'] = $subMenu;
);
// Load template
- $OUT .= loadTemplate('admin_menu_status_row', true, $content);
+ $OUT .= loadTemplate('admin_menu_status_row', TRUE, $content);
} else {
// Entry not found?
$content = array(
);
// Load template
- $OUT .= loadTemplate('admin_menu_404_row', true, $content);
+ $OUT .= loadTemplate('admin_menu_404_row', TRUE, $content);
}
SQL_FREERESULT($result);
} // END - if
$content['count'] = $count;
// Load template
- loadTemplate('admin_member_menu_status', false, $content);
+ loadTemplate('admin_member_menu_status', FALSE, $content);
} elseif ((isFormSent()) && (!isDemoModeActive())) {
// Process menu editing form
adminProcessMenuEditForm('member', $subMenu);
$content['do'] = 'mem';
// Load row template and switch color
- $OUT .= loadTemplate('admin_menu_overview_row', true, $content);
+ $OUT .= loadTemplate('admin_menu_overview_row', TRUE, $content);
} // END - while
// Free memory
$content['sub'] = $subMenu;
// Load main template
- loadTemplate('admin_member_menu_overview', false, $content);
+ loadTemplate('admin_member_menu_overview', FALSE, $content);
} else {
// Menu entries are missing... (???)
displayMessage('{--ADMIN_NO_MENUS_FOUND--}');
);
// Load row template and switch color
- $OUT .= loadTemplate('admin_optimize_row', true, $row);
+ $OUT .= loadTemplate('admin_optimize_row', TRUE, $row);
} // END - foreach
// Remember rows
$content['now_optimized'] = $gain_tabs;
// Load main template
-loadTemplate('admin_optimize', false, $content);
+loadTemplate('admin_optimize', FALSE, $content);
// [EOF]
?>
switch (getRequestElement('do')) {
case 'add':
addSql("INSERT INTO `{?_MYSQL_PREFIX?}_payments` (`time`, `payment`, `mail_title`, `price`) VALUES ('".postRequestElement('t_wait')."','".postRequestElement('payment')."','".postRequestElement('title')."','".postRequestElement('price')."')");
- if (countSumTotalData(postRequestElement('t_wait'), 'payments', 'id', 'time', true) == 1) {
+ if (countSumTotalData(postRequestElement('t_wait'), 'payments', 'id', 'time', TRUE) == 1) {
// Re-init the array here
initSqls();
} // END - if
SQL_FREERESULT($result);
// Load row template and switch colors
- $OUT .= loadTemplate('admin_delete_payments_row', true, $content);
+ $OUT .= loadTemplate('admin_delete_payments_row', TRUE, $content);
} // END - foreach
// Load main template
- loadTemplate('admin_delete_payments', false, $OUT);
+ loadTemplate('admin_delete_payments', FALSE, $OUT);
} elseif ((isFormSent('edit')) && (ifPostContainsSelections())) {
// Edit entries
$OUT = '';
SQL_FREERESULT($result);
// Load row template and switch colors
- $OUT .= loadTemplate('admin_edit_payments_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_payments_row', TRUE, $content);
} // END - foreach
// Load main template
- loadTemplate('admin_edit_payments', false, $OUT);
+ loadTemplate('admin_edit_payments', FALSE, $OUT);
} else {
// Referral levels
$result = SQL_QUERY("SELECT `id`, `time`, `payment`, `mail_title`, `price` FROM `{?_MYSQL_PREFIX?}_payments` ORDER BY `time` ASC", __FILE__, __LINE__);
// List already existing categories for editing
while ($content = SQL_FETCHARRAY($result)) {
// Load row template and switch colors
- $OUT .= loadTemplate('admin_list_payments_row', true, $content);
+ $OUT .= loadTemplate('admin_list_payments_row', TRUE, $content);
} // END - switch
// Free memory
SQL_FREERESULT($result);
// Load main template
- loadTemplate('admin_list_payments', false, $OUT);
+ loadTemplate('admin_list_payments', FALSE, $OUT);
} // END - if
// Form for adding new referral levels
$content['visible'] = addSelectionBox('yn', $content['visible'], 'visible');
// Load row template and switch color
- $OUT .= loadTemplate('admin_edit_refbanner_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_refbanner_row', TRUE, $content);
} // END - foreach
// Load main template
- loadTemplate('admin_edit_refbanner', false, $OUT);
+ loadTemplate('admin_edit_refbanner', FALSE, $OUT);
} else {
if ((ifPostContainsSelections()) && (isFormSent('delete'))) {
// Delete banner
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Load row template and switch color
- $OUT .= loadTemplate('admin_list_refbanner_row', true, $content);
+ $OUT .= loadTemplate('admin_list_refbanner_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load main template
- loadTemplate('admin_list_refbanner', false, $OUT);
+ loadTemplate('admin_list_refbanner', FALSE, $OUT);
} // END - if
// Form for adding new referral levels
addYouAreHereLink('admin', __FILE__);
// Get a list with current language files
-$langFiles = getArrayFromDirectory('inc/language/', '', false, false, array('_de.php'), '.php', '@(\.|\.\.)$@', true, getCurrentLanguage());
+$langFiles = getArrayFromDirectory('inc/language/', '', FALSE, FALSE, array('_de.php'), '.php', '@(\.|\.\.)$@', TRUE, getCurrentLanguage());
// By default nothing is checked, which is isn't right...
$OUT = '';
);
// Compares, all fine
- $OUT .= loadTemplate('admin_repair_lang_row_compares', true, $content);
+ $OUT .= loadTemplate('admin_repair_lang_row_compares', TRUE, $content);
} else {
// Generate difference output only if count is smaller/equals 100 entries
$diffContent = '<ul>';
);
// Compares, all fine
- $OUT .= loadTemplate('admin_repair_lang_row_diff', true, $content);
+ $OUT .= loadTemplate('admin_repair_lang_row_diff', TRUE, $content);
}
} else {
// Not readable, prepare content
);
// Load template
- $OUT .= loadTemplate('admin_repair_lang_row_404', true, $content);
+ $OUT .= loadTemplate('admin_repair_lang_row_404', TRUE, $content);
}
} // END - foreach
} // END - foreach
);
// Load main template
-loadTemplate('admin_repair_lang', false, $content);
+loadTemplate('admin_repair_lang', FALSE, $content);
// [EOF]
?>
$content['html_select'] = '';
if (isExtensionActive('html_mail')) {
// If HTML extension is active
- $content['html_select'] = loadTemplate('admin_send_bonus_html', true);
+ $content['html_select'] = loadTemplate('admin_send_bonus_html', TRUE);
} // END - if
// Default template name is an invalid one
} // END - switch
// Load template
- loadTemplate($template, false, $content);
+ loadTemplate($template, FALSE, $content);
}
// [EOF]
// Load entry
while (list($userid) = SQL_FETCHROW($result)) {
// By default no code is unique
- $isUnique = false;
+ $isUnique = FALSE;
$couponCode = '';
// Look for a unique id
$couponCode = generatePassword(30, array('-', '+', '_', '/', '.'));
// Is it really unique?
- $isUnique = (countSumTotalData($couponCode, 'user_coupons', 'id', 'coupon_code', true) == 0);
+ $isUnique = (countSumTotalData($couponCode, 'user_coupons', 'id', 'coupon_code', TRUE) == 0);
} // END - while
// The above loop should always set $couponCode, so we can now insert it
$content['coupon_default_time_selection'] = createConfigurationTimeSelections('coupon_default_time', 'WDh');
// Load template
- loadTemplate('admin_send_coupon', false, $content);
+ loadTemplate('admin_send_coupon', FALSE, $content);
}
// [EOF]
$template = 'newsletter';
// Check for extension and sending-mode
- if (!isExtensionActive('html_mail', true) && (postRequestElement('mail_mode') == 'html')) {
+ if (!isExtensionActive('html_mail', TRUE) && (postRequestElement('mail_mode') == 'html')) {
// Set mode to text mode
postRequestElement('mail_mode') == 'text';
} elseif (postRequestElement('mail_mode') == 'html') {
// Extension html_mail installed?
if (isExtensionActive('html_mail')) {
// Load template with HTML mode
- loadTemplate('admin_newsletter', false, $content);
+ loadTemplate('admin_newsletter', FALSE, $content);
} else {
// Load template with only text mode
- loadTemplate('admin_newsletter_nohtml', false, $content);
+ loadTemplate('admin_newsletter_nohtml', FALSE, $content);
}
}
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Load row template
- $OUT .= loadTemplate('admin_list_mods_stats2_row', true, $content);
+ $OUT .= loadTemplate('admin_list_mods_stats2_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load final template
- loadTemplate('admin_list_mods_stats2', false, $OUT);
+ loadTemplate('admin_list_mods_stats2', FALSE, $OUT);
} else {
// Load module statics
$result = SQL_QUERY("SELECT `module`, `title`, `clicks` FROM `{?_MYSQL_PREFIX?}_mod_reg` ORDER BY `clicks` DESC,`module` ASC", __FILE__, __LINE__);
} // END - if
// Load row template
- $OUT .= loadTemplate('admin_list_mods_stats_row', true, $content);
+ $OUT .= loadTemplate('admin_list_mods_stats_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load final template
- loadTemplate('admin_list_mods_stats', false, $OUT);
+ loadTemplate('admin_list_mods_stats', FALSE, $OUT);
}
// [EOF]
$content['userid'] = bigintval(getRequestElement('userid'));
// Load form
- loadTemplate('admin_sub_points', false, $content);
+ loadTemplate('admin_sub_points', FALSE, $content);
}
} else {
// User not found
- loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}');
}
} else {
// Output selection form with all confirmed user accounts listed
- addMemberSelectionBox(0, true);
+ addMemberSelectionBox(0, TRUE);
}
// [EOF]
$content['last_surfed'] = generateDateTime($content['last_surfed'], 2);
// Load row template
- $OUT .= loadTemplate('admin_surfbar_url_stats_row', true, $content);
+ $OUT .= loadTemplate('admin_surfbar_url_stats_row', TRUE, $content);
$count++;;
} // END - while
// Load main template
- loadTemplate('admin_surfbar_url_stats', false, $content);
+ loadTemplate('admin_surfbar_url_stats', FALSE, $content);
} else {
// No statistics so far
displayMessage('{--ADMIN_SURFBAR_NO_URL_STATS--}');
$visits += $content['total_visits'];
// Load row template
- $OUT .= loadTemplate('admin_surfbar_stats_row', true, $content);
+ $OUT .= loadTemplate('admin_surfbar_stats_row', TRUE, $content);
} // END - while
// Prepare content
// Load main template
- loadTemplate('admin_surfbar_stats', false, $content);
+ loadTemplate('admin_surfbar_stats', FALSE, $content);
} else {
// No statistics so far
displayMessage('{--ADMIN_SURFBAR_NO_STATS--}');
$content['email'] = '<a href="mailto:' . $GLOBALS['theme_data']['email'] . '?Subject=[Theme:] ' . $GLOBALS['theme_data']['name'] . ' (' . $content['theme_path'] . ')\>' . $GLOBALS['theme_data']['author'] . '</a>';
// Load row template and switch color
- $OUT .= loadTemplate('admin_edit_theme_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_theme_row', TRUE, $content);
} // END - while
// Free memory
// No themes found???
$OUT .= '<tr>
<td colspan="7" class="bottom" height="60">
- ' . displayMessage('{--ADMIN_NO_THEMES_FOUND--}', true) . '
+ ' . displayMessage('{--ADMIN_NO_THEMES_FOUND--}', TRUE) . '
</td>
</tr>';
}
// Load template
-loadTemplate('admin_edit_theme', false, $OUT);
+loadTemplate('admin_edit_theme', FALSE, $OUT);
// [EOF]
?>
);
// Read directory "themes"
-$includes = getArrayFromDirectory('theme/', '', false, true, array('css', 'images'));
+$includes = getArrayFromDirectory('theme/', '', FALSE, TRUE, array('css', 'images'));
// Walk through all entries and add it
foreach ($includes as $inc) {
// Check if current theme is already imported or not
if (!ifThemeExists($unix)) {
// Theme not installed
- $formContent = loadTemplate('admin_import_theme_form', true, $unix);
+ $formContent = loadTemplate('admin_import_theme_form', TRUE, $unix);
} // END - if
// Prepare content
);
// Add row template
- $OUT .= loadTemplate('admin_import_theme_row', true, $content);
+ $OUT .= loadTemplate('admin_import_theme_row', TRUE, $content);
} // END - foreach
if (empty($OUT)) {
// No themes found???
- $OUT .= loadTemplate('admin_import_theme_none', true, displayMessage('{--ADMIN_NO_THEMES_FOUND--}', true));
+ $OUT .= loadTemplate('admin_import_theme_none', TRUE, displayMessage('{--ADMIN_NO_THEMES_FOUND--}', TRUE));
} // END - if
// Load template
-loadTemplate('admin_import_theme', false, $OUT);
+loadTemplate('admin_import_theme', FALSE, $OUT);
// [EOF]
?>
);
// Load row template and switch colors
- $OUT .= loadTemplate('admin_unlock_emails_redir_row', true, $content);
+ $OUT .= loadTemplate('admin_unlock_emails_redir_row', TRUE, $content);
} // END - foreach
// Load main template
- loadTemplate('admin_unlock_emails_redir', false, $OUT);
+ loadTemplate('admin_unlock_emails_redir', FALSE, $OUT);
} else {
// Nothing selected
displayMessage('{--ADMIN_MAILS_NOTHING_CHECKED--}');
$content['timestamp'] = generateDateTime($content['timestamp'], 2);
// Load row template and switch colors
- $OUT .= loadTemplate('admin_unlock_emails_row', true, $content);
+ $OUT .= loadTemplate('admin_unlock_emails_row', TRUE, $content);
} // END - while
// Free memory
$content['rows'] = $OUT;
// Load main template
- loadTemplate('admin_unlock_emails', false, $content);
+ loadTemplate('admin_unlock_emails', FALSE, $content);
} elseif ((isFormSent('lock')) && (!isUrlBlacklistEnabled())) {
// URL blacklist not activated
displayMessage('{--ADMIN_URL_BLACKLIST_DISABLED--}');
$content['sponsor_created'] = generateDateTime($content['sponsor_created'], 2);
// Load row template and switch colors
- $OUT .= loadTemplate('admin_unlock_sponsor_row', true, $content);
+ $OUT .= loadTemplate('admin_unlock_sponsor_row', TRUE, $content);
} // END - while
// Load template
- loadTemplate('admin_unlock_sponsor', false, $OUT);
+ loadTemplate('admin_unlock_sponsor', FALSE, $OUT);
} else {
// No pending accounts found
displayMessage('{--ADMIN_SPONSOR_NONE_PENDING--}');
// Is a newer version available?
if (empty($ONLINE['version'])) {
// Disconnected?
- loadTemplate('admin_settings_unsaved', false, '{--ADMIN_CANNOT_CHECK_VERSION--} (' . $ONLINE['code'] . ')');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CANNOT_CHECK_VERSION--} (' . $ONLINE['code'] . ')');
} elseif (($ONLINE['version'] != getFullVersion()) || ($ONLINE['revision'] > getCurrentRepositoryRevision())) {
// New full-version available (all previous released patches are included in this version!)
$ONLINE['changed'] = generateDateTime($ONLINE['changed'], 2);
// Load template
- loadTemplate('admin_update_download', false, $ONLINE);
+ loadTemplate('admin_update_download', FALSE, $ONLINE);
} elseif ($ONLINE['revision'] < getCurrentRepositoryRevision()) {
// Installed revision is newer than on server
displayMessage('{--ADMIN_LOCAL_REVISION_IS_NEWER_THAN_UPDATE--}');
displayMessage('{--ADMIN_USER_CONTACTED--}');
} else {
// Load contact form template
- loadTemplate('admin_contct_user_form', false, $content);
+ loadTemplate('admin_contct_user_form', FALSE, $content);
}
} else {
// Not found?
if (isExtensionActive('online')) {
// Count guests, members and admins
// @TODO Add a filter for sponsor
- $content['guests_online'] = countSumTotalData('N', 'online', 'id', 'is_admin', true, " AND `is_member`='N'");
- $content['admins_online'] = countSumTotalData('N', 'online', 'id', 'is_admin', true, " AND `is_member`='Y'");
- $content['members_online'] = countSumTotalData('N', 'online', 'id', 'is_admin', true);
+ $content['guests_online'] = countSumTotalData('N', 'online', 'id', 'is_admin', TRUE, " AND `is_member`='N'");
+ $content['admins_online'] = countSumTotalData('N', 'online', 'id', 'is_admin', TRUE, " AND `is_member`='Y'");
+ $content['members_online'] = countSumTotalData('N', 'online', 'id', 'is_admin', TRUE);
// Load template
- loadTemplate('admin_mini_online', false, $content);
+ loadTemplate('admin_mini_online', FALSE, $content);
// Check for online users
$result = SQL_QUERY("SELECT `id`, `ip`, `userid`, `refid`, `module`, `action`, `what`, `is_member`, `is_admin`, `timestamp` FROM `{?_MYSQL_PREFIX?}_online` ORDER by `timestamp` DESC",
$row['timestamp'] = generateDateTime($row['timestamp'], 2);
// Load row template and switch color
- $OUT .= loadTemplate('admin_list_online_row', true, $row);
+ $OUT .= loadTemplate('admin_list_online_row', TRUE, $row);
} // END - while
// Free memory
$content['rows'] = $OUT;
// Load footer template
- loadTemplate('admin_list_online', false, $content);
+ loadTemplate('admin_list_online', FALSE, $content);
} // END - if
} else {
// Online statistics deactivated!
loadIncludeOnce('inc/modules/admin/overview-inc.php');
// Default is that all jobs are done (why?)
-$jobsDone = true;
+$jobsDone = TRUE;
// Default is that 'task' is not installed
-$taskExt = false;
+$taskExt = FALSE;
// When the admin is logging in check several things first (new jobs to complete and so on)
if (getAction() == 'login') {
if ((isExtensionActive('task')) && (function_exists('outputAdvancedOverview'))) {
// When task extension is registered output advanced overview page
$jobsDone = outputAdvancedOverview($result_tasks); // This function is provided by the extension 'task'
- $taskExt = true;
+ $taskExt = TRUE;
} else {
// Output standart overview (provided by overview-inc.php)
$jobsDone = outputStandardOverview($result_tasks);
if (!ifAdminMenuHasEntries(getAction())) {
// This menu is empty and so no content is displayed
displayMessage('{--ADMIN_MENU_EMPTY--}');
-} elseif ($jobsDone === true) {
+} elseif ($jobsDone === TRUE) {
// Generate overview of all main menus
if ((is_array($GLOBALS['menu']['description'])) && (count($GLOBALS['menu']['description']) > 0)) {
$OUT = '';
);
// Load row template
- $OUT .= loadTemplate('admin_menu_hints_row', true, $content);
+ $OUT .= loadTemplate('admin_menu_hints_row', TRUE, $content);
} // END - foreach
// Load base template
- loadTemplate('admin_menu_hints', false, $OUT);
+ loadTemplate('admin_menu_hints', FALSE, $OUT);
}
-} elseif ($taskExt === false) {
+} elseif ($taskExt === FALSE) {
if (isExtensionActive('task')) {
// Output warning message
displayMessage('{%message,EXTENSION_WARNING_EXTENSION_INACTIVE=task%}');
runFilterChain('member_login_check');
// Redirect to member area
- $GLOBALS['message'] .= loadTemplate('member_login_js', true);
+ $GLOBALS['message'] .= loadTemplate('member_login_js', TRUE);
} else {
// Login failed!
- $GLOBALS['message'] .= loadTemplate('login_failed_js', true);
+ $GLOBALS['message'] .= loadTemplate('login_failed_js', TRUE);
}
// Output final message
// Build frameset
$content['order'] = bigintval(getRequestElement('order'));
$content['url'] = generateDereferrerUrl($url);
- loadTemplate('member_order_frametester', false, $content);
+ loadTemplate('member_order_frametester', FALSE, $content);
break;
case 'guest':
$content['url'] = generateDereferrerUrl($url);
- loadTemplate('guest_frametester', false, $content);
+ loadTemplate('guest_frametester', FALSE, $content);
break;
} // END - switch
break;
break;
case 'back': // Back buttom
- loadTemplate('member_order_back', false, getRequestElement('order'));
+ loadTemplate('member_order_back', FALSE, getRequestElement('order'));
break;
case 'send': // Send mail away
- loadTemplate('member_order_send', false, getRequestElement('order'));
+ loadTemplate('member_order_send', FALSE, getRequestElement('order'));
break;
} // END - switch
} else {
}
// Total visitors online
-$total = countSumTotalData('', 'online', 'id', 'userid', true);
+$total = countSumTotalData('', 'online', 'id', 'userid', TRUE);
if (getConfig('mad_count') < $total) {
// Update counter
// Prepare content
$content = array(
- 'guests' => countSumTotalData('N', 'online', 'id', 'is_admin', true, " AND `is_member`='N'"),
- 'members' => countSumTotalData('N', 'online', 'id', 'is_admin', true, " AND `is_member`='Y'"),
- 'admins' => countSumTotalData('Y', 'online', 'id', 'is_admin', true),
+ 'guests' => countSumTotalData('N', 'online', 'id', 'is_admin', TRUE, " AND `is_member`='N'"),
+ 'members' => countSumTotalData('N', 'online', 'id', 'is_admin', TRUE, " AND `is_member`='Y'"),
+ 'admins' => countSumTotalData('Y', 'online', 'id', 'is_admin', TRUE),
'total' => $total
);
// Output table
-$GLOBALS['rows'] .= loadTemplate('online_now', true, $content);
+$GLOBALS['rows'] .= loadTemplate('online_now', TRUE, $content);
// Add more links in this block
runFilterChain('online_extra_links');
// Get total num
if (isAdmin()) {
// Load all themes for admin
- $num_themes = countSumTotalData('', 'themes', 'id', '', true);
+ $num_themes = countSumTotalData('', 'themes', 'id', '', TRUE);
} else {
// Load only active designs for user
- $num_themes = countSumTotalData('Y', 'themes', 'id', 'theme_active', true);
+ $num_themes = countSumTotalData('Y', 'themes', 'id', 'theme_active', TRUE);
}
// Default is no box
$OUT = generateThemeSelectionBox();
} elseif (($num_themes == 1) || ((!isAdmin()) && ($num_themes == '0'))) {
// If there's only one just output it's name
- $OUT = loadTemplate('theme_one', true, getCurrentThemeName());
+ $OUT = loadTemplate('theme_one', TRUE, getCurrentThemeName());
} elseif (isAdmin()) {
// If there is no theme installed and there's an admin notify him!
$OUT = '{--ADMIN_NO_THEME_INSTALLED_WARNING--}';
}
// Load final box template
-$GLOBALS['rows'] .= loadTemplate('theme_select_box', true, $OUT);
+$GLOBALS['rows'] .= loadTemplate('theme_select_box', TRUE, $OUT);
// [EOF]
?>
$content['last_online'] = generateDateTime($content['last_online'], '2');
// Load template
- $OUT .= loadTemplate('guest_list_active_row', true, $content);
+ $OUT .= loadTemplate('guest_list_active_row', TRUE, $content);
} // END - while
} else {
// No member was online today! :-(
- $OUT = loadTemplate('guest_list_active_row_none', true);
+ $OUT = loadTemplate('guest_list_active_row_none', TRUE);
}
// Load template
-loadTemplate('guest_list_active', false, $OUT);
+loadTemplate('guest_list_active', FALSE, $OUT);
// [EOF]
?>
$content['payout_history'] = generateDoublerTable(0, 'Y', 'N', 'DESC');
// Load template
-loadTemplate('guest_doubler', false, $content);
+loadTemplate('guest_doubler', FALSE, $content);
// [EOF]
?>
// Prepare data
$content = array(
'name' => substr($template, 4),
- 'description' => loadTemplate($template, true),
+ 'description' => loadTemplate($template, TRUE),
);
// Load the template in a special row template
- $OUT .= loadTemplate('guest_extensions_row', true, $content);
+ $OUT .= loadTemplate('guest_extensions_row', TRUE, $content);
} // END - foreach
// Load main template
-loadTemplate('guest_extensions', false, $OUT);
+loadTemplate('guest_extensions', FALSE, $OUT);
// [EOF]
?>
// Initialize variables
$errorCode = '0';
-$userid = false;
+$userid = FALSE;
$hash = '';
$url = '';
$add = '';
} // END - if
// @TODO Move this HTML code into a template
- $content['message'] = loadTemplate('guest_login_error_message', true, $errorCode);
+ $content['message'] = loadTemplate('guest_login_error_message', TRUE, $errorCode);
} // END - if
// Display login form with resend-password form
if (isExtensionActive('nickname')) {
- loadTemplate('guest_nickname_login', false, $content);
+ loadTemplate('guest_nickname_login', FALSE, $content);
} else {
- loadTemplate('guest_login', false, $content);
+ loadTemplate('guest_login', FALSE, $content);
}
// Was an URL constructed?
}
// User who can receive mails
-$content['user_max_mails'] = countSumTotalData('CONFIRMED', 'user_data', 'max_mails', 'status', true, " AND `max_mails` > 0");
+$content['user_max_mails'] = countSumTotalData('CONFIRMED', 'user_data', 'max_mails', 'status', TRUE, " AND `max_mails` > 0");
// Users who can receive mails today
-$content['user_max_rec'] = countSumTotalData('CONFIRMED', 'user_data', 'receive_mails', 'status', true, " AND `receive_mails` > 0");
+$content['user_max_rec'] = countSumTotalData('CONFIRMED', 'user_data', 'receive_mails', 'status', TRUE, " AND `receive_mails` > 0");
// Max mails per day
-$content['max'] = countSumTotalData('CONFIRMED', 'user_data', 'max_mails', 'status', false, " AND `max_mails` > 0");
+$content['max'] = countSumTotalData('CONFIRMED', 'user_data', 'max_mails', 'status', FALSE, " AND `max_mails` > 0");
// Max mails for this day
-$content['rec'] = countSumTotalData('CONFIRMED', 'user_data', 'receive_mails', 'status', false, " AND `receive_mails` > 0");
+$content['rec'] = countSumTotalData('CONFIRMED', 'user_data', 'receive_mails', 'status', FALSE, " AND `receive_mails` > 0");
// Initial lots of variables
$bmails = '0';
$content['total_logins'] = $logins;
// Referral banner
-$total = countSumTotalData('Y', 'refbanner', 'id', 'visible', true);
+$total = countSumTotalData('Y', 'refbanner', 'id', 'visible', TRUE);
// Total views and clicks
$result = SQL_QUERY("SELECT SUM(`counter`) AS cnt, SUM(`clicks`) AS clx FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `visible`='Y'", __FILE__, __LINE__);
// Clicks on beg links
$data = array(
'lang' => '{--MEDIA_BEG_CLICKS--}',
- 'value' => countSumTotalData('0', 'user_data', 'beg_clicks', 'userid', false, ' AND `beg_clicks` > 0')
+ 'value' => countSumTotalData('0', 'user_data', 'beg_clicks', 'userid', FALSE, ' AND `beg_clicks` > 0')
);
- $OUT_EXTRA .= loadTemplate('mediadata_extra_row', true, $data);
+ $OUT_EXTRA .= loadTemplate('mediadata_extra_row', TRUE, $data);
} // END - if
if (isExtensionActive('doubler')) {
// Add header
- $OUT_SPECIAL .= loadTemplate('mediadata_extra_hrow', true, '{--MEDIA_DOUBLER_HEADER--}');
+ $OUT_SPECIAL .= loadTemplate('mediadata_extra_hrow', TRUE, '{--MEDIA_DOUBLER_HEADER--}');
// Add first line (count)
$data = array(
'lang' => '{--MEDIA_DOUBLER_COUNT--}',
- 'value' => countSumTotalData('Y','doubler','id','completed', true, ' AND `points` > 0'),
+ 'value' => countSumTotalData('Y','doubler','id','completed', TRUE, ' AND `points` > 0'),
);
// Add points
- $OUT_SPECIAL .= loadTemplate('mediadata_extra_row2', true, $data);
+ $OUT_SPECIAL .= loadTemplate('mediadata_extra_row2', TRUE, $data);
$data = array(
'lang' => '{--MEDIA_DOUBLER_CPOINTS--}',
- 'value' => countSumTotalData('Y','doubler','id','completed', false, ' AND `points` > 0')
+ 'value' => countSumTotalData('Y','doubler','id','completed', FALSE, ' AND `points` > 0')
);
- $OUT_SPECIAL .= loadTemplate('mediadata_extra_row', true, $data);
+ $OUT_SPECIAL .= loadTemplate('mediadata_extra_row', TRUE, $data);
$data = array(
'lang' => '{--MEDIA_DOUBLER_WAITING--}',
- 'value' => countSumTotalData('N','doubler','id','completed', true, ' AND `points` > 0')
+ 'value' => countSumTotalData('N','doubler','id','completed', TRUE, ' AND `points` > 0')
);
- $OUT_SPECIAL .= loadTemplate('mediadata_extra_row', true, $data);
+ $OUT_SPECIAL .= loadTemplate('mediadata_extra_row', TRUE, $data);
$data = array(
'lang' => '{--MEDIA_DOUBLER_WPOINTS--}',
- 'value' => countSumTotalData('N','doubler','id','completed', false, ' AND `points` > 0')
+ 'value' => countSumTotalData('N','doubler','id','completed', FALSE, ' AND `points` > 0')
);
- $OUT_SPECIAL .= loadTemplate('mediadata_extra_row', true, $data);
+ $OUT_SPECIAL .= loadTemplate('mediadata_extra_row', TRUE, $data);
} // END - if
if (isExtensionActive('holiday')) {
'lang' => '{--MEDIA_HOLIDAY_COUNT--}',
'value' => $holiday
);
- $OUT_USER .= loadTemplate('mediadata_extra_row', true, $data);
+ $OUT_USER .= loadTemplate('mediadata_extra_row', TRUE, $data);
} // END - if
if (isExtensionActive('transfer')) {
if (empty($points_out)) $points_out = '0';
// Add header
- $OUT_SPECIAL .= loadTemplate('mediadata_extra_hrow', true, '{--MEDIA_TRANSFER_HEADER--}');
+ $OUT_SPECIAL .= loadTemplate('mediadata_extra_hrow', TRUE, '{--MEDIA_TRANSFER_HEADER--}');
$data = array(
'lang' => '{--MEDIA_TRANSFER_IN_COUNT--}',
'value' => $count_in,
);
- $OUT_SPECIAL .= loadTemplate('mediadata_extra_row2', true, $data);
+ $OUT_SPECIAL .= loadTemplate('mediadata_extra_row2', TRUE, $data);
$data = array(
'lang' => '{--MEDIA_TRANSFER_IN_POINTS--}',
'value' => $points_in
);
- $OUT_SPECIAL .= loadTemplate('mediadata_extra_row', true, $data);
+ $OUT_SPECIAL .= loadTemplate('mediadata_extra_row', TRUE, $data);
$data = array(
'lang' => '{--MEDIA_TRANSFER_OUT_COUNT--}',
'value' => $count_out
);
- $OUT_SPECIAL .= loadTemplate('mediadata_extra_row', true, $data);
+ $OUT_SPECIAL .= loadTemplate('mediadata_extra_row', TRUE, $data);
$data = array(
'lang' => '{--MEDIA_TRANSFER_OUT_POINTS--}',
'value' => $points_out
);
- $OUT_SPECIAL .= loadTemplate('mediadata_extra_row', true, $data);
+ $OUT_SPECIAL .= loadTemplate('mediadata_extra_row', TRUE, $data);
} // END - if
$content['out_extra'] = $OUT_EXTRA;
$content['out_special'] = $OUT_SPECIAL;
// Load template
-loadTemplate('mediadata', false, $content);
+loadTemplate('mediadata', FALSE, $content);
// [EOF]
?>
// Found some (normally one...
$content = SQL_FETCHARRAY($result);
- $expired = false;
+ $expired = FALSE;
if (($content['end_time'] < time()) && (getTotalConfirmedUser() >= $content['min_users']) && (getTotalRallyeWinners($content['id']) >= $content['min_prices'])) {
// Rallye is expired
$content['extras'] = '{--RALLYE_HAS_EXPIRED--}';
- $expired = true;
+ $expired = TRUE;
} elseif (time() >= ($content['end_time'] - getOneDay())) {
// Rallye will expire in less one day!
$content['extras'] = '{--RALLYE_EXPIRE_ONE_DAY--}';
// Handle description...
if ((empty($content['descr'])) && (!empty($content['template']))) {
// Use description from template
- $content['descr'] = loadTemplate('rallye_' . $content['template'], true);
+ $content['descr'] = loadTemplate('rallye_' . $content['template'], TRUE);
} // END - if
// Set start and end time
// Determine min prices (now in function)
$content['min_prices'] = determineReferralRallyeMinimumPrices($content['min_prices']);
- if ($expired === true) {
+ if ($expired === TRUE) {
$content['prices'] = addReferralRallyeWinners('guest', $content['id']);
$content['top_users'] = '<div align="center" class="big">' . $content['extras'] . '</div>';
$content['can_win_this'] = '{--RALLYE_OUR_WINNERS_ARE--}';
}
// And load final template
- loadTemplate('guest_show_rallye', false, $content);
+ loadTemplate('guest_show_rallye', FALSE, $content);
} else {
// No rallye found so far
loadTemplate('guest_rallye_404');
registerOutputFailedMessage('ENTER_PASSWORD2');
}
- if ((isset($GLOBALS['registration_short_password'])) && ($GLOBALS['registration_short_password'] === true)) {
+ if ((isset($GLOBALS['registration_short_password'])) && ($GLOBALS['registration_short_password'] === TRUE)) {
registerOutputFailedMessage('GUEST_SHORT_PASS', ': ' . getPassLen());
} // END - if
- if ((isset($GLOBALS['registration_ip_timeout'])) && ($GLOBALS['registration_ip_timeout'] === true)) {
+ if ((isset($GLOBALS['registration_ip_timeout'])) && ($GLOBALS['registration_ip_timeout'] === TRUE)) {
registerOutputFailedMessage('REMOTE_ADDR_TIMEOUT');
} // END - if
// Shall I display the refid or shall I make it editable?
if (isDisplayRefidEnabled()) {
// Load "hide" form template
- $content['refid_content'] = loadTemplate('guest_register_refid_hide', true);
+ $content['refid_content'] = loadTemplate('guest_register_refid_hide', TRUE);
} else {
// Load template to enter it
- $content['refid_content'] = loadTemplate('guest_register_refid', true);
+ $content['refid_content'] = loadTemplate('guest_register_refid', TRUE);
}
// You may want to modify the register_header.tpl.xx file and not this script when you add your scripts etc. :-)
- $content['header_content'] = loadTemplate('register_header', true);
+ $content['header_content'] = loadTemplate('register_header', TRUE);
// ZIP codes are numerical values
$content['zip'] = '';
$content = runFilterChain('register_must_fillout', $content);
// Display registration form
- loadTemplate('guest_register', false, $content);
+ loadTemplate('guest_register', FALSE, $content);
}
// [EOF]
} // END - if
// Init both results (see footer of this file)
-$result_act = false;
-$result_pay = false;
+$result_act = FALSE;
+$result_pay = FALSE;
// Load all sponsor actions
$result_act = SQL_QUERY("SELECT
$OUT_ACT = '';
while ($content = SQL_FETCHARRAY($result_act)) {
// Load row template and switch color
- $OUT_ACT .= loadTemplate('guest_sponsor_act_row', true, $content);
+ $OUT_ACT .= loadTemplate('guest_sponsor_act_row', TRUE, $content);
} // END - while
// Check for pay types
$OUT_PAY = '';
while ($content = SQL_FETCHARRAY($result_pay)) {
// Load row template and switch color
- $OUT_PAY .= loadTemplate('guest_sponsor_pay_row', true, $content);
+ $OUT_PAY .= loadTemplate('guest_sponsor_pay_row', TRUE, $content);
} // END - while
} else {
// No pay types setuped so far!
- $OUT_PAY = loadTemplate('guest_sponsor_infos_none_row', false, displayMessage('{--SPONSOR_NO_ACTIONS_ACTIVATED--}', true));
+ $OUT_PAY = loadTemplate('guest_sponsor_infos_none_row', FALSE, displayMessage('{--SPONSOR_NO_ACTIONS_ACTIVATED--}', TRUE));
}
} else {
// No actions activated so far!
- $OUT_ACT = loadTemplate('guest_sponsor_infos_none_row', true, displayMessage('{--SPONSOR_NO_ACTIONS_ACTIVATED--}', true));
- $OUT_PAY = loadTemplate('guest_sponsor_infos_none_row', true, displayMessage('{--SPONSOR_NO_ACTIONS_ACTIVATED--}', true));
+ $OUT_ACT = loadTemplate('guest_sponsor_infos_none_row', TRUE, displayMessage('{--SPONSOR_NO_ACTIONS_ACTIVATED--}', TRUE));
+ $OUT_PAY = loadTemplate('guest_sponsor_infos_none_row', TRUE, displayMessage('{--SPONSOR_NO_ACTIONS_ACTIVATED--}', TRUE));
}
// Free memory
);
// Load main template
-loadTemplate('guest_sponsor_infos', false, $content);
+loadTemplate('guest_sponsor_infos', FALSE, $content);
// [EOF]
?>
(setSession('sponsor_pass', md5(postRequestElement('password')) ))
);
- if ($login === true) {
+ if ($login === TRUE) {
// Cookie setup successfull so we can forward to sponsor area
redirectToUrl('modules.php?module=sponsor');
} else {
$content['res'] = translateComma($content['pay_rate'] * $content['pay_min_count']);
// Load row template and switch color
- $OUT .= loadTemplate('guest_sponsor_payment_row', true, $content);
+ $OUT .= loadTemplate('guest_sponsor_payment_row', TRUE, $content);
} // END - while
// Remember the list in table
- $content['payment_list'] = loadTemplate('guest_sponsor_payment', true, $OUT);
+ $content['payment_list'] = loadTemplate('guest_sponsor_payment', TRUE, $OUT);
// Init a lot array elements
foreach (array('company','position','tax_ident','gender_m','gender_f','gender_c','surname','family','street_nr1','street_nr2','country','zip','city','phone','fax','cell','email','url','receive_warnings_y','receive_warnings_n','form_errors','refid') as $entry) {
// Errors found?
if (count($formErrors) > 0) {
- $OUT = displayMessage('{--SPONSOR_REGISTER_SOMETHING_MISSING--}', true);
+ $OUT = displayMessage('{--SPONSOR_REGISTER_SOMETHING_MISSING--}', TRUE);
$OUT .= '<ol>';
foreach ($formErrors as $error) {
$OUT .= '<li>' . $error . '</li>';
} // END - if
// Display registration form
- loadTemplate('guest_sponsor_reg', false, $content);
+ loadTemplate('guest_sponsor_reg', FALSE, $content);
} else {
// Nothing added so far
displayMessage('{--SPONSOR_PAYMENT_LIST_EMPTY--}');
switch (getConfig('guest_stats')) {
case 'MEMBERS': // Statistics about your members
// Only males / females
- $male = countSumTotalData('M', 'user_data', 'userid', 'gender', true, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
- $female = countSumTotalData('F', 'user_data', 'userid', 'gender', true, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
+ $male = countSumTotalData('M', 'user_data', 'userid', 'gender', TRUE, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
+ $female = countSumTotalData('F', 'user_data', 'userid', 'gender', TRUE, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
// List every month
$months = array();
} // END - if
// Count months
- $months[$month] = countSumTotalData(bigintval($month), 'user_data', 'userid', 'birth_month', true, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
+ $months[$month] = countSumTotalData(bigintval($month), 'user_data', 'userid', 'birth_month', TRUE, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
} // END - for
// Members in categories
// Now we have all categories loaded, count members
foreach ($cats as $id => $dummy) {
// We only need id and nothing more to count...
- $cat_cnt[$id] = countSumTotalData(bigintval($id), 'user_cats', 'id', 'cat_id', true);
+ $cat_cnt[$id] = countSumTotalData(bigintval($id), 'user_cats', 'id', 'cat_id', TRUE);
} // END - foreach
// Prepare data for the template
);
// Load row template
- $OUT .= loadTemplate('guest_stats_month_row', true, $row);
+ $OUT .= loadTemplate('guest_stats_month_row', TRUE, $row);
if ($SW == 2) {
$r2 = '';
);
// Load row template and switch colors
- $OUT .= loadTemplate('guest_stats_cats_row', true, $row);
+ $OUT .= loadTemplate('guest_stats_cats_row', TRUE, $row);
} // END - foreach
$content['cats_rows'] = $OUT;
// Load final template
- loadTemplate('guest_stats_member', false, $content);
+ loadTemplate('guest_stats_member', FALSE, $content);
break;
case 'MODULES': // TOP10 module clicks
if (!SQL_HASZERONUMS($guest_t10)) {
// Guest clicks
- $OUT .= loadTemplate('guest_stats_header', true, '{--GUEST_TOP_GUEST_STATS--}');
+ $OUT .= loadTemplate('guest_stats_header', TRUE, '{--GUEST_TOP_GUEST_STATS--}');
while ($content = SQL_FETCHARRAY($guest_t10)) {
// Load row template
- $OUT .= loadTemplate('guest_stats_row', true, $content);
+ $OUT .= loadTemplate('guest_stats_row', TRUE, $content);
} // END - while
} // END - if
if (!SQL_HASZERONUMS($mem_t10)) {
// Member clicks
- $OUT .= loadTemplate('guest_stats_header', true, '{--GUEST_TOP_MEMBER_STATS--}');
+ $OUT .= loadTemplate('guest_stats_header', TRUE, '{--GUEST_TOP_MEMBER_STATS--}');
while ($content = SQL_FETCHARRAY($mem_t10)) {
// Load row template
- $OUT .= loadTemplate('guest_stats_row', true, $content);
+ $OUT .= loadTemplate('guest_stats_row', TRUE, $content);
} // END - while
} // END - if
);
// Load final template
- loadTemplate('guest_stats_table', false, $content);
+ loadTemplate('guest_stats_table', FALSE, $content);
} else {
// No clicks detected
displayMessage('{--GUEST_STATS_NO_CLICKS--}');
);
// Load row template
- $OUT .= loadTemplate('guest_top10_row_login', true, $content);
+ $OUT .= loadTemplate('guest_top10_row_login', TRUE, $content);
// Count one up
$count++;
);
// Load row template
- $OUT .= loadTemplate('guest_top10_empty5', true, $content);
+ $OUT .= loadTemplate('guest_top10_empty5', TRUE, $content);
} // END - for
} // END - if
$content['last_online'] = generateDateTime($content['last_online'], '3');
// Load row template
- $OUT .= loadTemplate('guest_top10_row_earner', true, $content);
+ $OUT .= loadTemplate('guest_top10_row_earner', TRUE, $content);
// Count one up
$count++;
);
// Load row template
- $OUT .= loadTemplate('guest_top10_empty4', true, $content);
+ $OUT .= loadTemplate('guest_top10_empty4', TRUE, $content);
} // END - for
} // END - if
);
// Load row template
- $OUT .= loadTemplate('guest_top10_row_refs', true, $content);
+ $OUT .= loadTemplate('guest_top10_row_refs', TRUE, $content);
// Count one up
$count++;
);
// Load row template
- $OUT .= loadTemplate('guest_top10_empty5', true, $content);
+ $OUT .= loadTemplate('guest_top10_empty5', TRUE, $content);
} // END - for
} // END - if
SQL_FREERESULT($result);
// Load final template
-loadTemplate('guest_top10', false, $rows);
+loadTemplate('guest_top10', FALSE, $rows);
// [EOF]
?>
addYouAreHereLink('guest', __FILE__);
// Prepare content
-$content['ref_levels'] = countSumTotalData('', 'refdepths', 'id', '', true, ' WHERE `level` > 0');
+$content['ref_levels'] = countSumTotalData('', 'refdepths', 'id', '', TRUE, ' WHERE `level` > 0');
// Load default template
-loadTemplate('welcome', false, $content);
+loadTemplate('welcome', FALSE, $content);
// [EOF]
?>
outputHtml('<div style="padding-left: 10px; padding-right: 10px">');
$rdf = new fase4_rdf();
-$rdf->_use_nl2br = false;
-$rdf->use_dynamic_display(false);
+$rdf->_use_nl2br = FALSE;
+$rdf->use_dynamic_display(FALSE);
$rdf->set_CacheDir(getCachePath() . '');
$rdf->set_salt(md5(getSiteKey()));
$rdf->set_max_item(10);
$rdf->parse_RDF('http://www.wds66.com/rss.xml');
// Fix to avoid 'headers already sent' bug. Thanks to Profi-Concept
-outputHtml($rdf->finish(true));
+outputHtml($rdf->finish(TRUE));
outputHtml('</div>');
// [EOF]
}
// Generate a tableset for the menu title and content
-loadTemplate('guest_header', false, array('date_time' => generateDateTime(time(), 1)));
+loadTemplate('guest_header', FALSE, array('date_time' => generateDateTime(time(), 1)));
// Add code-message here
handleCodeMessage();
loadTemplate('guest_menu_td');
// Add the guest's menu here...
-if ((getConfig('guest_menu') == 'Y') || (!isExtensionActive('sql_patches', true))) {
+if ((getConfig('guest_menu') == 'Y') || (!isExtensionActive('sql_patches', TRUE))) {
// Show only when guest menu is active
addMenu('guest', getAction(), getWhat());
} // END - if
loadTemplate('guest_menu_content');
// Disable block-mode by default
-enableBlockMode(false);
+enableBlockMode(FALSE);
// Construct FQFN
$inc = sprintf("inc/modules/guest/action-%s.php", getAction());
logDebugMessage(__FILE__, __LINE__, 'Hash ' . getRequestElement('hash') . ' does not match URL ' . $decodedUrl);
} elseif (isUrlValid($decodedUrl)) {
// Generate a JavaScript that redirects us
- loadTemplate('loader', false, $decodedUrl);
+ loadTemplate('loader', FALSE, $decodedUrl);
} else {
// URL invalid
redirectToUrl('modules.php?module=index');
} // END - if
// Disable block mode by default
-enableBlockMode(false);
+enableBlockMode(FALSE);
// Generate a tableset for the menu title and content
-loadTemplate('member_header', false, array('date_time' => generateDateTime(time(), 1)));
+loadTemplate('member_header', FALSE, array('date_time' => generateDateTime(time(), 1)));
// Add code-message here
handleCodeMessage();
}
// Add the member's menu here...
-if ((getConfig('member_menu') == 'Y') || (!isExtensionActive('sql_patches', true))) {
+if ((getConfig('member_menu') == 'Y') || (!isExtensionActive('sql_patches', TRUE))) {
addMenu('member', getActionFromModuleWhat('member', getWhat()), getWhat());
} // END - if
// Disable block-mode again
-enableBlockMode(false);
+enableBlockMode(FALSE);
// Menu -> content
outputHtml(' </td>
redirectToUrl('modules.php?module=login');
}
-if ((getConfig('member_menu') == 'Y') || (!isExtensionActive('sql_patches', true))) {
+if ((getConfig('member_menu') == 'Y') || (!isExtensionActive('sql_patches', TRUE))) {
// Right side of content (hint: a good place for 120x600 skyscraper banner!)
loadTemplate('member_content_right');
// Get total num
if (isAdmin()) {
// Load only active designs for user
- $num_themes = countSumTotalData('Y', 'themes', 'id', 'theme_active', true);
+ $num_themes = countSumTotalData('Y', 'themes', 'id', 'theme_active', TRUE);
} else {
// Load all themes for admin
- $num_themes = countSumTotalData('', 'themes', 'id', '', true);
+ $num_themes = countSumTotalData('', 'themes', 'id', '', TRUE);
}
// Default is no box
$OUT = generateThemeSelectionBox();
} elseif (($num_themes == 1) || ((!isAdmin()) && ($num_themes == '0'))) {
// If there's only one just output it's name
- $OUT = loadTemplate('theme_one', true, getCurrentThemeName());
+ $OUT = loadTemplate('theme_one', TRUE, getCurrentThemeName());
} elseif (isAdmin()) {
// If there is no theme installed and there's an admin notify him!
$OUT = '{--ADMIN_NO_THEME_INSTALLED_WARNING--}';
}
// Load final box template
-$GLOBALS['rows'] .= loadTemplate('theme_select_box', true, $OUT);
+$GLOBALS['rows'] .= loadTemplate('theme_select_box', TRUE, $OUT);
// [EOF]
?>
// @TODO No more needed? define('__BEG_USERID_TIMEOUT', createFancyTime(getBegUseridTimeout()));
// Load template
-loadTemplate('member_beg', false, $content);
+loadTemplate('member_beg', FALSE, $content);
// [EOF]
?>
$content['last_online'] = generateDateTime($content['last_online'], '2');
// Load row template
- $OUT .= loadTemplate('member_list_beg_row', true, $content);
+ $OUT .= loadTemplate('member_list_beg_row', TRUE, $content);
// Count one up
$count++;
} // END - while
} else {
// No one is interested in our "begging rallye" ! :-(
- $OUT = loadTemplate('member_beg_404', true);
+ $OUT = loadTemplate('member_beg_404', TRUE);
}
// Prepare content
SQL_FREERESULT($result);
// Load final template
-loadTemplate('member_list_beg', false, $content);
+loadTemplate('member_list_beg', FALSE, $content);
// [EOF]
?>
$content['last_online'] = generateDateTime($content['last_online'], '2');
// Load row template
- $OUT .= loadTemplate('member_bonus_row', true, $content);
+ $OUT .= loadTemplate('member_bonus_row', TRUE, $content);
// Count one up
$count++;
} // END - while
} else {
// No one is interested in our "active rallye" ! :-(
- $OUT = loadTemplate('member_bonus_404', true);
+ $OUT = loadTemplate('member_bonus_404', TRUE);
}
// Free memory
$content['rows'] = $OUT;
// Load final template
-loadTemplate('member_bonus', false, $content);
+loadTemplate('member_bonus', FALSE, $content);
// [EOF]
?>
}
} else {
// Load form template
- loadTemplate('member_cash_coupon', false);
+ loadTemplate('member_cash_coupon', FALSE);
}
// [EOF]
// Are there entries?
if (!SQL_HASZERONUMS($result)) {
- $LEAST = false;
+ $LEAST = FALSE;
if (isFormSent()) {
$count = '0';
foreach (postRequestElement('cat') as $categoryId => $joined) {
if ((SQL_NUMROWS($result) - $count) < getLeastCats()) {
unsetPostRequestElement('ok');
- $LEAST = true;
+ $LEAST = TRUE;
} // END - if
} // END - if
switch ($joined) {
case 'Y':
// Check if this category has an entry
- if (countSumTotalData(getMemberId(), 'user_cats', 'id', 'userid', true, sprintf(" AND `cat_id`=%s", bigintval($categoryId))) == 0) {
+ if (countSumTotalData(getMemberId(), 'user_cats', 'id', 'userid', TRUE, sprintf(" AND `cat_id`=%s", bigintval($categoryId))) == 0) {
// No, so add it
addSql(sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_user_cats` (`userid`, `cat_id`) VALUES (%s,%s)", getMemberId(), bigintval($categoryId)));
} // END - if
displayMessage('{--MEMBER_CATEGORIES_NOT_SAVED--}');
}
} else {
- if ($LEAST === true) {
+ if ($LEAST === TRUE) {
// Also here we have to secure it... :(
displayMessage('{--CHOOSE_MORE_CATEGORIES--}');
} // END - if
} // END - if
} else {
// Check if he has an entry
- if (countSumTotalData(getMemberId(), 'user_cats', 'id', 'userid', true, sprintf(" AND `cat_id`=%s", bigintval($content['id']))) == 1) {
+ if (countSumTotalData(getMemberId(), 'user_cats', 'id', 'userid', TRUE, sprintf(" AND `cat_id`=%s", bigintval($content['id']))) == 1) {
$content['jn'] = '';
$content['jy'] = ' checked="checked"';
} // END - if
}
// Load row template
- $OUT .= loadTemplate('member_cats_row', true, $content);
+ $OUT .= loadTemplate('member_cats_row', TRUE, $content);
} // END - while
// Free result
SQL_FREERESULT($result);
// Load footer template
- loadTemplate('member_cats', false, $OUT);
+ loadTemplate('member_cats', FALSE, $OUT);
}
} else {
// No cateogries are defined yet
$content['payout_ref'] = generateDoublerTable(getMemberId(), 'N', 'Y', 'DESC');
// Load template
-loadTemplate('member_doubler', false, $content);
+loadTemplate('member_doubler', FALSE, $content);
// [EOF]
?>
// 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);
+ $OUT .= loadTemplate('member_earning_' . strtolower($content['earning_group']) . '_form_row', TRUE, $content);
} else {
// Load row template "already subscribed"
- $OUT .= loadTemplate('member_earning_' . strtolower($content['earning_group']) . '_row', true, $content);
+ $OUT .= loadTemplate('member_earning_' . strtolower($content['earning_group']) . '_row', TRUE, $content);
}
} // END - while
// Load main template
- loadTemplate('member_earning', false, $OUT);
+ loadTemplate('member_earning', FALSE, $OUT);
} else {
// Display message
displayMessage('{--MEMBER_EARNINGS_404--}');
$content['lock'] = generateDateTime($content['holiday_activated'], 1);
// Load template
- loadTemplate('member_holiday_deactivate', false, $content);
+ loadTemplate('member_holiday_deactivate', FALSE, $content);
} else {
// Free memory
SQL_FREERESULT($result);
$content['end_year'] = addSelectionBox('year' , getYear($endingStamp) , 'end');
// Output form
- loadTemplate('member_holiday_form', false, $content);
+ loadTemplate('member_holiday_form', FALSE, $content);
break;
} // END - switch
} else {
$content['html_' . strtolower(getUserData('html'))] = ' checked="checked"';
// Load main template
- loadTemplate('member_html_mail_settings', false, $content);
+ loadTemplate('member_html_mail_settings', FALSE, $content);
}
// [EOF]
$content['coupon_expired'] = generateDateTime($content['coupon_expired'], '2');
// Add the row template
- $OUT .= loadTemplate('member_list_coupon_row', true, $content);
+ $OUT .= loadTemplate('member_list_coupon_row', TRUE, $content);
} // END - while
// Load main template
- loadTemplate('member_list_coupon', false, $OUT);
+ loadTemplate('member_list_coupon', FALSE, $OUT);
} else {
// No cashed coupons found
displayMessage('{--MEMBER_COUPON_CASHED_404--}');
$content['actions'] = generateSurfbarMemberActions($content['url_id'], $content['url_status']);
// Load row template
- $OUT .= loadTemplate('member_list_surfbar_row', true, $content);
+ $OUT .= loadTemplate('member_list_surfbar_row', TRUE, $content);
} // END - foreach
// Load main template
- loadTemplate('member_list_surfbar', false, $OUT);
+ loadTemplate('member_list_surfbar', FALSE, $OUT);
} else {
// No URLs booked so far
displayMessage('{--MEMBER_SURFBAR_NO_URLS_FOUND--}');
// How far is last change on his profile away from now?
if ((($content['last_update'] + getProfileLock()) > time()) && (!isAdmin()) && (getProfileLock() > 0)) {
// You cannot change your account
- $content['change'] = displayMessage('<div class="notice">{%message,MEMBER_PROFILE_LOCKED=' . generateDateTime($content['last_update'] + getProfileLock(), 0) . '%}</div>', true);
+ $content['change'] = displayMessage('<div class="notice">{%message,MEMBER_PROFILE_LOCKED=' . generateDateTime($content['last_update'] + getProfileLock(), 0) . '%}</div>', TRUE);
} else {
// He is allowed to change his profile
- $content['change'] = loadTemplate('member_mydata_button', true);
+ $content['change'] = loadTemplate('member_mydata_button', TRUE);
}
if (strlen($content['birth_day']) == 1) $content['birth_day'] = '0' . $content['birth_day'];
} // END - if
// Load template
- loadTemplate('member_mydata_overview', false, $content);
+ loadTemplate('member_mydata_overview', FALSE, $content);
break;
case 'edit': // Edit data
- if (isExtensionActive('country', true)) {
+ if (isExtensionActive('country', TRUE)) {
// New way
$result = SQL_QUERY_ESC("SELECT
`surname`,
}
// Load template
- loadTemplate('member_mydata_edit', false, $content);
+ loadTemplate('member_mydata_edit', FALSE, $content);
}
break;
return;
} // END - if
-$isValid = false;
+$isValid = FALSE;
if (isFormSent()) {
// Nickname was submitted so let's check if it is not already in use
} // END - if
} // END - if
-if ($isValid === true) {
+if ($isValid === TRUE) {
// Nickname already in use which is the default
$content = '{--MEMBER_NICKNAME_ALREADY_IN_USE--}';
} else {
// Is there already submit the form?
if (isPostRequestElementSet('nickname')) {
- loadTemplate('admin_settings_unsaved', false, '{--MEMBER_NICKNAME_IS_INVALID--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_NICKNAME_IS_INVALID--}');
} // END - if
// Load Template
postRequestElement('url'),
bigintval(postRequestElement('cat')),
bigintval($content['target_send']),
- bigintval(postRequestElement('zip'), true, false),
+ bigintval(postRequestElement('zip'), TRUE, FALSE),
postRequestElement('html')
), __FILE__, __LINE__);
} else {
postRequestElement('url'),
bigintval(postRequestElement('cat')),
bigintval($content['target_send']),
- bigintval(postRequestElement('zip'), true, false),
+ bigintval(postRequestElement('zip'), TRUE, FALSE),
), __FILE__, __LINE__);
}
$userid_cnt = '0';
while (list($userid) = SQL_FETCHROW($result_userids)) {
// Check for holiday system
- $isHolidayActive = false;
+ $isHolidayActive = FALSE;
if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
// Check user's holiday status
$result_holiday = SQL_QUERY_ESC("SELECT
$isHolidayActive = ($count == 1);
} // END - if
- if ($isHolidayActive === false) {
+ if ($isHolidayActive === FALSE) {
// Check if the user want's to receive mails?
$result_ver = SQL_QUERY_ESC("SELECT `zip` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s".$HTML." AND `receive_mails` > 0 AND `status`='CONFIRMED' LIMIT 1",
array(bigintval($userid)), __FILE__, __LINE__);
} // END - switch
// Load final template
- loadTemplate('member_order_points', false, $content);
+ loadTemplate('member_order_points', FALSE, $content);
// Reset variables
- $OLD_ORDER = false;
+ $OLD_ORDER = FALSE;
$subject = '';
$text = '';
$target = '';
} // END - if
// Old order is grabbed
- $OLD_ORDER = true;
+ $OLD_ORDER = TRUE;
} else {
// Default output for that your members don't forget it...
$content['url'] = 'http://';
if (isPostRequestElementSet('zip')) {
// Output entered ZIP code
- $content['zip_content'] = loadTemplate('member_order_zip2', true, postRequestElement('zip'));
+ $content['zip_content'] = loadTemplate('member_order_zip2', TRUE, postRequestElement('zip'));
} // END - if
// No HTML extension installed by default
// HTML extension
if ((isExtensionActive('html_mail')) && (postRequestElement('html') == 'Y')) {
// Extension is active so output valid HTML tags
- $content['html_extension'] = loadTemplate('member_order_html_ext', true);
+ $content['html_extension'] = loadTemplate('member_order_html_ext', TRUE);
} // END - if
// Output form for page 2
- loadTemplate('member_order_page2', false, $content);
+ loadTemplate('member_order_page2', FALSE, $content);
} else {
// No HTML extension installed by default
$content['html_extension'] = '<input type="hidden" name="html" value="N" />';
// Remember maybe entered ZIP code in constant
if (isExtensionActive('html_mail')) {
// Add some content when html extension is active
- $content['html_extension'] = loadTemplate('member_order_html_intro', true);
+ $content['html_extension'] = loadTemplate('member_order_html_intro', TRUE);
} // END - if
// Default is no ZIP code
'zip' => ''
);
}
- $content['zip_content'] = loadTemplate('member_order_zip1', true, $data);
+ $content['zip_content'] = loadTemplate('member_order_zip1', TRUE, $data);
} // END - if
// Output form for page 1 (ZIP code or HTML)
- loadTemplate('member_order_page1', false, $content);
+ loadTemplate('member_order_page1', FALSE, $content);
}
} else {
// No mail types defined
$content['payout_timestamp'] = generateDateTime($content['payout_timestamp'], 2);
// Load row template and switch colors
- $OUT .= loadTemplate('member_payout_row', true, $content);
+ $OUT .= loadTemplate('member_payout_row', TRUE, $content);
} // END - while
// Load template
- loadTemplate('member_payout', false, $OUT);
+ loadTemplate('member_payout', FALSE, $OUT);
} // END - if
// Free memory
);
// Generate banner order form
- loadTemplate('member_payout_form_banner', false, $content);
+ loadTemplate('member_payout_form_banner', FALSE, $content);
} else {
// Prepare content
$content = array(
);
// Generate normal form
- loadTemplate('member_payout_form', false, $content);
+ loadTemplate('member_payout_form', FALSE, $content);
}
} else {
// Not enougth points
SQL_FREERESULT($result_points);
// Output row
- $OUT .= loadTemplate('member_points_row', true, $content);
+ $OUT .= loadTemplate('member_points_row', TRUE, $content);
} // END - while
// Free memory
$content['bonus_total_points'] = getUserData('turbo_bonus') + getUserData('login_bonus') + getUserData('bonus_ref') + getUserData('bonus_order') + getUserData('bonus_stats');
// Output rows
- $content['special_rows'] = loadTemplate('member_points_bonus_rows', true, $content);
+ $content['special_rows'] = loadTemplate('member_points_bonus_rows', TRUE, $content);
} elseif ((isExtensionActive('bonus')) && (!isBonusRallyeActive())) {
// Bonus active rallye deactivated
- $content['special_rows'] = loadTemplate('member_points_bonus_disabled', true);
+ $content['special_rows'] = loadTemplate('member_points_bonus_disabled', TRUE);
} elseif ((isAdmin()) && (isExtensionInstalledAndOlder('bonus', '0.2.2')) && (isExtensionActive('bonus'))) {
// Please upgrade your bonus extension to v0.2.2 or newer!
$content['special_rows'] = loadTemplate('member_points_upgrade');
// Load final template
if (isExtensionActive('user')) {
// Load template when required extension is there
- loadTemplate('member_points', false, $content);
+ loadTemplate('member_points', FALSE, $content);
} elseif (isAdmin()) {
// Missing extension
displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=user%}');
// Found some (normally one...
$content = SQL_FETCHARRAY($result);
- $expired = false;
+ $expired = FALSE;
if (($content['end_time'] < time()) && (getTotalConfirmedUser() >= $content['min_users']) && (getTotalRallyeWinners($content['id']) >= $content['min_prices'])) {
// Rallye is expired
$content['extras'] = '{--RALLYE_HAS_EXPIRED--}';
- $expired = true;
+ $expired = TRUE;
} elseif (time() >= ($content['end_time'] - getOneDay())) {
// Rallye will expire in less one day!
$content['extras'] = '{--RALLYE_EXPIRE_ONE_DAY--}';
// Handle description...
if ((empty($content['descr'])) && (!empty($content['template']))) {
// Use description from template
- $content['descr'] = loadTemplate('rallye_' . $content['template'], true);
+ $content['descr'] = loadTemplate('rallye_' . $content['template'], TRUE);
} // END - if
// Determine min_users/prices
$content['start_time'] = generateDateTime($content['start_time'], 1);
$content['end_time'] = generateDateTime($content['end_time'] , 1);
- if ($expired === true) {
+ if ($expired === TRUE) {
$content['prices'] = addReferralRallyeWinners('member', $content['id']);
$content['top_users'] = '<div align="center" class="big">' . $content['extras'] . '</div>';
$content['can_win_this'] = '{--RALLYE_OUR_WINNERS_ARE--}';
}
// And load final template
- loadTemplate('member_show_rallye', false, $content);
+ loadTemplate('member_show_rallye', FALSE, $content);
} else {
// No rallye found so far
loadTemplate('member_rallye_404');
displayMessage('{--MEMBER_REFBACK_DISABLED--}');
// Abort here
- return false;
+ return FALSE;
} // END - if
// Add description as navigation point
$content = getArrayFromUserRefbackData(postRequestElement('id'));
// Load form for editing
- loadTemplate('member_edit_refback', false, $content);
+ loadTemplate('member_edit_refback', FALSE, $content);
}
} // END - if
// Check for users ref in this level
foreach (getArrayFromRefbackUserRefs(getMemberId(), $content['level']) as $refRow) {
// Not-deleted account is default
- $deleted = false;
+ $deleted = FALSE;
if (is_null($refRow['status'])) {
- $deleted = true;
+ $deleted = TRUE;
} // END - if
// Add/"translate" more content
- $refRow['click_rate'] = translateComma($refRow['click_rate'], true, 1);
+ $refRow['click_rate'] = translateComma($refRow['click_rate'], TRUE, 1);
$refRow['joined'] = generateDateTime($refRow['joined'], '3');
// Load row template
- if ($deleted === true) {
- $rows .= loadTemplate('member_list_refback_deleted_row', true, $refRow);
+ if ($deleted === TRUE) {
+ $rows .= loadTemplate('member_list_refback_deleted_row', TRUE, $refRow);
} else {
- $rows .= loadTemplate('member_list_refback_row', true, $refRow);
+ $rows .= loadTemplate('member_list_refback_row', TRUE, $refRow);
}
// Count this ref and switch color
$content['rows'] = $rows;
// Load level template
- $OUT .= loadTemplate('member_list_refback_level', true, $content);
+ $OUT .= loadTemplate('member_list_refback_level', TRUE, $content);
} // END - while
// Load main template
- loadTemplate('member_list_refback', false, $OUT);
+ loadTemplate('member_list_refback', FALSE, $OUT);
} else {
// No entries
displayMessage('{--MEMBER_REFBACK_NO_ENTRIES--}');
if (!empty($nick)) {
// Display nickname link
- $content['nickname_content'] = loadTemplate('member_reflink_nickname', true, $nick);
+ $content['nickname_content'] = loadTemplate('member_reflink_nickname', TRUE, $nick);
} else {
// Display link to nickname form
- $content['nickname_content'] = loadTemplate('member_reflink_no_nickname', true);
+ $content['nickname_content'] = loadTemplate('member_reflink_no_nickname', TRUE);
}
} // END - if
$row['userid'] = getMemberId();
// Add row
- $OUT .= loadTemplate('member_list_reflinks_row', true, $row);
+ $OUT .= loadTemplate('member_list_reflinks_row', TRUE, $row);
} // END - while
// Load final template
- $content['refbanner_content'] = loadTemplate('member_list_reflinks', true, $OUT);
+ $content['refbanner_content'] = loadTemplate('member_list_reflinks', TRUE, $OUT);
} else {
// No refbanner found
- $content['refbanner_content'] = displayMessage('{--MEMBER_REFERRAL_BANNER_404--}', true);
+ $content['refbanner_content'] = displayMessage('{--MEMBER_REFERRAL_BANNER_404--}', TRUE);
}
// Free result
$content['extra_content'] = runFilterChain('member_reflink_extra_content');
// Load main template
-loadTemplate('member_reflink', false, $content);
+loadTemplate('member_reflink', FALSE, $content);
// [EOF]
?>
// Check for users ref in this level
foreach (getUserReferralPoints(getMemberId(), $content['level']) as $refRow) {
// Add/"translate" more content
- $refRow['click_rate'] = translateComma($refRow['click_rate'], true, 1);
+ $refRow['click_rate'] = translateComma($refRow['click_rate'], TRUE, 1);
// Load row template
- $rows .= loadTemplate('member_list_referral_row', true, $refRow);
+ $rows .= loadTemplate('member_list_referral_row', TRUE, $refRow);
// Count this ref and switch color
$counter++;
// Remember the content
$content['counter'] = $counter;
- $content['percents'] = translateComma($content['percents'], true, 1);
+ $content['percents'] = translateComma($content['percents'], TRUE, 1);
$content['rows'] = $rows;
// Load level template
- $OUT .= loadTemplate('member_list_referral_level', true, $content);
+ $OUT .= loadTemplate('member_list_referral_level', TRUE, $content);
} // END - while
// Load main template
- loadTemplate('member_list_referral', false, $OUT);
+ loadTemplate('member_list_referral', FALSE, $OUT);
} else {
// No entries
displayMessage('{--MEMBER_REFBACK_NO_ENTRIES--}');
} // END - if
// Load the template
-loadTemplate('member_start_surfbar_' . strtolower(getSurfbarPaymentModel()), false, $content);
+loadTemplate('member_start_surfbar_' . strtolower(getSurfbarPaymentModel()), FALSE, $content);
// Load surfbar link template
loadTemplate('member_surfbar_link');
$content['timestamp'] = generateDateTime($content['timestamp'], '2');
// Load template
- $OUT .= loadTemplate('member_pool_row', true, $content);
+ $OUT .= loadTemplate('member_pool_row', TRUE, $content);
} // END - if
// Load main template
- $main_content['pool'] = loadTemplate('member_pool_table', true, $OUT);
+ $main_content['pool'] = loadTemplate('member_pool_table', TRUE, $OUT);
} else {
// No mails in pool!
- $main_content['pool'] = displayMessage('{--MEMBER_NO_MAILS_IN_POOL--}', true);
+ $main_content['pool'] = displayMessage('{--MEMBER_NO_MAILS_IN_POOL--}', TRUE);
}
// Free result
} // END - if
// Load row template and switch colors
- $OUT .= loadTemplate('member_stats_row', true, $content);
+ $OUT .= loadTemplate('member_stats_row', TRUE, $content);
} // END - while
// Load main template
- $main_content['stats'] = loadTemplate('member_stats_table', true, $OUT);
+ $main_content['stats'] = loadTemplate('member_stats_table', TRUE, $OUT);
} else {
// No mail orders fond
- $main_content['stats'] = displayMessage('{--MEMBER_NO_MAILS_IN_STATS--}', true);
+ $main_content['stats'] = displayMessage('{--MEMBER_NO_MAILS_IN_STATS--}', TRUE);
}
// Free result
SQL_FREERESULT($result);
// Load main template
-loadTemplate('member_stats_pool', false, $main_content);
+loadTemplate('member_stats_pool', FALSE, $main_content);
// [EOF]
?>
} // END - if
// By default show the list...
-$show = true;
+$show = TRUE;
// Check for 'url_id' element
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isFormSent()=' . intval(isFormSent('add_subid')) . ',ifPostContainsSelections()=' . intval(ifPostContainsSelections()) . ',countRequestPost()=' . countRequestPost());
showEntriesByXmlCallback('member_edit_show_user_subid');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_edit')) {
// Change data of entries
showEntriesByXmlCallback('member_edit_do_user_subid');
showEntriesByXmlCallback('member_delete_show_user_subid');
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} elseif (isFormSent('do_delete')) {
// Remove entries from database
showEntriesByXmlCallback('member_delete_do_user_subid');
loadIncludeOnce($incFile);
// Do not show the list of URLs after this template
- $show = false;
+ $show = FALSE;
} else {
// Display error message
displayMessage('{--MEMBER_INVALID_DO_USER_SUBID--}');
}
// Show entries?
-if ($show === false) {
+if ($show === FALSE) {
// No, a form has already been show
- return false;
+ return FALSE;
} // END - if
// List all campaigns
);
// Read directory "themes"
-$includes = getArrayFromDirectory('theme/', '', false, true, array('css', 'images'));
+$includes = getArrayFromDirectory('theme/', '', FALSE, TRUE, array('css', 'images'));
// Walk through all entries and add it
foreach ($includes as $inc) {
);
// Load row template
- $OUT .= loadTemplate('member_themes_row', true, $content);
+ $OUT .= loadTemplate('member_themes_row', TRUE, $content);
} // END - foreach
if (empty($OUT)) {
// No themes found???
$OUT = '<tr>
<td colspan="5" class="bottom" height="80">
- ' . displayMessage('{--MEMBER_NO_THEMES_FOUND--}', true) . '
+ ' . displayMessage('{--MEMBER_NO_THEMES_FOUND--}', TRUE) . '
</td>
</tr>';
} // END - if
// Load template
-loadTemplate('member_themes', false, $OUT);
+loadTemplate('member_themes', FALSE, $OUT);
// [EOF]
?>
$valid_code = ($code == postRequestElement('code'));
} else {
// Zero length (= disabled) is always valid!
- $valid_code = true;
+ $valid_code = TRUE;
}
// Test password
// Transfer is completed
displayMessage('<div>{--MEMBER_TRANSFER_COMPLETED--}' . '</div><div><a href="{%url=modules.php?module=login&what=transfer%}">{--MEMBER_TRANSFER_CONTINUE_OVERVIEW--}</a></div>');
- } elseif ($valid_code === false) {
+ } elseif ($valid_code === FALSE) {
// Invalid Touring code!
- loadTemplate('admin_settings_unsaved', false, '{--MEMBER_TRANSFER_INVALID_CODE--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_TRANSFER_INVALID_CODE--}');
unsetPostRequestElement('ok');
- } elseif ($valid_pass === false) {
+ } elseif ($valid_pass === FALSE) {
// Wrong password entered
- loadTemplate('admin_settings_unsaved', false, '{--MEMBER_TRANSFER_INVALID_PASSWORD--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_TRANSFER_INVALID_PASSWORD--}');
unsetPostRequestElement('ok');
- } elseif ($valid_amount === false) {
+ } elseif ($valid_amount === FALSE) {
// Too much points entered
- loadTemplate('admin_settings_unsaved', false, '{--MEMBER_TRANSFER_INVALID_POINTS--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_TRANSFER_INVALID_POINTS--}');
unsetPostRequestElement('ok');
- } elseif ($valid_reason === false) {
+ } elseif ($valid_reason === FALSE) {
// No transfer reason entered
- loadTemplate('admin_settings_unsaved', false, '{--MEMBER_TRANSFER_INVALID_REASON--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_TRANSFER_INVALID_REASON--}');
unsetPostRequestElement('ok');
- } elseif ($valid_recipient === false) {
+ } elseif ($valid_recipient === FALSE) {
// No recipient selected
- loadTemplate('admin_settings_unsaved', false, '{--MEMBER_TRANSFER_INVALID_RECIPIENT--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_TRANSFER_INVALID_RECIPIENT--}');
unsetPostRequestElement('ok');
- } elseif ($valid_data === false) {
+ } elseif ($valid_data === FALSE) {
// No recipient/sender selected
- loadTemplate('admin_settings_unsaved', false, '{--MEMBER_TRANSFER_INVALID_DATA--}');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_TRANSFER_INVALID_DATA--}');
unsetPostRequestElement('ok');
}
SQL_FREERESULT($result);
} else {
// No one else is opt-in
- $OUT = displayMessage('{--MEMBER_TRANSFER_NO_ONE_ELSE_OPT_IN--}', true);
+ $OUT = displayMessage('{--MEMBER_TRANSFER_NO_ONE_ELSE_OPT_IN--}', TRUE);
$content['to_disabled'] = ' disabled="disabled"';
}
$code = generateRandomCode(getTransferCode(), $rand, getMemberId(), $content['max_transferable']);
// Generate image (HTML code)
- $img = generateImageOrCode($code, false);
+ $img = generateImageOrCode($code, FALSE);
// Add all and hidden field
$content['captcha_code'] = '<input type="hidden" name="code_chk" value="' . $rand . '" /><input type="text" name="code" class="form_field" size="5" maxlength="7"' . $content['to_disabled'] . ' /> ' . $img;
} else {
$code = '00000';
- $content['captcha_code'] = displayMessage('{--MEMBER_TRANSFER_NO_CODE--}', true);
+ $content['captcha_code'] = displayMessage('{--MEMBER_TRANSFER_NO_CODE--}', TRUE);
}
// Init points/reason
} // END - if
// Output form
- loadTemplate('member_transfer_new', false, $content);
+ loadTemplate('member_transfer_new', FALSE, $content);
} // END - if
break;
$$content['time_trans'] = generateDateTime($content['time_trans'], 3);
// Load row template
- $OUT .= loadTemplate('member_transfer_row2', true, $content);
+ $OUT .= loadTemplate('member_transfer_row2', TRUE, $content);
// Add points and switch color
$totalPoints += $content['points'];
// Nothing for in or out
$OUT = '<tr>
<td colspan="5" align="center" class="bottom">
- ' . displayMessage($nothingMessage, true) . '
+ ' . displayMessage($nothingMessage, TRUE) . '
</td>
</tr>';
}
$content['total_points'] = $totalPoints;
// Load final template
- loadTemplate('member_transfer_list', false, $content);
+ loadTemplate('member_transfer_list', FALSE, $content);
break;
case 'list_all': // List all transactions
$content['time'] = generateDateTime($content['time_trans'], 3);
// Load row template
- $OUT .= loadTemplate('member_transfer_row', true, $content);
+ $OUT .= loadTemplate('member_transfer_row', TRUE, $content);
// Add points and switch color
$total += $content['points'];
// Nothing for in and out
$OUT = '<tr>
<td colspan="5" align="center" class="bottom">
- ' . displayMessage('{--TRANSFER_NO_INOUT_TRANSFERS--}', true) . '
+ ' . displayMessage('{--TRANSFER_NO_INOUT_TRANSFERS--}', TRUE) . '
</td>
</tr>';
}
$result = SQL_QUERY_ESC("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_%s_transfers_tmp`", array(getMemberId()), __FILE__, __LINE__);
// Load final template
- loadTemplate('member_transfer_list', false, $content);
+ loadTemplate('member_transfer_list', FALSE, $content);
// Free some memory...
SQL_FREERESULT($result);
default: // Overview page
// Check incoming transfers
- $totalIn = countSumTotalData(getMemberId(), 'user_transfers_in', 'id', 'userid', true);
+ $totalIn = countSumTotalData(getMemberId(), 'user_transfers_in', 'id', 'userid', TRUE);
$content['in_link'] = $totalIn;
if ($totalIn > 0) {
$content['in_link'] = '<a href="{%url=modules.php?module=login&what=transfer&do=list_in%}">' . $totalIn . '</a>';
} // END - if
// Check outgoing transfers
- $totalOut = countSumTotalData(getMemberId(), 'user_transfers_out', 'id', 'userid', true);
+ $totalOut = countSumTotalData(getMemberId(), 'user_transfers_out', 'id', 'userid', TRUE);
$content['out_link'] = $totalOut;
if ($totalOut > 0) {
$content['settings'] = '{%message,MEMBER_TRANSFER_LATEST_IS=' . generateDateTime($newest, '3') . '%}';
} else {
// Load template
- $content['settings'] = loadTemplate('member_transfer_settings', true, $content);
+ $content['settings'] = loadTemplate('member_transfer_settings', TRUE, $content);
}
// Free result
SQL_FREERESULT($result);
// Load template
- loadTemplate('member_transfer_overview', false, $content);
+ loadTemplate('member_transfer_overview', FALSE, $content);
break;
} // END - switch
} // END - if
// Display it depending on mail (data) type
- loadTemplate('member_mail_bonus_' . strtolower($content['data_type']), false, $content);
+ loadTemplate('member_mail_bonus_' . strtolower($content['data_type']), FALSE, $content);
// Free result
SQL_FREERESULT($result_data);
} // END - if
// Display it depending on mail (data) type
- loadTemplate('member_mail_normal_' . strtolower($content['data_type']), false, $content);
+ loadTemplate('member_mail_normal_' . strtolower($content['data_type']), FALSE, $content);
// Free result
SQL_FREERESULT($result_data);
while ($row = SQL_FETCHARRAY($result)) {
// Load data from stats table...
$cat = '';
- $result_data = false;
+ $result_data = FALSE;
$message = '{--MEMBER_GENERAL_MAIL_PROBLEM--}';
$data = $row['stats_id'] . '/' . $row['bonus_id'] . '/' . $row['link_type'];
switch ($row['link_type']) {
// Load row template
if (getConfig('show_points_unconfirmed') == 'Y') {
- $OUT .= loadTemplate('member_unconfirmed_row', true, $content);
+ $OUT .= loadTemplate('member_unconfirmed_row', TRUE, $content);
} else {
- $OUT .= loadTemplate('member_unconfirmed_row_nopoints', true, $content);
+ $OUT .= loadTemplate('member_unconfirmed_row_nopoints', TRUE, $content);
}
// Count points
// Display points or not?
if (getConfig('show_points_unconfirmed') == 'Y') {
- $OUT .= loadTemplate('member_unconfirmed_404', true, $content);
+ $OUT .= loadTemplate('member_unconfirmed_404', TRUE, $content);
} else {
- $OUT .= loadTemplate('member_unconfirmed_404_nopoints', true, $content);
+ $OUT .= loadTemplate('member_unconfirmed_404_nopoints', TRUE, $content);
}
}
// Load main template
if (getConfig('show_points_unconfirmed') == 'Y') {
- loadTemplate('member_unconfirmed_table', false, $content);
+ loadTemplate('member_unconfirmed_table', FALSE, $content);
} else {
- loadTemplate('member_unconfirmed_table_nopoints', false, $content);
+ loadTemplate('member_unconfirmed_table_nopoints', FALSE, $content);
}
} else {
// No mails left to confirm... :)
);
// Load header template
-loadTemplate('member_welcome_header', false, $content);
+loadTemplate('member_welcome_header', FALSE, $content);
// Check if he is returning from a profile update notification
if ((isExtensionActive('profile')) && (getUserData('notified') == 'Y')) {
} // END - if
// Init the content array and points
-$content = array(); $points = false;
+$content = array(); $points = FALSE;
// Is the mode set (withdraw or payout)
if ((!isGetRequestElementSet('do')) || (getRequestElement('do') == 'choose')) {
);
// Load row template
- $content['rows'] .= loadTemplate('member_wernis_mode_list_row', true, $rowContent);
+ $content['rows'] .= loadTemplate('member_wernis_mode_list_row', TRUE, $rowContent);
} // END - while
// Free result
} else {
// All is fine here so do the withdraw
$success = WERNIS_EXECUTE_WITHDRAW(postRequestElement('wernis_userid'), md5(postRequestElement('wds66_password')), postRequestElement('amount'));
- if ($success === true) {
+ if ($success === TRUE) {
// Add it to this amount
initReferralSystem();
addPointsThroughReferralSystem('wernis_withdraw', getMemberId(), bigintval(postRequestElement('amount')));
} else {
// All is fine here so do the withdraw
$success = WERNIS_EXECUTE_PAYOUT(postRequestElement('wernis_userid'), postRequestElement('amount'));
- if ($success === true) {
+ if ($success === TRUE) {
// Sub points and ignore return status
subtractPoints('wernis_payout', getMemberId(), postRequestElement('amount'));
$mode = sprintf("member_wernis_mode_%s", getRequestElement('do'));
// Load the template
-loadTemplate($mode, false, $content);
+loadTemplate($mode, FALSE, $content);
// [EOF]
?>
$content['content'] = addSponsorContent(getWhat());
// Load header template
-$content['header'] = loadTemplate('sponsor_header', true);
+$content['header'] = loadTemplate('sponsor_header', TRUE);
// Load footer template
-$content['footer'] = loadTemplate('sponsor_footer', true);
+$content['footer'] = loadTemplate('sponsor_footer', TRUE);
// 'You are here' navigation
-$content['you_are_here'] = addYouAreHereLink('sponsor', getWhat(), true);
+$content['you_are_here'] = addYouAreHereLink('sponsor', getWhat(), TRUE);
// Load main sponsor template
-loadTemplate('sponsor_main', false, $content);
+loadTemplate('sponsor_main', FALSE, $content);
// [EOF]
?>
if (!empty($message)) {
// Output message
- $GLOBALS['sponsor_output'] = displayMessage($message, true);
+ $GLOBALS['sponsor_output'] = displayMessage($message, TRUE);
} else {
// No message generated
- $GLOBALS['sponsor_output'] = displayMessage('{--SPONSOR_NO_MESSAGE_GENERATED--}', true);
+ $GLOBALS['sponsor_output'] = displayMessage('{--SPONSOR_NO_MESSAGE_GENERATED--}', TRUE);
}
} else {
// Output formular
- $GLOBALS['sponsor_output'] = loadTemplate('sponsor_account_form', true, $content);
+ $GLOBALS['sponsor_output'] = loadTemplate('sponsor_account_form', TRUE, $content);
}
} else {
// Locked or so?
- $GLOBALS['sponsor_output'] = displayMessage('{%message,SPONSOR_ACCOUNT_FAILED=' . $content['status'] . '%}', true);
+ $GLOBALS['sponsor_output'] = displayMessage('{%message,SPONSOR_ACCOUNT_FAILED=' . $content['status'] . '%}', TRUE);
}
} else {
// Sponsor account not found
- $GLOBALS['sponsor_output'] = displayMessage('{%message,SPONSOR_ACCOUNT_404=' . getSession('sponsor_id') . '%}', true);
+ $GLOBALS['sponsor_output'] = displayMessage('{%message,SPONSOR_ACCOUNT_404=' . getSession('sponsor_id') . '%}', TRUE);
}
// Free memory
if (!empty($message)) {
// Output message
- $GLOBALS['sponsor_output'] = displayMessage($message, true);
+ $GLOBALS['sponsor_output'] = displayMessage($message, TRUE);
} else {
// No message generated
- $GLOBALS['sponsor_output'] = displayMessage('{--SPONSOR_NO_MESSAGE_GENERATED--}', true);
+ $GLOBALS['sponsor_output'] = displayMessage('{--SPONSOR_NO_MESSAGE_GENERATED--}', TRUE);
}
} else {
// Make yes/no selection
$content['receive_warnings_' . strtolower($content['receive_warnings'])] = ' checked="checked"';
// Output formular
- $GLOBALS['sponsor_output'] = loadTemplate('sponsor_settings_form', true, $content);
+ $GLOBALS['sponsor_output'] = loadTemplate('sponsor_settings_form', TRUE, $content);
}
} else {
// Locked or so?
- $GLOBALS['sponsor_output'] = displayMessage('{%message,SPONSOR_ACCOUNT_FAILED=' . $content['status'] . '%}', true);
+ $GLOBALS['sponsor_output'] = displayMessage('{%message,SPONSOR_ACCOUNT_FAILED=' . $content['status'] . '%}', TRUE);
}
} else {
// Sponsor account not found
- $GLOBALS['sponsor_output'] = displayMessage('{%message,SPONSOR_ACCOUNT_404=' . getSession('sponsor_id') . '%}', true);
+ $GLOBALS['sponsor_output'] = displayMessage('{%message,SPONSOR_ACCOUNT_404=' . getSession('sponsor_id') . '%}', TRUE);
}
// Free memory
SQL_FREERESULT($result);
// Load main template
-$GLOBALS['sponsor_output'] = loadTemplate('sponsor_welcome', true, $content);
+$GLOBALS['sponsor_output'] = loadTemplate('sponsor_welcome', TRUE, $content);
// [EOF]
?>
set_error_handler('__errorHandler');
// Disable block-mode by default
-enableBlockMode(false);
+enableBlockMode(FALSE);
// Init error handler
initErrorHandler();
enableExitOnError();
// Is it a valid resource?
- if (SQL_SELECT_DB($GLOBALS['mysql']['dbase'], __FILE__, __LINE__) === true) {
+ if (SQL_SELECT_DB($GLOBALS['mysql']['dbase'], __FILE__, __LINE__) === TRUE) {
// Set database name (required for ext-optimize and ifSqlTableExists())
setConfigEntry('__DB_NAME', $GLOBALS['mysql']['dbase']);
}
// Add link into output stream (or return it) for 'You Are Here' navigation
-function addYouAreHereLink ($accessLevel, $FQFN, $return = false) {
+function addYouAreHereLink ($accessLevel, $FQFN, $return = FALSE) {
// Use only filename of the FQFN...
$file = basename($FQFN);
// Add default content
$prefix .= '<div class="you_are_here">{--YOU_ARE_HERE--} <strong><a class="you_are_here" href="{%url=modules.php?module=' . getModule() . $linkAdd . '%}">Home</a></strong>';
- } elseif ($return === false) {
+ } elseif ($return === FALSE) {
// Count depth
$GLOBALS['nav_depth']++;
}
} // END - if
// Return or output HTML code?
- if ($return === true) {
+ if ($return === TRUE) {
// Return HTML code
return $OUT;
} else {
$main_cnt = '0';
// is the menu action valid?
- if (!isMenuActionValid($mode, $action, $what, true)) {
+ if (!isMenuActionValid($mode, $action, $what, TRUE)) {
return getCode('MENU_NOT_VALID');
} // END - if
while ($content = SQL_FETCHARRAY($result_main)) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',action=' . $content['action'] . ',getWhat()=' . getWhat());
// Disable the block-mode
- enableBlockMode(false);
+ enableBlockMode(FALSE);
// Load menu header template
- $GLOBALS['rows'] .= loadTemplate($mode . '_menu_title', true, $content);
+ $GLOBALS['rows'] .= loadTemplate($mode . '_menu_title', TRUE, $content);
// Sub menu
$result_sub = SQL_QUERY_ESC("SELECT
// Add regular menu row or bottom row?
if ($count < SQL_NUMROWS($result_sub)) {
- $GLOBALS['rows'] .= loadTemplate($mode . '_menu_row', true, $content);
+ $GLOBALS['rows'] .= loadTemplate($mode . '_menu_row', TRUE, $content);
} else {
- $GLOBALS['rows'] .= loadTemplate($mode . '_menu_bottom', true, $content);
+ $GLOBALS['rows'] .= loadTemplate($mode . '_menu_bottom', TRUE, $content);
}
} // END - while
} else {
$INC = sprintf("inc/modules/%s/action-%s.php", $mode, $content['action']);
if (isFileReadable($INC)) {
// Load include file
- if ((!isExtensionActive($content['action'])) || ($content['action'] == 'online')) $GLOBALS['rows'] .= loadTemplate('menu_what_begin', true, $mode);
+ if ((!isExtensionActive($content['action'])) || ($content['action'] == 'online')) $GLOBALS['rows'] .= loadTemplate('menu_what_begin', TRUE, $mode);
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',action=' . $content['action'] . ',getWhat()=' . getWhat());
loadInclude($INC);
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',action=' . $content['action'] . ',getWhat()=' . getWhat());
- if ((!isExtensionActive($content['action'])) || ($content['action'] == 'online')) $GLOBALS['rows'] .= loadTemplate('menu_what_end', true, $mode);
+ if ((!isExtensionActive($content['action'])) || ($content['action'] == 'online')) $GLOBALS['rows'] .= loadTemplate('menu_what_end', TRUE, $mode);
}
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',action=' . $content['action'] . ',getWhat()=' . getWhat());
}
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',getWhat()=' . getWhat());
if (SQL_NUMROWS($result_main) > $main_cnt) {
// Add separator
- $GLOBALS['rows'] .= loadTemplate('menu_separator', true, $mode);
+ $GLOBALS['rows'] .= loadTemplate('menu_separator', TRUE, $mode);
// Should we display adverts in this menu?
if ((isExtensionInstalledAndNewer('menu', '0.0.1')) && (getConfig($mode . '_menu_advert_enabled') == 'Y') && ($action != 'admin')) {
// Display advert template
- $GLOBALS['rows'] .= loadTemplate('menu_' . $mode . '_advert_' . $action, true);
+ $GLOBALS['rows'] .= loadTemplate('menu_' . $mode . '_advert_' . $action, TRUE);
// Add separator again
- $GLOBALS['rows'] .= loadTemplate('menu_separator', true, $mode);
+ $GLOBALS['rows'] .= loadTemplate('menu_separator', TRUE, $mode);
} // END - if
} // END - if
} // END - while
// Should we display adverts in this menu?
if ((isExtensionInstalledAndNewer('menu', '0.0.1')) && (getConfig($mode . '_menu_advert_enabled') == 'Y')) {
// Add separator again
- $GLOBALS['rows'] .= loadTemplate('menu_separator', true, $mode);
+ $GLOBALS['rows'] .= loadTemplate('menu_separator', TRUE, $mode);
// Display advert template
- $GLOBALS['rows'] .= loadTemplate('menu_' . $mode . '_advert_end', true);
+ $GLOBALS['rows'] .= loadTemplate('menu_' . $mode . '_advert_end', TRUE);
} // END - if
// Prepare data
// Load main template
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',getWhat()=' . getWhat());
- loadTemplate('menu_table', false, $content);
+ loadTemplate('menu_table', FALSE, $content);
} // END - if
}
// Checks whether the current user is a member
function isMember () {
// By default no member
- $ret = false;
+ $ret = FALSE;
// Fix missing 'last_online' array, damn stupid code :(((
// @TODO Try to rewrite this to one or more functions
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'No member set in cookie/session.');
// Abort further processing
- return false;
+ return FALSE;
}
// Get userid secured from session
fixDeletedCookies(array('userid', 'u_hash'));
// Are cookies set and can the member data be loaded?
- if ((isMemberIdSet()) && (isSessionVariableSet('u_hash')) && (fetchUserData(getMemberId()) === true)) {
+ if ((isMemberIdSet()) && (isSessionVariableSet('u_hash')) && (fetchUserData(getMemberId()) === TRUE)) {
// Validate password by created the difference of it and the secret key
$valPass = encodeHashForCookie(getUserData('password'));
$GLOBALS['last_online']['online'] = getUserData('last_online');
// Account is confirmed and all cookie data is valid so he is definely logged in! :-)
- $ret = true;
+ $ret = TRUE;
} // END - if
} // END - if
// Is $ret still false?
- if ($ret === false) {
+ if ($ret === FALSE) {
// Yes, so destroy the session
destroyMemberSession();
} // END - if
// Extension ext-user must be there at any case
if (!isExtensionActive('user')) {
// Absent ext-user is really not good
- return false;
+ return FALSE;
} elseif (is_null($value)) {
// This shall never happen, so please report it
reportBug(__FUNCTION__, __LINE__, 'value=NULL,column=' . $column . ' - value can never be NULL');
} elseif (isUserDataValid()) {
// Use cache, so it is fine
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'value=' . $value . ' is valid, using cache #1');
- return true;
+ return TRUE;
} // END - if
} elseif (isUserDataValid()) {
// Using cache is fine
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'value=' . $value . ' is valid, using cache #2');
- return true;
+ return TRUE;
}
// By default none was found
- $found = false;
+ $found = FALSE;
// Extra SQL statements
$ADD = runFilterChain('convert_user_data_columns', ' ');
function isAdmin () {
// No admin in installation phase!
if ((isInstallationPhase()) || (!isAdminRegistered())) {
- return false;
+ return FALSE;
} // END - if
// Init variables
- $ret = false;
+ $ret = FALSE;
$adminId = '0';
$passwordFromCookie = '';
$valPass = '';
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Current adminId is zero. isSessionVariableSet(admin_id)=' . intval(isSessionVariableSet('admin_id')) . ',isSessionVariableSet(admin_md5)=' . intval(isSessionVariableSet('admin_md5')));
// Abort here now
- return false;
+ return FALSE;
} // END - if
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$adminId])) {
// Init it with failed
- $GLOBALS[__FUNCTION__][$adminId] = false;
+ $GLOBALS[__FUNCTION__][$adminId] = FALSE;
// Search in array for entry
if (isset($GLOBALS['admin_hash'])) {
// Use cached string
$valPass = $GLOBALS['admin_hash'];
- } elseif ((!empty($passwordFromCookie)) && (isAdminHashSet($adminId) === true) && (!empty($adminId))) {
+ } elseif ((!empty($passwordFromCookie)) && (isAdminHashSet($adminId) === TRUE) && (!empty($adminId))) {
// Login data is valid or not?
$valPass = encodeHashForCookie(getAdminHash($adminId));
// Count cache hits
incrementStatsEntry('cache_hits');
- } elseif ((!empty($adminId)) && ((!isExtensionActive('cache')) || (isAdminHashSet($adminId) === false))) {
+ } elseif ((!empty($adminId)) && ((!isExtensionActive('cache')) || (isAdminHashSet($adminId) === FALSE))) {
// Get admin hash and hash it
$valPass = encodeHashForCookie(getAdminHash($adminId));
// Generates a list of "max receiveable emails per day"
function addMaxReceiveList ($mode, $default = '') {
$OUT = '';
- $result = false;
+ $result = FALSE;
switch ($mode) {
case 'guest':
}
// Load template
- $OUT = loadTemplate(($mode . '_receive_table'), true, $OUT);
+ $OUT = loadTemplate(($mode . '_receive_table'), TRUE, $OUT);
} else {
// Maybe the admin has to setup some maximum values?
reportBug(__FUNCTION__, __LINE__, 'Nothing is being done here?');
}
// Validate the given menu action
-function isMenuActionValid ($mode, $action, $what, $updateEntry = false) {
+function isMenuActionValid ($mode, $action, $what, $updateEntry = FALSE) {
// Is the cache entry there and we shall not update?
- if ((isset($GLOBALS['action_valid'][$mode][$action][$what])) && ($updateEntry === false)) {
+ if ((isset($GLOBALS['action_valid'][$mode][$action][$what])) && ($updateEntry === FALSE)) {
// Count cache hit
incrementStatsEntry('cache_hits');
} // END - if
// By default nothing is valid
- $ret = false;
+ $ret = FALSE;
// Look in all menus or only unlocked
$add = '';
if ((!isAdmin()) && ($mode != 'admin')) $add = " AND `locked`='N'";
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'mode=' . $mode . ',action=' . $action . ',what=' . $what);
- if (($mode != 'admin') && ($updateEntry === true)) {
+ if (($mode != 'admin') && ($updateEntry === TRUE)) {
// Update guest or member menu
$sql = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `counter`=`counter`+1 WHERE `action`='%s' AND `what`='%s'".$add." LIMIT 1",
array(
$mode,
$action,
$what
- ), __FUNCTION__, __LINE__, false);
+ ), __FUNCTION__, __LINE__, FALSE);
} elseif (($what != 'welcome') && (!empty($what))) {
// Other actions
$sql = SQL_QUERY_ESC("SELECT `id`, `what` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `what`='%s'".$add." ORDER BY `action` DESC LIMIT 1",
$mode,
$action,
$what
- ), __FUNCTION__, __LINE__, false);
+ ), __FUNCTION__, __LINE__, FALSE);
} else {
// Admin login overview
$sql = SQL_QUERY_ESC("SELECT `id`, `what` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND (`what`='' OR `what` IS NULL)".$add." ORDER BY `action` DESC LIMIT 1",
array(
$mode,
$action
- ), __FUNCTION__, __LINE__, false);
+ ), __FUNCTION__, __LINE__, FALSE);
}
// Run SQL command
$result = SQL_QUERY($sql, __FUNCTION__, __LINE__);
// Should we look for affected rows (only update) or found rows?
- if ($updateEntry === true) {
+ if ($updateEntry === TRUE) {
// Check updated/affected rows
$ret = (!SQL_HASZEROAFFECTED());
} else {
}
// Get a string of "mail title" and price back
-function getPaymentTitlePrice ($paymentsId, $full = false) {
+function getPaymentTitlePrice ($paymentsId, $full = FALSE) {
// Only title or also including price?
- if ($full === false) {
+ if ($full === FALSE) {
$ret = getPaymentData($paymentsId, 'main_title');
} else {
$ret = getPaymentData($paymentsId, 'main_title') . ' / {%pipe,getPaymentData,translateComma=' . $paymentsId . '%} {?POINTS?}';
}
// Remove a receiver's id from $receivers and add a link for him to confirm
-function removeReceiver (&$receivers, $key, $userid, $poolId, $statsId = 0, $isBonusMail = false) {
+function removeReceiver (&$receivers, $key, $userid, $poolId, $statsId = 0, $isBonusMail = FALSE) {
// Default is not removed
$ret = 'failed';
$rowName = 'stats_id';
// Only when we got a real stats id continue searching for the entry
- if ($isBonusMail === true) {
+ if ($isBonusMail === TRUE) {
$type = 'BONUS';
$rowName = 'bonus_id';
} // END - if
}
// Calculate sum (default) or count records of given criteria
-function countSumTotalData ($search, $tableName, $lookFor = 'id', $whereStatement = 'userid', $countRows = false, $add = '', $mode = '=') {
+function countSumTotalData ($search, $tableName, $lookFor = 'id', $whereStatement = 'userid', $countRows = FALSE, $add = '', $mode = '=') {
// Init count/sum
$data['res'] = '0';
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',tableName=' . $tableName . ',lookFor=' . $lookFor . ',whereStatement=' . $whereStatement . ',add=' . $add);
if ((empty($search)) && ($search != '0')) {
// Count or sum whole table?
- if ($countRows === true) {
+ if ($countRows === TRUE) {
// Count whole table
$result = SQL_QUERY_ESC('SELECT COUNT(`%s`) AS `res` FROM `{?_MYSQL_PREFIX?}_%s`' . $add . ' LIMIT 1',
array(
$tableName
), __FUNCTION__, __LINE__);
}
- } elseif (($countRows === true) || ($lookFor == 'userid')) {
+ } elseif (($countRows === TRUE) || ($lookFor == 'userid')) {
// Count rows
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'COUNT!');
$result = SQL_QUERY_ESC("SELECT COUNT(`%s`) AS `res` FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`%s'%s'" . $add . ' LIMIT 1',
* Sends out mail to all administrators. This function is no longer obsolete
* because we need it when there is no ext-admins installed
*/
-function sendAdminEmails ($subject, $message, $isBugReport = false) {
+function sendAdminEmails ($subject, $message, $isBugReport = FALSE) {
// Default is no special header
$mailHeader = '';
// Is it a bug report?
- if ($isBugReport === true) {
+ if ($isBugReport === TRUE) {
// Then add a reply-to line back to the author (me)
$mailHeader = 'Reply-To: webmaster@mxchange.org' . chr(10);
} // END - if
// Start adding all
while ($data = SQL_FETCHARRAY($result_userids)) {
// Add user count
- $userid_cnt += countSumTotalData($data['userid'], 'user_data', 'userid', 'userid', true, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED' AND `receive_mails` > 0"));
+ $userid_cnt += countSumTotalData($data['userid'], 'user_data', 'userid', 'userid', TRUE, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED' AND `receive_mails` > 0"));
} // END - while
// Free memory
// Is admin or bonus extension there?
if (!isAdmin()) {
// Abort here
- return false;
+ return FALSE;
} elseif (!isExtensionActive('bonus')) {
// Abort here
- return false;
+ return FALSE;
}
// Calculcate target sent
// Init variables
$extraColumns = '';
$receiverList = '';
- $result = false;
+ $result = FALSE;
// Secure data
$categoryId = bigintval($categoryId);
// @TODO Rewrite this to a filter
if ((isset($data['stats_id'])) && ($data['stats_id'] > 0)) {
// User email
- $num = countSumTotalData($data['userid'], 'user_stats_data', 'id', 'userid', true, sprintf(" AND `stats_type`='mailid' AND `stats_data`=%s", bigintval($data['stats_id'])));
+ $num = countSumTotalData($data['userid'], 'user_stats_data', 'id', 'userid', TRUE, sprintf(" AND `stats_type`='mailid' AND `stats_data`=%s", bigintval($data['stats_id'])));
} elseif ((isset($data['bonus_id'])) && ($data['bonus_id'] > 0)) {
// Bonus mail
- $num = countSumTotalData($data['userid'], 'user_stats_data', 'id', 'userid', true, sprintf(" AND `stats_type`='bonusid' AND `stats_data`=%s", bigintval($data['bonus_id'])));
+ $num = countSumTotalData($data['userid'], 'user_stats_data', 'id', 'userid', TRUE, sprintf(" AND `stats_type`='bonusid' AND `stats_data`=%s", bigintval($data['bonus_id'])));
}
// Reduce this users total received emails?
}
// Creates a new task
-function createNewTask ($subject, $notes, $taskType, $userid = NULL, $adminId = NULL, $strip = true) {
+function createNewTask ($subject, $notes, $taskType, $userid = NULL, $adminId = NULL, $strip = TRUE) {
// Insert the task data into the database
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_task_system` (`assigned_admin`, `userid`, `status`, `task_type`, `subject`, `text`, `task_created`) VALUES (%s,%s,'NEW','%s','%s','%s', UNIX_TIMESTAMP())",
array(
$taskType,
$subject,
$notes
- ), __FUNCTION__, __LINE__, true, $strip);
+ ), __FUNCTION__, __LINE__, TRUE, $strip);
// Return insert id which is the task id
return SQL_INSERTID();
} // END - if
// Call the callback-function
- //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'callbackFunction=' . $callbackName . ',args=<pre>'.print_r($args, true).'</pre>');
+ //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'callbackFunction=' . $callbackName . ',args=<pre>'.print_r($args, TRUE).'</pre>');
// @TODO If we can rewrite the EL sub-system to support more than one parameter, this call_user_func_array() can be avoided
$content[$columnName] = call_user_func_array($callbackName, $args);
} // END - foreach
// Load row template
- $OUT .= loadTemplate(trim($rowTemplate[0]), true, $content);
+ $OUT .= loadTemplate(trim($rowTemplate[0]), TRUE, $content);
} // END - while
// Load main template
- loadTemplate(trim($tableTemplate[0]), false, $OUT);
+ loadTemplate(trim($tableTemplate[0]), FALSE, $OUT);
} else {
// No URLs in surfbar
displayMessage('{--' .$noEntryMessageId[0] . '--}');
// Adds a given entry to the database
function doGenericAddEntries ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $columnIndex = NULL) {
- //* DEBUG: */ die('columns=<pre>'.print_r($columns,true).'</pre>,filterFunctions=<pre>'.print_r($filterFunctions,true).'</pre>,extraValues=<pre>'.print_r($extraValues,true).'</pre>,POST=<pre>'.print_r($_POST,true).'</pre>');
+ //* DEBUG: */ die('columns=<pre>'.print_r($columns,TRUE).'</pre>,filterFunctions=<pre>'.print_r($filterFunctions,TRUE).'</pre>,extraValues=<pre>'.print_r($extraValues,TRUE).'</pre>,POST=<pre>'.print_r($_POST,TRUE).'</pre>');
// Verify that tableName and columns are not empty
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
$sqlValues = array();
// Default is that all went fine
- $GLOBALS['__XML_PARSE_RESULT'] = true;
+ $GLOBALS['__XML_PARSE_RESULT'] = TRUE;
// Is there "time columns"?
if (count($timeColumns) > 0) {
// Is columnIndex set?
if (!is_null($columnIndex)) {
// Check conditions
- //* DEBUG: */ die('columnIndex=<pre>'.print_r($columnIndex,true).'</pre>'.debug_get_printable_backtrace());
+ //* DEBUG: */ die('columnIndex=<pre>'.print_r($columnIndex,TRUE).'</pre>'.debug_get_printable_backtrace());
assert((is_array($columnName)) && (is_string($columnIndex)) && (isset($columnName[$columnIndex])));
// Then use that index "blindly"
} elseif ((isset($filterFunctions[$key])) && (!empty($filterFunctions[$key]))) {
// Run through an extra filter
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - BEFORE!');
- $sqlValues[$key] = handleExtraValues($filterFunctions[$key], $sqlValues[$key], '');
+ $sqlValues[$key] = handleExtraValues($filterFunctions[$key], $sqlValues[$key], NULL);
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - AFTER!');
}
} // END - if
// Is the value false?
- if ($sqlValues[$key] === false) {
+ if ($sqlValues[$key] === FALSE) {
// One "parser" didn't like it
- $GLOBALS['__XML_PARSE_RESULT'] = false;
+ $GLOBALS['__XML_PARSE_RESULT'] = FALSE;
break;
} // END - if
} // END - foreach
// If all values are okay, continue
- if ($sqlValues[$key] !== false) {
+ if ($sqlValues[$key] !== FALSE) {
// Build the SQL query
$sql = 'INSERT INTO `{?_MYSQL_PREFIX?}_' . $tableName[0] . '` (`' . implode('`, `', $sqlColumns) . "`) VALUES (" . implode(',', $sqlValues) . ')';
}
// Edit rows by given id numbers
-function doGenericEditEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $editNow = array(false), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array(), $subject = '') {
+function doGenericEditEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array(), $subject = '') {
// Change them all
$affected = '0';
foreach (postRequestElement($idColumn[0]) as $id => $sel) {
+ // Secure id number
+ $id = bigintval($id);
+
// Prepare content array (new values)
$content = array();
} // END - if
// Debug message
- //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',idColumn[0]=' . $idColumn[0] . ',entries=<pre>'.print_r($entries,true).'</pre>');
+ //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',idColumn[0]=' . $idColumn[0] . ',entries=<pre>'.print_r($entries,TRUE).'</pre>');
// Is entries an array?
if (($key != $idColumn[0]) && (is_array($entries)) && (isset($entries[$id]))) {
+ //die($key.'/'.$id.'=<pre>'.print_r($columns,TRUE).'</pre><pre>'.print_r($filterFunctions,TRUE).'</pre>');
+ // Search for the right array index
+ $search = key(search_array($columns, 'column', $key));
+
// Add this entry to content
$content[$key] = $entries[$id];
// Is the userid, we have to process it with convertZeroToNull()
$entries[$id] = convertZeroToNull($entries[$id]);
} elseif ((isset($filterFunctions[$key])) && (isset($extraValues[$key]))) {
- // Filter function set!
+ // Filter function + extra value set
$entries[$id] = handleExtraValues($filterFunctions[$key], $entries[$id], $extraValues[$key]);
+ } elseif (isset($filterFunctions[$search])) {
+ // Filter function set
+ //* BUG: */ die($id.'/'.$key.'='.$entries[$id].'/'.$filterFunctions[$search]);
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',filterFunctions=' . $filterFunctions[$search] . ',key=' . $key . ',id=' . $id . ',entries[' . gettype($entries[$id]) . ']=' . $entries[$id] . ' - BEFORE!');
+ $entries[$id] = handleExtraValues($filterFunctions[$search], $entries[$id], NULL);
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',filterFunctions=' . $filterFunctions[$search] . ',key=' . $key . ',id=' . $id . ',entries[' . gettype($entries[$id]) . ']=' . $entries[$id] . ' - AFTER!');
+ assert(!is_bool($entries[$id]));
}
// Is the value NULL?
}
// Delete rows by given id numbers
-function doGenericDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = array(false), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array()) {
+function doGenericDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array()) {
// The base SQL command:
$sql = "DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s` IN (%s)";
// Is a user id provided?
- //* BUG: */ die('<pre>'.print_r($rawUserId,true).'</pre><pre>'.print_r($userIdColumn,true).'</pre>');
+ //* BUG: */ die('<pre>'.print_r($rawUserId,TRUE).'</pre><pre>'.print_r($userIdColumn,TRUE).'</pre>');
if ((isset($rawUserId[0])) && (isPostRequestElementSet($rawUserId[0])) && (isset($userIdColumn[0]))) {
// Add user id as well
$sql .= ' AND `' . $userIdColumn[0] . '`=' . bigintval(postRequestElement($rawUserId[0]));
} // END - if
// Delete them all
- //* BUG: */ die($sql.'<br /><pre>'.print_r($tableName,true).'</pre><pre>'.print_r($columns,true).'</pre><pre>'.print_r($filterFunctions,true).'</pre><pre>'.print_r($extraValues,true).'</pre><pre>'.print_r($deleteNow,true).'</pre><pre>'.print_r($idColumn,true).'</pre>');
+ //* BUG: */ die($sql.'<br /><pre>'.print_r($tableName,TRUE).'</pre><pre>'.print_r($columns,TRUE).'</pre><pre>'.print_r($filterFunctions,TRUE).'</pre><pre>'.print_r($extraValues,TRUE).'</pre><pre>'.print_r($deleteNow,TRUE).'</pre><pre>'.print_r($idColumn,TRUE).'</pre>');
$idList = '';
foreach (postRequestElement($idColumn[0]) as $id => $sel) {
// Is id zero?
$OUT = '';
// "Walk" through all entries
- //* DEBUG: */ reportBug(__FUNCTION__, __LINE__, 'listType=<pre>'.print_r($listType,true).'</pre>,tableName<pre>'.print_r($tableName,true).'</pre>,columns=<pre>'.print_r($columns,true).'</pre>,filterFunctions=<pre>'.print_r($filterFunctions,true).'</pre>,extraValues=<pre>'.print_r($extraValues,true).'</pre>,idColumn=<pre>'.print_r($idColumn,true).'</pre>,userIdColumn=<pre>'.print_r($userIdColumn,true).'</pre>,rawUserId=<pre>'.print_r($rawUserId,true).'</pre>');
+ //* DEBUG: */ reportBug(__FUNCTION__, __LINE__, 'listType=<pre>'.print_r($listType,TRUE).'</pre>,tableName<pre>'.print_r($tableName,TRUE).'</pre>,columns=<pre>'.print_r($columns,TRUE).'</pre>,filterFunctions=<pre>'.print_r($filterFunctions,TRUE).'</pre>,extraValues=<pre>'.print_r($extraValues,TRUE).'</pre>,idColumn=<pre>'.print_r($idColumn,TRUE).'</pre>,userIdColumn=<pre>'.print_r($userIdColumn,TRUE).'</pre>,rawUserId=<pre>'.print_r($rawUserId,TRUE).'</pre>');
foreach (postRequestElement($idColumn[0]) as $id => $selected) {
// Secure id number
$id = bigintval($id);
$idx = searchXmlArray($key, $columns, 'column');
// Skip any missing entries
- if ($idx === false) {
+ if ($idx === FALSE) {
// Skip this one
//* DEBUG: */ reportBug(__FUNCTION__, __LINE__, 'key=' . $key . ' - SKIPPED!');
continue;
$prefix,
$listType,
$tableName[0]
- ), true, $content
+ ), TRUE, $content
);
} // END - if
$prefix,
$listType,
$tableName[0]
- ), false, $OUT
+ ), FALSE, $OUT
);
}
// Checks whether given URL is blacklisted
function isUrlBlacklisted ($url) {
// Mark it as not listed by default
- $listed = false;
+ $listed = FALSE;
// Is black-listing enbaled?
if (!isUrlBlacklistEnabled()) {
// No, then all URLs are not in this list
- return false;
+ return FALSE;
} elseif (!isset($GLOBALS['blacklist_data'][$url])) {
// Check black-list for given URL
$result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`timestamp`) AS `blist_timestamp` FROM `{?_MYSQL_PREFIX?}_url_blacklist` WHERE `url`='%s' LIMIT 1",
$GLOBALS['blacklist_data'][$url] = SQL_FETCHARRAY($result);
// Mark it as listed
- $listed = true;
+ $listed = TRUE;
} // END - if
// Free result
SQL_FREERESULT($result);
} else {
// Is found in cache -> black-listed
- $listed = true;
+ $listed = TRUE;
}
// Return result
Version 2.0.0 rc2 (Fri, Nov 16 2007), interim release
* implements new property to control VERP in class.smtp.php
example (requires instantiating class.smtp.php):
- $mail->do_verp = true;
+ $mail->do_verp = TRUE;
* POP-before-SMTP functionality included, thanks to Richard Davey
(see class.pop3.php & pop3_before_smtp_test.php for examples)
* included example showing how to use PHPMailer with GMAIL
/**
* Sets the Body of the message. This can be either an HTML or text body.
- * If HTML then run IsHTML(true).
+ * If HTML then run IsHTML(TRUE).
* @var string
*/
var $Body = '';
* Sets SMTP authentication. Utilizes the Username and Password variables.
* @var bool
*/
- var $SMTPAuth = false;
+ var $SMTPAuth = FALSE;
/**
* Sets SMTP username.
* Sets SMTP class debugging on or off.
* @var bool
*/
- var $SMTPDebug = false;
+ var $SMTPDebug = FALSE;
/**
* Prevents the SMTP connection from being closed after each mail
* requires an explicit call to SmtpClose().
* @var bool
*/
- var $SMTPKeepAlive = false;
+ var $SMTPKeepAlive = FALSE;
/**
* Provides the ability to have the TO field process individual
* emails, instead of sending to entire TO addresses
* @var bool
*/
- var $SingleTo = false;
+ var $SingleTo = FALSE;
/////////////////////////////////////////////////
// PROPERTIES, PRIVATE
* @return void
*/
function IsHTML($bool) {
- if($bool == true) {
+ if($bool == TRUE) {
$this->ContentType = 'text/html';
} else {
$this->ContentType = 'text/plain';
function Send() {
$header = '';
$body = '';
- $result = true;
+ $result = TRUE;
if((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
$this->SetError($this->Lang('provide_address'));
- return false;
+ return FALSE;
}
/* Set whether the message is multipart/alternative */
$body = $this->CreateBody();
if($body == '') {
- return false;
+ return FALSE;
}
/* Choose the mailer */
$result = $this->MailSend($header, $body);
break;
//$this->SetError($this->Mailer . $this->Lang('mailer_not_supported'));
- //$result = false;
+ //$result = FALSE;
//break;
}
if(!@$mail = popen($sendmail, 'w')) {
$this->SetError($this->Lang('execute') . $this->Sendmail);
- return false;
+ return FALSE;
}
fputs($mail, $header);
}
if($result != 0) {
$this->SetError($this->Lang('execute') . $this->Sendmail);
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
/**
if ($this->Sender != '' && strlen(ini_get('safe_mode')) < 1) {
$old_from = ini_get('sendmail_from');
ini_set('sendmail_from', $this->Sender);
- if ($this->SingleTo === true && count($toArr) > 1) {
+ if ($this->SingleTo === TRUE && count($toArr) > 1) {
foreach ($toArr as $key => $val) {
$rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
}
$rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
}
} else {
- if ($this->SingleTo === true && count($toArr) > 1) {
+ if ($this->SingleTo === TRUE && count($toArr) > 1) {
foreach ($toArr as $key => $val) {
$rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
}
if(!$rt) {
$this->SetError($this->Lang('instantiate'));
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
/**
$bad_rcpt = array();
if(!$this->SmtpConnect()) {
- return false;
+ return FALSE;
}
$smtp_from = ($this->Sender == '') ? $this->From : $this->Sender;
$error = $this->Lang('from_failed') . $smtp_from;
$this->SetError($error);
$this->smtp->Reset();
- return false;
+ return FALSE;
}
/* Attempt to send attach all recipients */
$error = $this->Lang('recipients_failed') . $error;
$this->SetError($error);
$this->smtp->Reset();
- return false;
+ return FALSE;
}
if(!$this->smtp->Data($header . $body)) {
$this->SetError($this->Lang('data_not_accepted'));
$this->smtp->Reset();
- return false;
+ return FALSE;
}
- if($this->SMTPKeepAlive == true) {
+ if($this->SMTPKeepAlive == TRUE) {
$this->smtp->Reset();
} else {
$this->SmtpClose();
}
- return true;
+ return TRUE;
}
/**
$connection = ($this->smtp->Connected());
/* Retry while there is no connection */
- while($index < count($hosts) && $connection == false) {
+ while($index < count($hosts) && $connection == FALSE) {
$hostinfo = array();
if(eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) {
$host = $hostinfo[1];
$this->smtp->Hello($this->ServerHostname());
}
- $connection = true;
+ $connection = TRUE;
if($this->SMTPAuth) {
if(!$this->smtp->Authenticate($this->Username, $this->Password)) {
$this->SetError($this->Lang('authenticate'));
$this->smtp->Reset();
- $connection = false;
+ $connection = FALSE;
}
}
}
}
$this->language = $PHPMAILER_LANG;
- return true;
+ return TRUE;
}
/////////////////////////////////////////////////
* @access private
* @return string
*/
- function WrapText($message, $length, $qp_mode = false) {
+ function WrapText($message, $length, $qp_mode = FALSE) {
$soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE;
// If utf-8 encoding is used, we will need to make sure we don't
// split multibyte characters when we wrap
* @return int
*/
function UTF8CharBoundary($encodedText, $maxLength) {
- $foundSplitPos = false;
+ $foundSplitPos = FALSE;
$lookBack = 3;
while (!$foundSplitPos) {
$lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
$encodedCharPos = strpos($lastChunk, "=");
- if ($encodedCharPos !== false) {
+ if ($encodedCharPos !== FALSE) {
// Found start of encoded character byte within $lookBack block.
// Check the encoded byte value (the 2 chars after the '=')
$hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);
// otherwise reduce maxLength to start of the encoded char
$maxLength = ($encodedCharPos == 0) ? $maxLength :
$maxLength - ($lookBack - $encodedCharPos);
- $foundSplitPos = true;
+ $foundSplitPos = TRUE;
} elseif ($dec >= 192) { // First byte of a multi byte character
// Reduce maxLength to split at start of character
$maxLength = $maxLength - ($lookBack - $encodedCharPos);
- $foundSplitPos = true;
+ $foundSplitPos = TRUE;
} elseif ($dec < 192) { // Middle byte of a multi byte character, look further back
$lookBack += 3;
}
} else {
// No encoded character found
- $foundSplitPos = true;
+ $foundSplitPos = TRUE;
}
}
return $maxLength;
function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
if(!@is_file($path)) {
$this->SetError($this->Lang('file_access') . $path);
- return false;
+ return FALSE;
}
$filename = basename($path);
$this->attachment[$cur][2] = $name;
$this->attachment[$cur][3] = $encoding;
$this->attachment[$cur][4] = $type;
- $this->attachment[$cur][5] = false; // isStringAttachment
+ $this->attachment[$cur][5] = FALSE; // isStringAttachment
$this->attachment[$cur][6] = 'attachment';
$this->attachment[$cur][7] = 0;
- return true;
+ return TRUE;
}
/**
} else {
$encoding = 'Q';
$encoded = $this->EncodeQ($str, $position);
- $encoded = $this->WrapText($encoded, $maxlen, true);
+ $encoded = $this->WrapText($encoded, $maxlen, TRUE);
$encoded = str_replace('='.$this->LE, "\n", trim($encoded));
}
* @access private
* @return string
*/
- function EncodeQP( $input = '', $line_max = 76, $space_conv = false ) {
+ function EncodeQP( $input = '', $line_max = 76, $space_conv = FALSE ) {
$hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
$lines = preg_split('/(?:\r\n|\r|\n)/', $input);
$eol = "\r\n";
$this->attachment[$cur][2] = $filename;
$this->attachment[$cur][3] = $encoding;
$this->attachment[$cur][4] = $type;
- $this->attachment[$cur][5] = true; // isString
+ $this->attachment[$cur][5] = TRUE; // isString
$this->attachment[$cur][6] = 'attachment';
$this->attachment[$cur][7] = 0;
}
if(!@is_file($path)) {
$this->SetError($this->Lang('file_access') . $path);
- return false;
+ return FALSE;
}
$filename = basename($path);
$this->attachment[$cur][2] = $name;
$this->attachment[$cur][3] = $encoding;
$this->attachment[$cur][4] = $type;
- $this->attachment[$cur][5] = false;
+ $this->attachment[$cur][5] = FALSE;
$this->attachment[$cur][6] = 'inline';
$this->attachment[$cur][7] = $cid;
- return true;
+ return TRUE;
}
/**
* @return bool
*/
function InlineImageExists() {
- $result = false;
+ $result = FALSE;
for($i = 0; $i < count($this->attachment); $i++) {
if($this->attachment[$i][6] == 'inline') {
- $result = true;
+ $result = TRUE;
break;
}
}
}
}
}
- $this->IsHTML(true);
+ $this->IsHTML(TRUE);
$this->Body = $message;
$textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message)));
if ( !empty($textMsg) && empty($this->AltBody) ) {
$this->$name = $value;
} else {
$this->SetError('Cannot set or reset variable ' . $name);
- return false;
+ return FALSE;
}
}
fclose($fp);
return $return;
} else {
- return false;
+ return FALSE;
}
}
function POP3 ()
{
$this->pop_conn = 0;
- $this->connected = false;
+ $this->connected = FALSE;
$this->error = null;
}
* @param string $username
* @param string $password
*/
- function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0)
+ function Authorise ($host, $port = FALSE, $tval = FALSE, $username, $password, $debug_level = 0)
{
$this->host = $host;
// If no port value is passed, retrieve it
- if ($port == false)
+ if ($port == FALSE)
{
$this->port = $this->POP3_PORT;
}
}
// If no port value is passed, retrieve it
- if ($tval == false)
+ if ($tval == FALSE)
{
$this->tval = $this->POP3_TIMEOUT;
}
{
$this->Disconnect();
- return true;
+ return TRUE;
}
}
// We need to disconnect regardless if the login succeeded
$this->Disconnect();
- return false;
+ return FALSE;
}
/**
* @param integer $tval
* @return boolean
*/
- function Connect ($host, $port = false, $tval = 30)
+ function Connect ($host, $port = FALSE, $tval = 30)
{
// Are we already connected?
if ($this->connected)
{
- return true;
+ return TRUE;
}
/*
}
// Did we connect?
- if ($this->pop_conn == false)
+ if ($this->pop_conn == FALSE)
{
// It would appear not...
$this->error = array(
$this->displayErrors();
}
- return false;
+ return FALSE;
}
// Increase the stream time-out
if ($this->checkResponse($pop3_response))
{
// The connection is established and the POP3 server is talking
- $this->connected = true;
- return true;
+ $this->connected = TRUE;
+ return TRUE;
}
}
*/
function Login ($username = '', $password = '')
{
- if ($this->connected == false)
+ if ($this->connected == FALSE)
{
$this->error = 'Not connected to POP3 server';
if ($this->checkResponse($pop3_response))
{
- return true;
+ return TRUE;
}
else
{
- return false;
+ return FALSE;
}
}
else
{
- return false;
+ return FALSE;
}
}
$this->displayErrors();
}
- return false;
+ return FALSE;
}
else
{
- return true;
+ return TRUE;
}
}
* Sets VERP use on/off (default is off)
* @var bool
*/
- var $do_verp = false;
+ var $do_verp = FALSE;
/**#@+
* @access private
# for now we will just give an error saying we
# are already connected
$this->error = array("error" => "Already connected to a server");
- return false;
+ return FALSE;
}
if(empty($port)) {
echo "SMTP -> ERROR: " . $this->error["error"] .
": $errstr ($errno)" . $this->CRLF;
}
- return false;
+ return FALSE;
}
# sometimes the SMTP server takes a little longer to respond
echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce;
}
- return true;
+ return TRUE;
}
/**
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
- return false;
+ return FALSE;
}
// Send encoded username
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
- return false;
+ return FALSE;
}
// Send encoded password
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
/**
"EOF caught while checking if connected";
}
$this->Close();
- return false;
+ return FALSE;
}
- return true; # everything looks good
+ return TRUE; # everything looks good
}
- return false;
+ return FALSE;
}
/**
if(!$this->connected()) {
$this->error = array(
"error" => "Called Data() without being connected");
- return false;
+ return FALSE;
}
fputs($this->smtp_conn,"DATA" . $this->CRLF);
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
- return false;
+ return FALSE;
}
# the server is ready to accept data!
# and we can process all lines before a blank "" line as
# headers.
$field = substr($lines[0],0,strpos($lines[0],":"));
- $in_headers = false;
+ $in_headers = FALSE;
if(!empty($field) && !strstr($field," ")) {
- $in_headers = true;
+ $in_headers = TRUE;
}
$max_line_length = 998; # used below; set here for ease in change
while(list(,$line) = @each($lines)) {
$lines_out = null;
if($line == "" && $in_headers) {
- $in_headers = false;
+ $in_headers = FALSE;
}
# ok we need to break this line up into several
# smaller lines
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
/**
if(!$this->connected()) {
$this->error = array(
"error" => "Called Expand() without being connected");
- return false;
+ return FALSE;
}
fputs($this->smtp_conn,"EXPN " . $name . $this->CRLF);
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
- return false;
+ return FALSE;
}
# parse the reply and place in our array to return to user
if(!$this->connected()) {
$this->error = array(
"error" => "Called Hello() without being connected");
- return false;
+ return FALSE;
}
# if a hostname for the HELO was not specified determine
if(!$this->SendHello("EHLO", $host))
{
if(!$this->SendHello("HELO", $host))
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
/**
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
- return false;
+ return FALSE;
}
$this->helo_rply = $rply;
- return true;
+ return TRUE;
}
/**
if(!$this->connected()) {
$this->error = array(
"error" => "Called Help() without being connected");
- return false;
+ return FALSE;
}
$extra = "";
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
- return false;
+ return FALSE;
}
return $rply;
if(!$this->connected()) {
$this->error = array(
"error" => "Called Mail() without being connected");
- return false;
+ return FALSE;
}
$useVerp = ($this->do_verp ? "XVERP" : "");
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
/**
if(!$this->connected()) {
$this->error = array(
"error" => "Called Noop() without being connected");
- return false;
+ return FALSE;
}
fputs($this->smtp_conn,"NOOP" . $this->CRLF);
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
/**
if(!$this->connected()) {
$this->error = array(
"error" => "Called Quit() without being connected");
- return false;
+ return FALSE;
}
# send the quit command to the server
echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg;
}
- $rval = true;
+ $rval = TRUE;
$e = null;
$code = substr($byemsg,0,3);
$e = array("error" => "SMTP server rejected quit command",
"smtp_code" => $code,
"smtp_rply" => substr($byemsg,4));
- $rval = false;
+ $rval = FALSE;
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $e["error"] . ": " .
$byemsg . $this->CRLF;
if(!$this->connected()) {
$this->error = array(
"error" => "Called Recipient() without being connected");
- return false;
+ return FALSE;
}
fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
/**
if(!$this->connected()) {
$this->error = array(
"error" => "Called Reset() without being connected");
- return false;
+ return FALSE;
}
fputs($this->smtp_conn,"RSET" . $this->CRLF);
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
/**
if(!$this->connected()) {
$this->error = array(
"error" => "Called Send() without being connected");
- return false;
+ return FALSE;
}
fputs($this->smtp_conn,"SEND FROM:" . $from . $this->CRLF);
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
/**
if(!$this->connected()) {
$this->error = array(
"error" => "Called SendAndMail() without being connected");
- return false;
+ return FALSE;
}
fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
/**
if(!$this->connected()) {
$this->error = array(
"error" => "Called SendOrMail() without being connected");
- return false;
+ return FALSE;
}
fputs($this->smtp_conn,"SOML FROM:" . $from . $this->CRLF);
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
/**
if($this->do_debug >= 1) {
echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF;
}
- return false;
+ return FALSE;
}
/**
if(!$this->connected()) {
$this->error = array(
"error" => "Called Verify() without being connected");
- return false;
+ return FALSE;
}
fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF);
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
- return false;
+ return FALSE;
}
return $rply;
}
When you need it, create your POP3 object
Right before I invoke PHP Mailer I activate the POP3 authorisation. POP3 before SMTP is a process whereby you login to your web hosts POP3 mail server BEFORE sending out any emails via SMTP. The POP3 logon 'verifies' your ability to send email by SMTP, which typically otherwise blocks you. On my web host (Pair Networks) a single POP3 logon is enough to 'verify' you for 90 minutes. Here is some sample PHP code that activates the POP3 logon and then sends an email via PHP Mailer:
-[geshi lang=php] Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1); $mail = new PHPMailer(); $mail->SMTPDebug = 2; $mail->IsSMTP(); $mail->IsHTML(false); $mail->Host = 'relay.example.com'; $mail->From = 'mailer@example.com'; $mail->FromName = 'Example Mailer'; $mail->Subject = 'My subject'; $mail->Body = 'Hello world'; $mail->AddAddress('rich@corephp.co.uk', 'Richard Davey'); if (!$mail->Send()) { echo $mail->ErrorInfo; } ?> [/geshi]
+[geshi lang=php] Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1); $mail = new PHPMailer(); $mail->SMTPDebug = 2; $mail->IsSMTP(); $mail->IsHTML(FALSE); $mail->Host = 'relay.example.com'; $mail->From = 'mailer@example.com'; $mail->FromName = 'Example Mailer'; $mail->Subject = 'My subject'; $mail->Body = 'Hello world'; $mail->AddAddress('rich@corephp.co.uk', 'Richard Davey'); if (!$mail->Send()) { echo $mail->ErrorInfo; } ?> [/geshi]
The PHP Mailer parts of this code should be obvious to anyone who has used PHP Mailer before. One thing to note - you almost certainly will not need to use SMTP Authentication *and* POP3 before SMTP together. The Authorisation method is a proxy method to all of the others within that class. There are Connect, Logon and Disconnect methods available, but I wrapped them in the single Authorisation one to make things easier.
The Parameters
$body = eregi_replace("[\]",'',$body);
$mail->IsSMTP();
-$mail->SMTPAuth = true; // enable SMTP authentication
+$mail->SMTPAuth = TRUE; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port
$mail->AddAddress("username@domain.com","First Last");
-$mail->IsHTML(true); // send as HTML
+$mail->IsHTML(TRUE); // send as HTML
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
$mail->IsSMTP();
$mail->SMTPDebug = 2;
- $mail->IsHTML(false);
+ $mail->IsHTML(FALSE);
$mail->Host = 'relay.example.com';
$body = eregi_replace("[\]",'',$body);
$mail->IsSMTP();
-$mail->SMTPAuth = true; // enable SMTP authentication
+$mail->SMTPAuth = TRUE; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->AddAttachment("images/phpmailer.gif"); // attachment
-$mail->IsHTML(true); // send as HTML
+$mail->IsHTML(TRUE); // send as HTML
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets the Body of the message. This can be either an HTML or text body.</p>
-<p class="description"><p>If HTML then run IsHTML(true).</p></p>
+<p class="description"><p>If HTML then run IsHTML(TRUE).</p></p>
* @private
* @type object
*/
- var $Mail = false;
+ var $Mail = FALSE;
/**
* Holds the SMTP mail host.
$this->Mail->Host = $global_vars["mail_host"];
$this->Mail->Port = 25;
$this->Mail->Helo = "localhost.localdomain";
- $this->Mail->SMTPAuth = false;
+ $this->Mail->SMTPAuth = FALSE;
$this->Mail->Username = "";
$this->Mail->Password = "";
$this->Mail->PluginDir = $INCLUDE_DIR;
*/
function test_Html() {
- $this->Mail->IsHTML(true);
+ $this->Mail->IsHTML(TRUE);
$this->Mail->Subject .= ": HTML only";
$this->Mail->Body = "This is a <b>test message</b> written in HTML. </br>" .
$this->Mail->Body = "This is the <b>HTML</b> part of the email.";
$this->Mail->Subject .= ": HTML + Attachment";
- $this->Mail->IsHTML(true);
+ $this->Mail->IsHTML(TRUE);
if(!$this->Mail->AddAttachment("phpmailer_test.php", "test_attach.txt"))
{
$this->Mail->Body = "Embedded Image: <img alt=\"phpmailer\" src=\"cid:my-attach\">" .
"Here is an image!</a>";
$this->Mail->Subject .= ": Embedded Image";
- $this->Mail->IsHTML(true);
+ $this->Mail->IsHTML(TRUE);
if(!$this->Mail->AddEmbeddedImage("test.png", "my-attach", "test.png",
"base64", "image/png"))
$this->Mail->Body = "Embedded Image: <img alt=\"phpmailer\" src=\"cid:my-attach\">" .
"Here is an image!</a>";
$this->Mail->Subject .= ": Embedded Image + Attachment";
- $this->Mail->IsHTML(true);
+ $this->Mail->IsHTML(TRUE);
if(!$this->Mail->AddEmbeddedImage("test.png", "my-attach", "test.png",
"base64", "image/png"))
$this->Mail->Body = "This is the <b>HTML</b> part of the email.";
$this->Mail->AltBody = "This is the text part of the email.";
$this->Mail->Subject .= ": AltBody + Attachment";
- $this->Mail->IsHTML(true);
+ $this->Mail->IsHTML(TRUE);
if(!$this->Mail->AddAttachment("phpmailer_test.php", "test_attach.txt"))
{
$this->BuildBody();
$subject = $this->Mail->Subject;
- $this->Mail->SMTPKeepAlive = true;
+ $this->Mail->SMTPKeepAlive = TRUE;
$this->Mail->Subject = $subject . ": SMTP keep-alive 1";
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
$this->Mail->Subject .= ": This should be sent";
$this->BuildBody();
$this->Mail->ClearAllRecipients(); // no addresses should cause an error
- $this->assert($this->Mail->IsError() == false, "Error found");
- $this->assert($this->Mail->Send() == false, "Send succeeded");
+ $this->assert($this->Mail->IsError() == FALSE, "Error found");
+ $this->assert($this->Mail->Send() == FALSE, "Send succeeded");
$this->assert($this->Mail->IsError(), "No error found");
$this->assertEquals('You must provide at least one ' .
'recipient email address.', $this->Mail->ErrorInfo);
/* Collect the results of running a set of TestCases. */
var $fFailures = array();
var $fRunTests = 0;
- var $fStop = false;
+ var $fStop = FALSE;
function TestResult() { }
function stop() {
/* set indication that the test sequence should halt */
- $fStop = true;
+ $fStop = TRUE;
}
function countFailures() {
// Don't run on daily reset
if ((isResetModeEnabled()) || (!isHtmlOutputMode())) {
// Skip here
- return false;
+ return FALSE;
} elseif (!isExtensionActive('foo')) {
// Abort if extension foo is not active
- return false;
+ return FALSE;
}
// [EOF]
// Don't run on daily reset
if ((isResetModeEnabled()) || (!isHtmlOutputMode())) {
// Skip here
- return false;
+ return FALSE;
} elseif (!isExtensionActive('bonus')) {
// Abort if extension bonus is not active
- return false;
+ return FALSE;
}
// Only send bonus mail when bonus extension is active and maximum send-mails is not reached
//* DEBUG: */ debugOutput('OK!/L:'.__LINE__);
// Remove receiver from list
- $status = removeReceiver($temporaryReceivers, $key, $userid, $mailData['id'], $mailData['id'], true);
+ $status = removeReceiver($temporaryReceivers, $key, $userid, $mailData['id'], $mailData['id'], TRUE);
// Did it work?
switch ($status) {
implode(';', $temporaryReceivers),
bigintval($mailData['id'])
), __FILE__, __LINE__);
- //* DEBUG: */ debugOutput('*L:'.__LINE__.'<pre>'.print_r($temporaryReceivers, true).'</pre>!!!');
+ //* DEBUG: */ debugOutput('*L:'.__LINE__.'<pre>'.print_r($temporaryReceivers, TRUE).'</pre>!!!');
// Run any SQLs
runFilterChain('run_sqls');
// Don't run on daily reset
if ((isResetModeEnabled()) || (!isHtmlOutputMode())) {
// Skip here
- return false;
+ return FALSE;
} elseif (!isExtensionActive('user')) {
// Abort here if extension user is not active
- return false;
+ return FALSE;
}
// No HTML is default
// Abort if autopurge is not active or disabled by admin
if ((!isExtensionActive('autopurge')) || (getConfig('auto_purge_active') != 'Y')) {
// Abort here
- return false;
+ return FALSE;
} // END - if
// [EOF]
die();
} elseif ((!isExtensionActive('autopurge')) || (!isAutoPurgingActive())) {
// Abort here
- return false;
+ return FALSE;
}
if (getAutoPurge() > 0) {
// Remove confirmation links from queue
addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s",
- array(bigintval($content['id'])), __FILE__, __LINE__, false));
+ array(bigintval($content['id'])), __FILE__, __LINE__, FALSE));
// Update status of order
addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `data_type`='DELETED' WHERE `id`=%s LIMIT 1",
- array(bigintval($content['pool_id'])), __FILE__, __LINE__, false));
+ array(bigintval($content['pool_id'])), __FILE__, __LINE__, FALSE));
} // END - if
} // END - while
SQL_FREERESULT($result);
// Is the 'bonus' extension installed and activated?
- if (isExtensionActive('bonus', true)) {
+ if (isExtensionActive('bonus', TRUE)) {
// Check for bonus campaigns
$result = SQL_QUERY("SELECT `id`, `points` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `data_type`='SEND' AND `timestamp` <= {?auto_purge?} ORDER BY `id` ASC", __FILE__, __LINE__);
if (!SQL_HASZERONUMS($result)) {
// Remove confirmation links from queue
addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s",
- array(bigintval($content['id'])), __FILE__, __LINE__, false));
+ array(bigintval($content['id'])), __FILE__, __LINE__, FALSE));
// Update status of order
addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `data_type`='DELETED' WHERE `id`=%s LIMIT 1",
- array(bigintval($content['id'])), __FILE__, __LINE__, false));
+ array(bigintval($content['id'])), __FILE__, __LINE__, FALSE));
} // END - if
} // END - while
// Abort if autopurge is not active or disabled by admin
if ((!isExtensionActive('autopurge')) || (!isAutoPurgingActive())) {
// Abort here
- return false;
+ return FALSE;
} // END - if
// Shall I look for inactive accounts and autopurge inactive accounts?
// Update this account
addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ap_notified`=UNIX_TIMESTAMP() WHERE `userid`=%s LIMIT 1",
- array(bigintval($content['userid'])), __FILE__, __LINE__, false));
+ array(bigintval($content['userid'])), __FILE__, __LINE__, FALSE));
} // END - while
// Remove last comma
// Abort if autopurge is not active or disabled by admin
if ((!isExtensionActive('autopurge')) || (!isAutoPurgingActive()) || (getConfig('ap_del_mails') != 'Y')) {
// Abort here
- return false;
+ return FALSE;
} // END - if
// Okay, let's check for deleted mails
// Abort if autopurge is not active or disabled by admin
if ((!isExtensionActive('autopurge')) || (!isAutoPurgingActive())) {
// Abort here
- return false;
+ return FALSE;
} // END - if
// Check version (must be >= 0.1.9)
// Abort if autopurge is not active or disabled by admin
if ((!isExtensionActive('autopurge')) || (!isAutoPurgingActive())) {
// Abort here
- return false;
+ return FALSE;
} // END - if
// Shall I auto-purge unconfirmed accounts?
// Abort if autopurge is not active or disabled by admin
if ((!isExtensionActive('autopurge')) || (getConfig('auto_purge_active') != 'Y')) {
// Abort here
- return false;
+ return FALSE;
} // END - if
// [EOF]
function initReferralSystem () {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ' Referral system initialized!');
$GLOBALS['ref_level'] = NULL;
- $GLOBALS['ref_system'] = true;
+ $GLOBALS['ref_system'] = TRUE;
}
// Getter fro ref level percents
if ((isset($GLOBALS['cache_array']['refdepths']['level'])) && (isExtensionActive('cache'))) {
// First look for level
$key = array_search($level, $GLOBALS['cache_array']['refdepths']['level']);
- if ($key !== false) {
+ if ($key !== FALSE) {
// Entry found
$data['percents'] = $GLOBALS['cache_array']['refdepths']['percents'][$key];
function addPointsThroughReferralSystem ($subject, $userid, $points, $refid = NULL) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',userid=' . $userid . ',points=' . $points . ',refid=' . convertNullToZero($refid) . ' - ENTERED!');
// By default nothing has been added
- $added = false;
+ $added = FALSE;
// Determine payment method and notification
$paymentMethod = strtoupper(getPaymentMethodFromSubject($subject));
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',userid=' . $userid . ',refid=' . $refid . ',paymentMethod=' . $paymentMethod . ',sendNotify=' . intval($sendNotify) . ',isLocked=' . intval($isLocked));
// Send "referral confirmed" mails out?
- if ((isValidUserid($refid)) && ($refid != $userid) && ($sendNotify === true)) {
+ if ((isValidUserid($refid)) && ($refid != $userid) && ($sendNotify === TRUE)) {
// Calculate the referral's points and percents
$percentsReferral = getReferralLevelPercents($GLOBALS['ref_level'] + 1);
} // END - if
// Points updated, maybe I shall send him an email?
- if (($sendNotify === true) && ($isLocked === false)) {
+ if (($sendNotify === TRUE) && ($isLocked === FALSE)) {
// "Explode" subject
$subjectArray = explode(':', $subject);
$subjectUserid = (isset($subjectArray[1])) ? $subjectArray[1] : '0';
$columnName = $pointsData['column_name'];
// Are the points locked?
- if (($isLocked === true) && ($pointsData['locked_mode'] == 'LOCKED')) {
+ if (($isLocked === TRUE) && ($pointsData['locked_mode'] == 'LOCKED')) {
// Locked points, so prefix it
$columnName = 'locked_' . $pointsData['column_name'];
} // END - if
} // END - foreach
} // END - foreach
} // END - foreach
- //die('<pre>'.print_r($GLOBALS['referral_refid'][$userid],true).'</pre>');
+ //die('<pre>'.print_r($GLOBALS['referral_refid'][$userid],TRUE).'</pre>');
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - EXIT!');
}
// Prepare SQL
$SQL = 'INSERT INTO `{?_MYSQL_PREFIX?}_user_refs` (`userid`, `level`, `refid`) VALUES ';
- $executeSql = false;
+ $executeSql = FALSE;
// Now walk through the array, first levels
foreach ($GLOBALS['referral_refid'][$userid] as $level => $levelArray) {
$SQL .= '(' . $userid . ',' . $level . ',' . $refid . '),';
// Some has been added, so execute the query
- $executeSql = true;
+ $executeSql = TRUE;
} // END - if
} // END - foreach
} // END - foreach
// And run it
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',SQL=' . $SQL);
- if ($executeSql === true) {
+ if ($executeSql === TRUE) {
SQL_QUERY($SQL, __FUNCTION__, __LINE__);
} // END - if
return getReferralId();
} elseif ((!isHtmlOutputMode()) && (basename($_SERVER['PHP_SELF']) != 'ref.php')) {
// Skip this in non-html-mode and outside ref.php
- return false;
+ return FALSE;
}
// Check if refid is set
// Set cookie when default refid > 0
if ((!isSessionVariableSet('refid')) || (!isValidUserId(getReferralId())) || ((!isValidUserId(getSession('refid'))) && (isExtensionInstalledAndNewer('sql_patches', '0.1.2')) && (isValidUserId(getDefRefid())))) {
// Default is not found
- $found = false;
+ $found = FALSE;
// Is there nickname or userid set?
if ((isExtensionActive('nickname')) && (isNicknameUsed(getReferralId()))) {
$found = fetchUserData(getReferralId(), 'nickname');
// If we found it, use the userid as referral id
- if ($found === true) {
+ if ($found === TRUE) {
// Set the userid as 'refid'
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Using refid from user account by nickname (' . getUserData('userid') . ')');
setReferralId(getUserData('userid'));
}
// Is the record valid?
- if ((($found === false) || (!isUserDataValid())) && (isExtensionInstalledAndNewer('sql_patches', '0.1.2'))) {
+ if ((($found === FALSE) || (!isUserDataValid())) && (isExtensionInstalledAndNewer('sql_patches', '0.1.2'))) {
// No, then reset referral id
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Using default refid (' . getDefRefid() . ')');
setReferralId(getDefRefid());
// Counts entries in $_GET or returns false if not an array
function countRequestGet () {
// By default this is not an array
- $count = false;
+ $count = FALSE;
// Get the array
$GET = getRequestArray();
* 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_int($subElement))));
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element[]=' . gettype($element) . ',subElement[]=' . gettype($subElement));
+ assert(is_string($element) && ((is_null($subElement)) || (is_string($subElement)) || (is_int($subElement)) || (is_double($subElement))));
// Is a sub element set?
if (is_null($subElement)) {
// Counts entries in $_POST or returns false if not an array
function countRequestPost () {
// By default this is not an array
- $count = false;
+ $count = FALSE;
// Get the array
$postData = postRequestArray();
$ret = 'INVALID';
// By default nothing is new... ;-)
- $new = false;
+ $new = FALSE;
// Is the cache entry there?
if (isset($GLOBALS['cache_array']['revision'][$type][0])) {
// Check if 'check_revision_data' is setted (switch for manually rewrite the .revision-File)
if ((isGetRequestElementSet('check_revision_data')) && (getRequestElement('check_revision_data') == 'yes')) {
// Forced rebuild of .revision file
- $new = true;
+ $new = TRUE;
} else {
// Check for revision file
if (!isFileReadable($FQFN)) {
// Not found, so we need to create it
- $new = true;
+ $new = TRUE;
} else {
// Revision file found
$ins_vers = explode(chr(10), readFromFile($FQFN));
// Get array for mapping information
$mapper = array_flip($GLOBALS['repository_search_for']);
- //* DEBUG: */ debugOutput('<pre>mapper='.print_r($mapper, true).'</pre>ins_vers=<pre>'.print_r($ins_vers, true).'</pre>');
+ //* DEBUG: */ debugOutput('<pre>mapper='.print_r($mapper, TRUE).'</pre>ins_vers=<pre>'.print_r($ins_vers, TRUE).'</pre>');
// Is the content valid?
if ((!is_array($ins_vers)) || (count($ins_vers) <= 0) || (!isset($ins_vers[$mapper[$type]])) || (trim($ins_vers[$mapper[$type]]) == '') || ($ins_vers[0]) == 'new') {
// File needs update!
- $new = true;
+ $new = TRUE;
} else {
// Generate fake cache entry
foreach ($mapper as $map => $idx) {
}
// Has it been updated?
- if ($new === true) {
+ if ($new === TRUE) {
// Write it
writeToFile($FQFN, implode(chr(10), getArrayFromRepositoryData()));
function setSession ($var, $value) {
// Abort in CSS mode here
if (isCssOutputMode()) {
- return true;
+ return TRUE;
} // END - if
// Trim value and session variable
unset($GLOBALS['_SESSION'][$var]);
if (isPhpVersionEqualNewer('5.3.0')) {
// session_unregister() is deprecated as of 5.3.0
- return true;
+ return TRUE;
} else {
// PHP version < 5.3.0
return session_unregister($var);
$GLOBALS['_SESSION'][$var] = $value;
if (isPhpVersionEqualNewer('5.3.0')) {
// session_unregister() is deprecated as of 5.3.0
- return true;
+ return TRUE;
} else {
// PHP version < 5.3.0
return session_register($var);
// Update session
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'UPDATE:' . $var . '=' . $value);
$GLOBALS['_SESSION'][$var] = $value;
- return true;
+ return TRUE;
}
// Ignored (but valid)
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'IGNORED:' . $var . '=' . $value);
- return true;
+ return TRUE;
}
// Check whether a session variable is set
}
// Destroy user session
-function destroyMemberSession ($destroy = false) {
+function destroyMemberSession ($destroy = FALSE) {
// Reset userid
initMemberId();
// Remove all user data from session
- if ($destroy === true) {
+ if ($destroy === TRUE) {
// Destroy whole session
return session_destroy();
} else {
}
// Destroys the admin session
-function destroyAdminSession ($destroy = true) {
+function destroyAdminSession ($destroy = TRUE) {
// Kill maybe existing session variables including array elements
setAdminId(0);
setAdminMd5('');
setAdminLast('');
// Destroy session if requested and return status
- if ($destroy === true) {
+ if ($destroy === TRUE) {
return session_destroy();
} // END - if
// All fine if we shall not really destroy the session
- return true;
+ return TRUE;
}
// [EOF]
} elseif ((substr($value, -2, 2) == '()') || (substr($value, 0, 1) == '`')) {
// SQL function needs no ticks (')
$SQL .= '`' . $entry . '`=' . SQL_ESCAPE($value) . ',';
- } elseif ('' . bigintval($value, true, false) . '' == '' . $value . '') {
+ } elseif ('' . bigintval($value, TRUE, FALSE) . '' == '' . $value . '') {
// No need for ticks (')
$SQL .= '`' . $entry . '`=' . $value . ',';
} else {
} elseif ((substr($value[$multiDimId], -2, 2) == '()') || (substr($value[$multiDimId], 0, 1) == '`')) {
// SQL function needs no ticks (')
$SQL .= '`' . $entry . '`=' . SQL_ESCAPE($value[$multiDimId]) . ',';
- } elseif (('' . bigintval($value[$multiDimId], true, false) . '' == '' . $value[$multiDimId] . '')) {
+ } elseif (('' . bigintval($value[$multiDimId], TRUE, FALSE) . '' == '' . $value[$multiDimId] . '')) {
// No need for ticks (')
$SQL .= '`' . $entry . '`=' . $value[$multiDimId] . ',';
} else {
} elseif (substr($value, -2, 2) == '()') {
// SQL function needs no ticks (')
$SQL .= SQL_ESCAPE($value) . ',';
- } elseif ('' . bigintval($value, true, false) . '' == '' . $value . '') {
+ } elseif ('' . bigintval($value, TRUE, FALSE) . '' == '' . $value . '') {
// Number detected, no need for ticks (')
$SQL .= bigintval($value) . ',';
} elseif ('' . (float) $value . '' == '' . $value . '') {
loadStatsTable();
// Stats are loaded!
- $GLOBALS['stats_loaded'] = true;
+ $GLOBALS['stats_loaded'] = TRUE;
} // END - if
}
// Loads stats table
function loadStatsTable () {
// Check if the link is up
- if (!SQL_IS_LINK_UP()) return false;
+ if (!SQL_IS_LINK_UP()) return FALSE;
// Is it there for today?
if (!isStatsTableCreated()) {
// Checks if the the statistics table is created
function isStatsTableCreated () {
// Check if the link is up
- if (!SQL_IS_LINK_UP()) return false;
+ if (!SQL_IS_LINK_UP()) return FALSE;
// Ask for it
$result = SQL_QUERY_ESC("SHOW TABLES LIKE '{?_MYSQL_PREFIX?}_stats_%s'",
// Create the dummy table
function createStatsTable () {
// Check if the link is up
- if (!SQL_IS_LINK_UP()) return false;
+ if (!SQL_IS_LINK_UP()) return FALSE;
// Create it here
$result = SQL_QUERY_ESC("CREATE TEMPORARY TABLE IF NOT EXISTS `{?_MYSQL_PREFIX?}_stats_%s` (
// Write all entries to the table
function writeStatsTable () {
// Check if the link is up
- if (!SQL_IS_LINK_UP()) return false;
+ if (!SQL_IS_LINK_UP()) return FALSE;
// Empty the table first
SQL_QUERY_ESC("TRUNCATE `{?_MYSQL_PREFIX?}_stats_%s`",
} // END - foreach
// Load template
- $GLOBALS['__page_header'] .= loadTemplate('css_inline', true, $OUT);
+ $GLOBALS['__page_header'] .= loadTemplate('css_inline', TRUE, $OUT);
} else {
// Now we load all CSS files from css.php!
$OUT = '<link rel="stylesheet" type="text/css" href="{%url=css.php';
} // END - if
// Wrapper until we merged to the EL branch
-function preCompileCode ($code, $template = '', $compiled = false, $full = true, $overwrite = false) {
- return compileCode($code, false, true, $full);
+function preCompileCode ($code, $template = '', $compiled = FALSE, $full = TRUE, $overwrite = FALSE) {
+ return compileCode($code, FALSE, TRUE, $full);
}
// Setter for 'is_template_html'
-function enableTemplateHtml ($enable = true) {
+function enableTemplateHtml ($enable = TRUE) {
$GLOBALS['is_template_html'] = (bool) $enable;
}
// Is the output_mode other than 0 (HTML), then no comments are enabled
if (!isHtmlOutputMode()) {
// No HTML
- return false;
+ return FALSE;
} else {
// Maybe HTML?
return $GLOBALS['is_template_html'];
// "Getter" for color switch code
function getColorSwitchCode ($template) {
// Prepare the code
- $code = "{DQUOTE} . doTemplateColorSwitch('" . $template . "', false, false) . {DQUOTE}";
+ $code = "{DQUOTE} . doTemplateColorSwitch('" . $template . "', FALSE, FALSE) . {DQUOTE}";
// And return it
return $code;
}
// Output HTML code directly or 'render' it. You addionally switch the new-line character off
-function outputHtml ($htmlCode, $newLine = true) {
+function outputHtml ($htmlCode, $newLine = TRUE) {
// Init output
if (!isset($GLOBALS['__output'])) {
$GLOBALS['__output'] = '';
outputRawCode($htmlCode);
// That's why you don't need any \n at the end of your HTML code... :-)
- if ($newLine === true) {
+ if ($newLine === TRUE) {
outputRawCode(chr(10));
} // END - if
} else {
$GLOBALS['__output'] .= $htmlCode;
// That's why you don't need any \n at the end of your HTML code... :-)
- if ($newLine === true) {
+ if ($newLine === TRUE) {
$GLOBALS['__output'] .= chr(10);
} // END - if
}
// The same as above... ^
outputRawCode($htmlCode);
- if ($newLine === true) {
+ if ($newLine === TRUE) {
outputRawCode(chr(10));
} // END - if
break;
}
// Main compilation loop
-function doFinalCompilation ($code, $insertComments = true, $enableCodes = true) {
+function doFinalCompilation ($code, $insertComments = TRUE, $enableCodes = TRUE) {
// Insert comments? (Only valid with HTML templates, of course)
enableTemplateHtml($insertComments);
$count = 0;
// Compile all out
- while (((isInString('{--', $code)) || (isInString('{DQUOTE}', $code)) || (isInString('{?', $code)) || (isInString('{%', $code) !== false)) && ($count < 7)) {
+ while (((isInString('{--', $code)) || (isInString('{DQUOTE}', $code)) || (isInString('{?', $code)) || (isInString('{%', $code) !== FALSE)) && ($count < 7)) {
// Init common variables
$content = array();
$newContent = '';
// Compile it
//* DEBUG: */ debugOutput('<pre>'.linenumberCode($code).'</pre>');
- $eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($code), false, true, $enableCodes)) . '";';
+ $eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($code), FALSE, TRUE, $enableCodes)) . '";';
//* DEBUG: */ if (!$insertComments) print('EVAL=<pre>'.linenumberCode($eval).'</pre>');
eval($eval);
//* DEBUG: */ if (!$insertComments) print('NEW=<pre>'.linenumberCode($newContent).'</pre>');
// Was that eval okay?
if (empty($newContent)) {
// Something went wrong!
- reportBug(__FUNCTION__, __LINE__, 'Evaluation error:<pre>' . linenumberCode($eval) . '</pre>', false);
+ reportBug(__FUNCTION__, __LINE__, 'Evaluation error:<pre>' . linenumberCode($eval) . '</pre>', FALSE);
} // END - if
// Use it again
$code = $newContent;
// Compile the final code if insertComments is true
- if ($insertComments == true) {
+ if ($insertComments == TRUE) {
// ... because SQL queries shall keep OPEN_CONFIG and such in
$code = compileRawCode($code);
} // END - if
} // END - while
// Add debugging data in HTML code, if mode is enabled
- if ((isDebugModeEnabled()) && ($insertComments === true) && ((isHtmlOutputMode()) || (isCssOutputMode()))) {
+ if ((isDebugModeEnabled()) && ($insertComments === TRUE) && ((isHtmlOutputMode()) || (isCssOutputMode()))) {
// Add loop count
$code .= '<!-- Total compilation loop=' . $count . ' //-->';
} // END - if
}
// Load a template file and return it's content (only it's name; do not use ' or ")
-function loadTemplate ($template, $return = false, $content = array(), $compileCode = true) {
+function loadTemplate ($template, $return = FALSE, $content = array(), $compileCode = TRUE) {
// @TODO Remove these sanity checks if all is fine
if (!is_bool($return)) {
// $return has to be boolean
$code = '<!-- Template ' . $template . ' - Start //-->' . $GLOBALS['template_content']['html'][$template] . '<!-- Template ' . $template . ' - End //-->';
// Prepare eval() command
- $GLOBALS['template_eval']['html'][$template] = '$ret = "' . getColorSwitchCode($template) . compileCode(escapeQuotes($code), false, true, true, $compileCode) . '";';
+ $GLOBALS['template_eval']['html'][$template] = '$ret = "' . getColorSwitchCode($template) . compileCode(escapeQuotes($code), FALSE, TRUE, TRUE, $compileCode) . '";';
} elseif (substr($template, 0, 3) == 'js_') {
// JavaScripts don't like entities, dollar signs and timings
- $GLOBALS['template_eval']['html'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($GLOBALS['template_content']['html'][$template]), false, true, true, $compileCode) . '");';
+ $GLOBALS['template_eval']['html'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($GLOBALS['template_content']['html'][$template]), FALSE, TRUE, TRUE, $compileCode) . '");';
} else {
// Prepare eval() command, other output doesn't like entities, maybe
- $GLOBALS['template_eval']['html'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['template_content']['html'][$template]), false, true, true, $compileCode) . '");';
+ $GLOBALS['template_eval']['html'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['template_content']['html'][$template]), FALSE, TRUE, TRUE, $compileCode) . '");';
}
} elseif (isHtmlOutputMode()) {
// Add surrounding HTML comments to help finding bugs faster
$ret = '<!-- Template ' . $template . ' - Start //-->' . $GLOBALS['template_content']['html'][$template] . '<!-- Template ' . $template . ' - End //-->';
- $GLOBALS['template_eval']['html'][$template] = '$ret = "' . getColorSwitchCode($template) . compileRawCode(escapeQuotes($ret), false, true, true, $compileCode) . '";';
+ $GLOBALS['template_eval']['html'][$template] = '$ret = "' . getColorSwitchCode($template) . compileRawCode(escapeQuotes($ret), FALSE, TRUE, TRUE, $compileCode) . '";';
} else {
// JavaScript again
- $GLOBALS['template_eval']['html'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($GLOBALS['template_content']['html'][$template]), false, true, true, $compileCode) . '");';
+ $GLOBALS['template_eval']['html'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($GLOBALS['template_content']['html'][$template]), FALSE, TRUE, TRUE, $compileCode) . '");';
} // END - if
} elseif ((isAdmin()) || ((isInstalling()) && (!isInstalled()))) {
// Only admins shall see this warning or when installation mode is active
</div>
<div class="para">
{--TEMPLATE_CONTENT--}:
- <pre>' . print_r($content, true) . '</pre>
+ <pre>' . print_r($content, TRUE) . '</pre>
</div>';
} else {
// No file!
// Is there some content to output or return?
if (!empty($ret)) {
// Not empty so let's put it out! ;)
- if ($return === true) {
+ if ($return === TRUE) {
// Return the HTML code
return $ret;
} else {
}
} elseif (isDebugModeEnabled()) {
// Warning, empty output!
- return 'E:' . $template . ',content=<pre>' . print_r($content, true) . '</pre>';
+ return 'E:' . $template . ',content=<pre>' . print_r($content, TRUE) . '</pre>';
}
}
}
// Loads an email template and compiles it
-function loadEmailTemplate ($template, $content = array(), $userid = NULL, $loadUserData = true) {
+function loadEmailTemplate ($template, $content = array(), $userid = NULL, $loadUserData = TRUE) {
// Make sure all template names are lowercase!
$template = strtolower($template);
</div>
<div class="para">
{--TEMPLATE_CONTENT--}:
- <pre>' . print_r($content, true) . '</pre>
+ <pre>' . print_r($content, TRUE) . '</pre>
</div>';
// Don't cache this, as there is no template to cache
// Add last error if the required function exists
if (function_exists('error_get_last')) {
// Add last error and some lines for better overview
- $newContent .= "\n--------------------------------------\nDebug:\n" . print_r(error_get_last(), true) . "--------------------------------------\nPlease don't alter these informations!\nThanx.";
+ $newContent .= "\n--------------------------------------\nDebug:\n" . print_r(error_get_last(), TRUE) . "--------------------------------------\nPlease don't alter these informations!\nThanx.";
} // END - if
} // END - if
}
// Compiles the given HTML/mail code
-function compileCode ($code, $simple = false, $constants = true, $full = true, $compileCode = true) {
+function compileCode ($code, $simple = FALSE, $constants = TRUE, $full = TRUE, $compileCode = TRUE) {
// Is the code a string or should we not compile?
- if ((!is_string($code)) || ($compileCode === false)) {
+ if ((!is_string($code)) || ($compileCode === FALSE)) {
// Silently return it
return $code;
} // END - if
// Start couting
- $startCompile = microtime(true);
+ $startCompile = microtime(TRUE);
// Comile the code
$code = compileRawCode($code, $simple, $constants, $full);
// Get timing
- $compilationTime = $startCompile - microtime(true);
+ $compilationTime = $startCompile - microtime(TRUE);
// Add timing if enabled
if (isTemplateHtml()) {
// Compiles the code
// @TODO $simple/$constants are deprecated
-function compileRawCode ($code, $simple = false, $constants = true, $full = true, $compileCode = true) {
+function compileRawCode ($code, $simple = FALSE, $constants = TRUE, $full = TRUE, $compileCode = TRUE) {
// Is the code a string or shall we not compile?
- if ((!is_string($code)) || ($compileCode === false)) {
+ if ((!is_string($code)) || ($compileCode === FALSE)) {
// Silently return it
return $code;
} // END - if
$secChars = $GLOBALS['url_chars'];
// Select full set of chars to replace when we e.g. want to compile URLs
- if ($full === true) {
+ if ($full === TRUE) {
$secChars = $GLOBALS['security_chars'];
} // END - if
$matchesFound = array();
foreach ($matches[0] as $key => $match) {
// Fuzzy look has failed by default
- $fuzzyFound = false;
+ $fuzzyFound = FALSE;
// Fuzzy look on match if already found
foreach ($matchesFound as $found => $set) {
if ($test == $match) {
// Match found
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'fuzzyFound!');
- $fuzzyFound = true;
+ $fuzzyFound = TRUE;
break;
} // END - if
} // END - foreach
// Skip this entry?
- if ($fuzzyFound === true) {
+ if ($fuzzyFound === TRUE) {
continue;
} // END - if
$newMatch = str_replace(array('[', ']', '$'), array("['", "']", '{COMPILE_DOLLAR}'), $match);
$code = str_replace($match, '".' . $newMatch . '."', $code);
$matchesFound[$key . '_' . $matches[3][$key]] = 1;
- $matchesFound[$match] = true;
+ $matchesFound[$match] = TRUE;
} elseif (!isset($matchesFound[$match])) {
// Not yet replaced!
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'match=' . $match);
}
// Insert the code in $img_code into jpeg or PNG image
-function generateImageOrCode ($img_code, $headerSent = true) {
+function generateImageOrCode ($img_code, $headerSent = TRUE) {
// Is the code size oversized or shouldn't we display it?
if ((strlen($img_code) > 6) || (empty($img_code)) || (getCodeLength() == '0')) {
// Stop execution of function here because of over-sized code length
reportBug(__FUNCTION__, __LINE__, 'img_code ' . $img_code .' has invalid length. img_code(length)=' . strlen($img_code) . ' code_length=' . getCodeLength());
- } elseif ($headerSent === false) {
+ } elseif ($headerSent === FALSE) {
// Return an HTML code here
return '<img src="{%url=img.php?code=' . $img_code . '%}" alt="Image" />';
}
}
// Create selection box or array of splitted timestamp
-function createTimeSelections ($timestamp, $prefix = '', $display = '', $align = 'center', $asArray = false) {
+function createTimeSelections ($timestamp, $prefix = '', $display = '', $align = 'center', $asArray = FALSE) {
// Do not continue if ONE_DAY is absend
if (!isConfigEntrySet('ONE_DAY')) {
// Abort here
//
// Now we convert them in seconds...
//
- if ($asArray === true) {
+ if ($asArray === TRUE) {
// Just put all data in an array for later use
$OUT = array(
'Y' => $Y,
} // END - if
// Make sure, that the script realy realy diese here and now
- $GLOBALS['app_died'] = true;
+ $GLOBALS['app_died'] = TRUE;
// Set content type as text/html
setContentType('text/html');
);
// Load the message template
- loadTemplate('app_exit_message', false, $message);
+ loadTemplate('app_exit_message', FALSE, $message);
// Load footer
loadIncludeOnce('inc/footer.php');
// Is the timer started?
if (!isset($GLOBALS['__start_time'])) {
// Abort here
- return false;
+ return FALSE;
} // END - if
// Get end time
- $endTime = microtime(true);
+ $endTime = microtime(TRUE);
// "Explode" both times
$start = explode(' ', $GLOBALS['__start_time']);
);
// Load the template
- $GLOBALS['__page_footer'] .= loadTemplate('show_timings', true, $content);
+ $GLOBALS['__page_footer'] .= loadTemplate('show_timings', TRUE, $content);
}
/**
* @param $sendEmail Wether to send an email to all configured administrators
* @return void
*/
-function reportBug ($F, $L, $message = '', $sendEmail = true) {
+function reportBug ($F, $L, $message = '', $sendEmail = TRUE) {
// Is this already called?
if (isset($GLOBALS[__FUNCTION__])) {
// Other backtrace
setHttpStatus('500 Internal Server Error');
// Mark this function as called
- $GLOBALS[__FUNCTION__] = true;
+ $GLOBALS[__FUNCTION__] = TRUE;
// Init message
$debug = '';
$debug .= '<div class="para">Thank you for finding bugs.</div>';
// Send an email? (e.g. not wanted for evaluation errors)
- if (($sendEmail === true) && (!isInstallationPhase())) {
+ if (($sendEmail === TRUE) && (!isInstallationPhase())) {
// Prepare content
$content = array(
'message' => trim($message),
}
// Compile characters which are allowed in URLs
-function compileUriCode ($code, $simple = true) {
+function compileUriCode ($code, $simple = TRUE) {
// Trim code
$test = trim($code);
);
// Compile constants
- if ($simple === false) {
+ if ($simple === FALSE) {
// Add more 'from'
array_push($charsCompile['from'], '{--', '--}');
$message = getMessageFromErrorCode(getRequestElement('code'));
// Load message template
- loadTemplate('message', false, $message);
+ loadTemplate('message', FALSE, $message);
} // END - if
}
// Flushes non-flushed template cache to disk
function flushTemplateCache ($prefix, $template, $eval) {
// Is this cache flushed?
- if ((isDebuggingTemplateCache() === false) && (isTemplateCached($prefix, $template) === false) && ($eval != '404')) {
+ if ((isDebuggingTemplateCache() === FALSE) && (isTemplateCached($prefix, $template) === FALSE) && ($eval != '404')) {
// Generate FQFN
$FQFN = generateCacheFqfn($prefix, $template);
} // END - if
// And flush it
- writeToFile($FQFN, $eval, true);
+ writeToFile($FQFN, $eval, TRUE);
} // END - if
}
}
// Escapes quotes (default is only double-quotes)
-function escapeQuotes ($str, $single = false) {
+function escapeQuotes ($str, $single = FALSE) {
// Should we escape all?
- if ($single === true) {
+ if ($single === TRUE) {
// Escape all (including null)
$str = addslashes($str);
} else {
}
// Generates a 'selection box' from given array
-function generateSelectionBoxFromArray ($options, $name, $optionKey, $optionContent = '', $extraName = '', $templateName = '', $default = NULL, $nameElement = '', $allowNone = false, $useDefaultAsArray = false) {
+function generateSelectionBoxFromArray ($options, $name, $optionKey, $optionContent = '', $extraName = '', $templateName = '', $default = NULL, $nameElement = '', $allowNone = FALSE, $useDefaultAsArray = FALSE) {
// Default is empty
$addKey = '';
// Use default value as array key?
- if ($useDefaultAsArray === true) {
+ if ($useDefaultAsArray === TRUE) {
// Then set it
$addKey = '[' . convertNullToZero($default) . ']';
} // END - if
<option value="X" disabled="disabled">{--PLEASE_SELECT--}</option>';
// Allow none?
- if ($allowNone === true) {
+ if ($allowNone === TRUE) {
// Then add it
$OUT .= '<option value="0">{--SELECT_NONE--}</option>';
} // END - if
// Is a template name given?
if (empty($templateName)) {
// ... $name template
- $OUT .= loadTemplate('select_' . $name . $extraName . '_option', true, $option);
+ $OUT .= loadTemplate('select_' . $name . $extraName . '_option', TRUE, $option);
} else {
// ... $templateName template
- $OUT .= loadTemplate('select_' . $templateName . $extraName . '_option', true, $option);
+ $OUT .= loadTemplate('select_' . $templateName . $extraName . '_option', TRUE, $option);
}
} else {
// ... direct HTML code
// Load template and return it
if (empty($templateName)) {
// Use name from $name + $extraName
- return loadTemplate('select_' . $name . $extraName . '_box', true, $content);
+ return loadTemplate('select_' . $name . $extraName . '_box', TRUE, $content);
} else {
// Use name from $templateName + $extraName
- return loadTemplate('select_' . $templateName . $extraName . '_box', true, $content);
+ return loadTemplate('select_' . $templateName . $extraName . '_box', TRUE, $content);
}
}
}
// Displays given message in admin_settings_saved template
-function displayMessage ($message, $return = false) {
+function displayMessage ($message, $return = FALSE) {
// Load the template
return loadTemplate('admin_settings_saved', $return, $message);
}
//-----------------------------------------------------------------------------
// Color-switch helper function
-function doTemplateColorSwitch ($templateName, $clear = false, $return = true) {
+function doTemplateColorSwitch ($templateName, $clear = FALSE, $return = TRUE) {
// Is it there?
if (!isset($GLOBALS['color_switch'][$templateName])) {
// Initialize it
initTemplateColorSwitch($templateName);
- } elseif ($clear === false) {
+ } elseif ($clear === FALSE) {
// Switch color if called from loadTemplate()
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'SWITCH:' . $templateName);
$GLOBALS['color_switch'][$templateName] = 3 - $GLOBALS['color_switch'][$templateName];
}
// Return CSS class name
- if ($return === true) {
+ if ($return === TRUE) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'RETURN:' . $templateName . '=' . $GLOBALS['color_switch'][$templateName]);
return 'switch_sw' . $GLOBALS['color_switch'][$templateName];
} // END - if
}
// Template helper function to create selection box for "locked points mode"
-function doTemplatePointsLockedModeSelectionBox ($templateName, $clear = false, $default = NULL) {
+function doTemplatePointsLockedModeSelectionBox ($templateName, $clear = FALSE, $default = NULL) {
// Init array
$lockedModes = array(
0 => array('mode' => 'LOCKED'),
}
// Template helper function to create selection box for payment method
-function doTemplatePointsPaymentMethodSelectionBox ($templateName, $clear = false, $default = NULL) {
+function doTemplatePointsPaymentMethodSelectionBox ($templateName, $clear = FALSE, $default = NULL) {
// Init array
$paymentMethods = array(
0 => array('method' => 'DIRECT'),
}
// Writes content to a file
-function writeToFile ($FQFN, $content, $aquireLock = false) {
+function writeToFile ($FQFN, $content, $aquireLock = FALSE) {
// Is the file writeable?
if ((isFileReadable($FQFN)) && (!is_writeable($FQFN)) && (!changeMode($FQFN, 0644))) {
// Not writeable!
logDebugMessage(__FUNCTION__, __LINE__, sprintf("File %s not writeable.", basename($FQFN)));
// Failed! :(
- return false;
+ return FALSE;
} // END - if
// By default all is failed...
- $GLOBALS['file_readable'][$FQFN] = false;
+ $GLOBALS['file_readable'][$FQFN] = FALSE;
unset($GLOBALS['file_content'][$FQFN]);
- $return = false;
+ $return = FALSE;
// Is the function there?
if (function_exists('file_put_contents')) {
// With lock?
- if ($aquireLock === true) {
+ if ($aquireLock === TRUE) {
// Write it directly with lock
$return = file_put_contents($FQFN, $content, LOCK_EX);
} else {
$fp = fopen($FQFN, 'w') or reportBug(__FUNCTION__, __LINE__, 'Cannot write to file ' . basename($FQFN) . '!');
// Aquire a lock?
- if ($aquireLock === true) {
+ if ($aquireLock === TRUE) {
// Aquire a lock.
flock($fp, LOCK_EX);
} // END - if
}
// Was something written?
- if ($return !== false) {
+ if ($return !== FALSE) {
// Mark it as readable
- $GLOBALS['file_readable'][$FQFN] = true;
+ $GLOBALS['file_readable'][$FQFN] = TRUE;
// Remember content in cache
$GLOBALS['file_content'][$FQFN] = $content;
} // END - if
// Return status
- return (($return !== false) && (changeMode($FQFN, 0644)));
+ return (($return !== FALSE) && (changeMode($FQFN, 0644)));
}
// Clears the output buffer. This function does *NOT* backup sent content.
} // END - if
// Mark this function as called
- $GLOBALS[__FUNCTION__] = true;
+ $GLOBALS[__FUNCTION__] = TRUE;
}
// Encode strings
// "Getter" for remote IP number
function detectRemoteAddr () {
// Get remote ip from environment
- $remoteAddr = determineRealRemoteAddress(true);
+ $remoteAddr = determineRealRemoteAddress(TRUE);
// Is removeip installed?
if (isExtensionActive('removeip')) {
}
// "Getter" for user agent
-function detectUserAgent ($alwaysReal = false) {
+function detectUserAgent ($alwaysReal = FALSE) {
// Get remote ip from environment
$userAgent = getenv('HTTP_USER_AGENT');
// Is removeip installed?
- if ((isExtensionActive('removeip')) && ($alwaysReal === false)) {
+ if ((isExtensionActive('removeip')) && ($alwaysReal === FALSE)) {
// Then anonymize it
$userAgent = getAnonymousUserAgent($userAgent);
} // END - if
// Checks whether the hourly reset mode is active
function isHourlyResetEnabled () {
// Now simply check it
- return ((isset($GLOBALS['hourly_enabled'])) && ($GLOBALS['hourly_enabled'] === true));
+ return ((isset($GLOBALS['hourly_enabled'])) && ($GLOBALS['hourly_enabled'] === TRUE));
}
// Checks whether the reset mode is active
function isResetModeEnabled () {
// Now simply check it
- return ((isset($GLOBALS['reset_enabled'])) && ($GLOBALS['reset_enabled'] === true));
+ return ((isset($GLOBALS['reset_enabled'])) && ($GLOBALS['reset_enabled'] === TRUE));
}
// Checks whether the debug mode is enabled
// even if there is no xdebug extension installed.
function copyFileVerified ($source, $dest, $chmod = '') {
// Failed is the default
- $status = false;
+ $status = FALSE;
// Is the source file there?
if (!isFileReadable($source)) {
reportBug(__FUNCTION__, __LINE__, 'copy() has failed to copy the file.');
} else {
// Reset cache
- $GLOBALS['file_readable'][$dest] = true;
+ $GLOBALS['file_readable'][$dest] = TRUE;
}
// All fine by default
- $status = true;
+ $status = TRUE;
// If there are chmod rights set, apply them
if (!empty($chmod)) {
// Is the file there?
if (isFileReadable($FQFN)) {
// Reset cache first
- $GLOBALS['file_readable'][$FQFN] = false;
+ $GLOBALS['file_readable'][$FQFN] = FALSE;
// Yes, so remove it
return unlink($FQFN);
// All fine if no file was removed. If we change this to 'false' or rewrite
// above if() block it would be to restrictive.
- return true;
+ return TRUE;
}
// Wrapper for $_POST['sel']
// Checks whether the config-local.php is loaded
function isConfigLocalLoaded () {
- return ((isset($GLOBALS['config_local_loaded'])) && ($GLOBALS['config_local_loaded'] === true));
+ return ((isset($GLOBALS['config_local_loaded'])) && ($GLOBALS['config_local_loaded'] === TRUE));
}
// Checks whether a nickname or userid was entered and caches the result
// Is the cache there
if (!isset($GLOBALS[__FUNCTION__][$userid])) {
// Determine it
- $GLOBALS[__FUNCTION__][$userid] = ((!empty($userid)) && (('' . bigintval($userid, true, false) . '') != $userid) && ($userid != 'NULL'));
+ $GLOBALS[__FUNCTION__][$userid] = ((!empty($userid)) && (('' . bigintval($userid, TRUE, FALSE) . '') != $userid) && ($userid != 'NULL'));
} // END - if
// Return the result
}
// Getter for 'what' value
-function getWhat ($strict = true) {
+function getWhat ($strict = TRUE) {
// Default is null
$what = NULL;
$isset = (isset($GLOBALS['__what']) && (!empty($GLOBALS['__what'])));
// Should we abort here?
- if (($strict === true) && ($isset === false)) {
+ if (($strict === TRUE) && ($isset === FALSE)) {
// Output backtrace
debug_report_bug(__FUNCTION__, __LINE__, 'what is empty.');
} // END - if
}
// Getter for 'action' value
-function getAction ($strict = true) {
+function getAction ($strict = TRUE) {
// Default is null
$action = NULL;
$isset = ((isset($GLOBALS['__action'])) && (!empty($GLOBALS['__action'])));
// Should we abort here?
- if (($strict === true) && ($isset === false)) {
+ if (($strict === TRUE) && ($isset === FALSE)) {
// Output backtrace
reportBug(__FUNCTION__, __LINE__, 'action is empty.');
} // END - if
}
// Getter for 'module' value
-function getModule ($strict = true) {
+function getModule ($strict = TRUE) {
// Default is null
$module = NULL;
$isset = ((isset($GLOBALS['__module'])) && (!empty($GLOBALS['__module'])));
// Should we abort here?
- if (($strict === true) && ($isset === false)) {
+ if (($strict === TRUE) && ($isset === FALSE)) {
// Output backtrace
reportBug(__FUNCTION__, __LINE__, 'Module is empty.');
} // END - if
// Return it
- return (($isset === true) && ($GLOBALS['__module'] != 'unknown')) ;
+ return (($isset === TRUE) && ($GLOBALS['__module'] != 'unknown')) ;
}
// Getter for 'output_mode' value
$isset = (isset($GLOBALS['__output_mode']));
// Should we abort here?
- if (($strict === true) && ($isset === false)) {
+ if (($strict === TRUE) && ($isset === FALSE)) {
// Output backtrace
reportBug(__FUNCTION__, __LINE__, 'Output mode is not set.');
} // END - if
}
// Enables block-mode
-function enableBlockMode ($enabled = true) {
+function enableBlockMode ($enabled = TRUE) {
$GLOBALS['__block_mode'] = $enabled;
}
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isCurrentUserIdSet()=false - ABORTING!');
// Abort here
- return false;
+ return FALSE;
} // END - if
// Is it cached?
// Wrapper for strpos() to ease porting from deprecated ereg() function
function isInString ($needle, $haystack) {
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'needle=' . $needle . ', haystack=' . $haystack . ', returned=' . intval(strpos($haystack, $needle) !== false));
- return (strpos($haystack, $needle) !== false);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'needle=' . $needle . ', haystack=' . $haystack . ', returned=' . intval(strpos($haystack, $needle) !== FALSE));
+ return (strpos($haystack, $needle) !== FALSE);
}
// Wrapper for strpos() to ease porting from deprecated eregi() function
if (!isset($GLOBALS[__FUNCTION__])) {
// Then do it
if (isExtensionActive('user')) {
- $GLOBALS[__FUNCTION__] = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true, runFilterChain('user_exclusion_sql', ' '));
+ $GLOBALS[__FUNCTION__] = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', TRUE, runFilterChain('user_exclusion_sql', ' '));
} else {
$GLOBALS[__FUNCTION__] = 0;
}
if (!isset($GLOBALS[__FUNCTION__])) {
// Then do it
if (isExtensionActive('user')) {
- $GLOBALS[__FUNCTION__] = countSumTotalData('UNCONFIRMED', 'user_data', 'userid', 'status', true, runFilterChain('user_exclusion_sql', ' '));
+ $GLOBALS[__FUNCTION__] = countSumTotalData('UNCONFIRMED', 'user_data', 'userid', 'status', TRUE, runFilterChain('user_exclusion_sql', ' '));
} else {
$GLOBALS[__FUNCTION__] = 0;
}
if (!isset($GLOBALS[__FUNCTION__])) {
// Then do it
if (isExtensionActive('user')) {
- $GLOBALS[__FUNCTION__] = countSumTotalData('LOCKED', 'user_data', 'userid', 'status', true, runFilterChain('user_exclusion_sql', ' '));
+ $GLOBALS[__FUNCTION__] = countSumTotalData('LOCKED', 'user_data', 'userid', 'status', TRUE, runFilterChain('user_exclusion_sql', ' '));
} else {
$GLOBALS[__FUNCTION__] = 0;
}
if (!isset($GLOBALS[__FUNCTION__])) {
// Then do it
if (isExtensionInstalledAndNewer('user', '0.3.4')) {
- $GLOBALS[__FUNCTION__] = countSumTotalData('{?user_min_confirmed?}', 'user_data', 'userid', 'rand_confirmed', true, runFilterChain('user_exclusion_sql', ' '), '>=');
+ $GLOBALS[__FUNCTION__] = countSumTotalData('{?user_min_confirmed?}', 'user_data', 'userid', 'rand_confirmed', TRUE, runFilterChain('user_exclusion_sql', ' '), '>=');
} else {
$GLOBALS[__FUNCTION__] = 0;
}
// Encodes entities
function encodeEntities ($str) {
// Secure it first
- $str = secureString($str, true, true);
+ $str = secureString($str, TRUE, TRUE);
// Encode dollar sign as well
$str = str_replace('$', '$', $str);
// "Getter" for total available receivers
function getTotalReceivers ($mode = 'normal') {
// Get num rows
- $numRows = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true, runFilterChain('user_exclusion_sql', ' AND `receive_mails` > 0' . runFilterChain('exclude_users', $mode)));
+ $numRows = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', TRUE, runFilterChain('user_exclusion_sql', ' AND `receive_mails` > 0' . runFilterChain('exclude_users', $mode)));
// Return value
return $numRows;
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$userid])) {
// Determine it
- $GLOBALS[__FUNCTION__][$userid] = countSumTotalData($userid, 'user_links', 'id', 'userid', true);
+ $GLOBALS[__FUNCTION__][$userid] = countSumTotalData($userid, 'user_links', 'id', 'userid', TRUE);
} // END - if
// Return cache
// Checks whether frameset_mode is set to true
function isFramesetModeEnabled () {
// Check it
- return ((isset($GLOBALS['frameset_mode'])) && ($GLOBALS['frameset_mode'] === true));
+ return ((isset($GLOBALS['frameset_mode'])) && ($GLOBALS['frameset_mode'] === TRUE));
}
// Function to determine correct 'what' value
function convertSelectionsToEpocheTimeInPostData ($id) {
// Init variables
$content = array();
- $skip = false;
+ $skip = FALSE;
// Get all POST data
$postData = postRequestArray();
// Wraps checking if given points account type matches with given in POST data
function ifPointsAccountTypeMatchesPost ($type) {
// Check condition
- exit(__FUNCTION__.':type='.$type.',post=<pre>'.print_r(postRequestArray(), true).'</pre>');
+ exit(__FUNCTION__.':type='.$type.',post=<pre>'.print_r(postRequestArray(), TRUE).'</pre>');
}
// Gets given user's total referral
// Is the level NULL?
if (is_null($level)) {
// Get total amount (all levels)
- $GLOBALS[__FUNCTION__][$userid][$level] = countSumTotalData($userid, 'user_refs', 'refid', 'userid', true);
+ $GLOBALS[__FUNCTION__][$userid][$level] = countSumTotalData($userid, 'user_refs', 'refid', 'userid', TRUE);
} else {
// Get it from user refs
- $GLOBALS[__FUNCTION__][$userid][$level] = countSumTotalData($userid, 'user_refs', 'refid', 'userid', true, ' AND `level`=' . bigintval($level));
+ $GLOBALS[__FUNCTION__][$userid][$level] = countSumTotalData($userid, 'user_refs', 'refid', 'userid', TRUE, ' AND `level`=' . bigintval($level));
}
} // END - if
} // END - if
// Calls back a function based on given XML template data
-function showEntriesByXmlCallback ($template, $content = array(), $compileCode = true) {
+function showEntriesByXmlCallback ($template, $content = array(), $compileCode = TRUE) {
// Generate FQFN for with special path
$FQFN = sprintf("%stemplates/xml/%s%s.xml",
getPath(),
$templateContent = readFromFile($FQFN);
// Prepare it for finaly eval() command
- $GLOBALS['template_eval']['xml'][$template] = '$templateContent = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($templateContent), false, true, true, $compileCode) . '");';
+ $GLOBALS['template_eval']['xml'][$template] = '$templateContent = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($templateContent), FALSE, TRUE, TRUE, $compileCode) . '");';
// Eval the code, this does insert any array elements from $content
eval($GLOBALS['template_eval']['xml'][$template]);
$xmlParser = xml_parser_create();
// Force case-folding to on
- xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, true);
+ xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, TRUE);
// Set UTF-8
xml_parser_set_option($xmlParser, XML_OPTION_TARGET_ENCODING, 'UTF-8');
// Searches in given XML array for value and returns the parent index
function searchXmlArray ($value, $columns, $childKey) {
// Default is not found
- $return = false;
+ $return = FALSE;
// Walk through whole array
foreach ($columns as $key => $columnArray) {
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module/what and output mode
$GLOBALS['__module'] = 'index';
$content['module'] = 'index';
// Load template
- loadTemplate('index_forward', false, $content);
+ loadTemplate('index_forward', FALSE, $content);
} // END - if
// Footer (which will call doShutdown() for us)
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Tell every module / require file we are installing
-$GLOBALS['__mailer_installing'] = true;
+$GLOBALS['__mailer_installing'] = TRUE;
// Set module and output mode
$GLOBALS['__module'] = 'install';
);
// Load main installation table
- loadTemplate('install_main_ajax', false, $content);
+ loadTemplate('install_main_ajax', FALSE, $content);
} elseif (isPlainInstaller()) {
// Plain installer:
// Load include file
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// This is a fake-CSS file loader, more a JavaScript loader...
// This is in one way good and in one not. The whole reset part will be
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module and output mode
$GLOBALS['__module'] = 'lead-confirm';
} // END - if
// Load the lead template
-loadTemplate('lead_code', false, $content);
+loadTemplate('lead_code', FALSE, $content);
// Footer
loadIncludeOnce('inc/footer.php');
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module / output mode
$GLOBALS['__module'] = 'login';
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Tell everyone we are in this module
$GLOBALS['__module'] = 'mailid';
$errorCode = '';
// This is a frameset module
-$GLOBALS['frameset_mode'] = true;
+$GLOBALS['frameset_mode'] = TRUE;
// Disable copyright footer which would break the frameset
$GLOBALS['__copyright_enabled'] = 'N';
// 01 1 12 2 2 21 1 2210
if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalErrorsDetected())) {
// Init result
- $result_link = false;
+ $result_link = FALSE;
// Maybe he wants to confirm an email?
if ($mailId > 0) {
list($pay) = SQL_FETCHROW($result);
$time = getPaymentData($pay, 'time');
$payment = getPaymentData($pay, 'payment');
- $isValid = true;
+ $isValid = TRUE;
} // END - if
// Free memory
if (SQL_NUMROWS($result) == 1) {
list($points, $time) = SQL_FETCHROW($result);
$payment = '0.00000';
- $isValid = true;
+ $isValid = TRUE;
} // END - if
// Free memory
loadIncludeOnce('inc/header.php');
// Was that mail a valid one?
- if ($isValid === true) {
+ if ($isValid === TRUE) {
// If time is zero seconds we have a sponsor mail. 1 Second shall be set to avoid problems
if (($time == '0') && ($payment > 0)) {
$url = getUrl();
);
// Load template
- loadTemplate('mailid_frames', false, $content);
+ loadTemplate('mailid_frames', FALSE, $content);
} else {
$errorCode = getCode('DATA_INVALID');
}
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Tell everyone we are in this module
$GLOBALS['__module'] = 'mailid';
$data = SQL_FETCHARRAY($result_main);
// Init result here with invalid to avoid possible missing variable
- $result_mailid = false;
+ $result_mailid = FALSE;
// @TODO Rewrite this to a filter/function
switch ($data['link_type']) {
} // END - if
// Is the user id valid?
- if (fetchUserData($userId) === true) {
+ if (fetchUserData($userId) === TRUE) {
// Is the user status CONFIRMED?
if (getUserData('status') == 'CONFIRMED') {
// User has confirmed his account so we can procede...
list($pay) = SQL_FETCHROW($result);
$time = getPaymentData($pay, 'time');
$payment = getPaymentData($pay, 'payment');
- $isValid = true;
+ $isValid = TRUE;
} // END - if
// Free memory...
// Entry found?
if (SQL_NUMROWS($result) == 1) {
list($time, $payment) = SQL_FETCHROW($result);
- $isValid = true;
+ $isValid = TRUE;
} // END - if
// Free memory...
} // END - switch
// Is this entry valid?
- if ($isValid === true) {
+ if ($isValid === TRUE) {
if (($time == '0') && ($payment > 0)) $time = 1;
if (($time > 0) && ($payment > 0)) {
$realCode = '0';
} // END - switch
// Export data into constants for the template
- $content['banner'] = loadTemplate('mailid_banner', true);
+ $content['banner'] = loadTemplate('mailid_banner', TRUE);
// Only when user extension = v0.1.2: Update mails-confirmed counter
// @TODO Rewrite these blocks to filter
$content['points'] = $payment;
// Load template
- loadTemplate($template, false, $content);
+ loadTemplate($template, FALSE, $content);
} elseif (isValidUserId($data['sender'])) {
// Wrong image code! So add points to sender's account
initReferralSystem();
$content['points'] = $payment;
// Load template
- loadTemplate('mailid_points_failed', false, $content);
+ loadTemplate('mailid_points_failed', FALSE, $content);
} else {
// Add payment points (again)
$content['points'] = $payment;
// Load template
- loadTemplate('mailid_points_failed2', false, $content);
+ loadTemplate('mailid_points_failed2', FALSE, $content);
}
// Remove link from table
$content['userid'] = $userId;
$content['type'] = $type;
$content['data'] = $urlId;
- $content['banner'] = loadTemplate('mailid_banner', true);
+ $content['banner'] = loadTemplate('mailid_banner', TRUE);
if (getCodeLength() > 0) {
// Generate Code
$content['image'] = generateCaptchaCode($code, $type, $urlId, $userId);
}
// Load template
- loadTemplate($templ, false, $content);
+ loadTemplate($templ, FALSE, $content);
} else {
// Cannot confirm!
reportBug(__FILE__, __LINE__, 'No code given.');
$content['type'] = $type;
$content['data'] = $urlId;
$content['rand'] = getRandomTan();
- $content['banner'] = loadTemplate('mailid_banner', true);
+ $content['banner'] = loadTemplate('mailid_banner', TRUE);
// Load template
- loadTemplate('mailid_timer', false, $content);
+ loadTemplate('mailid_timer', FALSE, $content);
break;
default: // Unknown mode
break;
} // END - switch
} else {
- loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (6)');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--MAIL_ALREADY_CONFIRMED--} (6)');
$do = 'failed';
}
} else {
- loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (5)');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--MAIL_ALREADY_CONFIRMED--} (5)');
$do = 'failed';
}
} else {
- loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (4)');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--MAIL_ALREADY_CONFIRMED--} (4)');
$do = 'failed';
}
} else {
- loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (3)');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--MAIL_ALREADY_CONFIRMED--} (3)');
$do = 'failed';
}
} else {
- loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (2)');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--MAIL_ALREADY_CONFIRMED--} (2)');
$do = 'failed';
}
// Free result
SQL_FREERESULT($result_mailid);
} else {
- loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (1)');
+ loadTemplate('admin_settings_unsaved', FALSE, '{--MAIL_ALREADY_CONFIRMED--} (1)');
$do = 'failed';
}
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Init output mode and module
$GLOBALS['__module'] = 'unknown';
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module and output mode (raw)
$GLOBALS['__module'] = 'network-vcheck';
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module
$GLOBALS['__module'] = 'ref';
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set this because we have no module in URI
$GLOBALS['__module'] = 'show_bonus';
$content = merge_array($content, $GLOBALS['ranking_content']);
// Load pre-template
- $content['message'] = loadTemplate('show_bonus_msg', true, $content);
+ $content['message'] = loadTemplate('show_bonus_msg', TRUE, $content);
} else {
// No data found
$content['message'] = '<span class="bad">{--BONUS_SHOW_NO_DATA--}</span>';
}
// Load send_bonus header template (for your banners, e.g.?)
-$content['header'] = loadTemplate('show_bonus_header', true);
+$content['header'] = loadTemplate('show_bonus_header', TRUE);
// Load show_bonus footer template (for your banners, e.g.?)
-$content['footer'] = loadTemplate('show_bonus_footer', true);
+$content['footer'] = loadTemplate('show_bonus_footer', TRUE);
// Load final template
-loadTemplate('show_bonus', false, $content);
+loadTemplate('show_bonus', FALSE, $content);
// Include footer
loadIncludeOnce('inc/footer.php');
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module / output mode
$GLOBALS['__module'] = 'sponsor_confirm';
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module / output mode
$GLOBALS['__module'] = 'sponsor_ref';
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module output mode
$GLOBALS['__module'] = 'surfbar';
);
// Load template for "stats" page
- loadTemplate('surfbar_frame_stats', false, $content);
+ loadTemplate('surfbar_frame_stats', FALSE, $content);
} elseif ((!isFullPage()) && (getRequestElement('frame') == 'textlinks')) {
// Prepare content
$content = array(
);
// Load template for "stats" page
- loadTemplate('surfbar_frame_textlinks', false, $content);
+ loadTemplate('surfbar_frame_textlinks', FALSE, $content);
} else {
// Prepare content
$content = array(
);
// Load template for stopped surfbar
- loadTemplate('surfbar_stopped', false, $content);
+ loadTemplate('surfbar_stopped', FALSE, $content);
}
} elseif ((isGetRequestElementSet('check')) && (isGetRequestElementSet('id')) && (isGetRequestElementSet('salt'))) {
// Dummy next id get
$templateName = determineSurfbarTemplateName();
// Load that template
- //* DEBUG: */ exit('templateName=' . $templateName . '<br /><strong>content</strong>=<pre>' . print_r($content, true) . '</pre>');
- loadTemplate($templateName, false, $content);
+ //* DEBUG: */ exit('templateName=' . $templateName . '<br /><strong>content</strong>=<pre>' . print_r($content, TRUE) . '</pre>');
+ loadTemplate($templateName, FALSE, $content);
}
// Load footer
<extra-parameter-list>
</extra-parameter-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="true" />
<!--
<extra-parameter-list>
</extra-parameter-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="true" />
<!--
<extra-parameter-list>
</extra-parameter-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="true" />
<!--
<extra-parameter-list>
</extra-parameter-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="true" />
<!--
<extra-parameter-list>
</extra-parameter-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="true" />
<!--
<extra-parameter-list>
</extra-parameter-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="true" />
<!--
</extra-parameter-list-entry>
</extra-parameter-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="false" />
<!--
<extra-parameter-list>
</extra-parameter-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="false" />
<!--
<extra-parameter-list-entry name="" type="string" value="" />
</extra-parameter-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="false" />
<!--
</extra-parameter-list-entry>
</extra-parameter-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="false" />
<!--
<time-columns-list>
</time-columns-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="true" />
<!--
<time-columns-list>
</time-columns-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="true" />
<!--
<time-columns-list>
</time-columns-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="true" />
<!--
<time-columns-list>
</time-columns-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="true" />
<!--
<time-columns-list>
</time-columns-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="true" />
<!--
<time-columns-list>
</time-columns-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="false" />
<!--
<time-columns-list>
</time-columns-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="false" />
<!--
<time-columns-list>
</time-columns-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="false" />
<!--
<time-columns-list>
</time-columns-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="false" />
<!--
<time-columns-list>
</time-columns-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="false" />
<!--
<time-columns-list>
</time-columns-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="false" />
<!--
<time-columns-list>
</time-columns-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="false" />
<!--
<status-change-list-entry name="url_status" type="string" old="LOCKED" value="ACTIVE" />
</status-change-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="true" />
<!--
//-->
<status-change-column name="" type="string" value="url_status" />
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="false" />
<!--
<status-change-list-entry name="url_status" type="string" old="DELETED" value="ACTIVE" />
</status-change-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="true" />
<!--
<extra-parameter-list-entry name="" type="string" value="" />
</extra-parameter-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="false" />
<!--
</extra-parameter-list-entry>
</extra-parameter-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="false" />
<!--
<extra-parameter-list>
</extra-parameter-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="true" />
<!--
</extra-parameter-list-entry>
</extra-parameter-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="false" />
<!--
And all column names to read/write, leave this list tag empty for all (*).
//-->
<database-column-list>
+ <!--
+ Only handle this column in a special function.
+ //-->
+ <database-column-list-entry name="" type="string" table="" value="subid" alias="" function="" />
</database-column-list>
<!--
"Filter" call-back functions to call back for piping the fetched data
through (can be left empty, no call-back function will be called)
//-->
<callback-function-list>
+ <!--
+ Use again prepareSubId() to validate it.
+ //-->
+ <callback-function-list-entry name="" type="string" value="validateSubId" />
</callback-function-list>
<!--
Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
<time-columns-list>
</time-columns-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="true" />
<!--
<time-columns-list>
</time-columns-list>
<!--
- Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+ Wether to 'edit/delete/change' (change) the entries (TRUE) or just read them for displaying (FALSE)
//-->
<enable-modify-entries name="" type="bool" value="false" />
<!--
require('inc/libs/security_functions.php');
// Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
// Set module
$GLOBALS['__module'] = 'view';
setContentType('image/' . substr($data['url'], -3, 3));
// Redirect
- redirectToUrl($data['url'], false);
+ redirectToUrl($data['url'], FALSE);
} else {
// @TODO No banner found, output some default banner
logDebugMessage(__FILE__, __LINE__, 'Banner ' . bigintval(getRequestElement('banner')) . ' not dound.');