./inc/modules/member/what-payout.php:229: // @TODO Rewrite this to a filter
./inc/modules/member/what-points.php:54:// @TODO Should we rewrite this to a filter?
./inc/modules/member/what-rallyes.php:89: // @TODO Reactivate this: $content['admin'] = "<a href=\"{?URL?}/modules.php?module=index&what=impressum&admin=".$content['admin_id']."\">".$content['login']."</a>";
-./inc/modules/member/what-stats.php:115: // @TODO Rewrite in template: stamp->timestamp_ordered,recs->max_rec,clix->clicks,perc->percents
-./inc/modules/member/what-stats.php:68: // @TODO Rewrite in template subj->subject,stamp->timestamp,recs->target_send
+./inc/modules/member/what-stats.php:118: // @TODO Rewrite in template: clix->clicks
./inc/modules/member/what-transfer.php:101: // @TODO Rewrite this to a filter
./inc/modules/member/what-transfer.php:143: // @TODO Rewrite this to a filter
./inc/modules/member/what-transfer.php:233: // @TODO Try to rewrite his to $content = SQL_FETCHARRAY(), see some lines above for two different queries
} elseif (($status != 'CONFIRMED') && ($status != 'failed')) {
// Maybe locked/unconfirmed account?
$errorCode = generateErrorCodeFromUserStatus($status);
- } elseif (($userid == '0') || ($status == 'failed')) {
+ } elseif (($userid == 0) || ($status == 'failed')) {
// Inalid or locked account, so let's find out
$result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE nickname='%s' LIMIT 1",
array(getRequestElement('userid')), __FILE__, __LINE__);
// Add points to account
// @TODO Try to rewrite the following unset()
unset($GLOBALS['ref_level']);
- addPointsThroughReferalSystem('birthday_confirm', $userid, $data['points'], false, '0', $locked, strtolower(getConfig('birthday_mode')));
+ addPointsThroughReferalSystem('birthday_confirm', $userid, $data['points'], false, 0, $locked, strtolower(getConfig('birthday_mode')));
// Remove entry from table
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_birthday` WHERE `userid`=%s AND `chk_value`='%s' LIMIT 1",
$content['payout_time'] = getMessage('DOUBLER_PAYOUT_TIME_' . getConfig('doubler_send_mode'));
// Generate table with already payed out doubles
-$content['payout_history'] = generateDoublerTable('0', 'Y', 'N', 'DESC');
+$content['payout_history'] = generateDoublerTable(0, 'Y', 'N', 'DESC');
// Generate timemark
$content['timeout_mark'] = createFancyTime(getConfig('doubler_timeout'));
// Add points from deleted accounts to jackpot, but here just add to notify mail
if ($admin_points > 0) {
// Send mail to admin
- sendAdminNotification(getMessage('AUTOPURGE_ADMIN_SUBJECT'), "admin_autopurge_points", translateComma($points), '0');
+ sendAdminNotification(getMessage('AUTOPURGE_ADMIN_SUBJECT'), "admin_autopurge_points", translateComma($points), 0);
} // END - if
// Run all SQLs here
$UIDs .= $content['userid'].", ";
// Get date/time from timestamp
- $content['last_online'] = generateDateTime($content['last_online'], '0');
+ $content['last_online'] = generateDateTime($content['last_online'], 0);
// Load mail template
$message = loadEmailTemplate('member_autopurge_inactive', $content, bigintval($content['userid']));
$UIDs .= $content['userid'] . ', ';
// Get date/time from timestamp
- $content['last_online'] = generateDateTime($content['last_online'], '0');
+ $content['last_online'] = generateDateTime($content['last_online'], 0);
// Finnaly delete this inactive account
deleteUserAccount($content['userid'], loadEmailTemplate('member_autopurge_delete', $content['last_online'], ''));
} // END - while
// Remove last comma
- $UIDs = str_replace(", ", "\n", substr($UIDs, 0, -2));
+ $UIDs = str_replace(', ', "\n", substr($UIDs, 0, -2));
// Send mail notification to admin
if (getConfig('ap_in_notify') == 'Y') {
$UIDs .= $content['userid'] . ', ';
// Get date/time from timestamp
- $content['joined'] = generateDateTime($content['joined'], '0');
+ $content['joined'] = generateDateTime($content['joined'], 0);
// Finnaly delete this inactive account
deleteUserAccount($content['userid'], loadEmailTemplate('member_autopurge_unconfirmed', $content, ''));
} // END - while
// Remove last comma
- $UIDs = str_replace(", ", "\n", substr($UIDs, 0, -2));
+ $UIDs = str_replace(', ', "\n", substr($UIDs, 0, -2));
// Send mail notification to admin
if (getConfig('ap_un_notify') == 'Y') {
// Update config entries
function updateConfiguration ($entries, $values, $updateMode='') {
// Do not update config in CSS mode
- if ((getOutputMode() == '1') || (getOutputMode() == -1) || (isInstallationPhase())) {
+ if ((getOutputMode() == 1) || (getOutputMode() == -1) || (isInstallationPhase())) {
return;
} // END - if
}
// Filter for loading configuration
-function FILTER_LOAD_CONFIGURATION ($no = '0') {
+function FILTER_LOAD_CONFIGURATION ($no = 0) {
// Check for cache extension, cache-array and if the requested configuration is in cache
if ((isset($GLOBALS['cache_array']['config'][$no])) && (is_array($GLOBALS['cache_array']['config'][$no]))) {
// Load config from cache
setConfigEntry('ONE_DAY', (60*60*24));
// Current date
-setConfigEntry('CURRENT_DATE', generateDateTime(time(), '3'));
+setConfigEntry('CURRENT_DATE', generateDateTime(time(), 3));
// Timestamp for yesterday, today ... all at 00:00 am
setConfigEntry('START_YDAY', makeTime(0, 0, 0, time() - getConfig('ONE_DAY')));
incrementConfigEntry('sql_count');
// Debug output
- if ((getOutputMode() != '1') && (isDebugModeEnabled()) && (getConfig('DEBUG_SQL') == 'Y')) {
+ if ((getOutputMode() != 1) && (isDebugModeEnabled()) && (getConfig('DEBUG_SQL') == 'Y')) {
//
// Debugging stuff...
//
// Download functions file
loadIncludeOnce($funcsInclude);
} // END - if
- } elseif ((!isset($GLOBALS['cache_array']['extension']['ext_func'][$ext_name])) && (isDebugModeEnabled()) && (getOutputMode() == '0') && ($ext_name != 'sql_patches') && (substr($ext_name, 0, 10) != 'admintheme') && (getExtensionMode() == 'test')) {
+ } elseif ((!isset($GLOBALS['cache_array']['extension']['ext_func'][$ext_name])) && (isDebugModeEnabled()) && (getOutputMode() == 0) && ($ext_name != 'sql_patches') && (substr($ext_name, 0, 10) != 'admintheme') && (getExtensionMode() == 'test')) {
// No functions file is not so good...
logDebugMessage(__FUNCTION__, __LINE__, sprintf("NOTICE: Extension %s has no own functions file or we cannot read from it. mode=%s",
$ext_name,
// Count cache hits
incrementStatsEntry('cache_hits');
- } elseif ((!isCacheInstanceValid()) || (isset($GLOBALS['cache_array']['extension'])) || (getOutputMode() != '0')) {
+ } elseif ((!isCacheInstanceValid()) || (isset($GLOBALS['cache_array']['extension'])) || (getOutputMode() != 0)) {
// Load from database
$result = SQL_QUERY_ESC("SELECT `ext_version` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1",
array($ext_name), __FUNCTION__, __LINE__);
KEY (admin_id),
PRIMARY KEY (id)
) TYPE={?_TABLE_TYPE?}");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','admins_mails','Admin-Mails','Stellen Sie hier ein, welcher Admin welche Mail erhalten soll. Sie können dies (derzeit) jedoch erst, wenn einmal die Mail versendet wurde!','5')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','admins_mails','Admin-Mails','Stellen Sie hier ein, welcher Admin welche Mail erhalten soll. Sie können dies (derzeit) jedoch erst, wenn einmal die Mail versendet wurde!',5)");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Kontrollieren Sie, welche Mails welcher Admin oder alle (admin_id=0) bekommen soll oder im UserLog (admin_id=-1) verzeichnet werden soll. Standartmässig wird weiter an alle versendet.");
break;
case '0.2.4': // SQL queries for v0.2.4
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='extras', `sort`='1' WHERE `what`='beg' LIMIT 1");
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='rals', `sort`='3', `title`='Bettel-Rallye' WHERE `what`='beg2' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='extras', `sort`=1 WHERE `what`='beg' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='rals', `sort`=3, `title`='Bettel-Rallye' WHERE `what`='beg2' LIMIT 1");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
break;
case '0.2.0': // SQL queries for v0.2.0
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET target_send=mails_sent WHERE target_send='0' AND mails_sent>0 AND receivers != ''");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET target_send=mails_sent WHERE target_send=0 AND mails_sent>0 AND receivers != ''");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Behebt ein Versand-Problem mit den Bonus-Mails. Es wurde die Spalte target_send nicht beim Einfügen der Buchung gessetzt. Bitte laden Sie sich dazu - wenn nicht bereits geschehen - alle Patches bis mindestens Patch 240 unter <a href=\"{?URL?}/modules.php?module=admin&what=updates\">Updates prüfen</a> herunter.");
break;
case '0.2.8': // SQL queries for v0.2.8
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET timestamp='0' WHERE timestamp='0000000000'");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET timestamp=0 WHERE timestamp='0000000000'");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_bonus_turbo` CHANGE points points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE turbo_bonus turbo_bonus FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE login_bonus login_bonus FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
case '0.5.6': // SQL queries for v0.5.6
// Get current month
$curr = date('m', time());
- if (strlen($curr) == 1) $curr = '0'.$curr;
+ if (strlen($curr) == 1) $curr = 0 . $curr;
if ($curr == "00") $curr = "12";
// Generate timemark...
break;
case '0.6.8': // SQL queries for v0.6.8
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `data_type`='SEND' WHERE `data_type` != 'SEND' AND `data_type` != 'DELETED' AND `receivers`='' AND `target_send`='0'");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `data_type`='SEND' WHERE `data_type` != 'SEND' AND `data_type` != 'DELETED' AND `receivers`='' AND `target_send`=0");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Eingegebene Anzahl auszusendener Bonus-Mails wurde bei der Empfänderauswahl nicht berücksichtigt. Zudem wird jetzt das eingestellte Auswahlverfahren mitberücksichtigt.");
break;
case '0.8.3': // SQL queries for v0.8.3
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='rals', `sort`='2', `title`='Aktiv-Rallye' WHERE `what`='bonus' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='rals', `sort`=2, `title`='Aktiv-Rallye' WHERE `what`='bonus' LIMIT 1");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
break;
case '0.1.4': // SQL queries for v0.1.4
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='extras', `sort`='4' WHERE `what`='doubler' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='extras', `sort`=4 WHERE `what`='doubler' LIMIT 1");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
addAdminMenuSql('holiday','config_holiday','Einstellungen','Maximale Tage für Urlaub usw. einstellen.',3);
// Remove 0 max mails per day
- addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE value='0' LIMIT 1");
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE value=0 LIMIT 1");
break;
case 'remove': // Do stuff when removing extension
addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_holidays`");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='holiday' LIMIT 1");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='holiday' LIMIT 4");
- addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE value='0' LIMIT 1");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_max_receive` (value, comment) VALUES ('0','Urlaub')");
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE value=0 LIMIT 1");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_max_receive` (value, comment) VALUES (0,'Urlaub')");
break;
case 'activate': // Do stuff when admin activates this extension
case '0.1.3': // SQL queries for v0.1.3
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD holiday_active ENUM('Y','N') NOT NULL DEFAULT 'N'");
- addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE value='0' LIMIT 1");
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE value=0 LIMIT 1");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD holiday_lock BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('ONE_DAY')*2)."'");
// Update notes (these will be set as task text!)
break;
case '0.1.9': // SQL queries for v0.1.9
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='account', `sort`='2', `title`='In Urlaub' WHERE `what`='holiday' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='account', `sort`=2, `title`='In Urlaub' WHERE `what`='holiday' LIMIT 1");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
$GLOBALS['valid_email_chars'] = array(
'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s',
't','u','v','w','x','y','z','a','B','C','D','E','F','G','H','I','J','K','L',
- 'M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','-','.','_','0','1',
- '2','3','4','5','6','7','8','9'
+ 'M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','-','.','_',0,1,
+ 2,3,4,5,6,7,8,9
);
break;
addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_newsletter_topics`");
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_newsletter_topics` (
`nl_topic_id` BIGINT(20) NOT NULL AUTO_INCREMENT,
-`nl_id` BIGINT(20) NOT NULL DEFAULT '0',
+`nl_id` BIGINT(20) NOT NULL DEFAULT 0,
`nl_topic_title` VARCHAR(255) NOT NULL DEFAULT '',
`nl_topic_text` MEDIUMTEXT,
INDEX `newsletter_id` (`nl_id`),
$GLOBALS['valid_email_chars'] = array(
'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s',
't','u','v','w','x','y','z','a','B','C','D','E','F','G','H','I','J','K','L',
- 'M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','-','.','_','0','1',
- '2','3','4','5','6','7','8','9'
+ 'M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','-','.','_',0,1,
+ 2,3,4,5,6,7,8,9
);
break;
break;
case '0.0.6': // SQL queries for v0.0.6
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nickname_len` TINYINT(3) UNSIGNED NOT NULL DEFAULT '5'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nickname_len` TINYINT(3) UNSIGNED NOT NULL DEFAULT 5");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nickname_pattern` VARCHAR(255) NOT NULL DEFAULT 'a-zA-Z0-9_'");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nickname_chars` VARCHAR(255) NOT NULL DEFAULT 'a-z, A-Z, 0-9, _'");
addAdminMenuSql('setup','config_nickname','Nicknamen','Stellen Sie minimale Nicknamenlänge, sowie erlaubte Zeichen hier ein.', 12);
break;
case '0.1.6': // SQL queries for v0.1.6
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='extras', `sort`='2' WHERE `what`='nickname' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='extras', `sort`=2 WHERE `what`='nickname' LIMIT 1");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
gain decimal(10,3) NOT NULL DEFAULT '0.000',
PRIMARY KEY (id)
) TYPE={?_TABLE_TYPE?}");
- addAdminMenuSql('misc','optimize','DB optimieren','Führen Sie dies ab und an aus, damit überflüssige Daten aus der Datenbank entfernt werden.','5');
+ addAdminMenuSql('misc','optimize','DB optimieren','Führen Sie dies ab und an aus, damit überflüssige Daten aus der Datenbank entfernt werden.',5);
break;
case 'remove': // Do stuff when removing extension
switch (getCurrentExtensionVersion()) {
case '0.1.0': // SQL queries for v0.1
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD order_max_full ENUM('ORDER','MAX') NOT NULL DEFAULT 'MAX'");
- addAdminMenuSql('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.');
+ addAdminMenuSql('setup','config_order','Mailbuchungsseite',7,'Einstellungen am Mailbuchungsformular.');
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Maximale Mailbuchungen sind nun vom maximalen Empfang abhägig.");
case '0.1.1': // SQL queries for v0.1.1
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_order' LIMIT 1");
- addAdminMenuSql('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.');
+ addAdminMenuSql('setup','config_order','Mailbuchungsseite',7,'Einstellungen am Mailbuchungsformular.');
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD mail_orders BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
// Update notes (these will be set as task text!)
case '0.4.6': // SQL queries for v0.4.6
addMemberMenuSql('order',NULL,'Mailbuchungen','N','Y',3);
addMemberMenuSql('order','order2','Framekiller-Mails','N','Y',2);
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='order', `sort`='1', `title`='Klick-Mails' WHERE `what`='order' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='order', `sort`=1, `title`='Klick-Mails' WHERE `what`='order' LIMIT 1");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
break;
case '0.0.4': // SQL queries for v0.0.4
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD max_comma TINYINT(3) UNSIGNED NOT NULL DEFAULT '3'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD max_comma TINYINT(3) UNSIGNED NOT NULL DEFAULT 3");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Angezeigte Kommastellen können zwischen 0 und 5 eingestellt werden.");
case '0.2.0': // SQL queries for v0.2.0
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_rallye_data` ADD min_users BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_rallye_data` ADD min_prices BIGINT(20) UNSIGNED NOT NULL DEFAULT '3'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_rallye_data` ADD min_prices BIGINT(20) UNSIGNED NOT NULL DEFAULT 3");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Ablaufen der Rallyes intergriert. Bauen Sie in Ihr Template <strong>templates/de/emails/member/member_rallye_notify.tpl</strong> folgende zwei Zeilen ein:<br />
break;
case '0.3.2': // SQL queries for v0.3.2
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='rals', `sort`='1', `title`='Referal-Rallye' WHERE `what`='rallyes' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='rals', `sort`=1, `title`='Referal-Rallye' WHERE `what`='rallyes' LIMIT 1");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
case 'init': // Do stuff when extension is initialized
// Do stuff only when not in CSS mode
// @TODO Move this code into rallye_functions.php
- if (getOutputMode() != '1') {
+ if (getOutputMode() != 1) {
// Get total member count
$total = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true);
addMemberMenuSql('extras',NULL,'Extras','Y','N',5);
addMemberMenuSql('rals',NULL,'Rallyes','Y','N',6);
addMemberMenuSql('account',NULL,'Ihr Account','Y','N',7);
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='stats', `sort`='1', `title`='Klick-Mails' WHERE `what`='stats' LIMIT 1");
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='extras', `sort`='3' WHERE `what`='reflinks' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='stats', `sort`=1, `title`='Klick-Mails' WHERE `what`='stats' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='extras', `sort`=3 WHERE `what`='reflinks' LIMIT 1");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
break;
case '0.3.6': // SQL queries for v0.3.6
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `salt_length` TINYINT(3) UNSIGNED NOT NULL DEFAULT '9'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `salt_length` TINYINT(3) UNSIGNED NOT NULL DEFAULT 9");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `pass_scramble` VARCHAR(255) NOT NULL DEFAULT ''");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` MODIFY `password` VARCHAR(255) NOT NULL DEFAULT ''");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `rand_no` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
// Memember menu
addMemberMenuSql('themes',NULL,'Design-Auswahl','N','Y',3);
addMemberMenuSql('main','themes','Designs','N','Y',6);
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`='8' WHERE `action`='themes' LIMIT 1");
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='account', `sort`='1', `title`='Designs' WHERE `what`='themes' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`=8 WHERE `action`='themes' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='account', `sort`=1, `title`='Designs' WHERE `what`='themes' LIMIT 1");
// User data
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `curr_theme` VARCHAR(255) NOT NULL DEFAULT 'default'");
break;
case '0.2.5': // SQL queries for v0.2.5
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='extras', `sort`='5' WHERE `what`='transfer' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='extras', `sort`=5 WHERE `what`='transfer' LIMIT 1");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Mitgliedsmenü komplett geändert.");
// Sends out pooled mails
function FILTER_TRIGGER_SENDING_POOL () {
// Are we in normal output mode?
- if (getOutputMode() != '0') {
+ if (getOutputMode() != 0) {
// Only in normal output mode to prevent race-conditons!
} // END - if
// Footer disabled or already sent?
// 1234 5 54 45 5 5 543 3 321
-if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != '1') && ($GLOBALS['footer_sent'] != '2'))) && (getOutputMode() != '1'))) {
+if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != 1) && ($GLOBALS['footer_sent'] != 2))) && (getOutputMode() != 1))) {
// @TODO Rewrite these all into filters
// Handle fatal errors
handleFatalErrors();
// Shall we display the copyright notice?
- if ((!isGetRequestElementSet('frame')) && (basename($_SERVER['PHP_SELF']) != 'mailid_top.php') && ((getConfig('WRITE_FOOTER') == 'Y') || (isInstalling())) && ($GLOBALS['header_sent'] == '2')) {
+ if ((!isGetRequestElementSet('frame')) && (basename($_SERVER['PHP_SELF']) != 'mailid_top.php') && ((getConfig('WRITE_FOOTER') == 'Y') || (isInstalling())) && ($GLOBALS['header_sent'] == 2)) {
// Backlink enabled?
if ((getConfig('ENABLE_BACKLINK') == 'Y') || (isInstalling())) {
// Copyright with backlink, thanks! :-)
} // END - if
// Shall we display the parsing time and number of queries?
- if ((((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (getConfig('show_timings') == 'Y') && (!isGetRequestElementSet('frame'))) || (isInstallationPhase())) && (getOutputMode() != 0) && ($GLOBALS['header_sent'] == '2')) {
+ // 1234 5 54 4 5 5 4 4 5 543 3 4432 2 33 2 2 21
+ if ((((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (getConfig('show_timings') == 'Y') && (!isGetRequestElementSet('frame'))) || (isInstallationPhase())) && (getOutputMode() == 0) && ($GLOBALS['header_sent'] == 2)) {
// Then display it here
displayParsingTime();
} // END - if
// Shall we display SQL queries?
- if ((isAdmin()) && (isExtensionInstalledAndNewer('other', '0.2.2')) && (getConfig('display_debug_sqls') == 'Y') && (!isGetRequestElementSet('frame')) && ($GLOBALS['header_sent'] == '2')) {
+ if ((isAdmin()) && (isExtensionInstalledAndNewer('other', '0.2.2')) && (getConfig('display_debug_sqls') == 'Y') && (!isGetRequestElementSet('frame')) && ($GLOBALS['header_sent'] == 2)) {
// Then display it here
displayDebugSqls();
} // END - if
// Shall we include the uberwach snippet?
- if ((!isGetRequestElementSet('frame')) && (isExtensionActive('uberwach')) && (getModule() != 'admin') && ($GLOBALS['header_sent'] == '2')) {
+ if ((!isGetRequestElementSet('frame')) && (isExtensionActive('uberwach')) && (getModule() != 'admin') && ($GLOBALS['header_sent'] == 2)) {
// Then display it here
loadUberwachSnippet();
} // END - if
sendHeader('Content-language: ' . getLanguage());
// Extension 'rewrite' installed?
- if ((isExtensionActive('rewrite')) && (getOutputMode() != '1')) {
+ if ((isExtensionActive('rewrite')) && (getOutputMode() != 1)) {
$GLOBALS['output'] = rewriteLinksInCode($GLOBALS['output']);
} // END - if
outputRawCode($GLOBALS['output']);
} elseif ((getConfig('OUTPUT_MODE') == 'render') && (!empty($GLOBALS['output']))) {
// Rewrite links when rewrite extension is active
- if ((isExtensionActive('rewrite')) && (getOutputMode() != '1')) {
+ if ((isExtensionActive('rewrite')) && (getOutputMode() != 1)) {
$GLOBALS['output'] = rewriteLinksInCode($GLOBALS['output']);
} // END - if
if (empty($GLOBALS['refid'])) $GLOBALS['refid'] = 0;
// Generate date/time string
- $date_time = generateDateTime(time(), '1');
+ $date_time = generateDateTime(time(), 1);
// Is content an array
if (is_array($content)) $content['date_time'] = $date_time;
}
// Loads an email template and compiles it
-function loadEmailTemplate ($template, $content = array(), $UID = '0') {
+function loadEmailTemplate ($template, $content = array(), $UID = 0) {
global $DATA;
// Our configuration is kept non-global here
// Free result
SQL_FREERESULT($result_email);
}
- } elseif ($toEmail == '0') {
+ } elseif ($toEmail == 0) {
// Is the webmaster!
$toEmail = getConfig('WEBMASTER');
}
}
// Generates a human-readable timestamp from the Uni* stamp
-function generateDateTime ($time, $mode = '0') {
+function generateDateTime ($time, $mode = 0) {
// Filter out numbers
$time = bigintval($time);
switch (getLanguage()) {
case 'de': // German date / time format
switch ($mode) {
- case '0': $ret = date("d.m.Y \u\m H:i \U\h\\r", $time); break;
- case '1': $ret = strtolower(date('d.m.Y - H:i', $time)); break;
- case '2': $ret = date('d.m.Y|H:i', $time); break;
- case '3': $ret = date('d.m.Y', $time); break;
+ case 0: $ret = date("d.m.Y \u\m H:i \U\h\\r", $time); break;
+ case 1: $ret = strtolower(date('d.m.Y - H:i', $time)); break;
+ case 2: $ret = date('d.m.Y|H:i', $time); break;
+ case 3: $ret = date('d.m.Y', $time); break;
default:
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
break;
default: // Default is the US date / time format!
switch ($mode) {
- case '0': $ret = date('r', $time); break;
- case '1': $ret = date('Y-m-d - g:i A', $time); break;
- case '2': $ret = date('y-m-d|H:i', $time); break;
- case '3': $ret = date('y-m-d', $time); break;
+ case 0: $ret = date('r', $time); break;
+ case 1: $ret = date('Y-m-d - g:i A', $time); break;
+ case 2: $ret = date('y-m-d|H:i', $time); break;
+ case 3: $ret = date('y-m-d', $time); break;
default:
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
break;
// Translates the american decimal dot into a german comma
function translateComma ($dotted, $cut = true, $max = 0) {
// Default is 3 you can change this in admin area "Misc -> Misc Options"
- if (!isConfigEntrySet('max_comma')) setConfigEntry('max_comma', '3');
+ if (!isConfigEntrySet('max_comma')) setConfigEntry('max_comma', 3);
// Use from config is default
$maxComma = getConfig('max_comma');
}
//
-function addSelectionBox ($type, $default, $prefix = '', $id = '0') {
+function addSelectionBox ($type, $default, $prefix = '', $id = 0) {
$OUT = '';
if ($type == 'yn') {
case 'sec':
case 'min':
for ($idx = 0; $idx < 60; $idx+=5) {
- if (strlen($idx) == 1) $idx = '0' . $idx;
+ if (strlen($idx) == 1) $idx = 0 . $idx;
$OUT .= "<option value=\"" . $idx."\"";
if ($default == $idx) $OUT .= ' selected="selected"';
$OUT .= ">" . $idx."</option>\n";
case 'hour':
for ($idx = 0; $idx < 24; $idx++) {
- if (strlen($idx) == 1) $idx = '0' . $idx;
+ if (strlen($idx) == 1) $idx = 0 . $idx;
$OUT .= "<option value=\"" . $idx."\"";
if ($default == $idx) $OUT .= ' selected="selected"';
$OUT .= ">" . $idx."</option>\n";
$NAV = '';
for ($page = 1; $page <= $PAGES; $page++) {
// Is the page currently selected or shall we generate a link to it?
- if (($page == getRequestElement('page')) || ((!isGetRequestElementSet('page')) && ($page == '1'))) {
+ if (($page == getRequestElement('page')) || ((!isGetRequestElementSet('page')) && ($page == 1))) {
// Is currently selected, so only highlight it
$NAV .= '<strong>-';
} else {
$NAV .= '">';
}
$NAV .= $page;
- if (($page == getRequestElement('page')) || ((!isGetRequestElementSet('page')) && ($page == '1'))) {
+ if (($page == getRequestElement('page')) || ((!isGetRequestElementSet('page')) && ($page == 1))) {
// Is currently selected, so only highlight it
$NAV .= '-</strong>';
} else {
$mod = dechex(sqrt(($part2 - $part1) * getConfig('_PRIME') / pi()));
}
$mod = substr(round($mod), 0, 4);
- $mod = str_repeat('0', 4-strlen($mod)) . $mod;
+ $mod = str_repeat(0, 4-strlen($mod)) . $mod;
//* DEBUG: */ outputHtml("*" . $start.'=' . $mod."*<br />");
$start += 4;
$newHash .= $mod;
case getCode('OVERLENGTH') : $message = getMessage('MEMBER_TEXT_OVERLENGTH'); break;
case getCode('URL_FOUND') : $message = getMessage('MEMBER_TEXT_CONTAINS_URL'); break;
case getCode('SUBJ_URL') : $message = getMessage('MEMBER_SUBJ_CONTAINS_URL'); break;
- case getCode('BLIST_URL') : $message = "{--MEMBER_URL_BLACK_LISTED--}<br />\n{--MEMBER_BLIST_TIME--}: ".generateDateTime(getRequestElement('blist'), '0'); break;
+ case getCode('BLIST_URL') : $message = "{--MEMBER_URL_BLACK_LISTED--}<br />\n{--MEMBER_BLIST_TIME--}: ".generateDateTime(getRequestElement('blist'), 0); break;
case getCode('NO_RECS_LEFT') : $message = getMessage('MEMBER_SELECTED_MORE_RECS'); break;
case getCode('INVALID_TAGS') : $message = getMessage('MEMBER_HTML_INVALID_TAGS'); break;
case getCode('MORE_POINTS') : $message = getMessage('MEMBER_MORE_POINTS_NEEDED'); break;
// Load timestamp from last order
list($timestamp) = SQL_FETCHROW($result);
- $timestamp = generateDateTime($timestamp, '1');
+ $timestamp = generateDateTime($timestamp, 1);
// Free memory
SQL_FREERESULT($result);
return false;
}
// Send notification to admin
-function sendAdminNotification ($subject, $templateName, $content=array(), $userid = '0') {
+function sendAdminNotification ($subject, $templateName, $content=array(), $userid = 0) {
if (getExtensionVersion('admins') >= '0.4.1') {
// Send new way
sendAdminsEmails($subject, $templateName, $content, $userid);
//* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):accessLevel={$accessLevel}<br />");
$content = array(
'login_failures' => getSession('mxchange_' . $accessLevel.'_failures'),
- 'last_failure' => generateDateTime(getSession('mxchange_' . $accessLevel.'_last_fail'), '2')
+ 'last_failure' => generateDateTime(getSession('mxchange_' . $accessLevel.'_last_fail'), 2)
);
// Load template
// Determines referal id and sets it
function determineReferalId () {
// Skip this in non-html-mode
- if (getOutputMode() != '0') return false;
+ if (getOutputMode() != 0) return false;
// Check if refid is set
if ((isset($GLOBALS['refid'])) && ($GLOBALS['refid'] > 0)) {
}
// Set cookie when default refid > 0
- if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((getSession('refid') == '0') && (getConfig('def_refid') > 0))) {
+ if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((getSession('refid') == 0) && (getConfig('def_refid') > 0))) {
// Set cookie
setSession('refid', $GLOBALS['refid']);
} // END - if
if (!is_array($code)) $codeE = explode("\n", $code); else $codeE = $code;
$count_lines = count($codeE);
- $r = "Line | Code:<br />";
+ $r = 'Line | Code:<br />';
foreach($codeE as $line => $c) {
- $r .= "<div class=\"line\"><span class=\"linenum\">";
+ $r .= '<div class="line"><span class="linenum">';
if ($count_lines == 1) {
- $r .= '1';
+ $r .= 1;
} else {
$r .= ($line == ($count_lines - 1)) ? '' : ($line+1);
}
- $r .= "</span>|";
+ $r .= '</span>|';
// Add code
- $r .= "<span class=\"linetext\">" . htmlentities($c) . "</span></div>";
+ $r .= '<span class="linetext">' . htmlentities($c) . '</span></div>';
}
- return "<div class=\"code\">" . $r . "</div>\n";
+ return '<div class="code">' . $r . '</div>';
+}
+
+// Convert ';' to ', ' for e.g. receiver list
+function convertReceivers ($old) {
+ return str_replace(';', ', ', $old);
}
//////////////////////////////////////////////////
}
// Is the header already sent?
-if (($GLOBALS['header_sent'] != '1') && ($GLOBALS['header_sent'] != '2')) {
+if (($GLOBALS['header_sent'] != 1) && ($GLOBALS['header_sent'] != 2)) {
// If not in CSS mode generate the header
if (getOutputMode() != 1) {
// Config and database connection valid?
} // END - if
// Closing HEAD tag
- if (getOutputMode() != '1') outputHtml('</head>');
+ if (getOutputMode() != 1) outputHtml('</head>');
if ($GLOBALS['header_sent'] == 0) $GLOBALS['header_sent'] = 1;
} // END - if
addTemplateToInstallContent('install_welcome');
break;
- case '1': // Server path, base URL
+ case 1: // Server path, base URL
// Load template
addTemplateToInstallContent('install_page1');
break;
- case '2': // MySQL data (alone!)
+ case 2: // MySQL data (alone!)
if (empty($mysql['dbase'])) $mysql['dbase'] = 'your_database';
if (empty($mysql['login'])) $mysql['login'] = 'your_login';
if (empty($mysql['host'])) $mysql['host'] = 'localhost';
addTemplateToInstallContent('install_page2', $content);
break;
- case '3':
+ case 3:
// Set more values
$content['spath'] = postRequestElement('spath');
$content['burl'] = postRequestElement('burl');
addTemplateToInstallContent('install_page3', $content);
break;
- case '5': // Misc settings
+ case 5: // Misc settings
// General settings
$content['spath'] = postRequestElement('spath');
$content['burl'] = postRequestElement('burl');
if (isLanguageIncludeReadable($ext_name)) {
// Load language file
loadLanguageInclude($ext_name);
- } elseif ((isDebugModeEnabled()) && (getOutputMode() == '0') && ($ext_name != 'sql_patches') && (substr($ext_name, 0, 10) != 'admintheme')) {
+ } elseif ((isDebugModeEnabled()) && (getOutputMode() == 0) && ($ext_name != 'sql_patches') && (substr($ext_name, 0, 10) != 'admintheme')) {
// No language file is not so good...
logDebugMessage(__FUNCTION__, __LINE__, sprintf("NOTICE: Extension %s has no language file or we cannot read from it. lang=%s, mode=%s",
$ext_name,
// When both passwords match update admin account
if ($postData['pass1'][$id] == $postData['pass2'][$id]) {
// Save only when both passwords are the same (also when they are empty)
- $add = ''; $cache_update = '1';
+ $add = ''; $cache_update = 1;
// Generate hash
$hash = generateHash($postData['pass1'][$id]);
$UID
));
}
- } elseif ($adminId == '0') {
+ } elseif ($adminId == 0) {
// Select all email adresses
$result = SQL_QUERY("SELECT `email` FROM `{?_MYSQL_PREFIX?}_admins` ORDER BY `id` ASC",
__FUNCTION__, __LINE__);
// Add points to account
// @TODO Try to rewrite the following unset()
unset($GLOBALS['ref_level']);
- addPointsThroughReferalSystem('beg', $userid, $points, false, '0', $locked, strtolower(getConfig('beg_mode')));
+ addPointsThroughReferalSystem('beg', $userid, $points, false, 0, $locked, strtolower(getConfig('beg_mode')));
}
// Subtract begged points from member account if the admin has selected one
// Transfer data to template
$GLOBALS['ranking_content']['yr_level'] = $GLOBALS['ranking_content']['level'];
$GLOBALS['ranking_content']['yr_points'] = translateComma($GLOBALS['ranking_content']['points']);
- $GLOBALS['ranking_content']['yr_tmark'] = generateDateTime($GLOBALS['ranking_content']['timemark'], '1');
+ $GLOBALS['ranking_content']['yr_tmark'] = generateDateTime($GLOBALS['ranking_content']['timemark'], 1);
// Load template
$GLOBALS['ranking_content']['own'] = loadTemplate('show_bonus_yr', true, $GLOBALS['ranking_content']);
if (getConfig('bonus_active') != 'Y') return;
// Switch to jackpot-mode when no UID is supplied but userid-mode is selected
- if ((getConfig('bonus_mode') == 'UID') && (getConfig('bonus_userid') == '0') && (isExtensionActive('jackpot'))) {
+ if ((getConfig('bonus_mode') == 'UID') && (getConfig('bonus_userid') == 0) && (isExtensionActive('jackpot'))) {
// Update database & config
updateConfiguration('bonus_mode', 'JACKPOT');
} // END - if
// Generates a HTML table based on given data
// @TODO Lame description
-function generateDoublerTable ($userid = '0', $done = 'N', $ref = 'N', $sort = 'ASC') {
+function generateDoublerTable ($userid = 0, $done = 'N', $ref = 'N', $sort = 'ASC') {
if (empty($cnt)) $cnt = 0;
$add = ''; $DT_MODE = 0;
if ($userid > 0) {
// Load entries only from a single user
$add = " AND `userid`='".bigintval($userid)."'";
- $mode = 'member'; $COLS = '4'; $DT_MODE = '2';
+ $mode = 'member'; $COLS = 4; $DT_MODE = 2;
$message = getMessage('DOUBLER_MEMBER_NO_ENTRIES_FOUND');
} else {
// Guest mode!
- $mode = 'guest'; $COLS = '3'; $DT_MODE = '3';
+ $mode = 'guest'; $COLS = 3; $DT_MODE = 3;
$message = getMessage('DOUBLER_GUEST_NO_ENTRIES_FOUND');
}
// Prepare array
$content = array(
- 'holiday_end' => generateDateTime($content['holiday_end'] , '3'),
- 'holiday_start' => generateDateTime($content['holiday_start'], '3'),
+ 'holiday_end' => generateDateTime($content['holiday_end'] , 3),
+ 'holiday_start' => generateDateTime($content['holiday_start'], 3),
'holiday_comments' => $content['comments']
);
} // END - if
// Send mail to admins
- sendAdminNotification(getMessage('HOLIDAY_ADMIN_UNLOCK_SUBJ'), 'admin_holiday_unlock', $admin, '0');
+ sendAdminNotification(getMessage('HOLIDAY_ADMIN_UNLOCK_SUBJ'), 'admin_holiday_unlock', $admin, 0);
// Run all SQLs
runFilterChain('run_sqls');
// Transfer all neccessary data to the $DATA array
$DATA['userid_cnt'] = countSumTotalData('CONFIRMED','user_data','userid','status',true);
- $DATA['start'] = generateDateTime($start, '2');
- $DATA['end'] = generateDateTime($end , '2');
- $DATA['now_t'] = generateDateTime(time(), '2');
+ $DATA['start'] = generateDateTime($start, 2);
+ $DATA['end'] = generateDateTime($end , 2);
+ $DATA['now_t'] = generateDateTime(time(), 2);
$DATA['title'] = $title;
$DATA['id'] = $id; // ID for the rallye details link
if ($notify == 'Y') $templ = 'admin_rallye_notify';
// Send email to admin
- sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_NOTIFY'), $title), $templ, $prices, '0');
+ sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_NOTIFY'), $title), $templ, $prices, 0);
// Free memory
SQL_FREERESULT($result_user);
if (SQL_NUMROWS($result) == 0) {
// Add userid and his ref count to table
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_rallye_users` (`rallye_id`, `userid`, `refs`)
-VALUES ('%s','%s','0')",
+VALUES ('%s','%s',0)",
array(bigintval($id), bigintval($userid)), __FUNCTION__, __LINE__);
} // END - if
if ($notify == 'Y') {
// Transfer all neccessary data to the global $DATA array
- $DATA['start'] = generateDateTime($start, '2');
- $DATA['end'] = generateDateTime($end , '2');
- $DATA['now_t'] = generateDateTime(time(), '2');
+ $DATA['start'] = generateDateTime($start, 2);
+ $DATA['end'] = generateDateTime($end , 2);
+ $DATA['now_t'] = generateDateTime(time(), 2);
$DATA['title'] = $title;
$DATA['id'] = $id; // ID for the rallye details link
$DATA['ref'] = 0;
$DATA = array(); $cnt = 0;
$users = array();
$DATA['title'] = $title;
- $DATA['start'] = generateDateTime($start, '1');
- $DATA['end'] = generateDateTime($end , '1');
- $DATA['now_t'] = generateDateTime(time(), '1');
+ $DATA['start'] = generateDateTime($start, 1);
+ $DATA['end'] = generateDateTime($end , 1);
+ $DATA['now_t'] = generateDateTime(time(), 1);
// Just count...
$total = 0;
//
function getArrayFromReferalRallyeUsers ($rallye) {
// Fix zero points to 0.00000
- if (getConfig('ref_payout') == '0') setConfigEntry('ref_payout', '0.00000');
+ if (getConfig('ref_payout') == 0) setConfigEntry('ref_payout', '0.00000');
// Init multi array
$users = array(
$active = countSumTotalData($DATA['userid'][$idx], 'user_data', 'userid', 'userid', true, " AND `status`='CONFIRMED'");
if (empty($DATA['userid'][$idx])) $DATA['userid'][$idx] = '---';
- if ((empty($DATA['ref'][$idx])) || ($DATA['ref'][$idx] == 0) || ($active == 0) || ("".round($DATA['cpoints'][$idx])."" == '0') || (empty($DATA['cpoints'][$idx]))) {
+ if ((empty($DATA['ref'][$idx])) || ($DATA['ref'][$idx] == 0) || ($active == 0) || ("".round($DATA['cpoints'][$idx])."" == 0) || (empty($DATA['cpoints'][$idx]))) {
// Allow valid and active users with at least one ref to get points
$DATA['ref'][$idx] = '---';
$DATA['userid'][$idx] = '---';
// Expire found rallyes and notify admin
while ($content = SQL_FETCHARRAY($result_rallye)) {
// Prepare data for mail template
- $content['start_time'] = generateDateTime($content['start_time'], '1');
- $content['end_time'] = generateDateTime($content['end_time'] , '1');
- $content['now_time'] = generateDateTime(time(), '1');
+ $content['start_time'] = generateDateTime($content['start_time'], 1);
+ $content['end_time'] = generateDateTime($content['end_time'] , 1);
+ $content['now_time'] = generateDateTime(time(), 1);
// Send mail to admin
sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_PURGED_SUBJ'), $content['title']), 'admin_rallye_purged', $content, 0);
unset($phpSelfFile);
// Security system loaded...
-define('__SECURITY', '1');
+define('__SECURITY', 1);
// [EOF]
?>
// Generate message
$message = getMessageFromIndexedArray(getMessage('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
$DATA['keys'][] = 'sponsor_created'; $DATA['values'][] = time();
$DATA['keys'][] = 'status';
// URL invalid
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s : Invalid URL.", $url, $limit, $reload));
return false;
- } elseif (SURFBAR_LOOKUP_BY_URL($url, '0')) {
+ } elseif (SURFBAR_LOOKUP_BY_URL($url, 0)) {
// URL already found in surfbar!
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s : Already added.", $url, $limit, $reload));
return false;
}
// Register the new URL
- return SURFBAR_REGISTER_URL($url, '0', 'ACTIVE', 'unlock', array('limit' => $limit, 'reload' => $reload));
+ return SURFBAR_REGISTER_URL($url, 0, 'ACTIVE', 'unlock', array('limit' => $limit, 'reload' => $reload));
}
// Admin unlocked an email so we can migrate the URL
// Display selected "action form"
function SURFBAR_MEMBER_DISPLAY_ACTION_FORM ($action, $urlData) {
// Translate some data
- $urlData['registered'] = generateDateTime($urlData['registered'], '2');
+ $urlData['registered'] = generateDateTime($urlData['registered'], 2);
$urlData['views_total'] = translateComma($urlData['views_total']);
$urlData['views_max'] = translateComma($urlData['views_max']);
$urlData['views_allowed'] = translateComma($urlData['views_allowed']);
- $urlData['last_locked'] = generateDateTime($urlData['last_locked'], '2');
+ $urlData['last_locked'] = generateDateTime($urlData['last_locked'], 2);
// Is the lock reason empty?
if (empty($urlData['lock_reason'])) {
// Handle URLs which limit has depleted
function SURFBAR_HANDLE_DEPLETED_VIEWS () {
// Get all URLs
- $urlArray = SURFBAR_GET_URL_DATA('0', 'views_max', 'id', 'ASC', 'id', " AND views_allowed>0 AND `status`='ACTIVE'");
+ $urlArray = SURFBAR_GET_URL_DATA(0, 'views_max', 'id', 'ASC', 'id', " AND views_allowed>0 AND `status`='ACTIVE'");
// Do we have some entries?
if (count($urlArray) > 0) {
// Translate some data if present
if (isset($content['status'])) $content['status'] = translateSurfbarUrlStatus($content['status']);
- if (isset($content['registered'])) $content['registered'] = generateDateTime($content['registered'], '2');
- if (isset($content['last_locked'])) $content['last_locked'] = generateDateTime($content['last_locked'], '2');
+ if (isset($content['registered'])) $content['registered'] = generateDateTime($content['registered'], 2);
+ if (isset($content['last_locked'])) $content['last_locked'] = generateDateTime($content['last_locked'], 2);
if (isset($content['views_total'])) $content['views_total'] = translateComma($content['views_total']);
if (isset($content['views_allowed'])) $content['views_allowed'] = translateComma($content['views_allowed']);
if (isset($content['views_max'])) $content['views_max'] = translateComma($content['views_max']);
// Translate some data if present
if (isset($content['status'])) $content['status'] = translateSurfbarUrlStatus($content['status']);
- if (isset($content['registered'])) $content['registered'] = generateDateTime($content['registered'], '2');
- if (isset($content['last_locked'])) $content['last_locked'] = generateDateTime($content['last_locked'], '2');
+ if (isset($content['registered'])) $content['registered'] = generateDateTime($content['registered'], 2);
+ if (isset($content['last_locked'])) $content['last_locked'] = generateDateTime($content['last_locked'], 2);
if (isset($content['views_total'])) $content['views_total'] = translateComma($content['views_total']);
if (isset($content['views_allowed'])) $content['views_allowed'] = translateComma($content['views_allowed']);
if (isset($content['views_max'])) $content['views_max'] = translateComma($content['views_max']);
$addon += abs(log($onlineUsers / $totalUsers + 1) * $percent * $totalUsers);
// Get total URLs
- $totalUrls = SURFBAR_GET_TOTAL_URLS('ACTIVE', '0');
+ $totalUrls = SURFBAR_GET_TOTAL_URLS('ACTIVE', 0);
// Get user's total URLs
$userUrls = SURFBAR_GET_TOTAL_USER_URLS(0, 'ACTIVE');
$addon += abs($max * $percent * $totalUsers);
// Get total URLs
- $totalUrls = SURFBAR_GET_TOTAL_URLS('ACTIVE', '0');
+ $totalUrls = SURFBAR_GET_TOTAL_URLS('ACTIVE', 0);
// Calculate addon
$addon += abs($max * $percent * $totalUrls);
'purged_mails','purged_bonus_mails'
) as $entry) {
// Set it to zero
- $content[$entry] = '0';
+ $content[$entry] = 0;
} // END - foreach
// Extension updates found
//
// 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>";
$OUT = '';
for ($page = 1; $page <= $PAGES; $page++) {
- if (($page == getRequestElement('page')) || ((!isGetRequestElementSet('page')) && ($page == '1'))) {
+ if (($page == getRequestElement('page')) || ((!isGetRequestElementSet('page')) && ($page == 1))) {
$OUT .= '<strong>-';
} else {
if (!isGetRequestElementSet('letter')) setRequestGetElement('letter', getMessage('_ALL2'));
$OUT .= $page;
- if (($page == getRequestElement('page')) || ((!isGetRequestElementSet('page')) && ($page == '1'))) {
+ if (($page == getRequestElement('page')) || ((!isGetRequestElementSet('page')) && ($page == 1))) {
$OUT .= '-</strong>';
} else {
$OUT .= '</a>';
if (($GLOBALS['cache_instance']->loadCacheFile('foo')) && ($GLOBALS['cache_instance']->extensionVersionMatches('foo'))) {
// Load cache
$GLOBALS['cache_array']['foo'] = $GLOBALS['cache_instance']->getArrayFromCache();
-} elseif (getOutputMode() != '1') {
+} elseif (getOutputMode() != 1) {
// Create cache file
$GLOBALS['cache_instance']->init();
$GLOBALS['cache_instance']->removeCacheFile();
unset($GLOBALS['cache_array']['admin']);
}
-} elseif (getOutputMode() != '1') {
+} elseif (getOutputMode() != 1) {
// Create cache file
$GLOBALS['cache_instance']->init();
if (($GLOBALS['cache_instance']->loadCacheFile('admin_acls')) && ($GLOBALS['cache_instance']->extensionVersionMatches('admins'))) {
// Load referal system from cache
$GLOBALS['cache_array']['admin_acls'] = $GLOBALS['cache_instance']->getArrayFromCache();
- } elseif (getOutputMode() != '1') {
+ } elseif (getOutputMode() != 1) {
// Create cache file here
$GLOBALS['cache_instance']->init();
// Remove dummy array
unset($config);
-} elseif (getOutputMode() != '1') {
+} elseif (getOutputMode() != 1) {
// Create cache file here
$GLOBALS['cache_instance']->init();
// Remove array and mark cache as loaded
unset($EXT_POOL);
-} elseif (getOutputMode() != '1') {
+} elseif (getOutputMode() != 1) {
// Create cache file here
$GLOBALS['cache_instance']->init();
if (($GLOBALS['cache_instance']->loadCacheFile('filter')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) {
// Load filter from cache
$GLOBALS['cache_array']['filter'] = $GLOBALS['cache_instance']->getArrayFromCache();
-} elseif ((getOutputMode() != '1') && (isExtensionInstalled('sql_patches'))) {
+} elseif ((getOutputMode() != 1) && (isExtensionInstalled('sql_patches'))) {
// Create cache file here
$GLOBALS['cache_instance']->init();
if (($GLOBALS['cache_instance']->loadCacheFile('imprint')) && ($GLOBALS['cache_instance']->extensionVersionMatches('imprint'))) {
// Load cache
$GLOBALS['cache_array']['imprint'] = $GLOBALS['cache_instance']->getArrayFromCache();
-} elseif (getOutputMode() != '1') {
+} elseif (getOutputMode() != 1) {
// Create cache file
$GLOBALS['cache_instance']->init();
} // END - if
} // END - foreach
unset($modArray);
-} elseif (getOutputMode() != '1') {
+} elseif (getOutputMode() != 1) {
// Create cache file here
$GLOBALS['cache_instance']->init();
if (($GLOBALS['cache_instance']->loadCacheFile('refdepths')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) {
// Load referal system from cache
$GLOBALS['cache_array']['refdepths'] = $GLOBALS['cache_instance']->getArrayFromCache();
-} elseif (getOutputMode() != '1') {
+} elseif (getOutputMode() != 1) {
// Create cache file here
$GLOBALS['cache_instance']->init();
if (($GLOBALS['cache_instance']->loadCacheFile('refsystem')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) {
// Load referal system from cache
$GLOBALS['cache_array']['refsystem'] = $GLOBALS['cache_instance']->getArrayFromCache();
-} elseif (getOutputMode() != '1') {
+} elseif (getOutputMode() != 1) {
// Create cache file here
$GLOBALS['cache_instance']->init();
if (($GLOBALS['cache_instance']->loadCacheFile('revision'))) {
// Load revision from cache
$GLOBALS['cache_array']['revision'] = $GLOBALS['cache_instance']->getArrayFromCache();
-} elseif ((getOutputMode() != '1')) {
+} elseif ((getOutputMode() != 1)) {
// Create cache file here
$GLOBALS['cache_instance']->init();
// Remove dummy array
unset($cache);
-} elseif (getOutputMode() != '1') {
+} elseif (getOutputMode() != 1) {
// Create cache file here
$GLOBALS['cache_instance']->init();
// Doubled points
'points' => translateComma($content['points']),
// Timemark
- 'when' => generateDateTime($content['timemark'], '2'),
+ 'when' => generateDateTime($content['timemark'], 2),
// IP number when the member submitted the doubling form
'ip' => $content['remote_ip'],
);
}
// Create member selection box
-function addMemberSelectionBox ($def='0', $add_all=false, $return=false, $none=false, $field='userid') {
+function addMemberSelectionBox ($def=0, $add_all=false, $return=false, $none=false, $field='userid') {
// Output selection form with all confirmed user accounts listed
$result = SQL_QUERY("SELECT `userid`, `surname`, `family` FROM `{?_MYSQL_PREFIX?}_user_data` ORDER BY `userid` ASC", __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Load menu as selection
$OUT = "<select name=\"".$mode."_menu";
- if ((!empty($defid)) || ($defid == '0')) $OUT .= "[".$defid."]";
+ if ((!empty($defid)) || ($defid == 0)) $OUT .= "[".$defid."]";
$OUT .= "\" size=\"1\" class=\"admin_select\">
<option value=\"\">{--SELECT_NONE--}</option>\n";
// @TODO Try to rewrite this to $content = SQL_FETCHARRAY(). Please look some lines above for the dynamic query
if (SQL_NUMROWS($result) == 1) {
// "Implode" all data to single string
- $DATA_UPDATE = implode(", ", $DATA);
+ $DATA_UPDATE = implode(', ', $DATA);
// Generate SQL string
$sql = sprintf("UPDATE `{?_MYSQL_PREFIX?}%s` SET %s WHERE %s LIMIT 1",
} // END - foreach
// Add both in one line
- $KEYs = implode(", ", $KEYs);
- $values = implode(", ", $values);
+ $KEYs = implode(', ', $KEYs);
+ $values = implode(', ', $values);
// Generate SQL string
$sql = sprintf("INSERT INTO {?_MYSQL_PREFIX?}%s (%s) VALUES (%s)",
// Creates a user-profile link for the admin. This function can also be used for many other purposes
function generateUserProfileLink ($userid, $title = '', $what = 'list_user') {
- if (($title == '') && ($title != '0')) {
+ if (($title == '') && ($title != 0)) {
// Set userid as title
$title = $userid;
} // END - if
- if (($title == '0') && ($what == 'list_refs')) {
+ if (($title == 0) && ($what == 'list_refs')) {
// Return title again
return $title;
} // END - if
// Task is valid...
list($tid, $userid, $type, $subj, $text, $created, $status, $adminId) = SQL_FETCHROW($result_task);
- if ($adminId == '0') {
+ if ($adminId == 0) {
// Assgin current admin to unassgigned task
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=%s WHERE `id`=%s LIMIT 1",
array(getCurrentAdminId(), bigintval($tid)), __FILE__, __LINE__);
'subject' => $subj,
'add' => $add,
'text' => $text,
- 'created' => generateDateTime($created, '1'),
+ 'created' => generateDateTime($created, 1),
'extension' => $ext_name
);
array($ext_name), __FILE__, __LINE__);
$lines = SQL_NUMROWS($result_lines);
SQL_FREERESULT($result_lines);
- if ($lines == '0') {
+ if ($lines == 0) {
// New extension found
$OUT .= loadTemplate('admin_ext_reg_form', true, array(
'id' => bigintval($id),
// Load final template
loadTemplate('admin_overview_list', false, $OUT);
} else {
- if ((isset($postData['task'])) && ((count($postData['task']) > 0) || ($postData['task'][0] == '1'))) {
+ if ((isset($postData['task'])) && ((count($postData['task']) > 0) || ($postData['task'][0] == 1))) {
// Only unassign / delete tasks when there are selected tasks posted
if (!empty($postData['unassign'])) {
// Unassign from tasks
'assigned_admin' => $content['assigned_admin'],
'userid' => $content['userid'],
'task_type_msg' => $content['task_type_msg'],
- 'created' => generateDateTime($content['task_created'], '2')
+ 'created' => generateDateTime($content['task_created'], 2)
));
// Do we have extension task?
SQL_FREERESULT($result);
} else {
// Output selection form with all confirmed user accounts listed
- addMemberSelectionBox('0', true);
+ addMemberSelectionBox(0, true);
}
// [EOF]
$content['notify_options'] = generateOptionList('/ARRAY/', array('Y','N'), array(getMessage('YES'), getMessage('NO') ));
// Starting day
-$content['start_sec'] = addSelectionBox('sec' , '0' , 'start');
-$content['start_min'] = addSelectionBox('min' , '0' , 'start');
+$content['start_sec'] = addSelectionBox('sec' , 0 , 'start');
+$content['start_min'] = addSelectionBox('min' , 0 , 'start');
$content['start_hour'] = addSelectionBox('hour' , date('G', time()), 'start');
$content['start_day'] = addSelectionBox('day' , date('d', time()), 'start');
$content['start_month'] = addSelectionBox('month', date('m', time()), 'start');
$Y = date('Y', time() + (getConfig('ONE_DAY') * 7));
// Ending day
-$content['end_sec'] = addSelectionBox('sec' , '0' , 'end');
-$content['end_min'] = addSelectionBox('min' , '0' , 'end');
+$content['end_sec'] = addSelectionBox('sec' , 0 , 'end');
+$content['end_min'] = addSelectionBox('min' , 0 , 'end');
$content['end_hour'] = addSelectionBox('hour' , date('G', time()), 'end');
$content['end_day'] = addSelectionBox('day' , $D , 'end');
$content['end_month'] = addSelectionBox('month', $M , 'end');
// Send mail or message
if ((isExtensionActive('msg')) && (postRequestElement('type') == 'message')) {
// Add message
- $message = loadEmailTemplate('admins_msg_contct_admin', postRequestElement('text'), '0');
+ $message = loadEmailTemplate('admins_msg_contct_admin', postRequestElement('text'), 0);
SEND_ADMIN_MESSAGE(getRequestElement('admin'), ADMINS_MSG_FROM_ADMIN, $message);
} else {
// Load admin's email address
$email = getAdminEmail(bigintval(getRequestElement('admin')));
// Load email template and send the mail to the admin
- $message = loadEmailTemplate('admins_mail_contct_admin', postRequestElement('text'), '0');
+ $message = loadEmailTemplate('admins_mail_contct_admin', postRequestElement('text'), 0);
sendEmail($email, getMessage('ADMINS_MSG_FROM_ADMIN'), $message);
}
$adminId = bigintval(getRequestElement('admin'));
// Set required fields
- setRequestPostElement('edit', '1');
- setRequestPostElement('sel', array($adminId => '1'));
+ setRequestPostElement('edit', 1);
+ setRequestPostElement('sel', array($adminId => 1));
} // END - if
if ((isPostRequestElementSet('edit')) && (countPostSelection() > 0)) {
// @TODO Can this be rewritten???
$OUT .= "<select name=\"admin_id[".$content['id']."]\" size=\"1\" class=\"admin_select\">
<option value=\"0\"";
- if ($content['admin_id'] == '0') $OUT .= ' selected="selected"';
+ if ($content['admin_id'] == 0) $OUT .= ' selected="selected"';
$OUT .=">{--ADMINS_ALL_ADMINS--}</option>\n";
if (isExtensionActive('events')) {
$OUT .= "<option value=\"-1\"";
// Start of this exchange
if (getConfig('mt_start') > 0) {
// Only show start
- $content['mt_start'] = '<strong>' . generateDateTime(getConfig('mt_start'), '3') . '</strong>';
+ $content['mt_start'] = '<strong>' . generateDateTime(getConfig('mt_start'), 3) . '</strong>';
} else {
// Make start editable
$content['mt_start'] =
'admin_id' => $content['admin_id'],
'email_link' => generateEmailLink($content['admin_id']),
'alogin' => $content['login'],
- 'start' => generateDateTime($content['start_time'], '3'),
- 'end' => generateDateTime($content['end_time'], '3'),
+ 'start' => generateDateTime($content['start_time'], 3),
+ 'end' => generateDateTime($content['end_time'], 3),
);
// Load row template and switch color
if (isFormSent()) {
// If salt length is empty or null then we shall generate new passwords
- if (!isPostRequestElementSet(('salt_length')) || (postRequestElement('salt_length') == '0')) {
+ if (!isPostRequestElementSet(('salt_length')) || (postRequestElement('salt_length') == 0)) {
// Generate new passwords for all!
loadInclude('inc/gen_sql_patches.php');
$content['subject'] = $subject;
$content['url'] = generateDerefererUrl($url);
$content['url_raw'] = $url;
- $content['timestamp'] = generateDateTime($timestamp, '0');
+ $content['timestamp'] = generateDateTime($timestamp, 0);
// Load template
loadTemplate('admin_del_email_normal', false, $content);
// Pay back points
//* DEBUG: */ outputHtml("PAYBACK:".$sender."<br />");
- addPointsThroughReferalSystem('mail_deleted', $sender, $totalPoints, true, '0', false,'direct');
+ addPointsThroughReferalSystem('mail_deleted', $sender, $totalPoints, true, 0, false,'direct');
// Output message
if (getConfig('repay_deleted_mails') == 'REPAY') {
$content['id'] = $id;
$content['subject'] = $subject;
$content['url'] = generateDerefererUrl($url);
- $content['timestamp'] = generateDateTime($timestamp, '0');
+ $content['timestamp'] = generateDateTime($timestamp, 0);
$content['cnt'] = $cnt;
// Load template
$content['id'] = $id;
$content['subject'] = $subject;
$content['url'] = generateDerefererUrl($url);
- $content['timestamp'] = generateDateTime($timestamp, '0');
+ $content['timestamp'] = generateDateTime($timestamp, 0);
$content['cnt'] = $cnt;
// Load template
// Update user's account
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data`
-SET `holiday_active`='N', holiday_activated='0'
+SET `holiday_active`='N', holiday_activated=0
WHERE `userid`=%s LIMIT 1", array(bigintval($userid)), __FILE__, __LINE__);
// Remove holiday
// Prepare loaded data for the
$content = array(
- 'start' => generateDateTime($start, '3'),
- 'end' => generateDateTime($end , '3')
+ 'start' => generateDateTime($start, 3),
+ 'end' => generateDateTime($end , 3)
);
// Send email to user
$content = array(
'sw' => $SW,
'trans_id' => $content['trans_id'],
- 'stamp' => generateDateTime($content['time_trans'], '3'),
+ 'stamp' => generateDateTime($content['time_trans'], 3),
'userid_from' => generateUserProfileLink($content['userid']),
'userid_to' => generateUserProfileLink($content['to_userid']),
'reason' => $content['reason'],
$result_maximum = SQL_QUERY($sql, __FILE__, __LINE__);
// Set offset an current page to default values
-if (!isGetRequestElementSet('page')) setRequestGetElement('page' , '1');
+if (!isGetRequestElementSet('page')) setRequestGetElement('page' , 1);
if (!isGetRequestElementSet('offset')) setRequestGetElement('offset', getConfig('mails_page'));
// Add limitation to SQL string
$content['top_email_nav'] = '';
$content['bottom_email_nav'] = '';
if ($pages > 1) {
- $content['top_email_nav'] = addEmailNavigation($pages, getConfig('mails_page'), true , '3', true);
- $content['bottom_email_nav'] = addEmailNavigation($pages, getConfig('mails_page'), false, '3', true);
+ $content['top_email_nav'] = addEmailNavigation($pages, getConfig('mails_page'), true , 3, true);
+ $content['bottom_email_nav'] = addEmailNavigation($pages, getConfig('mails_page'), false, 3, true);
} // END - if
$OUT = ''; $SW = 2;
'pay' => getPaymentTitlePrice($pool[5]),
'cat' => getCategory($pool[10]),
'sent' => $sent,
- 'ruserids' => str_replace(';', ", ", $pool[4]),
+ 'ruserids' => convertReceivers($pool[4]),
'unconfirmed' => $unconfirmed,
'type' => translatePoolType($pool[6]),
'target_send' => $pool[9],
'frametester' => generateFrametesterUrl($pool[8]),
'url' => $pool[8],
- 'stamp' => generateDateTime($pool[7], '0'),
+ 'stamp' => generateDateTime($pool[7], 0),
'mid' => $pool[0],
);
$result_normal = SQL_QUERY($sql, __FILE__, __LINE__);
// Set offset an current page to default values
-if (!isGetRequestElementSet('page')) setRequestGetElement('page', '1');
+if (!isGetRequestElementSet('page')) setRequestGetElement('page', 1);
if (!isGetRequestElementSet('offset')) {
if (isConfigEntrySet('mails_page')) {
$content['sender_link'] = generateUserProfileLink($pool['sender']);
$content['payment'] = getPaymentTitlePrice($pool['payment_id']);
$content['category'] = getCategory($pool['cat_id']);
- $content['receivers'] = str_replace(';', ", ", $pool['receivers']);
+ $content['receivers'] = convertReceivers($pool['receivers']);
$content['type'] = translatePoolType($pool['data_type']);
$content['frametester'] = generateFrametesterUrl($pool['url']);
- $content['timestamp'] = generateDateTime($pool['timestamp'], '0');
+ $content['timestamp'] = generateDateTime($pool['timestamp'], 0);
// Load row template
$OUT .= loadTemplate('admin_list_emails_row', true, $content);
// Add navigation (with change box and colspan=3)
$content['nav'] = '';
- if ($PAGES > 1) $content['nav'] = addEmailNavigation($PAGES, getConfig('mails_page'), false, '3', true);
+ if ($PAGES > 1) $content['nav'] = addEmailNavigation($PAGES, getConfig('mails_page'), false, 3, true);
// Prepare content
$content['rows'] = $OUT;
$content = $bonus;
$content['time'] = createFancyTime($content['time']);
$content['category'] = getCategory($content['cat_id']);
- $content['receivers'] = str_replace(';', ", ", $content['receivers']);
+ $content['receivers'] = convertReceivers($content['receivers']);
$content['type'] = translatePoolType($content['data_type']);
$content['frametester'] = generateFrametesterUrl($content['url']);
- $content['timestamp'] = generateDateTime($content['timestamp'], '0');
+ $content['timestamp'] = generateDateTime($content['timestamp'], 0);
// Load row template
$OUT .= loadTemplate('admin_list_bonus_emails_row', true, $content);
// Add navigation (without change box but with colspan=3)
$content['nav'] = '';
- if ($PAGES > 1) $content['nav'] = addEmailNavigation($PAGES, getConfig('mails_page'), false, '3', true);
+ if ($PAGES > 1) $content['nav'] = addEmailNavigation($PAGES, getConfig('mails_page'), false, 3, true);
// Prepare content
$content['rows'] = $OUT;
// Extension was not found in task management
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_REG_FAILED_ID_404'));
}
- } elseif ($task_found == '0') {
+ } elseif ($task_found == 0) {
// No longer assigned or old task
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_REG_FAILED_ASSIGED'));
} else {
'surname' => $content['surname'],
'family' => $content['family'],
'email' => "<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".$content['email']."</a>",
- 'joined' => generateDateTime($content['joined'], '2'),
- 'last_online' => generateDateTime($content['last_online'], '2'),
- 'notified' => generateDateTime($content['ap_notified'], '2'),
+ 'joined' => generateDateTime($content['joined'], 2),
+ 'last_online' => generateDateTime($content['last_online'], 2),
+ 'notified' => generateDateTime($content['ap_notified'], 2),
);
// Load row template
if (isPostRequestElementSet(('withdraw'))) {
// Okay, let's prepare...
$curr = date('m', time()) - 1;
- if (strlen($curr) == 1) $curr = '0'.$curr;
+ if (strlen($curr) == 1) $curr = 0 . $curr;
updateConfiguration('last_month', $curr);
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_BEG_WITHDRAW_PREPARED'));
} // END - if
'surname' => $content['surname'],
'family' => $content['family'],
'turbo' => translateComma($content['beg_points']),
- 'last_online' => generateDateTime($content['last_online'], '2'),
+ 'last_online' => generateDateTime($content['last_online'], 2),
'sw' => $SW,
'win1' => $WIN1,
'win2' => $WIN2,
// Prepare constant for timemark
if (isExtensionActive('autopurge')) {
- $content['autopurge_timeout'] = generateDateTime(time() - getConfig('ap_inactive_since'), '2');
+ $content['autopurge_timeout'] = generateDateTime(time() - getConfig('ap_inactive_since'), 2);
} else {
$content['autopurge_timeout'] = loadTemplate('admin_settings_saved', true, sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'autopurge'));
}
if (isPostRequestElementSet(('withdraw'))) {
// Okay, let's prepare...
$curr = date('m', time()) - 1;
- if (strlen($curr) == 1) $curr = '0'.$curr;
+ if (strlen($curr) == 1) $curr = 0 . $curr;
updateConfiguration('last_month', $curr);
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_BONUS_WITHDRAW_PREPARED'));
} // END - if
$content['email'] = generateEmailLink($content['email'], 'user_data');
$content['gender'] = translateGender($content['gender']);
$content['points'] = translateComma($content['points']);
- $content['last_online'] = generateDateTime($content['last_online'], '2');
+ $content['last_online'] = generateDateTime($content['last_online'], 2);
$content['sw'] = $SW;
$content['win1'] = $WIN1;
$content['win2'] = $WIN2;
// Prepare constant for timemark
if (isExtensionActive('autopurge')) {
- $content['autopurge_timeout'] = generateDateTime(time() - getConfig('ap_inactive_since'), '2');
+ $content['autopurge_timeout'] = generateDateTime(time() - getConfig('ap_inactive_since'), 2);
} else {
$content['autopurge_timeout'] = loadTemplate('admin_settings_saved', true, sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'autopurge'));
}
case 'overview': // General overview page
// Prepare links
foreach (array('already_direct','already_ref','waiting_direct','waiting_ref') as $entry) {
- $content[$entry . '_link'] = '0';
+ $content[$entry . '_link'] = 0;
} // END - switch
// Init sums
'sw' => $SW,
'id' => $content['id'],
'userid' => generateUserProfileLink($content['userid']),
- 'start' => generateDateTime($content['holiday_start'], '3'),
- 'end' => generateDateTime($content['holiday_end'], '3'),
+ 'start' => generateDateTime($content['holiday_start'], 3),
+ 'end' => generateDateTime($content['holiday_end'], 3),
'comments' => wordwrap($content['comments'], 15),
'status' => translateUserStatus($content['status']),
- 'last_online' => generateDateTime($content['last_online'], '3'),
+ 'last_online' => generateDateTime($content['last_online'], 3),
);
// Load row template and switch color
'sw' => $SW,
'link' => $LINK,
'subject' => $subject,
- 'stamp' => generateDateTime($timestamp, '0'),
+ 'stamp' => generateDateTime($timestamp, 0),
'cat' => getCategory($cat),
);
$result_max = false;
// Set offset an current page to default values
-if (!isGetRequestElementSet('page')) setRequestGetElement('page' , '1');
+if (!isGetRequestElementSet('page')) setRequestGetElement('page' , 1);
if (!isGetRequestElementSet('offset')) setRequestGetElement('offset', getConfig('mails_page'));
if (isExtensionActive('bonus')) {
$content = $bonus;
$content['time'] = createFancyTime($content['time']);
$content['category'] = getCategory($content['cat_id']);
- $content['receivers'] = str_replace(';', ", ", $content['receivers']);
+ $content['receivers'] = convertReceivers($content['receivers']);
$content['type'] = translatePoolType($content['data_type']);
$content['frametester'] = generateFrametesterUrl($content['url']);
- $content['timestamp'] = generateDateTime($content['timestamp'], '0');
+ $content['timestamp'] = generateDateTime($content['timestamp'], 0);
// Load row template
$OUT .= loadTemplate('admin_list_notify_emails_row', true, $content);
// Add navigation (without change box but with colspan=3)
$content['nav'] = '';
- if ($PAGES > 1) $content['nav'] = addEmailNavigation($PAGES, getConfig('mails_page'), false, '3', true);
+ if ($PAGES > 1) $content['nav'] = addEmailNavigation($PAGES, getConfig('mails_page'), false, 3, true);
// Prepare content
$content['rows'] = $OUT;
list($task) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
if (empty($task)) $task = 0;
- } elseif ((empty($userid)) || ($userid == '0')) {
+ } elseif ((empty($userid)) || ($userid == 0)) {
// Cannot obtain member ID!
loadTemplate('admin_settings_saved', false, getMessage('PAYOUT_FAILED_OBTAIN_USERID'));
} else {
// Cannot load user data
loadTemplate('admin_settings_saved', false, getMessage('PAYOUT_FAILED_OBTAIN_USERDATA'));
}
- } elseif ((empty($task)) || ($task == '0')) {
+ } elseif ((empty($task)) || ($task == 0)) {
// Failed loading task ID
loadTemplate('admin_settings_saved', false, getMessage('PAYOUT_FAILED_OBTAIN_TASK_ID'));
}
'ptype' => translateComma($content['payout_total']) . ' ' . $content['type'],
'account' => $content['target_account'],
'bank' => $content['target_bank'],
- 'tstamp' => generateDateTime($content['payout_timestamp'], '2'),
+ 'tstamp' => generateDateTime($content['payout_timestamp'], 2),
'status' => $content['status'],
);
$content['sw'] = $SW;
$content['link'] = generateUserProfileLink($content['userid']);
$content['primera_amount'] = translateComma($content['primera_amount']);
- $content['primera_timestamp'] = generateDateTime($content['primera_timestamp'], '2');
+ $content['primera_timestamp'] = generateDateTime($content['primera_timestamp'], 2);
$content['raw_type'] = strtolower($content['primera_type']);
$content['primera_type'] = PRIMERA_TRANSFER_STATUS($content['primera_type']);
// Activate / deactivate
switch (getRequestElement('activate'))
{
- case '1': // Activate
+ case 1: // Activate
addSql("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET is_active='Y' WHERE `id`=%s AND is_active='N' LIMIT 1");
break;
- case '0': // Deactivate
+ case 0: // Deactivate
addSql("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET is_active='N' WHERE `id`=%s AND is_active='Y' LIMIT 1");
break;
}
// Automatic notification
switch (getRequestElement('notify'))
{
- case '1': // Activate
+ case 1: // Activate
addSql("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET send_notify='Y' WHERE `id`=%s AND send_notify='N' LIMIT 1");
break;
- case '0': // Deactivate
+ case 0: // Deactivate
addSql("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET send_notify='N' WHERE `id`=%s AND send_notify='Y' LIMIT 1");
break;
}
// Automatic adding of new members
switch (getRequestElement('auto'))
{
- case '1': // Activate
+ case 1: // Activate
addSql("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET auto_add_new_user='Y' WHERE `id`=%s AND auto_add_new_user='N' LIMIT 1");
break;
- case '0': // Deactivate
+ case 0: // Deactivate
addSql("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET auto_add_new_user='N' WHERE `id`=%s AND auto_add_new_user='Y' LIMIT 1");
break;
}
'title' => $row['title'],
'template' => $row['template'],
'joined' => $joined,
- 'start_date' => generateDateTime($row['start_time'], '2'),
- 'end_date' => generateDateTime($row['end_time'] , '2'),
+ 'start_date' => generateDateTime($row['start_time'], 2),
+ 'end_date' => generateDateTime($row['end_time'] , 2),
'active_lnk' => translateYesNo($row['is_active']),
'notify_lnk' => translateYesNo($row['send_notify']),
'auto_lnk' => translateYesNo($row['auto_add_new_user']),
case 'N':
$row['active_title'] = getMessage('RALLYE_ACTIVATE_NOW');
- $row['active'] = '1';
+ $row['active'] = 1;
break;
}
case 'N':
$row['notify_title'] = getMessage('RALLYE_START_NOTIFY_NOW');
- $row['notify'] = '1';
+ $row['notify'] = 1;
break;
}
case 'N':
$row['auto_title'] = getMessage('RALLYE_START_AUTO_ADD_NOW');
- $row['auto'] = '1';
+ $row['auto'] = 1;
break;
}
'sw' => $SW,
'u_link' => generateUserProfileLink($data['userid']),
'gender' => translateGender($data['gender']),
- 'refs_link' => '0',
+ 'refs_link' => 0,
'surname' => $data['surname'],
'family' => $data['family'],
'email' => "[<a href=\"".generateEmailLink($data['email'], 'user_data')."\">".$data['email']."</a>]",
'status' => translateUserStatus($data['status']),
- 'registered' => generateDateTime($data['joined'], '3'),
+ 'registered' => generateDateTime($data['joined'], 3),
);
// Check if referal count is larger 0 and update link
} // END - while
} else {
// Output info message
- $levels['info'] = sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), generateUserProfileLink($userid), '0', '0');
+ $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));
'sw' => $SW,
'u_link' => generateUserProfileLink($levels['userid']),
'gender' => translateGender($levels['gender']),
- 'refs_link' => '0',
+ 'refs_link' => 0,
'surname' => $levels['surname'],
'family' => $levels['family'],
'email' => "[<a href=\"".generateEmailLink($levels['email'], 'user_data')."\">".$levels['email']."</a>]",
'status' => translateUserStatus($levels['status']),
- 'registered' => generateDateTime($levels['joined'], '3'),
+ 'registered' => generateDateTime($levels['joined'], 3),
);
// Check if referal count is larger 0 and update link
$content['email_link'] = generateEmailLink($content['email'], 'sponsor_data');
$content['url'] = generateDerefererUrl($content['url']);
// Timestamps
- $content['created'] = generateDateTime($content['sponsor_created'], '2');
- $content['last_online'] = generateDateTime($content['last_online'], '2');
- $content['last_change'] = generateDateTime($content['last_change'], '2');
+ $content['created'] = generateDateTime($content['sponsor_created'], 2);
+ $content['last_online'] = generateDateTime($content['last_online'], 2);
+ $content['last_change'] = generateDateTime($content['last_change'], 2);
// Sponsor points
$content['points_amount'] = translateComma($content['points_amount']);
$content['points_used'] = translateComma($content['points_used']);
'family' => $content['family'],
'email' => generateEmailLink($content['email'], 'sponsor_data'),
'status' => sponsorTranslateUserStatus($content['status']),
- 'created' => generateDateTime($content['sponsor_created'], '2'),
- 'last_online' => generateDateTime($content['last_online'], '2'),
+ 'created' => generateDateTime($content['sponsor_created'], 2),
+ 'last_online' => generateDateTime($content['last_online'], 2),
'points' => translateComma($content['points_amount'] - $content['points_used']),
'ip' => $content['remote_addr'],
);
'admin' => $content['assigned_admin'],
'userid' => $content['userid'],
'type' => $content['task_type_msg'],
- 'created' => generateDateTime($content['task_created'], '2')
+ 'created' => generateDateTime($content['task_created'], 2)
));
// Do we have an extension task?
$content = array(
'sw' => $SW,
'trans_id' => $content['trans_id'],
- 'stamp' => generateDateTime($content['time_trans'], '3'),
+ 'stamp' => generateDateTime($content['time_trans'], 3),
'from_link' => generateUserProfileLink($content['userid']),
'to_link' => generateUserProfileLink($content['to_userid']),
'reason' => wordwrap($content['reason'], 15),
'text' => $text,
'url' => generateFrametesterUrl($url),
'unconfirmed' => $unconfirmed,
- 'stamp' => generateDateTime($stamp, '2'),
+ 'stamp' => generateDateTime($stamp, 2),
'rows' => $OUT
);
// Init variables
$MORE = '';
-$colspan = '4';
+$colspan = 4;
// Add nickname if extension is found&active
// @TODO Rewrite these if-blocks in a filter
// Init unset data
if (!isGetRequestElementSet('letter')) { setRequestGetElement('letter', getMessage('_ALL2')); }
if (!isGetRequestElementSet('sortby')) { setRequestGetElement('sortby', 'userid'); }
-if (!isGetRequestElementSet('page')) { setRequestGetElement('page' , '1'); }
+if (!isGetRequestElementSet('page')) { setRequestGetElement('page' , 1); }
// Set base URL
$base = '[<a href="{?URL?}/modules.php?module=admin';
// Is this above zero?
if ($stamp > 0) {
// Then use it
- $content['birthday'] = generateDateTime($stamp, '3');
+ $content['birthday'] = generateDateTime($stamp, 3);
} else {
// Zero or below so set zero!
- $content['birthday'] = generateDateTime(0, '3');
+ $content['birthday'] = generateDateTime(0, 3);
}
// Prepare data for template
$content['gender'] = translateGender($content['gender']);
$content['email_link'] = generateEmailLink($content['email'], 'user_data');
$content['status'] = translateUserStatus($content['status']);
- $content['last_online'] = generateDateTime($content['last_online'], '0');
+ $content['last_online'] = generateDateTime($content['last_online'], 0);
$content['used_points'] = translateComma($content['used_points']);
if ($content['emails_sent'] > 0) $content['emails_sent'] = $base . '&what=email_details&userid=' . $userid . '">' . translateComma($content['emails_sent']) . '</a>]';
- $content['joined'] = generateDateTime($content['joined'], '0');
- $content['last_update'] = generateDateTime($content['last_update'], '0');
- $content['last_profile_sent'] = generateDateTime($content['last_profile_sent'], '0');
+ $content['joined'] = generateDateTime($content['joined'], 0);
+ $content['last_update'] = generateDateTime($content['last_update'], 0);
+ $content['last_profile_sent'] = generateDateTime($content['last_profile_sent'], 0);
$content['total'] = translateComma(countSumTotalData($userid, 'user_points', 'points'));
$content['locked'] = translateComma(countSumTotalData($userid, 'user_points', 'locked_points'));
- $content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], '2');
+ $content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], 2);
// Is the lock reason not set?
if (!isset($content['lock_reason'])) $content['lock_reason'] = '---';
// Activate the extension please!
$PAGES = round(SQL_NUMROWS($result_master) / getConfig('user_limit') + 0.5);
- if (!isGetRequestElementSet('page')) setRequestGetElement('page' , '1');
+ if (!isGetRequestElementSet('page')) setRequestGetElement('page' , 1);
if (!isGetRequestElementSet('offset')) setRequestGetElement('offset', getConfig('user_limit'));
// Add limitation to SQL string and run him again
$content['points'] = translateComma($pointsTotal);
$content['rate'] = translateComma($clickRate);
$content['locked'] = translateComma(countSumTotalData($content['userid'], 'user_points', 'locked_points'));
- $content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], '2');
+ $content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], 2);
$content['status'] = translateUserStatus($content['status']);
$content['refs'] = countSumTotalData($content['userid'], 'refsystem', 'counter');
$content['sw'] = $SW;
$content['link'] = generateUserProfileLink($content['userid']);
$content['wernis_amount'] = translateComma($content['wernis_amount']);
- $content['wernis_timestamp'] = generateDateTime($content['wernis_timestamp'], '2');
+ $content['wernis_timestamp'] = generateDateTime($content['wernis_timestamp'], 2);
$content['raw_type'] = strtolower($content['wernis_type']);
$content['wernis_type'] = WERNIS_TRANSFER_STATUS($content['wernis_type']);
}
} else {
// Copy data into constants for the template and load it
- $content['datestamp'] = generateDateTime(time(), '3');
+ $content['datestamp'] = generateDateTime(time(), 3);
if (isExtensionActive('html_mail')) {
// Load template with HTML mode
loadTemplate('admin_newsletter', false, $content);
SQL_FREERESULT($result);
} else {
// Output selection form with all confirmed user accounts listed
- addMemberSelectionBox('0', true);
+ addMemberSelectionBox(0, true);
}
// [EOF]
// "Translate" some data
$content['userid'] = generateUserProfileLink($content['userid']);
$content['total_visits'] = translateComma($content['total_visits']);
- $content['last_surfed'] = generateDateTime($content['last_surfed'], '2');
+ $content['last_surfed'] = generateDateTime($content['last_surfed'], 2);
$content['sw'] = $SW;
// Load row template
'sw' => $SW,
'index' => ($idx + 1),
'name' => $name,
- 'created' => generateDateTime($themes['fctime'][$idx], '2'),
+ 'created' => generateDateTime($themes['fctime'][$idx], 2),
'size' => translateComma(round($themes['fsize'][$idx] / 1.024) / 1000),
'version' => $themes['ver'][$idx],
'current' => $themes['cver'][$idx],
'cat_link' => $content['category'],
'pay_title' => str_replace("\"", '"', getPaymentTitlePrice($content['payment'], true)),
'pay_link' => $content['payment'],
- 'timestamp' => generateDateTime($content['timestamp'], '2'),
+ 'timestamp' => generateDateTime($content['timestamp'], 2),
'target_send' => $content['target_send'],
);
// Set default email
$content['email'] = getMessage('SPONSOR_NO_ADMIN');
- if ($content['admin_id'] > '0') {
+ if ($content['admin_id'] > 0) {
// Load admin's email address for contact
$content['email'] = getAdminEmail($content['admin_id']);
} // END - if
$data = array(
'admin_id' => $content['email'],
'order' => ($content['pay_count'] * $content['pay_rate'])." ".$content['pay_currency'],
- 'stamp' => generateDateTime($content['pay_ordered'], '2'),
+ 'stamp' => generateDateTime($content['pay_ordered'], 2),
'pname' => $content['pay_name'],
);
'family' => $content['family'],
'email' => generateEmailLink($content['email'], 'sponsor_data'),
'remote' => $content['remote_addr'],
- 'created' => generateDateTime($content['sponsor_created'], '2'),
+ 'created' => generateDateTime($content['sponsor_created'], 2),
);
// Load row template and switch colors
loadTemplate('admin_settings_saved', false, "<div class=\"admin_failed\">{--ADMIN_CANNOT_CHECK_VERSION--} (".$ONLINE['code'].")</div>");
} elseif (($ONLINE['version'] != getConfig('FULL_VERSION')) || ($ONLINE['revision'] != getConfig('CURR_SVN_REVISION'))) {
// New full-version available (all previous released patches are included in this version!)
- $ONLINE['changed'] = generateDateTime($ONLINE['changed'], '2');
+ $ONLINE['changed'] = generateDateTime($ONLINE['changed'], 2);
// Load template
loadTemplate('admin_update_download', false, $ONLINE);
// Add more content
$row['sw'] = $SW;
- $row['timestamp'] = generateDateTime($row['timestamp'], '2');
+ $row['timestamp'] = generateDateTime($row['timestamp'], 2);
// Load row template and switch color
$OUT .= loadTemplate('admin_list_online_row', true, $row);
'userid' => $userid,
'nickname' => $nick2,
'points' => translateComma(countSumTotalData($userid, 'user_points', 'points') - countSumTotalData($userid, 'user_data', 'used_points')),
- 'last_online' => generateDateTime($last, '2'),
+ 'last_online' => generateDateTime($last, 2),
);
// Load template
// Init content
$content = array(
'message' => getMessage('GUEST_CONFIRMED_FAILED'),
- 'userid' => '0',
+ 'userid' => 0,
);
if (isGetRequestElementSet('hash')) {
updateReferalCounter($rid);
// Shall I 'pay' the referal points imidiately?
- if (getConfig('ref_payout') == '0') {
+ if (getConfig('ref_payout') == 0) {
// Yes, 'pay' it now
$locked = false;
} else {
$content['payout_time'] = getMessage('DOUBLER_PAYOUT_TIME_' . getConfig('doubler_send_mode'));
// Generate table with already payed out doubles
-$content['payout_history'] = generateDoublerTable('0', 'Y', 'N', 'DESC');
+$content['payout_history'] = generateDoublerTable(0, 'Y', 'N', 'DESC');
// Generate table with next-to-run payouts
$content['next_table'] = generateDoublerTable();
$content['user_count'] = ($content['user_confirmed'] + $content['user_unconfirmed'] + $content['user_locked']);
// Start of this exchange
-$content['mt_start'] = generateDateTime(getConfig('mt_start'), '3');
+$content['mt_start'] = generateDateTime(getConfig('mt_start'), 3);
// Project timestamp when number of members are reached
$PROJECTED = 0;
$TEST = makeTime(0, 0, 0, $PROJECTED);
if ($TEST > time()) {
- $content['projected'] = generateDateTime($PROJECTED, '3');
+ $content['projected'] = generateDateTime($PROJECTED, 3);
} else {
$content['projected'] = getMessage('USER_PROJECTION_UNKNOWN');
}
$data = array(
'lang' => getMessage('MEDIA_DOUBLER_COUNT'),
'value' => countSumTotalData('Y','doubler','id','completed', true, " AND `points` > 0"),
- 'rows' => '4'
+ 'rows' => 4
);
// Add points
$data = array(
'lang' => getMessage('MEDIA_TRANSFER_IN_COUNT'),
'value' => $count_in,
- 'rows' => '4'
+ 'rows' => 4
);
$OUT_SPECIAL .= loadTemplate('mediadata_extra_row2', true, $data);
$data = array(
$content['rowspan_user'] = $ROWS_USER;
// Patch timespamp
-$contentp['patch_ctime'] = generateDateTime(getConfig('patch_ctime'), '2');
+$contentp['patch_ctime'] = generateDateTime(getConfig('patch_ctime'), 2);
// Load template
loadTemplate('mediadata', false, $content);
}
// Set start and end time
- $content['start'] = generateDateTime($start, '1');
- $content['end'] = generateDateTime($end , '1');
+ $content['start'] = generateDateTime($start, 1);
+ $content['end'] = generateDateTime($end , 1);
// Determine min_users
$content['min_users'] = determineReferalRallyeMinimumUsers($min_users);
//* DEBUG: */ print intval(isFormSent()).'/'.intval($isOkay).'/'.intval(isAdmin()).'<br />';
if ((isFormSent()) && (($isOkay === true) || (isAdmin()))) {
// Prepapre month and day of birth
- if (strlen(postRequestElement('day')) == 1) setRequestPostElement('day' , '0'.postRequestElement('day'));
- if (strlen(postRequestElement('month')) == 1) setRequestPostElement('month', '0'.postRequestElement('month'));
+ if (strlen(postRequestElement('day')) == 1) setRequestPostElement('day' , 0 . postRequestElement('day'));
+ if (strlen(postRequestElement('month')) == 1) setRequestPostElement('month', 0 . postRequestElement('month'));
// Get total ...
// ... confirmed, ...
$gender = translateGender(postRequestElement('gender'));
// ... rewrite a zero referal ID to the main title
- if (postRequestElement('refid') == '0') setRequestPostElement('refid', getConfig('MAIN_TITLE'));
+ if (postRequestElement('refid') == 0) setRequestPostElement('refid', getConfig('MAIN_TITLE'));
// Is ZIP code set?
if (isPostRequestElementSet('zip')) {
$content['surname'] = secureString(postRequestElement('surname'));
$content['family'] = secureString(postRequestElement('family'));
$content['gender'] = translateGender(postRequestElement('gender'));
- $content['timestamp'] = generateDateTime(time(), '0');
+ $content['timestamp'] = generateDateTime(time(), 0);
$content['password'] = secureString(postRequestElement('pass1'));
// Generate email and send it to the new sponsor
$content['refid'] = bigintval(getRequestElement('refid'));
} else {
// No referal link
- $content['refid'] = '0';
+ $content['refid'] = 0;
}
// Display registration form
$month = $idx;
// Append leading zero
- if ($idx < 10) $month = '0'.$idx;
+ if ($idx < 10) $month = 0 . $idx;
// Count months
$months[$month] = countSumTotalData(bigintval($month), 'user_data', 'userid', 'birth_month', true, " AND `status`='CONFIRMED'");
'nickname' => $content['nickname'],
'total_logins' => $content['total_logins'],
'points' => translateComma(countSumTotalData($content['userid'], 'user_points', 'points')),
- 'last_online' => generateDateTime($content['last_online'], '3'),
+ 'last_online' => generateDateTime($content['last_online'], 3),
);
// Load row template
'userid' => $content['userid'],
'nickname' => $content['nickname'],
'points' => translateComma($content['points']),
- 'last_online' => generateDateTime($content['last_online'], '3')
+ 'last_online' => generateDateTime($content['last_online'], 3)
);
// Load row template
'refs' => $content['refs'],
'nickname' => $content['nickname'],
'points' => translateComma(countSumTotalData($content['userid'], 'user_points', 'points')),
- 'last_online' => generateDateTime($content['last_online'], '3')
+ 'last_online' => generateDateTime($content['last_online'], 3)
);
// Load row template
'cnt' => $cnt,
'userid' => bigintval($content['userid']),
'points' => translateComma($content['beg']),
- 'last_online' => generateDateTime($content['last_online'], '2'),
+ 'last_online' => generateDateTime($content['last_online'], 2),
);
// Load row template
'cnt' => $cnt,
'userid' => bigintval($content['userid']),
'points' => translateComma($content['points']),
- 'last_online' => generateDateTime($content['last_online'], '2')
+ 'last_online' => generateDateTime($content['last_online'], 2)
);
// Load row template
}
// Display message and exit here
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('HOLIDAY_MEMBER_ORDER'), generateDateTime($stamp, '1')));
+ loadTemplate('admin_settings_saved', false, sprintf(getMessage('HOLIDAY_MEMBER_ORDER'), generateDateTime($stamp, 1)));
return;
}
} // END - if
SQL_FREERESULT($result);
// Prepare it for the template
- $content['start'] = generateDateTime($content['holiday_start'], '3');
- $content['end'] = generateDateTime($content['holiday_end'] , '3');
+ $content['start'] = generateDateTime($content['holiday_start'], 3);
+ $content['end'] = generateDateTime($content['holiday_end'] , 3);
// Deactivate it now
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data`
SQL_FREERESULT($result);
// Prepare it for the template
- $content['start'] = generateDateTime($content['holiday_start'] , '3');
- $content['end'] = generateDateTime($content['holiday_end'] , '3');
- $content['lock'] = generateDateTime($content['holiday_activated'], '1');
+ $content['start'] = generateDateTime($content['holiday_start'] , 3);
+ $content['end'] = generateDateTime($content['holiday_end'] , 3);
+ $content['lock'] = generateDateTime($content['holiday_activated'], 1);
// Load template
loadTemplate('member_holiday_deactivate', false, $content);
// Translate some things
$content['gender'] = translateGender($content['gender']);
- $content['last_update'] = generateDateTime($content['last_update'], '0');
+ $content['last_update'] = generateDateTime($content['last_update'], 0);
// How far is last change on his profile away from now?
if ((($content['last_update'] + getConfig('profile_lock')) > time()) && (!isAdmin()) && (getConfig('profile_lock') > 0)) {
// You cannot change your account
- $content['change'] = loadTemplate('admin_settings_saved', true, "<div class=\"member_failed\">".sprintf(getMessage('MEMBER_PROFILE_LOCKED'), generateDateTime($content['last_update'] + getConfig('profile_lock'), '0'))."</div>");
+ $content['change'] = loadTemplate('admin_settings_saved', true, "<div class=\"member_failed\">".sprintf(getMessage('MEMBER_PROFILE_LOCKED'), generateDateTime($content['last_update'] + getConfig('profile_lock'), 0))."</div>");
} else {
// He is allowed to change his profile
$content['change'] = loadTemplate('member_mydata_button', true);
}
- if (strlen($content['birth_day']) == 1) $content['birth_day'] = '0' . $content['birth_day'];
- if (strlen($content['birth_month']) == 1) $content['birth_month'] = '0' . $content['birth_month'];
+ if (strlen($content['birth_day']) == 1) $content['birth_day'] = 0 . $content['birth_day'];
+ if (strlen($content['birth_month']) == 1) $content['birth_month'] = 0 . $content['birth_month'];
switch (getLanguage()) {
case 'de': $content['dob'] = $content['birth_day'] . '.' . $content['birth_month'] . '.' . $content['birth_year']; break;
// How far is last change on his profile away from now?
if (($content['update_check'] > time()) && (!isAdmin()) && (getConfig('profile_lock') > 0)) {
- $content['update_check'] = generateDateTime($content['update_check'] + getConfig('profile_lock'), '0');
+ $content['update_check'] = generateDateTime($content['update_check'] + getConfig('profile_lock'), 0);
// You cannot change your account
loadTemplate('member_mydata_locked', false, $content);
} else {
// How far is last change on his profile away from now?
if (($content['last_change'] > time()) && (!isAdmin()) && (getConfig('profile_lock') > 0)) {
- $content['last_change'] = generateDateTime($content['last_change'] + getConfig('profile_lock'), '0');
+ $content['last_change'] = generateDateTime($content['last_change'] + getConfig('profile_lock'), 0);
// You cannot change your account
loadTemplate('member_mydata_locked');
} elseif ((!isEmailValid(postRequestElement('email'))) && (!isAdmin())) {
// Update receiver list
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `receive_mails`=`receive_mails`-1 WHERE `userid` IN (%s) LIMIT %s",
- array(str_replace(';', ", ", $RECEIVER), $content['target_send']), __FILE__, __LINE__);
+ array(convertReceivers($RECEIVER), $content['target_send']), __FILE__, __LINE__);
// Is calculated max receivers larger than wanted receivers then reset it
if ($content['target_send'] > postRequestElement('receiver')) $content['target_send'] = bigintval(postRequestElement('receiver'));
$USED = $content['target_send'] * getPaymentPoints(bigintval(postRequestElement('type')));
// Fix empty zip code
- if (!isPostRequestElementSet('zip')) setRequestPostElement('zip', '0');
+ if (!isPostRequestElementSet('zip')) setRequestPostElement('zip', 0);
// Check if he has enougth points for this order and selected more than 0 receivers
if (($USED > 0) && ($USED <= $total) && ($content['target_send'] > 0)) {
// Gettings points is okay, so we can add $USED later from
- if (($id == '0') || ($type != 'TEMP')) {
+ if (($id == 0) || ($type != 'TEMP')) {
// New order
$id = 0;
if (isExtensionActive('html_mail')) {
$URL = 'modules.php?module=login&what=order&code=' . getCode('NO_RECS_LEFT');
}
}
-} elseif (postRequestElement('receiver') == '0') {
+} elseif (postRequestElement('receiver') == 0) {
// Not enougth receivers selected
$URL = 'modules.php?module=login&what=order&code=' . getCode('MORE_RECEIVERS1');
} elseif (($ALLOWED == 0) && (getConfig('order_max_full') == 'ORDER')) {
// No more mail orders allowed
loadTemplate('admin_settings_saved', false, getMessage('MEMBER_ORDER_ALLOWED_EXHAUSTED'));
-} elseif (($links < getConfig('unconfirmed')) && ($mmails == '1')) {
+} elseif (($links < getConfig('unconfirmed')) && ($mmails == 1)) {
// Display order form
$result_cats = SQL_QUERY("SELECT
`id`, `cat`
// No cateogries are defined yet
loadTemplate('admin_settings_saved', false, "<span class=\"member_failed\">{--MEMBER_NO_CATS--}</span>");
}
-} elseif ($mmails == '0') {
+} elseif ($mmails == 0) {
// Please set more than 0 mails per day
loadTemplate('admin_settings_saved', false, getMessage('MEMBER_HAS_ZERO_MMAILS'));
} else {
'acc' => $content['target_account'],
'points' => translateComma($content['payout_total']) . ' ' . $content['type'],
'bank' => $content['target_bank'],
- 'stamp' => generateDateTime($content['payout_timestamp'], '2'),
+ 'stamp' => generateDateTime($content['payout_timestamp'], 2),
'status' => $content['status']
);
}
// If TLOCK is 0 add 3 zeros for floating
-if ($TLOCK == '0') $TLOCK = '0.00000';
+if ($TLOCK == 0) $TLOCK = '0.00000';
// Remember several values in constants
$content['used'] = translateComma($usedPoints);
while ($data = SQL_FETCHARRAY($result)) {
// Prepare data for output
$rowContent = array(
- 'stamp' => generateDateTime($data['primera_timestamp'], '2'),
+ 'stamp' => generateDateTime($data['primera_timestamp'], 2),
'points' => translateComma($data['primera_amount']),
'acc' => SQL_ESCAPE($data['primera_account']),
'status' => PRIMERA_TRANSFER_STATUS($data['primera_type']),
$locked = true;
// Shall I 'pay' the referal points imidiately?
- if (getConfig('ref_payout') == '0') {
+ if (getConfig('ref_payout') == 0) {
// Yes, 'pay' it now
$locked = false;
} // END - if
$content['min_prices'] = determineReferalRallyeMinimumPrices($content['min_prices']);
// Set start and end time
- $content['start'] = generateDateTime($content['start_time'], '1');
- $content['end'] = generateDateTime($content['end_time'] , '1');
+ $content['start'] = generateDateTime($content['start_time'], 1);
+ $content['end'] = generateDateTime($content['end_time'] , 1);
if ($expired === true) {
$content['prices'] = addReferalRallyeWinners($content['id']);
$main_content = array();
// Load waiting/pending orders
-$result = SQL_QUERY_ESC("SELECT id, cat_id, payment_id, subject, url, timestamp, target_send, data_type, zip
-FROM `{?_MYSQL_PREFIX?}_pool`
-WHERE sender=%s AND data_type != 'SEND'
-ORDER BY timestamp DESC",
-array(getUserId()), __FILE__, __LINE__);
+$result = SQL_QUERY_ESC("SELECT
+ `id`, `cat_id`, `payment_id`, `subject`, `url`, `timestamp`, `target_send`, `data_type`, `zip`
+FROM
+ `{?_MYSQL_PREFIX?}_pool`
+WHERE
+ `sender`=%s AND `data_type` != 'SEND'
+ORDER BY
+ `timestamp` DESC",
+ array(getUserId()), __FILE__, __LINE__);
// Are there mails left in pool?
if (SQL_NUMROWS($result) > 0) {
if (empty($data['zip'])) $data['zip'] = '---';
// Prepare content for output
- // @TODO Rewrite in template subj->subject,stamp->timestamp,recs->target_send
$content = array(
- 'sw' => $SW,
- 'id' => $data['id'],
- 'cat' => getCategory($data['cat_id']),
- 'pay' => getPaymentTitlePrice($data['payment_id']),
- 'subject' => $data['subject'],
- 'url' => generateDerefererUrl($data['url']),
- 'stamp' => generateDateTime($data['timestamp'], '2'),
- 'recs' => $data['target_send'],
- 'type' => translatePoolType($data['data_type']),
- 'zip' => $data['zip']
+ 'sw' => $SW,
+ 'id' => $data['id'],
+ 'cat' => getCategory($data['cat_id']),
+ 'pay' => getPaymentTitlePrice($data['payment_id']),
+ 'subject' => $data['subject'],
+ 'url' => generateDerefererUrl($data['url']),
+ 'timestamp' => generateDateTime($data['timestamp'], 2),
+ 'target_send' => $data['target_send'],
+ 'type' => translatePoolType($data['data_type']),
+ 'zip' => $data['zip']
);
// Load template
$OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result)) {
// Prepare data for the template
- // @TODO Rewrite in template: stamp->timestamp_ordered,recs->max_rec,clix->clicks,perc->percents
+ // @TODO Rewrite in template: clix->clicks
$content = array(
- 'sw' => $SW,
- 'cat' => getCategory($content['cat_id']),
- 'pay' => getPaymentTitlePrice($content['payment_id']),
- 'url' => generateDerefererUrl($content['url']),
- 'stamp' => generateDateTime($content['timestamp_ordered'], '2'),
- 'recs' => $content['max_rec'],
- 'sent' => generateDateTime($content['timestamp_send'], '2'),
- 'clix' => $content['clicks'],
- 'subject' => $content['subject'],
- 'percents' => translateComma($content['clicks'] / $content['max_rec'] * 100)."%",
+ 'sw' => $SW,
+ 'cat' => getCategory($content['cat_id']),
+ 'pay' => getPaymentTitlePrice($content['payment_id']),
+ 'url' => generateDerefererUrl($content['url']),
+ 'timestamp_ordered' => generateDateTime($content['timestamp_ordered'], 2),
+ 'target_send' => $content['max_rec'],
+ 'sent' => generateDateTime($content['timestamp_send'], 2),
+ 'clix' => $content['clicks'],
+ 'subject' => $content['subject'],
+ 'percents' => translateComma($content['clicks'] / $content['max_rec'] * 100)."%",
);
// Load row template and switch colors
// Include link to stats
$content['views_total'] = "[<a href=\"{?URL?}/modules.php?module=login&what=surfbar_list\">".translateComma($content['views_total'])."</a>]";
} // END - if
- $content['registered'] = generateDateTime($content['registered'], '2');
- $content['last_locked'] = generateDateTime($content['last_locked'], '2');
+ $content['registered'] = generateDateTime($content['registered'], 2);
+ $content['last_locked'] = generateDateTime($content['last_locked'], 2);
$content['actions'] = SURFBAR_MEMBER_ACTIONS($content['id'], $content['status']);
$content['status'] = translateSurfbarUrlStatus($content['status']);
if (empty($content['lock_reason'])) {
'surfbar_static_reward' => translateComma(getConfig('surfbar_static_reward')),
'surfbar_static_time' => createFancyTime(getConfig('surfbar_static_time')),
'surfbar_static_lock' => createFancyTime(getConfig('surfbar_static_lock')),
- 'surfbar_total_urls' => SURFBAR_GET_TOTAL_URLS('ACTIVE', '0')
+ 'surfbar_total_urls' => SURFBAR_GET_TOTAL_URLS('ACTIVE', 0)
);
// In dynamic mode we need some more data
// Total URLs
$content = array(
'surfbar_dynamic_percent' => translateComma(getConfig('surfbar_dynamic_percent')),
- 'surfbar_total_urls' => SURFBAR_GET_TOTAL_URLS('ACTIVE', '0'),
+ 'surfbar_total_urls' => SURFBAR_GET_TOTAL_URLS('ACTIVE', 0),
'surfbar_user_urls' => SURFBAR_GET_TOTAL_USER_URLS(),
'surfbar_total_online' => SURFBAR_DETERMINE_TOTAL_ONLINE(),
'surfbar_total_users' => translateComma(countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true)),
$row = array(
'sw' => $SW,
'tid' => $tid,
- 'stamp' => generateDateTime($stamp, '3'),
+ 'stamp' => generateDateTime($stamp, 3),
'userid' => $userid,
'reason' => $reason,
'points' => translateComma($points)
// First of all create the temporary table
$result = SQL_QUERY("CREATE TEMPORARY TABLE `{?_MYSQL_PREFIX?}_transfers_tmp` (
`trans_id` VARCHAR(12) NOT NULL DEFAULT '',
-`party_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
-`points` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+`party_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`reason` VARCHAR(255) NOT NULL DEFAULT '',
-`time_trans` VARCHAR(10) NOT NULL DEFAULT '0',
+`time_trans` VARCHAR(10) NOT NULL DEFAULT 0,
`trans_type` ENUM('IN','OUT') NOT NULL DEFAULT 'IN',
KEY (`party_userid`)
) TYPE=HEAP", __FILE__, __LINE__);
// Prepare content for template
$content['sw'] = $SW;
- $content['time'] = generateDateTime($content['time_trans'], '3');
+ $content['time'] = generateDateTime($content['time_trans'], 3);
$content['points'] = translateComma($content['points']);
// Load row template
if (SQL_NUMROWS($result) == 1) {
// Load newest transaction
list($newest) = SQL_FETCHROW($result);
- $content['settings'] = sprintf(getMessage('TRANSFER_LATEST_IS'), generateDateTime($newest, '3'));
+ $content['settings'] = sprintf(getMessage('TRANSFER_LATEST_IS'), generateDateTime($newest, 3));
} else {
// Load template
$content['settings'] = loadTemplate('member_transfer_settings', true);
$content = SQL_FETCHARRAY($result_data);
// Translate some data
- $content['timestamp'] = generateDateTime($content['timestamp'], '2');
+ $content['timestamp'] = generateDateTime($content['timestamp'], 2);
$content['category'] = getCategory($content['cat_id']);
$content['points'] = translateComma($content['points']);
$content['is_notify'] = translateYesNo($content['is_notify']);
// Get timestamp from insert
$content['user_status'] = sprintf(getMessage('MEMBER_MAIL_BONUS_CONFIRMED_ON'),
- generateDateTime(getTimestampFromUserStats('bonusid', $content['id']), '2')
+ generateDateTime(getTimestampFromUserStats('bonusid', $content['id']), 2)
);
// Display it depending on mail (data) type
$content = SQL_FETCHARRAY($result_data);
// Translate some data
- $content['timestamp'] = generateDateTime($content['timestamp'], '2');
+ $content['timestamp'] = generateDateTime($content['timestamp'], 2);
$content['category'] = getCategory($content['cat_id']);
$content['points'] = translateComma($content['points']);
$content['time'] = createFancyTime($content['time']);
// Get timestamp from insert
$content['user_status'] = sprintf(getMessage('MEMBER_MAIL_NORMAL_CONFIRMED_ON'),
- generateDateTime(getTimestampFromUserStats('mailid', $content['id']), '2')
+ generateDateTime(getTimestampFromUserStats('mailid', $content['id']), 2)
);
// Display it depending on mail (data) type
'type' => $type,
'subject' => $subject,
'sender' => $sender,
- 'stamp' => generateDateTime($timestamp, '2'),
+ 'stamp' => generateDateTime($timestamp, 2),
'cat' => getCategory($cat),
'points' => translateComma($pay),
);
while ($data = SQL_FETCHARRAY($result)) {
// Prepare data for output
$rowContent = array(
- 'stamp' => generateDateTime($data['wernis_timestamp'], '2'),
+ 'stamp' => generateDateTime($data['wernis_timestamp'], 2),
'points' => translateComma($data['wernis_amount']),
'acc' => bigintval($data['wernis_account']),
'status' => WERNIS_TRANSFER_STATUS($data['wernis_type']),
//* DEBUG: */ outputHtml(basename(__FILE__)."<br />");
// Reset surfbar counter
-updateConfiguration('surfbar_monthly_counter', '0');
+updateConfiguration('surfbar_monthly_counter', 0);
//
?>
setConfigEntry('OUTPUT_MODE', 'direct');
// This hack prevents a backtrace in CSS output
- if (getOutputMode() == '1') {
+ if (getOutputMode() == 1) {
// Problem with config so set output mode
setConfigEntry('OUTPUT_MODE', 'render');
} // END - if
// Set other missing variables
- if (!isOutputModeSet()) setOutputMode('0');
+ if (!isOutputModeSet()) setOutputMode(0);
// Include more
foreach (array('inc/databases.php','inc/db/lib.php','inc/session.php','inc/versions.php','inc/install-functions.php','inc/load_config.php') as $inc) {
loadIncludeOnce('inc/load_config.php');
// Are we installation routine?
- if ((!isInstalling()) && (getOutputMode() != '1') && (getOutputMode() != -1)) {
+ if ((!isInstalling()) && (getOutputMode() != 1) && (getOutputMode() != -1)) {
// You have to install first!
redirectToUrl('install.php');
} // END - if
// Destroy cache here
// @TODO Rewrite this to a filter
- if (getOutputMode() == '0') rebuildCacheFile('modules', 'modules');
+ if (getOutputMode() == 0) rebuildCacheFile('modules', 'modules');
// And reload data
unset($GLOBALS['module_status'][$mod]);
//* DEBUG: */ outputHtml(__LINE__.'+'.$type."+<br />");
// Add closing div and br-tag
$OUT .= "</div><br />\n";
- $GLOBALS['nav_depth'] = '0';
+ $GLOBALS['nav_depth'] = 0;
// Run the filter chain
$ret = runFilterChain('post_youhere_line', array('access_level' => $accessLevel, 'type' => $type, 'content' => ""));
$ret = getMessage('_CATEGORY_404');
// Is the category id set?
- if ($cid == '0') {
+ if ($cid == 0) {
// No category
$ret = getMessage('_CATEGORY_NONE');
} elseif ($cid > 0) {
function countSumTotalData ($search, $tableName, $lookFor = 'id', $whereStatement = 'userid', $countRows = false, $add = '') {
$ret = 0;
//* DEBUG: */ outputHtml($search.'/'.$tableName.'/'.$lookFor.'/'.$whereStatement.'/'.$add.'<br />');
- if ((empty($search)) && ($search != '0')) {
+ if ((empty($search)) && ($search != 0)) {
// Count or sum whole table?
if ($countRows === true) {
// Count whole table
$ret = '0.00000';
} elseif (''.$ret.'' == '') {
// Fix empty result
- $ret = '0';
+ $ret = 0;
}
// Return value
* add_mode = Add points only to $userid or also refs? (WARNING! Changing 'ref' to 'direct'
* for default value will cause no referal will get points ever!!!)
*/
-function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify = false, $rid = '0', $locked = false, $add_mode = 'ref') {
+function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify = false, $rid = 0, $locked = false, $add_mode = 'ref') {
//* DEBUG: */ outputHtml("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
// Convert mode to lower-case
$add_mode = strtolower($add_mode);
// When $userid = 0 add points to jackpot
- if (($userid == '0') && (isExtensionActive('jackpot'))) {
+ if (($userid == 0) && (isExtensionActive('jackpot'))) {
// Add points to jackpot
addPointsToJackpot($points);
return;
$RECEIVERS = array($DATA['receivers']);
} else {
// No users left
- $RECEIVERS = array('0');
+ $RECEIVERS = array(0);
}
$dummy = $RECEIVERS;
}
// Reset variables
-$cnt2 = 0; $lastSentId = 0; $cnt_back = array('0'); $pointsBack = array('0');
+$cnt2 = 0; $lastSentId = 0; $cnt_back = array(0); $pointsBack = array(0);
if (SQL_NUMROWS($result_main) > 0) {
// Parse all mails
while ($DATA = SQL_FETCHARRAY($result_main, 0, false)) {
$RECEIVERS = array($DATA['receivers']);
} else {
// No users left
- $RECEIVERS = array('0');
+ $RECEIVERS = array(0);
}
$dummy = $RECEIVERS;
SQL_FREERESULT($result_stats);
} else {
// User does not exists so we have add the sender's points back to sender's account
- if (($RECEIVERS['id'] == '0') || (empty($RECEIVERS['id']))) {
+ if (($RECEIVERS['id'] == 0) || (empty($RECEIVERS['id']))) {
// List was empty
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `data_type`='SEND' WHERE `id`=%s LIMIT 1",
array(bigintval($DATA['id'])), __FILE__, __LINE__);
array(bigintval($content['userid'])), __FILE__, __LINE__);
// Translate some data
- $content['timestamp'] = generateDateTime($content['timestamp_ordered'], '2');
+ $content['timestamp'] = generateDateTime($content['timestamp_ordered'], 2);
// Load email template and send email
$message = loadEmailTemplate('member_stats_bonus', $content, bigintval($content['userid']));
// Prepare all data for the template
$content = array(
- 'activated' => generateDateTime($content['holiday_activated'], '1'),
- 'start' => generateDateTime($content['holiday_start'] , '1'),
- 'end' => generateDateTime($content['holiday_end'] , '1')
+ 'activated' => generateDateTime($content['holiday_activated'], 1),
+ 'start' => generateDateTime($content['holiday_start'] , 1),
+ 'end' => generateDateTime($content['holiday_end'] , 1)
);
// Send email to user
// We need to send-out notifications...
while ($content = SQL_FETCHARRAY($result)) {
// Translate timestamp
- $content['joined'] = generateDateTime($content['joined'], '0');
+ $content['joined'] = generateDateTime($content['joined'], 0);
- if (round($content['last_update']) == '0') {
+ if (round($content['last_update']) == 0) {
// Has never changed his accont
$content['last_update'] = getMessage('PROFILE_NEVER_CHANGED');
} else {
// Has changed his account
- $content['last_update'] = generateDateTime($content['last_update'], '0');
+ $content['last_update'] = generateDateTime($content['last_update'], 0);
}
// Load email template and send mail away
if (!isConfigEntrySet('css_php')) setConfigEntry('css_php', 'FILE');
// Output CSS files or content or link to css.php ?
-if ((getOutputMode() == '1') || (getConfig('css_php') == 'DIRECT')) {
+if ((getOutputMode() == 1) || (getConfig('css_php') == 'DIRECT')) {
// Load CSS files
$STYLES = merge_array($STYLES, getExtensionCssFiles());
} // END - switch
} // END - if
} // END - foreach
-} elseif ((getOutputMode() == '0') || (getConfig('css_php') == 'INLINE')) {
+} elseif ((getOutputMode() == 0) || (getConfig('css_php') == 'INLINE')) {
// Load CSS files
$STYLES = merge_array($STYLES, getExtensionCssFiles());
//* DEBUG: */ outputHtml(basename(__FILE__)."<br />");
// Reset the surfbar counter
-updateConfiguration('surfbar_weekly_counter', '0');
+updateConfiguration('surfbar_weekly_counter', 0);
//
?>
$GLOBALS['module'] = 'login';
// Set 'CSS-Mode'
-$GLOBALS['output_mode'] = 0;
+$GLOBALS['output_mode'] = -2;
// Load the required file(s)
require('inc/config-global.php');
// Was that mail a valid one?
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 = getConfig('URL'); $time = '1'; }
+ if (($time == 0) && ($payment > 0)) { $URL = getConfig('URL'); $time = 1; }
if (($time > 0) && (($payment > 0) || ($points > 0))) {
// Export data into constants for the template
$content = array(
// Tell everyone we are in this module
$GLOBALS['module'] = 'mailid';
-$GLOBALS['output_mode'] = 0;
+$GLOBALS['output_mode'] = -1;
// Load the required file(s)
require('inc/config-global.php');
// Is this entry valid?
if ($isValid === true) {
- if (($time == '0') && ($payment > 0)) $time = '1';
+ if (($time == 0) && ($payment > 0)) $time = 1;
if (($time > 0) && ($payment > 0)) {
$img_code = 0;
if (!empty($code)) {
// Add points
// @TODO Try to rewrite the following unset()
unset($GLOBALS['ref_level']);
- addPointsThroughReferalSystem('mailid_okay', $url_userid, $payment, false, '0', $locked);
+ addPointsThroughReferalSystem('mailid_okay', $url_userid, $payment, false, 0, $locked);
// Shall I add bonus points for "turbo clickers" ?
if (getExtensionVersion('bonus') >= '0.2.2') {
$GLOBALS['module'] = 'sponsor_confirm';
// Set 'CSS-Mode'
-$GLOBALS['output_mode'] = 0;
+$GLOBALS['output_mode'] = -2;
// Load the required file(s)
require('inc/config-global.php');
$GLOBALS['module'] = 'sponsor_ref';
// Set 'CSS-Mode'
-$GLOBALS['output_mode'] = 0;
+$GLOBALS['output_mode'] = -2;
// Load the required file(s)
require('inc/config-global.php');
</td>
<td class="switch_mem$content[sw] top2" width="30%" align="center">
{--EMAIL_TIMESTAMP--}:<br />
- <strong>$content[stamp]</strong>
+ <strong>$content[timestamp]</strong>
</td>
</tr>
<tr>
<tr>
<td align="center" class="switch_mem$content[sw] top right">
{--EMAIL_RECEIVERS--}:<br />
- <strong>$content[recs]</strong>
+ <strong>$content[target_send]</strong>
</td>
<td align="center" class="switch_mem$content[sw] top right">
{--EMAIL_TYPE--}:<br />
</td>
<td class="switch_mem$content[sw] top2" width="54%" align="center">
{--EMAIL_TIMESTAMP--}:<br />
- <strong>$content[stamp]</strong>
+ <strong>$content[timestamp_ordered]</strong>
</td>
</tr>
<tr>
<tr>
<td align="center" class="switch_mem$content[sw] top right" width="30%">
{--EMAIL_RECEIVERS--}:<br />
- <strong>$content[recs]</strong>
+ <strong>$content[target_send]</strong>
</td>
<td align="center" class="switch_mem$content[sw] top right" width="16%">
{--EMAIL_CONFIRMED--}:<br />