From c2e17d983fcbc0c3bd1dd37908d87c678f0367df Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 29 Oct 2009 01:06:50 +0000 Subject: [PATCH] More rewrites, and output-mode fixed (we should documentate this) --- DOCS/TODOs.txt | 3 +- beg.php | 2 +- birthday_confirm.php | 2 +- doubler.php | 2 +- inc/autopurge/purge-general.php | 2 +- inc/autopurge/purge-inact.php | 6 +- inc/autopurge/purge-unconfirmed.php | 4 +- inc/config-functions.php | 4 +- inc/databases.php | 2 +- inc/db/lib-mysql3.php | 2 +- inc/extensions-functions.php | 4 +- inc/extensions/ext-admins.php | 2 +- inc/extensions/ext-beg.php | 4 +- inc/extensions/ext-bonus.php | 10 +-- inc/extensions/ext-doubler.php | 2 +- inc/extensions/ext-holiday.php | 10 +-- inc/extensions/ext-html_mail.php | 4 +- inc/extensions/ext-newsletter.php | 6 +- inc/extensions/ext-nickname.php | 4 +- inc/extensions/ext-optimize.php | 2 +- inc/extensions/ext-order.php | 6 +- inc/extensions/ext-other.php | 2 +- inc/extensions/ext-rallye.php | 6 +- inc/extensions/ext-sql_patches.php | 6 +- inc/extensions/ext-theme.php | 4 +- inc/extensions/ext-transfer.php | 2 +- inc/filters.php | 2 +- inc/footer.php | 11 +-- inc/functions.php | 71 ++++++++++--------- inc/header.php | 4 +- inc/install-inc.php | 8 +-- inc/language-functions.php | 2 +- inc/libs/admins_functions.php | 4 +- inc/libs/beg_functions.php | 2 +- inc/libs/bonus_functions.php | 4 +- inc/libs/doubler_functions.php | 6 +- inc/libs/holiday_functions.php | 6 +- inc/libs/rallye_functions.php | 32 ++++----- inc/libs/security_functions.php | 2 +- inc/libs/sponsor_functions.php | 2 +- inc/libs/surfbar_functions.php | 22 +++--- inc/libs/task_functions.php | 4 +- inc/libs/user_functions.php | 4 +- inc/loader/load_cache- | 2 +- inc/loader/load_cache-admin.php | 4 +- inc/loader/load_cache-config.php | 2 +- inc/loader/load_cache-extension.php | 2 +- inc/loader/load_cache-filter.php | 2 +- inc/loader/load_cache-impressum.php | 2 +- inc/loader/load_cache-modules.php | 2 +- inc/loader/load_cache-refdepths.php | 2 +- inc/loader/load_cache-refsystem.php | 2 +- inc/loader/load_cache-revision.php | 2 +- inc/loader/load_cache-them.php | 2 +- inc/mails/doubler_mails.php | 2 +- inc/modules/admin/admin-inc.php | 14 ++-- inc/modules/admin/overview-inc.php | 10 +-- inc/modules/admin/what-add_points.php | 2 +- inc/modules/admin/what-add_rallye.php | 8 +-- inc/modules/admin/what-admins_contct.php | 4 +- inc/modules/admin/what-admins_edit.php | 4 +- inc/modules/admin/what-admins_mails.php | 2 +- inc/modules/admin/what-config_mediadata.php | 2 +- .../admin/what-config_rallye_prices.php | 4 +- inc/modules/admin/what-config_secure.php | 2 +- inc/modules/admin/what-del_email.php | 8 +-- inc/modules/admin/what-del_holiday.php | 6 +- inc/modules/admin/what-del_transfer.php | 2 +- inc/modules/admin/what-email_archiv.php | 10 +-- inc/modules/admin/what-email_details.php | 14 ++-- inc/modules/admin/what-extensions.php | 2 +- inc/modules/admin/what-list_autopurge.php | 6 +- inc/modules/admin/what-list_beg.php | 6 +- inc/modules/admin/what-list_bonus.php | 6 +- inc/modules/admin/what-list_doubler.php | 2 +- inc/modules/admin/what-list_holiday.php | 6 +- inc/modules/admin/what-list_links.php | 2 +- inc/modules/admin/what-list_notifications.php | 8 +-- inc/modules/admin/what-list_payouts.php | 6 +- inc/modules/admin/what-list_primera.php | 2 +- inc/modules/admin/what-list_rallyes.php | 22 +++--- inc/modules/admin/what-list_refs.php | 10 +-- inc/modules/admin/what-list_sponsor.php | 10 +-- inc/modules/admin/what-list_task.php | 2 +- inc/modules/admin/what-list_transfer.php | 2 +- inc/modules/admin/what-list_unconfirmed.php | 2 +- inc/modules/admin/what-list_user.php | 22 +++--- inc/modules/admin/what-list_wernis.php | 2 +- inc/modules/admin/what-send_newsletter.php | 2 +- inc/modules/admin/what-sub_points.php | 2 +- inc/modules/admin/what-surfbar_stats.php | 2 +- inc/modules/admin/what-theme_check.php | 2 +- inc/modules/admin/what-unlock_emails.php | 2 +- inc/modules/admin/what-unlock_sponsor.php | 6 +- inc/modules/admin/what-updates.php | 2 +- inc/modules/admin/what-usr_online.php | 2 +- inc/modules/guest/what-active.php | 2 +- inc/modules/guest/what-confirm.php | 4 +- inc/modules/guest/what-doubler.php | 2 +- inc/modules/guest/what-mediadata.php | 10 +-- inc/modules/guest/what-rallyes.php | 4 +- inc/modules/guest/what-register.php | 6 +- inc/modules/guest/what-sponsor_reg.php | 4 +- inc/modules/guest/what-stats.php | 2 +- inc/modules/guest/what-top10.php | 6 +- inc/modules/member/what-beg2.php | 2 +- inc/modules/member/what-bonus.php | 2 +- inc/modules/member/what-holiday.php | 12 ++-- inc/modules/member/what-mydata.php | 12 ++-- inc/modules/member/what-order.php | 12 ++-- inc/modules/member/what-payout.php | 2 +- inc/modules/member/what-points.php | 2 +- inc/modules/member/what-primera.php | 4 +- inc/modules/member/what-rallyes.php | 4 +- inc/modules/member/what-stats.php | 57 ++++++++------- inc/modules/member/what-surfbar_list.php | 4 +- inc/modules/member/what-surfbar_start.php | 4 +- inc/modules/member/what-transfer.php | 12 ++-- inc/modules/member/what-unconfirmed.php | 10 +-- inc/modules/member/what-wernis.php | 2 +- inc/monthly/monthly_surfbar.php | 2 +- inc/mysql-connect.php | 6 +- inc/mysql-manager.php | 14 ++-- inc/pool/pool-bonus.php | 2 +- inc/pool/pool-user.php | 6 +- inc/reset/reset_100_bonus.php | 2 +- inc/reset/reset_holiday.php | 6 +- inc/reset/reset_profile.php | 6 +- inc/stylesheet.php | 4 +- inc/weekly/weekly_surfbar.php | 2 +- login.php | 2 +- mailid.php | 2 +- mailid_top.php | 6 +- sponsor_confirm.php | 2 +- sponsor_ref.php | 2 +- templates/de/html/member/member_pool_row.tpl | 4 +- templates/de/html/member/member_stats_row.tpl | 4 +- 137 files changed, 403 insertions(+), 395 deletions(-) diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index d06dea0e68..779093bcdf 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -157,8 +157,7 @@ ./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'] = "".$content['login'].""; -./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 diff --git a/beg.php b/beg.php index 139a4e633e..15bfb4f5c9 100644 --- a/beg.php +++ b/beg.php @@ -204,7 +204,7 @@ if (isGetRequestElementSet('userid')) { } 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__); diff --git a/birthday_confirm.php b/birthday_confirm.php index 68738e58d9..e60f59c985 100644 --- a/birthday_confirm.php +++ b/birthday_confirm.php @@ -92,7 +92,7 @@ if (SQL_NUMROWS($result) == 1) { // 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", diff --git a/doubler.php b/doubler.php index 9b6745a31d..5fd52022b5 100644 --- a/doubler.php +++ b/doubler.php @@ -243,7 +243,7 @@ if (isExtensionActive('nickname')) { $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')); diff --git a/inc/autopurge/purge-general.php b/inc/autopurge/purge-general.php index c1e0ffa31f..c9e9bcbea2 100644 --- a/inc/autopurge/purge-general.php +++ b/inc/autopurge/purge-general.php @@ -153,7 +153,7 @@ ORDER BY // 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 diff --git a/inc/autopurge/purge-inact.php b/inc/autopurge/purge-inact.php index 93dcb5b2b6..97b2dbb433 100644 --- a/inc/autopurge/purge-inact.php +++ b/inc/autopurge/purge-inact.php @@ -99,7 +99,7 @@ ORDER BY $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'])); @@ -143,14 +143,14 @@ ORDER BY `userid` ASC", $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') { diff --git a/inc/autopurge/purge-unconfirmed.php b/inc/autopurge/purge-unconfirmed.php index 1b566c7a77..cdfd391b59 100644 --- a/inc/autopurge/purge-unconfirmed.php +++ b/inc/autopurge/purge-unconfirmed.php @@ -69,14 +69,14 @@ ORDER BY $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') { diff --git a/inc/config-functions.php b/inc/config-functions.php index 02563b9935..48e6d0a63a 100644 --- a/inc/config-functions.php +++ b/inc/config-functions.php @@ -294,7 +294,7 @@ function updateOldConfigFile () { // 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 @@ -349,7 +349,7 @@ function updateConfiguration ($entries, $values, $updateMode='') { } // 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 diff --git a/inc/databases.php b/inc/databases.php index ef12560a0a..15c81b861f 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -93,7 +93,7 @@ $GLOBALS['replacer'] = array( 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'))); diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index e709c8a0d9..cb1d236f3d 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -104,7 +104,7 @@ Query string:
incrementConfigEntry('sql_count'); // Debug output - if ((getOutputMode() != '1') && (isDebugModeEnabled()) && (getConfig('DEBUG_SQL') == 'Y')) { + if ((getOutputMode() != 1) && (isDebugModeEnabled()) && (getConfig('DEBUG_SQL') == 'Y')) { // // Debugging stuff... // diff --git a/inc/extensions-functions.php b/inc/extensions-functions.php index bed7a9c3ce..59e2e95ded 100644 --- a/inc/extensions-functions.php +++ b/inc/extensions-functions.php @@ -102,7 +102,7 @@ function loadExtension ($ext_name, $ext_mode = 'init', $ext_ver = '', $dry_run = // 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, @@ -534,7 +534,7 @@ function getExtensionVersion ($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__); diff --git a/inc/extensions/ext-admins.php b/inc/extensions/ext-admins.php index 7bf9ef6028..b2b26ee805 100644 --- a/inc/extensions/ext-admins.php +++ b/inc/extensions/ext-admins.php @@ -128,7 +128,7 @@ mail_template VARCHAR(255) NOT NULL, 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."); diff --git a/inc/extensions/ext-beg.php b/inc/extensions/ext-beg.php index e6f17737b9..923abf8806 100644 --- a/inc/extensions/ext-beg.php +++ b/inc/extensions/ext-beg.php @@ -235,8 +235,8 @@ PRIMARY KEY (id) 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."); diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index 822c154a5d..f16ac0143d 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -113,7 +113,7 @@ PRIMARY KEY (id) 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 Updates prüfen herunter."); @@ -188,7 +188,7 @@ KEY userid (userid) 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"); @@ -355,7 +355,7 @@ KEY userid (userid) 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... @@ -421,7 +421,7 @@ WHERE `last_online` < ".$mark." ORDER BY `userid` ASC"); 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."); @@ -506,7 +506,7 @@ WHERE `last_online` < ".$mark." ORDER BY `userid` ASC"); 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."); diff --git a/inc/extensions/ext-doubler.php b/inc/extensions/ext-doubler.php index 44588a96a0..dda6a6794e 100644 --- a/inc/extensions/ext-doubler.php +++ b/inc/extensions/ext-doubler.php @@ -215,7 +215,7 @@ PRIMARY KEY (id) 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."); diff --git a/inc/extensions/ext-holiday.php b/inc/extensions/ext-holiday.php index 86d16dc43c..84b2544eea 100644 --- a/inc/extensions/ext-holiday.php +++ b/inc/extensions/ext-holiday.php @@ -74,7 +74,7 @@ PRIMARY KEY (id) 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 @@ -82,8 +82,8 @@ PRIMARY KEY (id) 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 @@ -156,7 +156,7 @@ PRIMARY KEY (id) 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!) @@ -202,7 +202,7 @@ PRIMARY KEY (id) 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."); diff --git a/inc/extensions/ext-html_mail.php b/inc/extensions/ext-html_mail.php index 3b36479df5..654f940b64 100644 --- a/inc/extensions/ext-html_mail.php +++ b/inc/extensions/ext-html_mail.php @@ -166,8 +166,8 @@ switch (getExtensionMode()) { $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; diff --git a/inc/extensions/ext-newsletter.php b/inc/extensions/ext-newsletter.php index 6e6d0174b1..5f9e9f34ea 100644 --- a/inc/extensions/ext-newsletter.php +++ b/inc/extensions/ext-newsletter.php @@ -165,7 +165,7 @@ PRIMARY KEY (`nl_id`) 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`), @@ -224,8 +224,8 @@ PRIMARY KEY (`nl_order_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; diff --git a/inc/extensions/ext-nickname.php b/inc/extensions/ext-nickname.php index b7ac3ca38d..0118114431 100644 --- a/inc/extensions/ext-nickname.php +++ b/inc/extensions/ext-nickname.php @@ -100,7 +100,7 @@ switch (getExtensionMode()) { 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); @@ -157,7 +157,7 @@ switch (getExtensionMode()) { 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."); diff --git a/inc/extensions/ext-optimize.php b/inc/extensions/ext-optimize.php index 79ce41bff5..cd58bc17f9 100644 --- a/inc/extensions/ext-optimize.php +++ b/inc/extensions/ext-optimize.php @@ -58,7 +58,7 @@ switch (getExtensionMode()) { 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 diff --git a/inc/extensions/ext-order.php b/inc/extensions/ext-order.php index 9b7993c3ed..501125434d 100644 --- a/inc/extensions/ext-order.php +++ b/inc/extensions/ext-order.php @@ -74,7 +74,7 @@ switch (getExtensionMode()) { 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."); @@ -82,7 +82,7 @@ switch (getExtensionMode()) { 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!) @@ -272,7 +272,7 @@ nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der Us 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."); diff --git a/inc/extensions/ext-other.php b/inc/extensions/ext-other.php index 02e16d3baf..fd0c94b00a 100644 --- a/inc/extensions/ext-other.php +++ b/inc/extensions/ext-other.php @@ -89,7 +89,7 @@ switch (getExtensionMode()) { 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."); diff --git a/inc/extensions/ext-rallye.php b/inc/extensions/ext-rallye.php index fa87340920..88da04d695 100644 --- a/inc/extensions/ext-rallye.php +++ b/inc/extensions/ext-rallye.php @@ -217,7 +217,7 @@ PRIMARY KEY (id) 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 templates/de/emails/member/member_rallye_notify.tpl folgende zwei Zeilen ein:
@@ -289,7 +289,7 @@ Zudem sollten Sie mindestens folgende Templates (in templates/".getLangu 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."); @@ -327,7 +327,7 @@ Zudem sollten Sie mindestens folgende Templates (in templates/".getLangu 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); diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index 77fcb36921..95971868ca 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -456,15 +456,15 @@ PRIMARY KEY (`id`) 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"); diff --git a/inc/extensions/ext-theme.php b/inc/extensions/ext-theme.php index e4b77c799b..a44d29b92c 100644 --- a/inc/extensions/ext-theme.php +++ b/inc/extensions/ext-theme.php @@ -140,8 +140,8 @@ INDEX (`theme_active`) // 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'"); diff --git a/inc/extensions/ext-transfer.php b/inc/extensions/ext-transfer.php index 3c5ab03e49..7ef77d5816 100644 --- a/inc/extensions/ext-transfer.php +++ b/inc/extensions/ext-transfer.php @@ -247,7 +247,7 @@ PRIMARY KEY (id) 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."); diff --git a/inc/filters.php b/inc/filters.php index 1b7eb19dae..5b007f3d21 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -603,7 +603,7 @@ function FILTER_DETERMINE_WHAT_ACTION () { // 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 diff --git a/inc/footer.php b/inc/footer.php index 0e9518d91f..d4f6a4d1d7 100644 --- a/inc/footer.php +++ b/inc/footer.php @@ -43,13 +43,13 @@ if (!defined('__SECURITY')) { // 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! :-) @@ -61,19 +61,20 @@ if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != '1') && } // 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 diff --git a/inc/functions.php b/inc/functions.php index 0048109565..c7064dccf7 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -116,7 +116,7 @@ function outputHtml ($htmlCode, $newLine = true) { sendHeader('Content-language: ' . getLanguage()); // Extension 'rewrite' installed? - if ((isExtensionActive('rewrite')) && (getOutputMode() != '1')) { + if ((isExtensionActive('rewrite')) && (getOutputMode() != 1)) { $GLOBALS['output'] = rewriteLinksInCode($GLOBALS['output']); } // END - if @@ -148,7 +148,7 @@ function outputHtml ($htmlCode, $newLine = true) { 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 @@ -241,7 +241,7 @@ function loadTemplate ($template, $return=false, $content=array()) { 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; @@ -410,7 +410,7 @@ function loadTemplate ($template, $return=false, $content=array()) { } // 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 @@ -600,7 +600,7 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = ' // Free result SQL_FREERESULT($result_email); } - } elseif ($toEmail == '0') { + } elseif ($toEmail == 0) { // Is the webmaster! $toEmail = getConfig('WEBMASTER'); } @@ -731,7 +731,7 @@ function generatePassword ($length = 0) { } // 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); @@ -744,10 +744,10 @@ function generateDateTime ($time, $mode = '0') { 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; @@ -756,10 +756,10 @@ function generateDateTime ($time, $mode = '0') { 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; @@ -808,7 +808,7 @@ function translatePoolType ($type) { // 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'); @@ -1165,7 +1165,7 @@ function array_pk_sort (&$array, $a_sort, $primary_key = 0, $order = -1, $nums = } // -function addSelectionBox ($type, $default, $prefix = '', $id = '0') { +function addSelectionBox ($type, $default, $prefix = '', $id = 0) { $OUT = ''; if ($type == 'yn') { @@ -1250,7 +1250,7 @@ function addSelectionBox ($type, $default, $prefix = '', $id = '0') { 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 .= "