]> git.mxchange.org Git - mailer.git/commitdiff
config.php partly solved, see #117
authorRoland Häder <roland@mxchange.org>
Mon, 6 Apr 2009 19:34:33 +0000 (19:34 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 6 Apr 2009 19:34:33 +0000 (19:34 +0000)
163 files changed:
.gitattributes
.gitignore
admin.php
agb.php
beg.php
birthday_confirm.php
click.php
confirm.php
css.php
debug.php
doubler.php
img.php
inc/config-functions.php
inc/config-global.php [new file with mode: 0644]
inc/config-local.php.dist [new file with mode: 0644]
inc/config.php
inc/databases.php
inc/db/lib-mysql3.php
inc/db/lib.php
inc/doubler_send.php
inc/extensions.php
inc/extensions/ext-lead.php [new file with mode: 0644]
inc/extensions/ext-newsletter.php
inc/filters.php
inc/footer.php
inc/functions.php
inc/header.php
inc/inc-functions.php
inc/install-inc.php
inc/language.php
inc/language/bonus_de.php
inc/language/de.php
inc/language/en.php
inc/language/install_de.php
inc/libs/admins_functions.php
inc/libs/bonus_functions.php
inc/libs/cache_functions.php
inc/libs/doubler_functions.php
inc/libs/holiday_functions.php
inc/libs/html_mail_functions.php
inc/libs/rallye_functions.php
inc/libs/register_functions.php
inc/libs/security_functions.php
inc/libs/sponsor_functions.php
inc/libs/surfbar_functions.php
inc/libs/user_functions.php
inc/load_config.php [new file with mode: 0644]
inc/modules/admin.php
inc/modules/admin/admin-inc.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-admin_add.php
inc/modules/admin/what-admins_edit.php
inc/modules/admin/what-admins_mails.php
inc/modules/admin/what-config_admin.php
inc/modules/admin/what-config_admins.php
inc/modules/admin/what-config_autopurge.php
inc/modules/admin/what-config_beg.php
inc/modules/admin/what-config_birthday.php
inc/modules/admin/what-config_bonus.php
inc/modules/admin/what-config_cache.php
inc/modules/admin/what-config_doubler.php
inc/modules/admin/what-config_extensions.php
inc/modules/admin/what-config_holiday.php
inc/modules/admin/what-config_mediadata.php
inc/modules/admin/what-config_order.php
inc/modules/admin/what-config_other.php
inc/modules/admin/what-config_points.php
inc/modules/admin/what-config_rallye_prices.php
inc/modules/admin/what-config_refback.php
inc/modules/admin/what-config_removeip.php
inc/modules/admin/what-config_rewrite.php
inc/modules/admin/what-config_surfbar.php
inc/modules/admin/what-config_wernis.php
inc/modules/admin/what-del_holiday.php
inc/modules/admin/what-del_transfer.php
inc/modules/admin/what-email_archiv.php
inc/modules/admin/what-email_details.php
inc/modules/admin/what-extensions.php
inc/modules/admin/what-guest_add.php
inc/modules/admin/what-list_autopurge.php
inc/modules/admin/what-list_beg.php
inc/modules/admin/what-list_bonus.php
inc/modules/admin/what-list_holiday.php
inc/modules/admin/what-list_notifications.php
inc/modules/admin/what-list_payouts.php
inc/modules/admin/what-list_primera.php
inc/modules/admin/what-list_rallyes.php
inc/modules/admin/what-list_refs.php
inc/modules/admin/what-list_sponsor.php
inc/modules/admin/what-list_task.php
inc/modules/admin/what-list_transfer.php
inc/modules/admin/what-list_unconfirmed.php
inc/modules/admin/what-list_user.php
inc/modules/admin/what-list_wernis.php
inc/modules/admin/what-logs.php
inc/modules/admin/what-mem_add.php
inc/modules/admin/what-refbanner.php
inc/modules/admin/what-send_newsletter.php
inc/modules/admin/what-surfbar_stats.php
inc/modules/admin/what-theme_check.php
inc/modules/admin/what-unlock_emails.php
inc/modules/admin/what-unlock_sponsor.php
inc/modules/admin/what-updates.php
inc/modules/admin/what-usage.php
inc/modules/guest/what-confirm.php
inc/modules/guest/what-login.php
inc/modules/guest/what-rallyes.php
inc/modules/guest/what-register.php
inc/modules/guest/what-stats.php
inc/modules/guest/what-top10.php
inc/modules/guest/what-wernis_portal.php
inc/modules/login.php
inc/modules/member/what-beg2.php
inc/modules/member/what-bonus.php
inc/modules/member/what-categories.php
inc/modules/member/what-holiday.php
inc/modules/member/what-html_mail.php
inc/modules/member/what-newsletter.php
inc/modules/member/what-order.php
inc/modules/member/what-payout.php
inc/modules/member/what-primera.php
inc/modules/member/what-rallyes.php
inc/modules/member/what-stats.php
inc/modules/member/what-support.php
inc/modules/member/what-surfbar_list.php
inc/modules/member/what-transfer.php
inc/modules/member/what-wernis.php
inc/modules/sponsor/settings.php
inc/mysql-connect.php
inc/mysql-manager.php
inc/pool/pool-user.php
inc/reset/reset_holiday.php
inc/session.php
inc/stats_bonus.php
inc/stylesheet.php
inc/wrapper-functions.php [new file with mode: 0644]
index.php
install.php
js.php
lead-confirm.php
login.php
mailid.php
mailid_top.php
modules.php
ref.php
show_bonus.php
sponsor_confirm.php
sponsor_ref.php
surfbar.php
templates/de/html/admin/admin_config_beg.tpl
templates/de/html/admin/admin_config_birthday.tpl
templates/de/html/admin/admin_config_bonus.tpl
templates/de/html/beg/beg_link.tpl
templates/de/html/birthday/birthday_confirm.tpl
templates/de/html/birthday/birthday_msg.tpl
templates/de/html/copyright.tpl
templates/de/html/ext/ext_lead.tpl [new file with mode: 0644]
templates/de/html/guest/guest_beg.tpl
templates/de/html/index.tpl
templates/de/html/member/member_beg.tpl
templates/de/html/show_bonus.tpl
templates/de/html/show_bonus_msg.tpl
view.php

index f9c448fe182e7c7f063471fef55f60f1fdb5a191..d789c7dec6cad1bfaa6d4aec626fbcf602be5f49 100644 (file)
@@ -92,6 +92,8 @@ inc/autopurge/purge-unconfirmed.php -text
 inc/cache/.htaccess -text
 inc/check-reset.php -text
 inc/config-functions.php -text
+inc/config-global.php -text
+inc/config-local.php.dist -text
 inc/config.php -text
 inc/databases.php -text
 inc/db/.htaccess -text
@@ -125,6 +127,7 @@ inc/extensions/ext-events.php -text
 inc/extensions/ext-holiday.php -text
 inc/extensions/ext-html_mail.php -text
 inc/extensions/ext-iso3166.php -text
+inc/extensions/ext-lead.php -text
 inc/extensions/ext-logs.php -text
 inc/extensions/ext-mailid.php -text
 inc/extensions/ext-maintenance.php -text
@@ -261,6 +264,7 @@ inc/libs/user_functions.php -text
 inc/libs/wernis_functions.php -text
 inc/libs/yoomedia_functions.php -text
 inc/load_cache.php -text
+inc/load_config.php -text
 inc/load_extensions.php -text
 inc/loader/.htaccess -text
 inc/loader/load_cache-admin.php -text
@@ -627,6 +631,7 @@ inc/stylesheet.php -text
 inc/weekly/.htaccess -text
 inc/weekly/weekly_ -text
 inc/weekly/weekly_surfbar.php -text
+inc/wrapper-functions.php -text
 /index.php -text
 /install.php -text
 install/menu-de.sql -text
@@ -1241,6 +1246,7 @@ templates/de/html/ext/ext_doubler.tpl -text
 templates/de/html/ext/ext_events.tpl -text
 templates/de/html/ext/ext_holiday.tpl -text
 templates/de/html/ext/ext_html_mail.tpl -text
+templates/de/html/ext/ext_lead.tpl -text
 templates/de/html/ext/ext_logs.tpl -text
 templates/de/html/ext/ext_mailid.tpl -text
 templates/de/html/ext/ext_maintenance.tpl -text
index e14734f1e00785adf64669d6476c1775625efa49..9df491e110499d42a26349c0fbc9bf0cda4a7422 100644 (file)
@@ -6,3 +6,4 @@ inc/.secret/dummy.php
 inc/cache/*.cache
 inc/cache/*.log
 inc/cache/.revision
+inc/cache/config-local.php
index 9ae71294abbc7626a6f0edbb36e9f74ccbd50195..c6a9bf529e99f8a2d7c02658610a513342b135ae 100644 (file)
--- a/admin.php
+++ b/admin.php
@@ -48,7 +48,7 @@ $GLOBALS['module'] = 'admin';
 $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Is the script installed?
 if (isInstalled()) {
diff --git a/agb.php b/agb.php
index 652ad4b25759bed578b875e3df380f7181a89b80..065941cc7ff753a20c707ce37cbf48270f489178 100644 (file)
--- a/agb.php
+++ b/agb.php
@@ -48,7 +48,7 @@ $GLOBALS['module'] = 'agb';
 $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Is the script installed?
 if (isInstalled()) {
diff --git a/beg.php b/beg.php
index 6d4e6c5cc6344665dc3054eb3818d905757d544d..669afcf88efcc9f450bb435c407fa5a2c4e4b60a 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -51,7 +51,7 @@ $GLOBALS['output_mode'] = -1;
 $msg = null;
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Is the 'beg' extension active?
 REDIRCT_ON_UNINSTALLED_EXTENSION('beg');
@@ -69,7 +69,7 @@ if (isInstalled()) {
                $pay = false;
 
                // Validate if it is not a number
-               if ("".(REQUEST_GET('uid') + 0)."" !== "".REQUEST_GET('uid')."") {
+               if (''.(REQUEST_GET('uid') + 0).'' !== ''.REQUEST_GET('uid').'') {
                        if (EXT_IS_ACTIVE('nickname')) {
                                // Maybe we have found a nickname?
                                $result = SQL_QUERY_ESC("SELECT userid, beg_clicks, ref_payout, status, last_online FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1",
@@ -86,7 +86,7 @@ if (isInstalled()) {
                }
 
                // Check if locked in so don't pay points
-               $status = "failed";
+               $status = 'failed';
 
                // Check if account was found
                if (SQL_NUMROWS($result) == 1) {
@@ -106,7 +106,7 @@ if (isInstalled()) {
                                // Set nickname / userid for the template(s
                                define('__BEG_UID'   , REQUEST_GET('uid'));
                                define('__BEG_CLICKS', ($clicks + 1));
-                               define('__BEG_BANNER', LOAD_TEMPLATE("beg_banner", true));
+                               define('__BEG_BANNER', LOAD_TEMPLATE('beg_banner', true));
                                define('__BEG_POINTS', translateComma($points));
                        } else {
                                // Other status
@@ -128,7 +128,7 @@ if (isInstalled()) {
                                array($uid, detectRemoteAddr(), session_id()), __FILE__, __LINE__);
 
                        // Entry not found, points set and not logged in?
-                       if (((SQL_NUMROWS($result) == 0) || (IS_ADMIN())) && ($points > 0) && (!IS_MEMBER()) && (getConfig('beg_pay_mode') == "NONE")) {
+                       if (((SQL_NUMROWS($result) == 0) || (IS_ADMIN())) && ($points > 0) && (!IS_MEMBER()) && (getConfig('beg_pay_mode') == 'NONE')) {
 
                                // Admin is testing?
                                if (!IS_ADMIN()) {
@@ -139,10 +139,7 @@ if (isInstalled()) {
                                                array($uid, detectRemoteAddr(), session_id()), __FILE__, __LINE__);
 
                                        // Was is successfull?
-                                       if (SQL_AFFECTEDROWS() == 1) {
-                                               // Okay!
-                                               $pay = true;
-                                       } // END - if
+                                       $pay (SQL_AFFECTEDROWS() == 1);
                                } else {
                                        // Is admin!
                                        $pay = true;
@@ -153,19 +150,19 @@ if (isInstalled()) {
                                        // Add points to user or begging rallye account
                                        if (BEG_ADD_POINTS($uid, $points)) {
                                                // Set 'done' message
-                                               define('__BEG_MSG', LOAD_TEMPLATE("beg_done", true));
+                                               $content['msg'] = LOAD_TEMPLATE('beg_done', true));
                                        } else {
                                                // Error!
-                                               define('__BEG_MSG', LOAD_TEMPLATE("beg_failed", true));
+                                               $content['msg'] = LOAD_TEMPLATE('beg_failed', true));
                                        }
                                } else {
                                        // Error!
-                                       define('__BEG_MSG', LOAD_TEMPLATE("beg_failed", true));
+                                       $content['msg'] = LOAD_TEMPLATE('beg_failed', true));
                                }
                        } elseif (IS_MEMBER()) {
                                // Logged in user found!
-                               define('__BEG_MSG', LOAD_TEMPLATE("beg_login", true));
-                       } elseif (getConfig('beg_pay_mode') != "NONE") { // Other pay-mode active!
+                               $content['msg'] = LOAD_TEMPLATE('beg_login', true));
+                       } elseif (getConfig('beg_pay_mode') != 'NONE') { // Other pay-mode active!
                                // Prepare content for template
                                $content = array(
                                        'clicks' => constant('__BEG_CLICKS'),
@@ -174,11 +171,11 @@ if (isInstalled()) {
                                );
 
                                // Load message template depending on pay-mode
-                               define('__BEG_MSG', LOAD_TEMPLATE("beg_pay_mode_".strtolower(getConfig('beg_pay_mode')), true, $content));
+                               $content['msg'] = LOAD_TEMPLATE('beg_pay_mode_'.strtolower(getConfig('beg_pay_mode')), true, $content));
                                $pay = true;
                        } else {
                                // Clicked received while reload lock is active
-                               define('__BEG_MSG', LOAD_TEMPLATE("beg_failed", true));
+                               $content['msg'] = LOAD_TEMPLATE('beg_failed', true));
                        }
 
                        // Free memory
@@ -188,28 +185,28 @@ if (isInstalled()) {
                        loadIncludeOnce('inc/header.php');
 
                        // Load final template
-                       LOAD_TEMPLATE("beg_link");
+                       LOAD_TEMPLATE('beg_link', false, $content);
 
                        // Tracker code enabled? (We don't track users here!
-                       if ((getConfig('beg_pay_mode') != "NONE") && ($pay)) {
+                       if ((getConfig('beg_pay_mode') != 'NONE') && ($pay === true)) {
                                // Prepare content for template
                                // @TODO Opps, what is missing here???
                                $content = array(
                                );
 
                                // Include config-depending template
-                               LOAD_TEMPLATE("beg_pay_code_".strtolower(getConfig('beg_pay_mode')), false, $content);
-                       } elseif ((!$pay) && (!defined('__BEG_MSG'))) {
+                               LOAD_TEMPLATE('beg_pay_code_'.strtolower(getConfig('beg_pay_mode')), false, $content);
+                       } elseif ((!$pay) && (!isset($content['msg']))) {
                                // Cannot pay! :-(
-                               define('__BEG_MSG', LOAD_TEMPLATE("beg_failed", true));
+                               $content['msg'] = LOAD_TEMPLATE('beg_failed', true));
                        }
 
                        // Include footer
                        loadIncludeOnce('inc/footer.php');
-               } elseif (($status != 'CONFIRMED') && ($status != "failed")) {
+               } elseif (($status != 'CONFIRMED') && ($status != 'failed')) {
                        // Maybe locked/unconfirmed account?
                        $msg = generateErrorCodeFromUserStatus($status);
-               } elseif (($uid == '0') || ($status == "failed")) {
+               } elseif (($uid == '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(REQUEST_GET('uid')), __FILE__, __LINE__);
index 829dc6965a7639a75841df2484b962c99f3bd676..24c46fcc56a945922d8907ba713932cf565b98a0 100644 (file)
@@ -48,10 +48,10 @@ $GLOBALS['module'] = 'birthday_confirm';
 $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Is the 'birthday' extension active?
-REDIRECT_ON_UNINSTALLED_EXTENSION('birthday');
+redirectOnUninstalledExtension('birthday');
 
 // Is the script installed?
 if (isInstalled()) {
@@ -70,6 +70,9 @@ WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1",
  array($uid, $chk), __FILE__, __LINE__);
        //* DEBUG: */ echo "uid=".$uid.",chk=".$chk." (".strlen($chk).'/'.strlen(REQUEST_GET('check')).'/'.SQL_NUMROWS($result).")<br />\n";
 
+       // Prepare content
+       $content = array();
+
        // Is an entry there?
        if (SQL_NUMROWS($result) == 1) {
                // Ok, congratulation again! Here's your gift from us...
@@ -95,21 +98,19 @@ WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1",
                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_birthday` WHERE userid=%s AND chk_value='%s' LIMIT 1",
                                array($uid, $chk), __FILE__, __LINE__);
 
-                       // Transfer data to constants for the template
-                       define('__GENDER', translateGender($data['gender']));
-                       define('__SNAME' , $data['surname']);
-                       define('__FNAME' , $data['family']);
-                       define('__GIFT'  , translateComma($data['points']));
+                       // "Translate" some data
+                       $data['gender'] = translateGender($data['gender']);
+                       $data['points'] = translateComma($data['points']);
 
                        // Load message from template
-                       define('__MSG', LOAD_TEMPLATE('birthday_msg', true));
+                       $content['msg'] = LOAD_TEMPLATE('birthday_msg', true, $data);
                } else {
                        // Unconfirmed / locked accounts cannot get points
-                       define('__MSG', sprintf(getMessage('BIRTHDAY_CANNOT_STATUS'), translateUserStatus($data['status'])));
+                       $content['msg'] = sprintf(getMessage('BIRTHDAY_CANNOT_STATUS'), translateUserStatus($data['status']));
                }
        } else {
                // Cannot load data!
-               define('__MSG', getMessage('BIRTHDAY_CANNOT_LOAD_DATA'));
+               $content['msg'] = getMessage('BIRTHDAY_CANNOT_LOAD_DATA');
        }
 
        // Free memory
@@ -122,13 +123,13 @@ WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1",
        loadInclude('inc/header.php');
 
        // Load birthday header template (for your banners, e.g.?)
-       define('__BIRTHDAY_HEADER', LOAD_TEMPLATE('birthday_header', true));
+       $content['header'] =  LOAD_TEMPLATE('birthday_header', true);
 
        // Load birthday footer template (for your banners, e.g.?)
-       define('__BIRTHDAY_FOOTER', LOAD_TEMPLATE('birthday_footer', true));
+       $content['footer'] =  LOAD_TEMPLATE('birthday_footer', true);
 
        // Load final template and output it
-       LOAD_TEMPLATE('birthday_confirm');
+       LOAD_TEMPLATE('birthday_confirm', false, $content);
 
        // Include footer
        loadInclude('inc/footer.php');
index 48ddf484d81a5fc1bc95774b4618f978862c6d24..cf6f3e529f98a96268bde12c897db2868e43b1d2 100644 (file)
--- a/click.php
+++ b/click.php
@@ -48,7 +48,7 @@ $GLOBALS['module'] = 'click';
 $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 if (((REQUEST_ISSET_GET(('user'))) || (REQUEST_ISSET_GET(('reseller')))) && (REQUEST_ISSET_GET(('banner')))) {
        // Update clicks counter...
index 1a540ccabc9e1c90c79aea39dd334bf560f6372b..96f75782085ba71f3ce113b23e1c09e3b09370ae 100644 (file)
@@ -48,7 +48,7 @@ $GLOBALS['module'] = 'confirm';
 $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Is the script installed?
 if ((isInstalled()) && (isAdminRegistered())) {
diff --git a/css.php b/css.php
index 520676709310c7959e466c41d290db8a1b4e7524..714848650a4749470773d05efef9998abfd43b89 100644 (file)
--- a/css.php
+++ b/css.php
@@ -40,7 +40,7 @@
 require('inc/libs/security_functions.php');
 
 // Footer is disabled in CSS mode
-$GLOBALS['footer_sent'] = "-1";
+$GLOBALS['footer_sent'] = '-1';
 
 // Init variables
 $GLOBALS['what'] = '';
@@ -50,11 +50,11 @@ $GLOBALS['action'] = '';
 $GLOBALS['output_mode'] = '1';
 $GLOBALS['module'] = 'css';
 
-// Set header
-header('Content-type: text/css');
-
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
+
+// Set header
+sendHeader('Content-type: text/css');
 
 // Load header
 loadInclude('inc/header.php');
index c7cf9e90231fe0122921015be3cabe1f9e5dfca8..aa7c764e1ffc549dae66a068b68df1632b2366f5 100644 (file)
--- a/debug.php
+++ b/debug.php
@@ -48,7 +48,7 @@ $GLOBALS['module'] = 'debug';
 $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Redirect only to registration page when this script is installed
 if ((isInstalled()) && (getTotalFatalErrors() == 0)) {
index 908cc0264d3a99189a3e158cfec472fdbdf86a6e..9a6354783170f111ac9641a081c022b837417457 100644 (file)
@@ -50,10 +50,10 @@ $GLOBALS['refid'] = 0;
 $GLOBALS['output_mode'] = 0;
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Is the 'doubler' extension active?
-REDIRECT_ON_UNINSTALLED_EXTENSION('doubler');
+redirectOnUninstalledExtension('doubler');
 
 // Is the script installed?
 if (isInstalled()) {
diff --git a/img.php b/img.php
index 2f39fa0e37c12d164084522470285955e1ce6025..f1099706eab7efadc03e45713d6fb72369f828c5 100644 (file)
--- a/img.php
+++ b/img.php
@@ -48,7 +48,7 @@ $GLOBALS['module'] = 'img';
 $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Script installed?
 if (isInstalled()) {
@@ -59,10 +59,10 @@ if (isInstalled()) {
        if (REQUEST_ISSET_GET(('code'))) {
                // Generate image
                GENERATE_IMAGE(bigintval(REQUEST_GET('code')));
-       } elseif (REQUEST_ISSET_GET(('tag'))) {
+       } elseif (REQUEST_ISSET_GET('tag')) {
                // Tag set so create the IFN (Include-FileName)
                $INC = sprintf("inc/img/tag-%s.php",
-                       REQUEST_GET(('tag'))
+                       REQUEST_GET('tag')
                );
 
                // Include is readable?
index 186ede833979629932d5b0994eec5780746665a1..506db1b908613789c62beb9e43428beecaa9d3b2 100644 (file)
@@ -49,16 +49,16 @@ function mergeConfig ($newConfig) {
 }
 
 // Getter for $_CONFIG entries
-function getConfig ($entry) {
+function getConfig ($configEntry) {
        global $_CONFIG;
 
        // Default value
        $value = null;
 
        // Is the entry there?
-       if (isConfigEntrySet($entry)) {
+       if (isConfigEntrySet($configEntry)) {
                // Then use it
-               $value = $_CONFIG[$entry];
+               $value = $_CONFIG[$configEntry];
        } // END - if
 
        // Return it
@@ -66,20 +66,26 @@ function getConfig ($entry) {
 }
 
 // Setter for $_CONFIG entries
-function setConfigEntry ($entry, $value) {
+function setConfigEntry ($configEntry, $value) {
        global $_CONFIG;
 
        // Secure the entry name
-       $entry = SQL_ESCAPE($entry);
+       if (function_exists('SQL_ESCAPE')) {
+               // Use our secure function
+               $configEntry = SQL_ESCAPE($configEntry);
+       } else {
+               // Use maybe insecure function
+               $configEntry = smartAddSlashes($configEntry);
+       }
 
        // And set it
-       $_CONFIG[$entry] = $value;
+       $_CONFIG[$configEntry] = $value;
 }
 
 // Checks wether the given config entry is set
-function isConfigEntrySet ($entry) {
+function isConfigEntrySet ($configEntry) {
        global $_CONFIG;
-       return (isset($_CONFIG[$entry]));
+       return (isset($_CONFIG[$configEntry]));
 }
 
 // Increment or init with given value or 1 as default the given config entry
@@ -105,6 +111,7 @@ function isConfigLoaded () {
 // Init the config array
 function initConfig () {
        global $_CONFIG;
+       debug_report_bug('Reached!');
 
        // Set a minimum dummy configuration
        $_CONFIG = array(
@@ -116,19 +123,17 @@ function initConfig () {
 
 // Load configuration and return it as an arry
 function loadConfiguration ($no = '0') {
-       global $_CONFIG;
-
        // Check for cache extension, cache-array and if the requested configuration is in cache
-       if ((is_array($GLOBALS['cache_array'])) && (isset($GLOBALS['cache_array']['config'][$no])) && (is_array($GLOBALS['cache_array']['config'][$no]))) {
+       if ((isset($GLOBALS['cache_array'])) && (is_array($GLOBALS['cache_array'])) && (isset($GLOBALS['cache_array']['config'][$no])) && (is_array($GLOBALS['cache_array']['config'][$no]))) {
                // Load config from cache
                //* DEBUG: */ echo gettype($GLOBALS['cache_array']['config'][$no])."<br />\n";
                foreach ($GLOBALS['cache_array']['config'][$no] as $key => $value) {
-                       $_CONFIG[$key] = $value;
+                       setConfigEntry($key, $value);
                } // END - foreach
 
                // Count cache hits if exists
-               if ((isset($_CONFIG['cache_hits'])) && (EXT_IS_ACTIVE('cache'))) {
-                       $_CONFIG['cache_hits']++;
+               if ((isConfigEntrySet('cache_hits')) && (EXT_IS_ACTIVE('cache'))) {
+                       incrementConfigEntry('cache_hits');
                } // END - if
        } elseif ((!EXT_IS_ACTIVE('cache')) || (!isset($GLOBALS['cache_array']['config'][$no]))) {
                // Load config from DB
@@ -138,14 +143,14 @@ function loadConfiguration ($no = '0') {
                // Is the config there?
                if (SQL_NUMROWS($result_config) == 1) {
                        // Get config from database
-                       $_CONFIG = SQL_FETCHARRAY($result_config);
+                       mergeConfig(SQL_FETCHARRAY($result_config));
                } // END - if
 
                // Free result
                SQL_FREERESULT($result_config);
 
                // Remember this config in the array
-               $GLOBALS['cache_array']['config'][$no] = $_CONFIG;
+               $GLOBALS['cache_array']['config'][$no] = getConfigArray();
        }
 }
 
@@ -153,8 +158,17 @@ function loadConfiguration ($no = '0') {
 function getConfigArray () {
        global $_CONFIG;
 
-       // Return it
-       return $_CONFIG;
+       // Default is null
+       $return = null;
+
+       // Is the config set?
+       if (isConfigLoaded()) {
+               // Then use it
+               $return = $_CONFIG;
+       } // END - if
+
+       // Return result
+       return $return;
 }
 
 // [EOF]
diff --git a/inc/config-global.php b/inc/config-global.php
new file mode 100644 (file)
index 0000000..de3c4ac
--- /dev/null
@@ -0,0 +1,81 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/03/2009 *
+ * ===============                              Last change: 04/03/2009 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : config-global.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Global configuration                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Globale Konfiguration                            *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * Needs to be in all Files and every File needs "svn propset           *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
+       require($INC);
+} // END - if
+
+/************************************************************************
+ *      PLEASE DO NOT EDIT THE COMMENTS! install.php NEEDS THEM!        *
+ ************************************************************************/
+
+if (function_exists('date_default_timezone_set')) {
+       // CFG: TIME-ZONE
+       @date_default_timezone_set('Europe/Berlin');
+} // END - if
+
+// CFG: ERROR_REPORTING
+@error_reporting(0);
+
+// CFG: REGISTER-GLOBALS
+@import_request_variables('');
+
+// These constants should be rewritten
+define('VERSION', 'v0.2.1');
+define('AUTHOR' , 'Roland H&auml;der');
+define('TITLE', 'MXChange - Mail Exchange');
+define('COPY', 'Copyright &copy; 2003 - 2008, by Roland H&auml;der');
+
+// Auto-detection... (patched by "Stelzi" aka. profi-concept, thanks again!)
+$URL = 'http://' . getenv('SERVER_NAME') . str_replace("\\", '/', dirname($_SERVER['PHP_SELF']));
+while (substr($URL, -1, 1) == '/') { $URL = substr($URL, 0, -1); }
+$PATH = str_replace("\\", '/', substr(dirname(__FILE__), 0, -3));
+
+// CFG: SERVER-PATH
+define('PATH', $PATH);
+
+// CFG: HOST-URL (without trailing '/' !)
+define('URL', $URL);
+
+// Connect to the MySQL database...
+require(constant('PATH') . 'inc/mysql-connect.php');
+
+//
+?>
diff --git a/inc/config-local.php.dist b/inc/config-local.php.dist
new file mode 100644 (file)
index 0000000..08e6779
--- /dev/null
@@ -0,0 +1,128 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/03/2009 *
+ * ===============                              Last change: 04/03/2009 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : config-local.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Local configuration                              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Lokale Konfiguration                             *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * Needs to be in all Files and every File needs "svn propset           *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
+       require($INC);
+} // END - if
+
+/************************************************************************
+ *      PLEASE DO NOT EDIT THE COMMENTS! install.php NEEDS THEM!        *
+ ************************************************************************/
+
+// CFG: SITE-KEY
+setConfigEntry('SITE_KEY', "");
+
+// CFG: DATE-KEY
+setConfigEntry('DATE_KEY', date("d-m-Y (l-F-T)", time()));
+
+// CFG: DEFAULT-LANGUAGE
+setConfigEntry('DEFAULT_LANG', "de");
+
+// CFG: NULLPASS-WARNING
+setConfigEntry('WARN_NO_PASS', "Y");
+
+// CFG: WRITE-FOOTER
+setConfigEntry('WRITE_FOOTER', "Y");
+
+// CFG: OUTPUT-MODE
+setConfigEntry('OUTPUT_MODE', "render");
+
+// CFG: INSTALLED
+setConfigEntry('MXCHANGE_INSTALLED', "N");
+
+// CFG: ADMIN-SETUP
+setConfigEntry('ADMIN_REGISTERED', "N");
+
+// CFG: MYSQL-PREIFX
+setConfigEntry('_MYSQL_PREFIX', "mxchange");
+
+// CFG: TABLE-TYPE
+setConfigEntry('_TABLE_TYPE', "MyISAM");
+
+// CFG: DATABASE-TYPE
+setConfigEntry('_DB_TYPE', "mysql3");
+
+// CFG: DEBUG-MODE (if enabled all mails will be *displayed* and *not* send!)
+setConfigEntry('DEBUG_MODE', "Y");
+
+// CFG: BACKLINK (Enable backlink to mxchange.org in footer? rel=external is set!)
+setConfigEntry('ENABLE_BACKLINK', 'Y');
+
+// CFG: DEBUG-RESET (comment in to test daily reset, comment out to not test)
+//setConfigEntry('DEBUG_RESET', "Y");
+
+// CFG: DEBUG-MONTHLY (comment in to test monthly reset, comment out to not test)
+//setConfigEntry('DEBUG_MONTHLY', "Y");
+
+// CFG: DEBUG-WEEKLY (comment in to test weekly reset, comment out to not test)
+//setConfigEntry('DEBUG_WEEKLY', "Y");
+
+// Your MySQL data (we don't like M$ SQL ;-) )
+$GLOBALS['mysql'] = array(
+       // CFG: MYSQL-HOST
+       'host'     => "localhost",
+       // CFG: MYSQL-DBASE
+       'dbase'    => "db",
+       // CFG: MYSQL-LOGIN
+       'login'    => "user",
+       // CFG: MYSQL-PASSWORD
+       'password' => "pass",
+);
+
+// SMTP-Subsystem (keep all empty to use legacy mail() command!)
+// CFG: SMTP-HOSTNAME
+setConfigEntry('SMTP_HOSTNAME', "");
+// CFG: SMTP-USER
+setConfigEntry('SMTP_USER'    , "");
+// CFG: SMTP-PASSWORD
+setConfigEntry('SMTP_PASSWORD', "");
+
+// @TODO Rewrite the following three constants, somehow...
+// CFG: MAIN-TITLE
+define('MAIN_TITLE', "Your mail-exchanger title");
+
+// CFG: SLOGAN
+define('SLOGAN', "Your cool slogan here");
+
+// CFG: WEBMASTER
+define('WEBMASTER', "you@some-hoster.tld.invalid");
+
+//
+?>
index dfc866fb738637492467e72e92f173053a36bdc4..f551ef47b7591c74e7b59193e56a1fa6505a87ab 100644 (file)
@@ -1,173 +1,3 @@
 <?php
-/************************************************************************
- * MXChange v0.2.1                                    Start: 08/25/2003 *
- * ===============                              Last change: 04/16/2004 *
- *                                                                      *
- * -------------------------------------------------------------------- *
- * File              : config.php                                       *
- * -------------------------------------------------------------------- *
- * Short description : Your configuration data (MySQL)                  *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung  : Ihre Konfigurationsdaten (MySQL)                 *
- * -------------------------------------------------------------------- *
- * $Revision::                                                        $ *
- * $Date::                                                            $ *
- * $Tag:: 0.2.1-FINAL                                                 $ *
- * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
- * For more information visit: http://www.mxchange.org                  *
- *                                                                      *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or    *
- * (at your option) any later version.                                  *
- *                                                                      *
- * This program is distributed in the hope that it will be useful,      *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
- * GNU General Public License for more details.                         *
- *                                                                      *
- * You should have received a copy of the GNU General Public License    *
- * along with this program; if not, write to the Free Software          *
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
- * MA  02110-1301  USA                                                  *
- ************************************************************************/
-
-// Some security stuff...
-if (!defined('__SECURITY'))
-{
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
-       require($INC);
-}
-
-/************************************************************************
- *      PLEASE DO NOT EDIT THE COMMENTS! install.php NEEDS THEM!        *
- ************************************************************************/
-
-if (function_exists('date_default_timezone_set')) {
-       // CFG: TIME-ZONE
-       @date_default_timezone_set("Europe/Berlin");
-}
-
-// Most of these constants are old and deprecated. We don't use them either.
-// You can still feel free to use them in your templates / scripts if you like :-)
-define('VERSION', "v0.2.1");
-define('AUTHOR' , "Roland H&auml;der");
-define('TITLE', "MXChange - Mail Exchange");
-define('COPY', "Copyright &copy; 2003 - 2008, by Roland H&auml;der");
-
-// CFG: ERROR_REPORTING
-@error_reporting(0);
-
-// CFG: REGISTER-GLOBALS
-@import_request_variables('');
-
-// CFG: SITE-KEY
-define('SITE_KEY', "gg42ny8-4yng23498-mf423igum-mtu248utn42-mf4839gun43");
-
-// CFG: DATE-KEY
-define('DATE_KEY', date("d-m-Y (l-F-T)", time()));
-
-// CFG: DEFAULT-LANGUAGE
-define('DEFAULT_LANG', "de");
-
-// CFG: NULLPASS-WARNING
-define('warn_no_pass', true);
-
-// CFG: WRITE-FOOTER
-define('WRITE_FOOTER', true);
-
-// CFG: OUTPUT-MODE
-define('OUTPUT_MODE', "render");
-
-// CFG: MAIN_TITLE
-define('MAIN_TITLE', "Your mail-exchanger title");
-
-// CFG: SLOGAN
-define('SLOGAN', "Your cool slogan here");
-
-// Auto-detection... (patched by "Stelzi" aka. profi-concept, thanks again!)
-$URL = "http://".getenv('SERVER_NAME') . str_replace("\\", '/', dirname($_SERVER['PHP_SELF']));
-while (substr($URL, -1, 1) == '/') { $URL = substr($URL, 0, -1); }
-$PATH = str_replace("\\", '/', substr(dirname(__FILE__), 0, -3));
-
-// CFG: HOST-URL (without trailing '/' !)
-define('URL', $URL);
-
-// CFG: SERVER-PATH
-define('PATH', $PATH);
-
-// CFG: WEBMASTER
-define('WEBMASTER', "you@some-hoster.tld.invalid");
-
-// CFG: INSTALLED
-define('mxchange_installed', false);
-
-// CFG: ADMIN-SETUP
-define('admin_registered', false);
-
-// CFG: FRAMESET
-define('frameset_active', false);
-
-// CFG: DEBUG-MODE (if enabled all mails will be *displayed* and *not* send!)
-define('DEBUG_MODE', false);
-
-// CFG: DEBUG-MAIL (turn this on if you need to debug mails, only affects if DEBUG_MODE is true)
-//define('DEBUG_MAIL', true);
-
-// CFG: DEBUG-RESET (comment in to test daily reset, comment out to not test)
-//define('DEBUG_RESET', true);
-
-// CFG: DEBUG-MONTHLY (comment in to test monthly reset, comment out to not test)
-//define('DEBUG_MONTHLY', true);
-
-// CFG: DEBUG-WEEKLY (comment in to test weekly reset, comment out to not test)
-//define('DEBUG_WEEKLY', true);
-
-// Your MySQL data (we don't like M$ SQL ;-) )
-$MySQL = array(
-       // CFG: MYSQL-HOST
-       'host'     => "localhost",
-       // CFG: MYSQL-DBASE
-       'dbase'    => "db",
-       // CFG: MYSQL-LOGIN
-       'login'    => "user",
-       // CFG: MYSQL-PASSWORD
-       'password' => "pass",
-);
-
-// CFG: MYSQL-PREIFX
-define('_MYSQL_PREFIX', "mxchange");
-
-// CFG: TABLE-TYPE
-define('_TABLE_TYPE', "MyISAM");
-
-// CFG: DATABASE-TYPE
-define('_DB_TYPE', "mysql3");
-
-// Lead-Code data
-define('LEAD_CODE_ENABLED', true);
-define('LEAD_EXPIRY_TIME' , (30*24*60*60)); // == 30 days
-
-// SMTP-Subsystem (keep all empty to use legacy mail() command!)
-// CFG: SMTP-HOSTNAME
-define('SMTP_HOSTNAME', "");
-// CFG: SMTP-USER
-define('SMTP_USER'    , "");
-// CFG: SMTP-PASSWORD
-define('SMTP_PASSWORD', "");
-
-// SSL cookies? (enable only if you have SSL, URLs will begin with https://)
-define('SSL_COOKIES', false);
-
-// CFG: BACKLINK (Enable backlink to mxchange.org in footer? rel=external is set!)
-define('ENABLE_BACKLINK', true);
-
-// Connect to the MySQL database...
-require(constant('PATH')."inc/mysql-connect.php");
-
-//
+// @DEPRECATED
 ?>
index f06b34c03446c2eacceef3345c9f94b79f0e155b..d8ebad0b6f17f8d7ff6927cabb4f8523f47ffeac 100644 (file)
@@ -95,26 +95,26 @@ setConfigEntry('one_day', (60*60*24));
 
 //
 // Timestamp for yesterday, today ... all at 00:00 am
-define('START_YDAY', makeTime(0, 0, 0, time() - getConfig('one_day')));
-define('START_TDAY', makeTime(0, 0, 0, time()));
+setConfigEntry('START_YDAY', makeTime(0, 0, 0, time() - getConfig('one_day')));
+setConfigEntry('START_TDAY', makeTime(0, 0, 0, time()));
 
 // Take a prime number which is long (if you know a longer one please try it out!)
-define('_PRIME', 591623);
+setConfigEntry('_PRIME', 591623);
 
 // Calculate "entropy" with the prime number (for code generation)
-define('_ADD', (constant('_PRIME') * constant('_PRIME') / (pi() * getConfig('code_length') + 1)));
+setConfigEntry('_ADD', (getConfig('_PRIME') * getConfig('_PRIME') / (pi() * getConfig('code_length') + 1)));
 
 // Random number for e.g. the "cache-buster" used in OpenX script
 define('CACHE_BUSTER', mt_rand(1000000, 9999999));
 
 // CFG: DEBUG-SQL (if enabled and DEBUG_MODE is enabled all SQL queries will be logged to debug.log)
-define('DEBUG_SQL', false);
+setConfigEntry('DEBUG_SQL', 'N');
 
 // CFG: ENCRYPT-SEPERATOR
-define('ENCRYPT_SEPERATOR', ':');
+setConfigEntry('ENCRYPT_SEPERATOR', ':');
 
 // Extra title is empty by default
-$EXTRA_TITLE = '';
+setExtraTitle('');
 
 //
 ?>
index b0de8af3fce16d60a795825c28db6cd3e09cf18c..823e5d02f95ebe5949eb00875deaa5d1faad02c0 100644 (file)
@@ -51,10 +51,10 @@ function SQL_QUERY ($sql_string, $F, $L) {
        $sql_string = str_replace("\t", " ", str_replace("\n", " ", str_replace("\r", " ", $sql_string)));
 
        // Replace {!_MYSQL_PREFIX!} with constant, closes #84. Thanks to profi-concept
-       $sql_string = str_replace("{!_MYSQL_PREFIX!}", constant('_MYSQL_PREFIX'), $sql_string);
+       $sql_string = str_replace("{!_MYSQL_PREFIX!}", getConfig('_MYSQL_PREFIX'), $sql_string);
 
        // Replace {!_TABLE_TYPE!} with constant
-       $sql_string = str_replace("{!_TABLE_TYPE!}", constant('_TABLE_TYPE'), $sql_string);
+       $sql_string = str_replace("{!_TABLE_TYPE!}", getConfig('_TABLE_TYPE'), $sql_string);
 
        // Starting time
        $querytimeBefore = array_sum(explode(' ', microtime()));
@@ -80,11 +80,11 @@ Query string:<br />
 
        // Debug output
        //* DEBUG: */ print "Query=<pre>".$sql_string."</pre>, affected=<strong>".SQL_AFFECTEDROWS()."</strong>, numrows=<strong>".SQL_NUMROWS($result)."</strong><br />\n";
-       if (($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1") && (isDebugModeEnabled()) && (isBooleanConstantAndTrue('DEBUG_SQL'))) {
+       if (($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1') && (isDebugModeEnabled()) && (getConfig('DEBUG_SQL') == 'Y')) {
                //
                // Debugging stuff...
                //
-               $fp = fopen(constant('PATH')."inc/cache/mysql.log", 'a') or app_die(__FILE__, __LINE__, "Cannot write mysql.log!");
+               $fp = fopen(constant('PATH') . 'inc/cache/mysql.log', 'a') or app_die(__FILE__, __LINE__, "Cannot write mysql.log!");
                if (!isset($GLOBALS['sql_first_entry'])) {
                        // Write first entry
                        fwrite($fp, "Module=".$GLOBALS['module']."\n");
@@ -274,7 +274,7 @@ function SQL_QUERY_ESC ($qstring, $data, $F, $L, $run=true, $strip=true, $secure
        // Debugging
        //
        //* DEBUG: */ $fp = fopen(constant('PATH')."inc/cache/escape_debug.log", 'a') or app_die(__FILE__, __LINE__, "Cannot write debug.log!");
-       //* DEBUG: */ fwrite($fp, $F."(".$L."): ".str_replace("\r", '', str_replace("\n", " ", $eval))."\n");
+       //* DEBUG: */ fwrite($fp, $F.'('.$L."): ".str_replace("\r", '', str_replace("\n", " ", $eval))."\n");
        //* DEBUG: */ fclose($fp);
 
        // Run the code
@@ -351,47 +351,54 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
        $result = false;
 
        // Determine index/fulltext/unique word
-       //         12    3             3         2    2    3                3         2    2    3              3         21
-       $noIndex = ((ereg("INDEX", $sql) == false) && (ereg("FULLTEXT", $sql) == false) && (ereg("UNIQUE", $sql) == false));
+       $noIndex = (
+               (
+                       strpos($sql, 'INDEX') === false
+               ) && (
+                       strpos($sql, 'FULLTEXT') === false
+               ) && (
+                       strpos($sql, 'UNIQUE') === false
+               )
+       );
 
        // Extract table name
        $tableArray = explode(" ", $sql);
-       $tableName = str_replace("`", '', $tableArray[2]);
+       $tableName = str_replace('`', '', $tableArray[2]);
 
        // Shall we add/drop?
-       if (((ereg("ADD", $sql)) || (ereg("DROP", $sql))) && ($noIndex)) {
+       if (((strpos($sql, 'ADD') !== false) || (strpos($sql, 'DROP') !== false)) && ($noIndex === true)) {
                // And column name as well
-               $columnName = str_replace("`", '', $tableArray[4]);
+               $columnName = str_replace('`', '', $tableArray[4]);
 
                // Get column information
                $result = SQL_QUERY_ESC("SHOW COLUMNS FROM %s LIKE '%s'",
                        array($tableName, $columnName), __FILE__, __LINE__);
 
                // Do we have no entry on ADD or an entry on DROP?
-               // 123           4       4     3    3    4           432    23           4       4     3    3    4            4321
-               if (((SQL_NUMROWS($result) == 0) && (ereg("ADD", $sql))) || ((SQL_NUMROWS($result) == 1) && (ereg("DROP", $sql)))) {
+               // 123           4       4     3    3      4           4          32    23           4       4     3    3      4            4          321
+               if (((SQL_NUMROWS($result) == 0) && (strpos($sql, 'ADD') !== false)) || ((SQL_NUMROWS($result) == 1) && (strpos($sql, 'DROP') !== false))) {
                        // Do the query
                        //* DEBUG: */ print __LINE__.':'.$sql."<br />\n";
                        $result = SQL_QUERY($sql, $F, $L, false);
                } // END - if
-       } elseif ((constant('_TABLE_TYPE') == "InnoDB") && (ereg("FULLTEXT", $sql))) {
+       } elseif ((getConfig('_TABLE_TYPE') == 'InnoDB') && (strpos($sql, 'FULLTEXT') !== false)) {
                // Skip this query silently
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Skipped FULLTEXT: sql=%s,file=%s,line=%s", $sql, $F, $L));
        } elseif (!$noIndex) {
                // And column name as well
-               $columnName = str_replace("`", '', $tableArray[4]);
+               $columnName = str_replace('`', '', $tableArray[4]);
 
                // Is this "UNIQUE" or so? FULLTEXT has been handled the elseif() block above
-               if (in_array(strtoupper($columnName), array("INDEX", "UNIQUE", "KEY", "FULLTEXT"))) {
+               if (in_array(strtoupper($columnName), array('INDEX', 'UNIQUE', 'KEY', 'FULLTEXT'))) {
                        // Init loop
-                       $begin = 1; $columnName = ",";
-                       while (strpos($columnName, ",") !== false) {
+                       $begin = 1; $columnName = ',';
+                       while (strpos($columnName, ',') !== false) {
                                // Use last
-                               $columnName = str_replace("`", '', $tableArray[count($tableArray) - $begin]);
+                               $columnName = str_replace('`', '', $tableArray[count($tableArray) - $begin]);
                                //* DEBUG: */ print __LINE__.':'.$columnName."----------------".$begin."<br />\n";
 
                                // Remove brackes
-                               $columnName = str_replace("(", '', str_replace(")", '', $columnName));
+                               $columnName = str_replace('(', '', str_replace(')', '', $columnName));
                                //* DEBUG: */ print __LINE__.':'.$columnName."----------------".$begin."<br />\n";
 
                                // Continue
@@ -400,7 +407,7 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
                } // END - if
 
                // Show indexes
-               $result = SQL_QUERY_ESC("SHOW INDEX FROM %s",
+               $result = SQL_QUERY_ESC("SHOW INDEX FROM `%s`",
                        array($tableName), __FILE__, __LINE__);
 
                // Walk through all
index 72a1f6a5252da70f095dc0aff7e597c35c9c48f9..217d7681b042081a783791c3b3aa665800b2efba 100644 (file)
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
-}
+} // END - if
 
-// Select MySQL 3 as default database type
-if (!defined('_DB_TYPE')) define('_DB_TYPE', "mysql3");
+// Is it not set?
+if (!isConfigEntrySet('_DB_TYPE')) setConfigEntry('_DB_TYPE', 'mysql3');
 
 // Create include file name
-$INC = sprintf("inc/db/lib-%s.php", constant('_DB_TYPE'));
+$INC = sprintf("inc/db/lib-%s.php", getConfig('_DB_TYPE'));
 
 if (isIncludeReadable($INC)) {
        // Include abstraction layer
        loadIncludeOnce($INC);
 } else {
        // Bye, bye...
-       die("Cannot load database abstraction layer ".constant('_DB_TYPE')." -&gt; R.I.P.");
+       die('Cannot load database abstraction layer <u>' . getConfig('_DB_TYPE') . '</u> -&gt; R.I.P.');
 }
 
 //
index 9388fc6b82bfd609f80a3e0b8145e2d026519ae4..6017dfb65e5bf50bcc0020995151155829b19e49 100644 (file)
@@ -148,7 +148,7 @@ if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == 'Y'))
                                // 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'],
                        );
index d6c49ad67cf0eae33893234dbfae21fe3d0dfa00..58f22fd02851b776555ab1b8b9c8eb2d69d27b9d 100644 (file)
@@ -1237,7 +1237,7 @@ function EXT_GET_REMOVAL_LIST () {
 }
 
 // Redirects if the provided extension is not installed
-function REDIRECT_ON_UNINSTALLED_EXTENSION ($ext_name) {
+function redirectOnUninstalledExtension ($ext_name) {
        // So is the extension there?
        if (!EXT_IS_ACTIVE($ext_name)) {
                // Redirect to index
diff --git a/inc/extensions/ext-lead.php b/inc/extensions/ext-lead.php
new file mode 100644 (file)
index 0000000..1e8d7ea
--- /dev/null
@@ -0,0 +1,92 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/25/2004 *
+ * ================                             Last change: 09/25/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-                                             *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * Needs to be in all Files and every File needs "svn propset           *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
+       require($INC);
+}
+
+// Version number
+EXT_SET_VERSION('0.0');
+
+// Version history array (add more with , '0.1.0' and so on)
+EXT_SET_VER_HISTORY(array('0.0'));
+
+switch ($EXT_LOAD_MODE)
+{
+case 'register': // Do stuff when installation is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       break;
+
+case 'remove': // Do stuff when removing extension
+       // SQL commands to run
+       break;
+
+case 'activate': // Do stuff when admin activates this extension
+       // SQL commands to run
+       break;
+
+case 'deactivate': // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       break;
+
+case 'update': // Update an extension
+       switch ($EXT_VER)
+       {
+       case '0.0.1': // SQL queries for v0.0.1
+               ADD_EXT_SQL("");
+
+               // Update notes (these will be set as task text!)
+               EXT_SET_UPDATE_NOTES("");
+               break;
+       }
+       break;
+
+case 'modify': // When the extension got modified
+       break;
+
+case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+//
+?>
index 2baf2f77454d1426663babaf3ca16578431cc375..83f9bdd7797412ef1548509401ae6af7fa2dc613 100644 (file)
@@ -158,10 +158,10 @@ default: // Do stuff when extension is loaded
        // Don't use these chars in links... ;-)
        //
        $GLOBALS['url_ends'] = array(
-               " ",
+               ' ',
                "\n",
                "\r",
-               ")",
+               ')',
        );
 
        // Valid email chars (without @, or do you want to have another @ inside your email addy?)
index 74cda8e85b8eea7d71b122241ff1306f477ae650..098a2157f952ce2a53cd8b7a794d0a6c616f4012 100644 (file)
@@ -521,7 +521,7 @@ function FILTER_CHECK_ADMIN_ACL () {
 // Filter for initializing randomizer
 function FILTER_INIT_RANDOMIZER () {
        // Simply init the randomizer with seed and _ADD value
-       mt_srand(generateSeed() + constant('_ADD'));
+       mt_srand(generateSeed() + getConfig('_ADD'));
 }
 
 // Filter for removing updates
index 556022f0bff0d16b97ce3e44dcd5e84f2760360a..d822c4eb7fbf31158211b3171f428b0932cbed79 100644 (file)
@@ -45,7 +45,7 @@ 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"))) && ($GLOBALS['output_mode'] != "1"))) {
+if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != '1') && ($GLOBALS['footer_sent'] != '2'))) && ($GLOBALS['output_mode'] != '1'))) {
        // Output the generated HTML code or do nothing in direct-mode
        if (getTotalFatalErrors() > 0) {
                // Output fatal error messages
@@ -53,9 +53,9 @@ if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != "1") &&
        } // END - if
 
        // Shall we display the copyright notice?
-       if ((!REQUEST_ISSET_GET(('frame'))) && (basename($_SERVER['PHP_SELF']) != "mailid_top.php") && (isBooleanConstantAndTrue('WRITE_FOOTER')) && ($GLOBALS['header_sent'] == "2")) {
+       if ((!REQUEST_ISSET_GET(('frame'))) && (basename($_SERVER['PHP_SELF']) != "mailid_top.php") && (getConfig('WRITE_FOOTER') == 'Y') && ($GLOBALS['header_sent'] == '2')) {
                // Backlink enabled?
-               if (isBooleanConstantAndTrue('ENABLE_BACKLINK')) {
+               if ((getConfig('ENABLE_BACKLINK') == 'Y') || (isInstalling())) {
                        // Copyright with backlink, thanks! :-)
                        LOAD_TEMPLATE("copyright_backlink");
                } else {
@@ -65,7 +65,7 @@ if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != "1") &&
        } // END - if
 
        // Shall we display the parsing time and number of queries?
-       if ((GET_EXT_VERSION('sql_patches') >= '0.4.1') && (getConfig('show_timings') == 'Y') && (!REQUEST_ISSET_GET(('frame'))) && ($GLOBALS['header_sent'] == "2")) {
+       if ((GET_EXT_VERSION('sql_patches') >= '0.4.1') && (getConfig('show_timings') == 'Y') && (!REQUEST_ISSET_GET(('frame'))) && ($GLOBALS['header_sent'] == '2')) {
                // Then display it here
                displayParsingTime();
        } // END - if
index dc5fe393673e2e7315da6d28456b434765148c2e..7262baf0b705d1fad031146fbf42b482dcdac4dc 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        require($INC);
 }
 
-// Output HTML code directly or "render" it. You addionally switch the new-line character off
+// Output HTML code directly or 'render' it. You addionally switch the new-line character off
 function OUTPUT_HTML ($HTML, $newLine = true) {
        // Some global variables
        global $OUTPUT;
@@ -49,11 +49,11 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
        // Do we have HTML-Code here?
        if (!empty($HTML)) {
                // Yes, so we handle it as you have configured
-               switch (constant('OUTPUT_MODE'))
+               switch (getConfig('OUTPUT_MODE'))
                {
-               case "render":
+               case 'render':
                        // That's why you don't need any \n at the end of your HTML code... :-)
-                       if (constant('_OB_CACHING') == "on") {
+                       if (constant('_OB_CACHING') == 'on') {
                                // Output into PHP's internal buffer
                                outputRawCode($HTML);
 
@@ -70,7 +70,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
 
                case 'direct':
                        // If we are switching from render to direct output rendered code
-                       if ((!empty($OUTPUT)) && (constant('_OB_CACHING') != "on")) { outputRawCode($OUTPUT); $OUTPUT = ''; }
+                       if ((!empty($OUTPUT)) && (constant('_OB_CACHING') != 'on')) { outputRawCode($OUTPUT); $OUTPUT = ''; }
 
                        // The same as above... ^
                        outputRawCode($HTML);
@@ -79,11 +79,11 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
 
                default:
                        // Huh, something goes wrong or maybe you have edited config.php ???
-                       DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Invalid renderer %s detected.", constant('OUTPUT_MODE')));
+                       DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Invalid renderer %s detected.", getConfig('OUTPUT_MODE')));
                        app_die(__FUNCTION__, __LINE__, "<strong>{--FATAL_ERROR--}:</strong> {--LANG_NO_RENDER_DIRECT--}");
                        break;
                }
-       } elseif ((constant('_OB_CACHING') == "on") && (isset($GLOBALS['footer_sent'])) && ($GLOBALS['footer_sent'] == 1)) {
+       } elseif ((constant('_OB_CACHING') == 'on') && (isset($GLOBALS['footer_sent'])) && ($GLOBALS['footer_sent'] == 1)) {
                // Headers already sent?
                if (headers_sent()) {
                        // Log this error
@@ -102,20 +102,20 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
                } // END - if
 
                // Send HTTP header
-               header("HTTP/1.1 200");
+               sendHeader('HTTP/1.1 200');
 
                // Used later
                $now = gmdate('D, d M Y H:i:s') . ' GMT';
 
                // General headers for no caching
-               header("Expired: " . $now); // RFC2616 - Section 14.21
-               header("Last-Modified: " . $now);
-               header("Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0"); // HTTP/1.1
-               header("Pragma: no-cache"); // HTTP/1.0
-               header("Connection: Close");
+               sendHeader('Expired: ' . $now); // RFC2616 - Section 14.21
+               sendHeader('Last-Modified: ' . $now);
+               sendHeader('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
+               sendHeader('Pragma: no-cache'); // HTTP/1.0
+               sendHeader('Connection: Close');
 
                // Extension 'rewrite' installed?
-               if ((EXT_IS_ACTIVE('rewrite')) && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) {
+               if ((EXT_IS_ACTIVE('rewrite')) && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) {
                        $OUTPUT = rewriteLinksInCode($OUTPUT);
                } // END - if
 
@@ -136,9 +136,9 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
 
                // Output code here, DO NOT REMOVE! ;-)
                outputRawCode($OUTPUT);
-       } elseif ((constant('OUTPUT_MODE') == "render") && (!empty($OUTPUT))) {
+       } elseif ((getConfig('OUTPUT_MODE') == 'render') && (!empty($OUTPUT))) {
                // Rewrite links when rewrite extension is active
-               if ((EXT_IS_ACTIVE('rewrite')) && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) {
+               if ((EXT_IS_ACTIVE('rewrite')) && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) {
                        $OUTPUT = rewriteLinksInCode($OUTPUT);
                } // END - if
 
@@ -158,8 +158,8 @@ function outputRawCode ($HTML) {
        // Output stripped HTML code to avoid broken JavaScript code, etc.
        echo stripslashes(stripslashes($HTML));
 
-       // Flush the output if only constant('_OB_CACHING') is not "on"
-       if (constant('_OB_CACHING') != "on") {
+       // Flush the output if only constant('_OB_CACHING') is not 'on'
+       if (constant('_OB_CACHING') != 'on') {
                // Flush it
                flush();
        } // END - if
@@ -259,7 +259,7 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
        } // END - if
 
        // Generate date/time string
-       $date_time = generateDateTime(time(), "1");
+       $date_time = generateDateTime(time(), '1');
 
        // Base directory
        $basePath = sprintf("%stemplates/%s/html/", constant('PATH'), getLanguage());
@@ -343,12 +343,12 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
                $ret = "<!-- Template ".$template." - Start -->\n".$ret."<!-- Template ".$template." - End -->\n";
        } elseif ((IS_ADMIN()) || ((isInstalling()) && (!isInstalled()))) {
                // Only admins shall see this warning or when installation mode is active
-               $ret = "<br /><span class=\"guest_failed\">".TEMPLATE_404."</span><br />
+               $ret = "<br /><span class=\"guest_failed\">{--TEMPLATE_404--}</span><br />
 (".basename($FQFN).")<br />
 <br />
-".TEMPLATE_CONTENT."
+{--TEMPLATE_CONTENT--}
 <pre>".print_r($content, true)."</pre>
-".TEMPLATE_DATA."
+{--TEMPLATE_DATA--}
 <pre>".print_r($DATA, true)."</pre>
 <br /><br />";
        }
@@ -411,7 +411,7 @@ function sendEmail($toEmail, $subject, $message, $HTML = 'N', $mailHeader = '')
        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$toEmail}<br />\n";
 
        // Check for PHPMailer or debug-mode
-       if (!CHECK_PHPMAILER_USAGE()) {
+       if (!checkPhpMailerUsage()) {
                // Not in PHPMailer-Mode
                if (empty($mailHeader)) {
                        // Load email header template
@@ -450,32 +450,30 @@ Message : ".$message."
 </pre>\n");
        } elseif (($HTML == 'Y') && (EXT_IS_ACTIVE('html_mail'))) {
                // Send mail as HTML away
-               SEND_HTML_EMAIL($toEmail, $subject, $message, $mailHeader);
+               sendHtmlEmail($toEmail, $subject, $message, $mailHeader);
        } elseif (!empty($toEmail)) {
                // Send Mail away
-               SEND_RAW_EMAIL($toEmail, $subject, $message, $mailHeader);
+               sendRawEmail($toEmail, $subject, $message, $mailHeader);
        } elseif ($HTML == 'N') {
                // Problem found!
-               SEND_RAW_EMAIL(constant('WEBMASTER'), "[PROBLEM:]".$subject, $message, $mailHeader);
+               sendRawEmail(constant('WEBMASTER'), '[PROBLEM:]' . $subject, $message, $mailHeader);
        }
 }
 
 // Check if legacy or PHPMailer command
 // @TODO Rewrite this to an extension 'smtp'
 // @private
-function CHECK_PHPMAILER_USAGE() {
-       return ((defined('SMTP_HOSTNAME')) && (defined('SMTP_USER')) && (defined('SMTP_PASSWORD')) && (constant('SMTP_HOSTNAME') != '') && (constant('SMTP_USER') != ''));
+function checkPhpMailerUsage() {
+       return ((getConfig('SMTP_HOSTNAME') != '') && (getConfig('SMTP_USER') != ''));
 }
 
-/*
- * Send out a raw email with PHPMailer class or legacy mail() command
- */
-function SEND_RAW_EMAIL ($toEmail, $subject, $msg, $from) {
+// Send out a raw email with PHPMailer class or legacy mail() command
+function sendRawEmail ($toEmail, $subject, $msg, $from) {
        // Shall we use PHPMailer class or legacy mode?
-       if (CHECK_PHPMAILER_USAGE()) {
+       if (checkPhpMailerUsage()) {
                // Use PHPMailer class with SMTP enabled
-               loadIncludeOnce("inc/phpmailer/class.phpmailer.php");
-               loadIncludeOnce("inc/phpmailer/class.smtp.php");
+               loadIncludeOnce('inc/phpmailer/class.phpmailer.php');
+               loadIncludeOnce('inc/phpmailer/class.smtp.php');
 
                // get new instance
                $mail = new PHPMailer();
@@ -483,10 +481,10 @@ function SEND_RAW_EMAIL ($toEmail, $subject, $msg, $from) {
 
                $mail->IsSMTP();
                $mail->SMTPAuth   = true;
-               $mail->Host       = constant('SMTP_HOSTNAME');
+               $mail->Host       = getConfig('SMTP_HOSTNAME');
                $mail->Port       = 25;
-               $mail->Username   = constant('SMTP_USER');
-               $mail->Password   = constant('SMTP_PASSWORD');
+               $mail->Username   = getConfig('SMTP_USER');
+               $mail->Password   = getConfig('SMTP_PASSWORD');
                if (empty($from)) {
                        $mail->From = constant('WEBMASTER');
                } else {
@@ -496,7 +494,7 @@ function SEND_RAW_EMAIL ($toEmail, $subject, $msg, $from) {
                $mail->Subject    = $subject;
                if ((EXT_IS_ACTIVE('html_mail')) && (strip_tags($msg) != $msg)) {
                        $mail->Body       = $msg;
-                       $mail->AltBody    = "Your mail program required HTML support to read this mail!";
+                       $mail->AltBody    = 'Your mail program required HTML support to read this mail!';
                        $mail->WordWrap   = 70;
                        $mail->IsHTML(true);
                } else {
@@ -504,8 +502,8 @@ function SEND_RAW_EMAIL ($toEmail, $subject, $msg, $from) {
                }
                $mail->AddAddress($toEmail, '');
                $mail->AddReplyTo(constant('WEBMASTER'), constant('MAIN_TITLE'));
-               $mail->AddCustomHeader("Errors-To:".constant('WEBMASTER'));
-               $mail->AddCustomHeader("X-Loop:".constant('WEBMASTER'));
+               $mail->AddCustomHeader('Errors-To:' . constant('WEBMASTER'));
+               $mail->AddCustomHeader('X-Loop:' . constant('WEBMASTER'));
                $mail->Send();
        } else {
                // Use legacy mail() command
@@ -580,7 +578,7 @@ function generateDateTime ($time, $mode = '0') {
 // Translates Y/N to yes/no
 function translateYesNo ($yn) {
        // Default
-       $translated = "??? (".$yn.")";
+       $translated = "??? (".$yn.')';
        switch ($yn) {
                case 'Y': $translated = getMessage('YES'); break;
                case 'N': $translated = getMessage('NO'); break;
@@ -728,11 +726,6 @@ function countSelection ($array) {
        return $ret;
 }
 
-// Wrapper for $_POST['sel']
-function countPostSelection () {
-       return countSelection(REQUEST_POST('sel'));
-}
-
 // Generate XHTML code for the CAPTCHA
 function generateCaptchaCode ($code, $type, $DATA, $uid) {
        return '<IMG border="0" alt="Code" src="{!URL!}/mailid_top.php?uid=' . $uid . '&amp;' . $type . '=' . $DATA . '&amp;mode=img&amp;code=' . $code . '" />';
@@ -741,13 +734,13 @@ function generateCaptchaCode ($code, $type, $DATA, $uid) {
 // "Getter" for language
 function getLanguage () {
        // Set default return value to default language from config
-       $ret = constant('DEFAULT_LANG');
+       $ret = getConfig('DEFAULT_LANG');
 
        // Init variable
        $lang = '';
 
        // Is the variable set
-       if (REQUEST_ISSET_GET(('mx_lang'))) {
+       if (REQUEST_ISSET_GET('mx_lang')) {
                // Accept only first 2 chars
                $lang = substr(REQUEST_GET('mx_lang'), 0, 2);
        } elseif (isset($GLOBALS['cache_array']['language'])) {
@@ -755,16 +748,16 @@ function getLanguage () {
                $ret = $GLOBALS['cache_array']['language'];
        } elseif (!empty($lang)) {
                // Check if main language file does exist
-               if (isFileReadable(constant('PATH').'inc/language/'.$lang.'.php')) {
+               if (isFileReadable(constant('PATH') . 'inc/language/'.$lang.'.php')) {
                        // Okay found, so let's update cookies
                        setLanguage($lang);
-               }
-       } elseif (!isSessionVariableSet('mx_lang')) {
+               } // END - if
+       } elseif (isSessionVariableSet('mx_lang')) {
                // Return stored value from cookie
                $ret = getSession('mx_lang');
 
                // Fixes a warning before the session has the mx_lang constant
-               if (empty($ret)) $ret = constant('DEFAULT_LANG');
+               if (empty($ret)) $ret = getConfig('DEFAULT_LANG');
        }
 
        // Cache entry
@@ -935,7 +928,7 @@ function LOAD_EMAIL_TEMPLATE ($template, $content = array(), $UID = '0') {
        return COMPILE_CODE($newContent);
 }
 
-// Generates a timestamp (wrapper for mktime())
+// Generates a timestamp (some wrapper for mktime())
 function makeTime ($H, $M, $S, $stamp) {
        // Extract day, month and year from given timestamp
        $day   = date('d', $stamp);
@@ -947,7 +940,7 @@ function makeTime ($H, $M, $S, $stamp) {
 }
 
 // Redirects to an URL and if neccessarry extends it with own base URL
-function redirectToUrl ($URL, $addUrlData=true) {
+function redirectToUrl ($URL) {
        // Compile out URI codes
        $URL = compileUriCode($URL);
 
@@ -958,7 +951,7 @@ function redirectToUrl ($URL, $addUrlData=true) {
        } // END - if
 
        // Three different debug ways...
-       //* DEBUG: */ debug_report_bug(sprintf("%s[%s:] URL=%s", __FUNCTION__, __LINE__, $URL));
+       /* DEBUG: */ debug_report_bug(sprintf("%s[%s:] URL=%s", __FUNCTION__, __LINE__, $URL));
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, $URL);
        //* DEBUG: */ die($URL);
 
@@ -979,9 +972,6 @@ function redirectToUrl ($URL, $addUrlData=true) {
                clearOutputBuffer();
        } // END - if
 
-       // Add some data to URL if cookies are not accepted
-       if ((!isBooleanConstantAndTrue('__COOKIES')) && ($addUrlData === true)) $URL = addUrlData($URL);
-
        // Secure the URL against bad things such als HTML insertions and so on...
        $URL = htmlentities(strip_tags($URL), ENT_QUOTES);
 
@@ -992,7 +982,7 @@ function redirectToUrl ($URL, $addUrlData=true) {
        } elseif (!headers_sent()) {
                // Load URL when headers are not sent
                //* DEBUG: */ debug_report_bug("URL={$URL}");
-               header ('Location: '.str_replace('&amp;', '&', $URL));
+               sendHeader('Location: '.str_replace('&amp;', '&', $URL));
        } else {
                // Output error message
                loadInclude('inc/header.php');
@@ -1005,7 +995,7 @@ function redirectToUrl ($URL, $addUrlData=true) {
 }
 
 // Wrapper for redirectToUrl but URL comes from a configuration entry
-function LOAD_CONFIGURED_URL ($configEntry) {
+function redirectToConfiguredUrl ($configEntry) {
        // Get the URL
        $URL = getConfig($configEntry);
 
@@ -1278,40 +1268,40 @@ function generateRandomCodde ($length, $code, $uid, $DATA = '') {
        if (!defined('_MAX')) define('_MAX', 15235);
 
        // Build server string
-       $server = $_SERVER['PHP_SELF'].constant('ENCRYPT_SEPERATOR').detectUserAgent().constant('ENCRYPT_SEPERATOR').getenv('SERVER_SOFTWARE').constant('ENCRYPT_SEPERATOR').detectRemoteAddr().":'.':".filemtime(constant('PATH')."inc/databases.php");
+       $server = $_SERVER['PHP_SELF'].getConfig('ENCRYPT_SEPERATOR').detectUserAgent().getConfig('ENCRYPT_SEPERATOR').getenv('SERVER_SOFTWARE').getConfig('ENCRYPT_SEPERATOR').detectRemoteAddr().":'.':".filemtime(constant('PATH').'inc/databases.php');
 
        // Build key string
-       $keys = constant('SITE_KEY').constant('ENCRYPT_SEPERATOR').constant('DATE_KEY');
-       if (isConfigEntrySet('secret_key'))  $keys .= constant('ENCRYPT_SEPERATOR').getConfig('secret_key');
-       if (isConfigEntrySet('file_hash'))   $keys .= constant('ENCRYPT_SEPERATOR').getConfig('file_hash');
-       $keys .= constant('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", getConfig(('patch_ctime')));
-       if (isConfigEntrySet('master_salt')) $keys .= constant('ENCRYPT_SEPERATOR').getConfig('master_salt');
+       $keys = getConfig('SITE_KEY').getConfig('ENCRYPT_SEPERATOR').getConfig('DATE_KEY');
+       if (isConfigEntrySet('secret_key'))  $keys .= getConfig('ENCRYPT_SEPERATOR').getConfig('secret_key');
+       if (isConfigEntrySet('file_hash'))   $keys .= getConfig('ENCRYPT_SEPERATOR').getConfig('file_hash');
+       $keys .= getConfig('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", getConfig(('patch_ctime')));
+       if (isConfigEntrySet('master_salt')) $keys .= getConfig('ENCRYPT_SEPERATOR').getConfig('master_salt');
 
        // Build string from misc data
-       $data   = $code.constant('ENCRYPT_SEPERATOR').$uid.constant('ENCRYPT_SEPERATOR').$DATA;
+       $data   = $code.getConfig('ENCRYPT_SEPERATOR').$uid.getConfig('ENCRYPT_SEPERATOR').$DATA;
 
        // Add more additional data
-       if (isSessionVariableSet('u_hash'))         $data .= constant('ENCRYPT_SEPERATOR').getSession('u_hash');
-       if (isUserIdSet())                          $data .= constant('ENCRYPT_SEPERATOR').getUserId();
-       if (isSessionVariableSet('mxchange_theme')) $data .= constant('ENCRYPT_SEPERATOR').getSession('mxchange_theme');
-       if (isSessionVariableSet('mx_lang'))        $data .= constant('ENCRYPT_SEPERATOR').getLanguage();
-       if (isset($GLOBALS['refid']))               $data .= constant('ENCRYPT_SEPERATOR').$GLOBALS['refid'];
+       if (isSessionVariableSet('u_hash'))         $data .= getConfig('ENCRYPT_SEPERATOR').getSession('u_hash');
+       if (isUserIdSet())                          $data .= getConfig('ENCRYPT_SEPERATOR').getUserId();
+       if (isSessionVariableSet('mxchange_theme')) $data .= getConfig('ENCRYPT_SEPERATOR').getSession('mxchange_theme');
+       if (isSessionVariableSet('mx_lang'))        $data .= getConfig('ENCRYPT_SEPERATOR').getLanguage();
+       if (isset($GLOBALS['refid']))               $data .= getConfig('ENCRYPT_SEPERATOR').$GLOBALS['refid'];
 
        // Calculate number for generating the code
-       $a = $code + constant('_ADD') - 1;
+       $a = $code + getConfig('_ADD') - 1;
 
        if (isConfigEntrySet('master_hash')) {
                // Generate hash with master salt from modula of number with the prime number and other data
-               $saltedHash = generateHash(($a % constant('_PRIME')).constant('ENCRYPT_SEPERATOR').$server.constant('ENCRYPT_SEPERATOR').$keys.constant('ENCRYPT_SEPERATOR').$data.constant('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", time()).constant('ENCRYPT_SEPERATOR').$a, getConfig('master_salt'));
+               $saltedHash = generateHash(($a % getConfig('_PRIME')).getConfig('ENCRYPT_SEPERATOR').$server.getConfig('ENCRYPT_SEPERATOR').$keys.getConfig('ENCRYPT_SEPERATOR').$data.getConfig('ENCRYPT_SEPERATOR').getConfig('DATE_KEY').getConfig('ENCRYPT_SEPERATOR').$a, getConfig('master_salt'));
 
                // Create number from hash
-               $rcode = hexdec(substr($saltedHash, strlen(getConfig('master_salt')), 9)) / abs(constant('_MAX') - $a + sqrt(constant('_ADD'))) / pi();
+               $rcode = hexdec(substr($saltedHash, strlen(getConfig('master_salt')), 9)) / abs(constant('_MAX') - $a + sqrt(getConfig('_ADD'))) / pi();
        } else {
                // Generate hash with "hash of site key" from modula of number with the prime number and other data
-               $saltedHash = generateHash(($a % constant('_PRIME')).constant('ENCRYPT_SEPERATOR').$server.constant('ENCRYPT_SEPERATOR').$keys.constant('ENCRYPT_SEPERATOR').$data.constant('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", time()).constant('ENCRYPT_SEPERATOR').$a, substr(sha1(constant('SITE_KEY')), 0, 8));
+               $saltedHash = generateHash(($a % getConfig('_PRIME')).getConfig('ENCRYPT_SEPERATOR').$server.getConfig('ENCRYPT_SEPERATOR').$keys.getConfig('ENCRYPT_SEPERATOR').$data.getConfig('ENCRYPT_SEPERATOR').getConfig('DATE_KEY').getConfig('ENCRYPT_SEPERATOR').$a, substr(sha1(getConfig('SITE_KEY')), 0, 8));
 
                // Create number from hash
-               $rcode = hexdec(substr($saltedHash, 8, 9)) / abs(constant('_MAX') - $a + sqrt(constant('_ADD'))) / pi();
+               $rcode = hexdec(substr($saltedHash, 8, 9)) / abs(constant('_MAX') - $a + sqrt(getConfig('_ADD'))) / pi();
        }
 
        // At least 10 numbers shall be secure enought!
@@ -1361,12 +1351,12 @@ function GENERATE_IMAGE ($img_code, $headerSent=true) {
                // Switch image type
                switch (getConfig('img_type'))
                {
-               case "jpg":
+               case 'jpg':
                        // Okay, load image and hide all errors
                        $image = @imagecreatefromjpeg($img);
                        break;
 
-               case "png":
+               case 'png':
                        // Okay, load image and hide all errors
                        $image = @imagecreatefrompng($img);
                        break;
@@ -1384,19 +1374,19 @@ function GENERATE_IMAGE ($img_code, $headerSent=true) {
        imagestring($image, 5, 14, 2, $img_code, $text_color);
 
        // Return to browser
-       header ("Content-Type: image/".getConfig('img_type'));
+       sendHeader('Content-Type: image/' . getConfig('img_type'));
 
        // Output image with matching image factory
        switch (getConfig('img_type')) {
-               case "jpg": imagejpeg($image); break;
-               case "png": imagepng($image);  break;
+               case 'jpg': imagejpeg($image); break;
+               case 'png': imagepng($image);  break;
        }
 
        // Remove image from memory
        imagedestroy($image);
 }
 // Create selection box or array of splitted timestamp
-function createTimeSelections ($timestamp, $prefix = '', $display = '', $align="center", $return_array=false) {
+function createTimeSelections ($timestamp, $prefix = '', $display = '', $align = 'center', $return_array=false) {
        // Calculate 2-seconds timestamp
        $stamp = round($timestamp);
        //* DEBUG: */ print("*".$stamp.'/'.$timestamp."*<br />");
@@ -1648,8 +1638,8 @@ function SEND_ADMIN_EMAILS_PRO ($subj, $template, $content, $UID) {
                $result = false;
 
                // "implode" IDs and query string
-               $aid = implode(",", $adminIds);
-               if ($aid == "-1") {
+               $aid = implode(',', $adminIds);
+               if ($aid == '-1') {
                        if (EXT_IS_ACTIVE('events')) {
                                // Add line to user events
                                EVENTS_ADD_LINE($subj, $msg, $UID);
@@ -1719,7 +1709,7 @@ function ADD_EMAIL_NAV ($PAGES, $offset, $show_form, $colspan, $return=false) {
        $NAV = '';
        for ($page = 1; $page <= $PAGES; $page++) {
                // Is the page currently selected or shall we generate a link to it?
-               if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == "1"))) {
+               if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == '1'))) {
                        // Is currently selected, so only highlight it
                        $NAV .= "<strong>-";
                } else {
@@ -1733,7 +1723,7 @@ function ADD_EMAIL_NAV ($PAGES, $offset, $show_form, $colspan, $return=false) {
                        $NAV .= "\">";
                }
                $NAV .= $page;
-               if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == "1"))) {
+               if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == '1'))) {
                        // Is currently selected, so only highlight it
                        $NAV .= "-</strong>";
                } else {
@@ -1901,7 +1891,7 @@ function sendRawRequest ($host, $request) {
                // Use login data to proxy? (username at least!)
                if (getConfig('proxy_username') != '') {
                        // Add it as well
-                       $encodedAuth = base64_encode(COMPILE_CODE(getConfig('proxy_username')).constant('ENCRYPT_SEPERATOR').COMPILE_CODE(getConfig('proxy_password')));
+                       $encodedAuth = base64_encode(COMPILE_CODE(getConfig('proxy_username')).getConfig('ENCRYPT_SEPERATOR').COMPILE_CODE(getConfig('proxy_password')));
                        $proxyTunnel .= "Proxy-Authorization: Basic ".$encodedAuth."\r\n";
                } // END - if
 
@@ -2091,19 +2081,19 @@ function generateHash ($plainText, $salt = '') {
        // When the salt is empty build a new one, else use the first x configured characters as the salt
        if (empty($salt)) {
                // Build server string (inc/databases.php is no longer updated with every commit)
-               $server = $_SERVER['PHP_SELF'].constant('ENCRYPT_SEPERATOR').detectUserAgent().constant('ENCRYPT_SEPERATOR').getenv('SERVER_SOFTWARE').constant('ENCRYPT_SEPERATOR').detectRemoteAddr();
+               $server = $_SERVER['PHP_SELF'].getConfig('ENCRYPT_SEPERATOR').detectUserAgent().getConfig('ENCRYPT_SEPERATOR').getenv('SERVER_SOFTWARE').getConfig('ENCRYPT_SEPERATOR').detectRemoteAddr();
 
                // Build key string
-               $keys   = constant('SITE_KEY').constant('ENCRYPT_SEPERATOR').constant('DATE_KEY').constant('ENCRYPT_SEPERATOR').getConfig('secret_key').constant('ENCRYPT_SEPERATOR').getConfig('file_hash').constant('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", getConfig(('patch_ctime'))).constant('ENCRYPT_SEPERATOR').getConfig('master_salt');
+               $keys   = getConfig('SITE_KEY').getConfig('ENCRYPT_SEPERATOR').getConfig('DATE_KEY').getConfig('ENCRYPT_SEPERATOR').getConfig('secret_key').getConfig('ENCRYPT_SEPERATOR').getConfig('file_hash').getConfig('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", getConfig(('patch_ctime'))).getConfig('ENCRYPT_SEPERATOR').getConfig('master_salt');
 
                // Additional data
-               $data = $plainText.constant('ENCRYPT_SEPERATOR').uniqid(mt_rand(), true).constant('ENCRYPT_SEPERATOR').time();
+               $data = $plainText.getConfig('ENCRYPT_SEPERATOR').uniqid(mt_rand(), true).getConfig('ENCRYPT_SEPERATOR').time();
 
                // Calculate number for generating the code
-               $a = time() + constant('_ADD') - 1;
+               $a = time() + getConfig('_ADD') - 1;
 
                // Generate SHA1 sum from modula of number and the prime number
-               $sha1 = sha1(($a % constant('_PRIME')).$server.constant('ENCRYPT_SEPERATOR').$keys.constant('ENCRYPT_SEPERATOR').$data.constant('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", time()).constant('ENCRYPT_SEPERATOR').$a);
+               $sha1 = sha1(($a % getConfig('_PRIME')).$server.getConfig('ENCRYPT_SEPERATOR').$keys.getConfig('ENCRYPT_SEPERATOR').$data.getConfig('ENCRYPT_SEPERATOR').getConfig('DATE_KEY').getConfig('ENCRYPT_SEPERATOR').$a);
                //* DEBUG: */ echo "SHA1=".$sha1." (".strlen($sha1).")<br />";
                $sha1 = scrambleString($sha1);
                //* DEBUG: */ echo "Scrambled=".$sha1." (".strlen($sha1).")<br />";
@@ -2203,31 +2193,6 @@ function genScrambleString ($len) {
        return $scrambleString;
 }
 
-// Append data like session ID or referal ID to the given URL which would
-// normally be stored in cookies
-function addUrlData ($URL) {
-       // Init add
-       $add = '';
-
-       // Determine URL binder
-       $BIND = '?';
-       if (strpos($URL, '?') !== false) $BIND = '&amp;';
-
-       if ((!defined('__COOKIES')) || ((!constant('__COOKIES')))) {
-               // Cookies are not accepted
-               if ((REQUEST_ISSET_GET(('refid'))) && (strpos($URL, "refid=") == 0)) {
-                       // Cookie found in URL
-                       $add .= $BIND."refid=".bigintval(REQUEST_GET('refid'));
-               } elseif ((GET_EXT_VERSION('sql_patches') != '') && (getConfig('def_refid') > 0)) {
-                       // Not found! So let's set default here
-                       $add .= $BIND."refid=".getConfig('def_refid');
-               }
-       } // END - if
-
-       // Add all together and return it
-       return $URL . $add;
-}
-
 // Generate an PGP-like encrypted hash of given hash for e.g. cookies
 function generatePassString ($passHash) {
        // Return vanilla password hash
@@ -2242,9 +2207,9 @@ function generatePassString ($passHash) {
                        $part2 = hexdec(substr(getConfig('secret_key'), $start, 4));
                        $mod = dechex($idx);
                        if ($part1 > $part2) {
-                               $mod = dechex(sqrt(($part1 - $part2) * constant('_PRIME') / pi()));
+                               $mod = dechex(sqrt(($part1 - $part2) * getConfig('_PRIME') / pi()));
                        } elseif ($part2 > $part1) {
-                               $mod = dechex(sqrt(($part2 - $part1) * constant('_PRIME') / pi()));
+                               $mod = dechex(sqrt(($part2 - $part1) * getConfig('_PRIME') / pi()));
                        }
                        $mod = substr(round($mod), 0, 4);
                        $mod = str_repeat('0', 4-strlen($mod)).$mod;
@@ -2253,7 +2218,7 @@ function generatePassString ($passHash) {
                        $newHash .= $mod;
                } // END - for
 
-               //* DEBUG: */ print($passHash."<br />".$newHash." (".strlen($newHash).")");
+               //* DEBUG: */ print($passHash."<br />".$newHash." (".strlen($newHash).')');
                $ret = generateHash($newHash, getConfig('master_salt'));
                //* DEBUG: */ print($ret."<br />\n");
        } else {
@@ -2476,60 +2441,6 @@ function getThemeId ($name) {
        return $id;
 }
 
-// Read a given file
-function readFromFile ($FQFN, $sqlPrepare = false) {
-       // Load the file
-       if (function_exists('file_get_contents')) {
-               // Use new function
-               $content = file_get_contents($FQFN);
-       } else {
-               // Fall-back to implode-file chain
-               $content = implode('', file($FQFN));
-       }
-
-       // Prepare SQL queries?
-       if ($sqlPrepare === true) {
-               // Remove some unwanted chars
-               $content = str_replace("\r", '', $content);
-               $content = str_replace("\n\n", "\n", $content);
-       } // END - if
-
-       // Return the content
-       return $content;
-}
-
-// Writes content to a file
-function writeToFile ($FQFN, $content) {
-       // Is the file writeable?
-       if ((isFileReadable($FQFN)) && (!is_writeable($FQFN)) && (!chmod($FQFN, 0644))) {
-               // Not writeable!
-               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("File %s not writeable.", basename($FQFN)));
-
-               // Failed! :(
-               return false;
-       } // END - if
-
-       // By default all is failed...
-       $return = false;
-
-       // Is the function there?
-       if (function_exists('file_put_contents')) {
-               // Write it directly
-               $return = file_put_contents($FQFN, $content);
-       } else {
-               // Write it with fopen
-               $fp = fopen($FQFN, 'w') or app_die(__FUNCTION__, __LINE__, "Cannot write file ".basename($FQFN).'!');
-               fwrite($fp, $content);
-               fclose($fp);
-
-               // Set CHMOD rights
-               $return = chmod($FQFN, 0644);
-       }
-
-       // Return status
-       return $return;
-}
-
 // Generates an error code from given account status
 function generateErrorCodeFromUserStatus ($status) {
        // Default error code if unknown account status
@@ -2551,15 +2462,6 @@ function generateErrorCodeFromUserStatus ($status) {
        return $errorCode;
 }
 
-// Clears the output buffer. This function does *NOT* backup sent content.
-function clearOutputBuffer () {
-       // Trigger an error on failure
-       if (!ob_end_clean()) {
-               // Failed!
-               debug_report_bug(__FUNCTION__.': Failed to clean output buffer.');
-       } // END - if
-}
-
 // Function to search for the last modifified file
 function searchDirsRecursive ($dir, &$last_changed) {
        // Get dir as array
@@ -2737,35 +2639,6 @@ function getArrayFromActualVersion () {
        return $akt_vers;
 }
 
-
-// Loads an include file and logs any missing files for debug purposes
-function loadInclude ($INC) {
-       // Add the path. This is why we need a trailing slash in config.php
-       $FQFN = constant('PATH') . $INC;
-
-       // Is the include file there?
-       if (!isIncludeReadable($INC)) {
-               // Not there so log it
-               debug_report_bug(sprintf("Include file %s not found.", $INC));
-               return false;
-       } // END - if
-
-       // Try to load it
-       require($FQFN);
-}
-
-// Loads an include file once
-function loadIncludeOnce ($INC) {
-       // Is it not loaded?
-       if (!isset($GLOBALS['load_once'][$INC])) {
-               // Then try to load it
-               loadInclude($INC);
-
-               // And mark it as loaded
-               $GLOBALS['load_once'][$INC] = "loaded";
-       } // END - if
-}
-
 // Back-ported from the new ship-simu engine. :-)
 function debug_get_printable_backtrace () {
        // Init variable
@@ -2777,7 +2650,7 @@ function debug_get_printable_backtrace () {
                if (!isset($trace['file'])) $trace['file'] = __FUNCTION__;
                if (!isset($trace['line'])) $trace['line'] = __LINE__;
                if (!isset($trace['args'])) $trace['args'] = array();
-               $backtrace .= "<li class=\"debug_list\"><span class=\"backtrace_file\">".basename($trace['file'])."</span>:".$trace['line'].", <span class=\"backtrace_function\">".$trace['function']."(".count($trace['args']).")</span></li>\n";
+               $backtrace .= "<li class=\"debug_list\"><span class=\"backtrace_file\">".basename($trace['file'])."</span>:".$trace['line'].", <span class=\"backtrace_function\">".$trace['function'].'('.count($trace['args']).")</span></li>\n";
        } // END - foreach
 
        // Close it
@@ -2805,7 +2678,7 @@ function debug_report_bug ($message = '') {
        // Add output
        $debug .= "Please report this bug at <a href=\"http://bugs.mxchange.org\" rel=\"external\" target=\"_blank\">bugs.mxchange.org</a>:<pre>";
        $debug .= debug_get_printable_backtrace();
-       $debug .= "</pre>Request-URI: ".$_SERVER['REQUEST_URI']."<br />\n";
+       $debug .= "</pre>\nRequest-URI: ".$_SERVER['REQUEST_URI']."<br />\n";
        $debug .= "Thank you for finding bugs.";
 
        // And abort here
@@ -2841,8 +2714,8 @@ function convertCodeToMessage ($code) {
                        break;
 
                case getCode('EXTENSION_PROBLEM'):
-                       if (REQUEST_ISSET_GET(('ext'))) {
-                               $msg = sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), REQUEST_GET(('ext')));
+                       if (REQUEST_ISSET_GET('ext')) {
+                               $msg = sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), REQUEST_GET('ext'));
                        } else {
                                $msg = getMessage('EXTENSION_PROBLEM_UNSET_EXT');
                        }
@@ -2896,29 +2769,6 @@ function generateAdminLink ($aid) {
        return $admin;
 }
 
-// Checks wether an include file (non-FQFN better) is readable
-function isIncludeReadable ($INC) {
-       // Construct FQFN
-       $FQFN = constant('PATH') . $INC;
-
-       // Is it readable?
-       return isFileReadable($FQFN);
-}
-
-// Encode strings
-// @TODO Implement $compress
-function encodeString ($str, $compress=true) {
-       $str = urlencode(base64_encode(compileUriCode($str)));
-       return $str;
-}
-
-// Decode strings encoded with encodeString()
-// @TODO Implement $decompress
-function decodeString ($str, $decompress=true) {
-       $str = compileUriCode(base64_decode(urldecode(compileUriCode($str))));
-       return $str;
-}
-
 // Compile characters which are allowed in URLs
 function compileUriCode ($code, $simple=true) {
        // Compile constants
@@ -3008,21 +2858,6 @@ function isUrlValidSimple ($url) {
        return $reg;
 }
 
-// Smartly adds slashes
-function smartAddSlashes ($unquoted) {
-       $unquoted = str_replace("\\", '', $unquoted);
-       return addslashes($unquoted);
-}
-
-// Decode entities in a nicer way
-function decodeEntities ($str) {
-       // Decode the entities to UTF-8 now
-       $decodedString = html_entity_decode($str, ENT_NOQUOTES, "UTF-8");
-
-       // Return decoded string
-       return $decodedString;
-}
-
 // Wtites data to a config.php-style file
 // @TODO Rewrite this function to use readFromFile() and writeToFile()
 function changeDataInFile ($FQFN, $comment, $prefix, $suffix, $DATA, $seek=0) {
@@ -3106,26 +2941,6 @@ function sendAdminNotification ($subject, $templateName, $content=array(), $uid
        }
 }
 
-// Merges an array together but only if both are arrays
-function merge_array ($array1, $array2) {
-       // Are both an array?
-       if ((is_array($array1)) && (is_array($array2))) {
-               // Merge all together
-               return array_merge($array1, $array2);
-       } elseif (is_array($array1)) {
-               // Return left array
-               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("array2 is not an array. array != %s", gettype($array2)));
-               return $array1;
-       } elseif (is_array($array2)) {
-               // Return right array
-               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("array1 is not an array. array != %s", gettype($array1)));
-               return $array2;
-       }
-
-       // Both are not arrays
-       debug_report_bug(__FUNCTION__.": No arrays provided!");
-}
-
 // Debug message logger
 function DEBUG_LOG ($funcFile, $line, $message, $force=true) {
        // Is debug mode enabled?
@@ -3152,7 +2967,7 @@ function runResetIncludes () {
        SET_INC_POOL(getArrayFromDirectory('inc/reset/', 'reset_'));
 
        // Update database
-       if (!defined('DEBUG_RESET')) updateConfiguration('last_update', time());
+       if (getConfig('DEBUG_RESET') != 'Y') updateConfiguration('last_update', time());
 
        // Is the config entry set?
        if (GET_EXT_VERSION('sql_patches') >= '0.4.2') {
@@ -3165,7 +2980,7 @@ function runResetIncludes () {
                        MERGE_INC_POOL(getArrayFromDirectory('inc/weekly/', 'weekly_'));
 
                        // Update config
-                       if (!defined('DEBUG_WEEKLY')) updateConfiguration('last_week', $currWeek);
+                       if (getConfig('DEBUG_WEEKLY') != 'Y') updateConfiguration('last_week', $currWeek);
                } // END - if
 
                // Create current month mark
@@ -3177,7 +2992,7 @@ function runResetIncludes () {
                        MERGE_INC_POOL(getArrayFromDirectory('inc/monthly/', 'monthly_'));
 
                        // Update config
-                       if (!defined('DEBUG_MONTHLY')) updateConfiguration('last_month', $currMonth);
+                       if (getConfig('DEBUG_MONTHLY') != 'Y') updateConfiguration('last_month', $currMonth);
                } // END - if
        } // END - if
 
@@ -3218,12 +3033,6 @@ function handleExtraValues ($filterFunction, $value, $extraValue) {
        return $ret;
 }
 
-// Check if given FQFN is a readable file
-function isFileReadable ($FQFN) {
-       // Check all...
-       return ((file_exists($FQFN)) && (is_file($FQFN)) && (is_readable($FQFN)));
-}
-
 // Converts timestamp selections into a timestamp
 function convertSelectionsToTimestamp (&$POST, &$DATA, &$id, &$skip) {
        // Init test variable
@@ -3294,7 +3103,7 @@ function HANDLE_LOGIN_FAILTURES ($accessLevel) {
                        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):accessLevel={$accessLevel}<br />\n";
                        $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
@@ -3372,8 +3181,8 @@ function determineRealRemoteAddress () {
        }
 
        // This strips out the real address from proxy output
-       if (strstr($address, ",")){
-               $addressArray = explode(",", $address);
+       if (strstr($address, ',')){
+               $addressArray = explode(',', $address);
                $address = $addressArray[0];
        } // END - if
 
@@ -3381,66 +3190,6 @@ function determineRealRemoteAddress () {
        return $address;
 }
 
-// "Getter" for remote IP number
-function detectRemoteAddr () {
-       // Get remote ip from environment
-       $remoteAddr = determineRealRemoteAddress();
-
-       // Is removeip installed?
-       if (EXT_IS_ACTIVE('removeip')) {
-               // Then anonymize it
-               $remoteAddr = GET_ANONYMOUS_REMOTE_ADDR($remoteAddr);
-       } // END - if
-
-       // Return it
-       return $remoteAddr;
-}
-
-// "Getter" for remote hostname
-function detectRemoteHostname () {
-       // Get remote ip from environment
-       $remoteHost = getenv('REMOTE_HOST');
-
-       // Is removeip installed?
-       if (EXT_IS_ACTIVE('removeip')) {
-               // Then anonymize it
-               $remoteHost = GET_ANONYMOUS_REMOTE_HOST($remoteHost);
-       } // END - if
-
-       // Return it
-       return $remoteHost;
-}
-
-// "Getter" for user agent
-function detectUserAgent () {
-       // Get remote ip from environment
-       $userAgent = getenv('HTTP_USER_AGENT');
-
-       // Is removeip installed?
-       if (EXT_IS_ACTIVE('removeip')) {
-               // Then anonymize it
-               $userAgent = GET_ANONYMOUS_USER_AGENT($userAgent);
-       } // END - if
-
-       // Return it
-       return $userAgent;
-}
-
-// "Getter" for referer
-function detectReferer () {
-       // Get remote ip from environment
-       $referer = getenv('HTTP_REFERER');
-
-       // Is removeip installed?
-       if (EXT_IS_ACTIVE('removeip')) {
-               // Then anonymize it
-               $referer = GET_ANONYMOUS_REFERER($referer);
-       } // END - if
-
-       // Return it
-       return $referer;
-}
-
 // Adds a bonus mail to the queue
 // This is a high-level function!
 function addNewBonusMail ($data, $mode = '', $output=true) {
@@ -3499,7 +3248,7 @@ function DETERMINE_REFID () {
                $GLOBALS['refid'] = getConfig(('def_refid'));
        } elseif ((GET_EXT_VERSION('user') >= '0.3.4') && (getConfig('select_user_zero_refid')) == 'Y') {
                // Select a random user which has confirmed enougth mails
-               $GLOBALS['refid'] = SELECT_RANDOM_REFID();
+               $GLOBALS['refid'] = determineRandomReferalId();
        } else {
                // No default ID when sql_patches is not installed or none set
                $GLOBALS['refid'] = 0;
@@ -3515,23 +3264,6 @@ function DETERMINE_REFID () {
        return $GLOBALS['refid'];
 }
 
-// Check wether we are installing
-function isInstalling () {
-       $installing = ((isset($GLOBALS['mxchange_installing'])) || (REQUEST_ISSET_GET('installing')));
-       //* DEBUG: */ var_dump($installing);
-       return $installing;
-}
-
-// Check wether this script is installed
-function isInstalled () {
-       return isBooleanConstantAndTrue('mxchange_installed');
-}
-
-// Check wether an admin is registered
-function isAdminRegistered () {
-       return isBooleanConstantAndTrue('admin_registered');
-}
-
 // Enables the reset mode. Only call this function if you really want the
 // reset to be run!
 function enableResetMode () {
@@ -3542,23 +3274,6 @@ function enableResetMode () {
        runFilterChain('reset_enabled');
 }
 
-// Checks wether the reset mode is active
-function isResetModeEnabled () {
-       // Now simply check it
-       return ((isset($GLOBALS['reset_enabled'])) && ($GLOBALS['reset_enabled'] === true));
-}
-
-// Checks wether the debug mode is enabled
-function isDebugModeEnabled () {
-       // Simply check it
-       return isBooleanConstantAndTrue('DEBUG_MODE');
-}
-
-// Checks wether the cache instance is valid
-function isCacheInstanceValid () {
-       return ((isset($GLOBALS['cache_instance'])) && (is_object($GLOBALS['cache_instance'])));
-}
-
 // Our shutdown-function
 function shutdown () {
        // Call the filter chain 'shutdown'
@@ -3601,33 +3316,43 @@ function isUserIdSet () {
        return (isset($GLOBALS['userid']));
 }
 
-// Checks wether the given FQFN is a directory and not .,.. or .svn
-function isDirectory ($FQFN) {
-       // Generate baseName
-       $baseName = basename($FQFN);
-
-       // Check it
-       $isDirectory = ((is_dir($FQFN)) && ($baseName != '.') && ($baseName != '..') && ($baseName != ".svn"));
-
-       // Return the result
-       return $isDirectory;
-}
-
 // Handle message codes from URL
 function handleCodeMessage () {
-       if (REQUEST_ISSET_GET(('msg'))) {
+       if (REQUEST_ISSET_GET('msg')) {
                // Default extension is "unknown"
-               $ext = "unknown";
+               $ext = 'unknown';
 
                // Is extension given?
-               if (REQUEST_ISSET_GET(('ext'))) $ext = REQUEST_GET(('ext'));
+               if (REQUEST_ISSET_GET('ext')) $ext = REQUEST_GET('ext');
 
                // Convert the 'msg' parameter from URL to a human-readable message
                $msg = convertCodeToMessage(REQUEST_GET('msg'));
 
                // Load message template
-               LOAD_TEMPLATE("message", false, $msg);
+               LOAD_TEMPLATE('message', false, $msg);
+       } // END - if
+}
+
+// Setter for extra title
+function setExtraTitle ($extraTitle) {
+       $GLOBALS['extra_title'] = $extraTitle;
+}
+
+// Getter for extra title
+function getExtraTitle () {
+       // Is the extra title set?
+       if (!isExtraTitleSet()) {
+               // No, then abort here
+               debug_report_bug('extra_title is not set!');
        } // END - if
+
+       // Return it
+       return $GLOBALS['extra_title'];
+}
+
+// Checks if the extra title is set
+function isExtraTitleSet () {
+       return ((isset($GLOBALS['extra_title'])) && (!empty($GLOBALS['extra_title'])));
 }
 
 //////////////////////////////////////////////////
index 5c904093df1782a87afb5070670b04b1e3632f5f..9afbe993d24e72c7a1b70be2020d6e0afef68b12 100644 (file)
@@ -45,9 +45,9 @@ if (!defined('__SECURITY')) {
 }
 
 // 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 (($GLOBALS['output_mode'] != "1")) {
+       if (($GLOBALS['output_mode'] != '1')) {
                // Generate header
                $TITLE = '';
 
@@ -59,9 +59,9 @@ if (($GLOBALS['header_sent'] != "1") && ($GLOBALS['header_sent'] != "2")) {
                                if ((getConfig('enable_title_deco') == 'Y') && (getConfig('title_left') != '')) $TITLE .= trim(getConfig('title_left'))." ";
 
                                // Do we have some extra title?
-                               if (!empty($EXTRA_TITLE)) {
+                               if (isExtraTitleSet()) {
                                        // Then prepent it
-                                       $TITLE .= $EXTRA_TITLE." by ";
+                                       $TITLE .= getExtraTitle() . ' by ';
                                } // END - if
 
                                // Add main title
@@ -81,9 +81,12 @@ if (($GLOBALS['header_sent'] != "1") && ($GLOBALS['header_sent'] != "2")) {
 
                                // Remember title in constant for the template
                                define('__PAGE_TITLE', $TITLE);
+                       } elseif ((isInstalled()) && (!isAdminRegistered())) {
+                               // Installed but no admin registered
+                               define('__PAGE_TITLE', sprintf(getMessage('SETUP_OF_MXCHANGE'), constant('MAIN_TITLE')));
                        } elseif ((!isInstalled()) || (!isAdminRegistered())) {
                                // Installation mode
-                               define('__PAGE_TITLE', sprintf(getMessage('INSTALLATION_OF_MXCHANGE'), constant('MAIN_TITLE')));
+                               define('__PAGE_TITLE', getMessage('INSTALLATION_OF_MXCHANGE'));
                        } else {
                                // Configuration not found!
                                define('__PAGE_TITLE', getMessage('NO_CONFIG_FOUND_TITLE'));
@@ -97,12 +100,12 @@ if (($GLOBALS['header_sent'] != "1") && ($GLOBALS['header_sent'] != "2")) {
                unset($TITLE);
 
                // Output page header code
-               LOAD_TEMPLATE("page_header");
+               LOAD_TEMPLATE('page_header');
 
                // Include meta data in 'guest' module
                if ($GLOBALS['module'] == 'index') {
                        // Load meta data template
-                       LOAD_TEMPLATE("metadata");
+                       LOAD_TEMPLATE('metadata');
 
                        // Add meta description to header
                        if ((isInstalled()) && (isAdminRegistered()) && (SQL_IS_LINK_UP())) {
@@ -112,23 +115,23 @@ if (($GLOBALS['header_sent'] != "1") && ($GLOBALS['header_sent'] != "2")) {
                } // END - if
 
                // Include more header data here
-               LOAD_TEMPLATE("header");
+               LOAD_TEMPLATE('header');
 
                // Include stylesheet
-               loadIncludeOnce("inc/stylesheet.php");
+               loadIncludeOnce('inc/stylesheet.php');
        } // END - if
 
        // Closing HEAD tag
-       if ($GLOBALS['output_mode'] != "1") OUTPUT_HTML("</head>");
+       if ($GLOBALS['output_mode'] != '1') OUTPUT_HTML('</head>');
        $GLOBALS['header_sent'] = 1;
 } // END - if
 
 // Load body or not
-if (($GLOBALS['module'] != "frametester") || (($GLOBALS['module'] == "frametester") && (REQUEST_ISSET_GET(('frame')))) || (($GLOBALS['header_sent'] == "1") && (REQUEST_ISSET_GET(('frame')))) && ($GLOBALS['output_mode'] != "1")) {
+if (($GLOBALS['module'] != 'frametester') || (($GLOBALS['module'] == 'frametester') && (REQUEST_ISSET_GET(('frame')))) || (($GLOBALS['header_sent'] == '1') && (REQUEST_ISSET_GET(('frame')))) && ($GLOBALS['output_mode'] != '1')) {
        // Is the header sent and the script is not the mail confirmation script and not a CSS?
-       if (($GLOBALS['header_sent'] == "1") && (basename($_SERVER['PHP_SELF']) != "mailid.php") && ($GLOBALS['output_mode'] != "1")) {
+       if (($GLOBALS['header_sent'] == '1') && (basename($_SERVER['PHP_SELF']) != 'mailid.php') && ($GLOBALS['output_mode'] != '1')) {
                // Add BODY tag
-               LOAD_TEMPLATE("page_body");
+               LOAD_TEMPLATE('page_body');
                $GLOBALS['header_sent'] = 2;
        } // END - if
 } // END - if
index 7dc1946e0c7583b519c993f494cf07d6eb013d6f..a2a63b59298d2fc8443b330fa35f2fdd0789e743 100644 (file)
@@ -63,7 +63,7 @@ function getArrayFromDirectory ($baseDir, $prefix, $includeDirs = false, $addBas
        $INCs = array();
 
        // Open directory
-       $dirPointer = opendir(constant('PATH') . $baseDir) or app_die(__FUNCTION__, __LINE__, "Cannot read ".basename($baseDir)." path!");
+       $dirPointer = opendir(constant('PATH') . $baseDir) or app_die(__FUNCTION__, __LINE__, 'Cannot read '.basename($baseDir).' path!');
 
        // Read all entries
        while ($baseFile = readdir($dirPointer)) {
@@ -88,7 +88,7 @@ function getArrayFromDirectory ($baseDir, $prefix, $includeDirs = false, $addBas
 
                // Is this a valid reset file?
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "baseDir={$baseDir},prefix={$prefix},baseFile={$baseFile}");
-               if (((isFileReadable($FQFN)) && (substr($baseFile, 0, strlen($prefix)) == $prefix) && (substr($baseFile, -4, 4) == ".php")) || (($includeDirs) && (isDirectory($FQFN)))) {
+               if (((isFileReadable($FQFN)) && (substr($baseFile, 0, strlen($prefix)) == $prefix) && (substr($baseFile, -4, 4) == '.php')) || (($includeDirs) && (isDirectory($FQFN)))) {
                        // Remove both for extension name
                        $extName = substr($baseFile, strlen($prefix), -4);
 
index 6073f4e66d211a08f437efa8c3ec24d813e6e1d8..3b938296277fc3c2282137a9d7c9c5c73e2ca1f5 100644 (file)
@@ -44,7 +44,7 @@
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
-}
+} // END - if
 
 // Init variables
 $mysql = array();
@@ -79,30 +79,29 @@ if ((REQUEST_ISSET_GET('page') && (REQUEST_GET('page') == 5))) {
 } // END - if
 
 // Is MXChange installed or no admin registered so far?
-if ((!isInstalled()) || (!isAdminRegistered()))
-{
+if ((!isInstalled()) || (!isAdminRegistered())) {
        // Set URL for FORM actions
        define('__BURL_ACTION', constant('URL'));
 
        // Output page for entered value
        switch (REQUEST_GET('page'))
        {
-       case "welcome": // Welcome to the installation!
-               LOAD_TEMPLATE("install_welcome");
+       case 'welcome': // Welcome to the installation!
+               LOAD_TEMPLATE('install_welcome');
                break;
 
-       case "1": // Server path, base URL
+       case '1': // Server path, base URL
                // @Profi-Concept: Hab meine Meinung doch geaendert! :-)
                // Load template
-               LOAD_TEMPLATE("install_page1");
+               LOAD_TEMPLATE('install_page1');
                break;
 
-       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";
-               if (empty($mysql['prefix'])) $mysql['prefix'] = "mxchange";
-               if (empty($mysql['type']))   $mysql['type']   = "MyISAM";
+       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';
+               if (empty($mysql['prefix'])) $mysql['prefix'] = 'mxchange';
+               if (empty($mysql['type']))   $mysql['type']   = 'MyISAM';
                if (getTotalFatalErrors() > 0) {
                        OUTPUT_HTML("<span class=\"install_fatal\">");
                        foreach (getFatalArray() as $key => $err) {
@@ -122,10 +121,10 @@ if ((!isInstalled()) || (!isAdminRegistered()))
                define('__EMAIL_VALUE' , REQUEST_POST('email'));
 
                // Load template
-               LOAD_TEMPLATE("install_page2");
+               LOAD_TEMPLATE('install_page2');
                break;
 
-       case "3":
+       case '3':
                // Set more values
                define('__SPATH_VALUE' , REQUEST_POST('spath'));
                define('__BURL_VALUE'  , REQUEST_POST('burl'));
@@ -134,14 +133,18 @@ if ((!isInstalled()) || (!isAdminRegistered()))
                define('__EMAIL_VALUE' , REQUEST_POST('email'));
 
                // Use default SMTP data
-               $smtpHost  = constant('SMTP_HOSTNAME');
-               $smtpUser  = constant('SMTP_USER');
-               $smtpPass1 = constant('SMTP_PASSWORD');
-               $smtpPass2 = constant('SMTP_PASSWORD');
+               $smtpHost  = getConfig('SMTP_HOSTNAME');
+               $smtpUser  = getConfig('SMTP_USER');
+               $smtpPass1 = getConfig('SMTP_PASSWORD');
+               $smtpPass2 = getConfig('SMTP_PASSWORD');
 
                // Overwrite it with the data from sent (failed) form
                if (REQUEST_ISSET_POST(('smtp_host'))) $smtpHost = REQUEST_POST('smtp_host');
                if (REQUEST_ISSET_POST(('smtp_user'))) $smtpUser = REQUEST_POST('smtp_user');
+               if (REQUEST_ISSET_POST(('smtp_pass'))) {
+                       $smtpPass1 = REQUEST_POST('smtp_pass');
+                       $smtpPass2 = REQUEST_POST('smtp_pass');
+               } // END - if
 
                // MySQL settings
                define('__MYSQL_HOST'  , $mysql['host']);
@@ -159,10 +162,10 @@ if ((!isInstalled()) || (!isAdminRegistered()))
                define('__SMTP_PASS2', $smtpPass2);
 
                // Load template
-               LOAD_TEMPLATE("install_page3");
+               LOAD_TEMPLATE('install_page3');
                break;
 
-       case "5": // Misc settings
+       case '5': // Misc settings
                // General settings
                define('__SPATH_VALUE' , REQUEST_POST('spath'));
                define('__BURL_VALUE'  , REQUEST_POST('burl'));
@@ -199,12 +202,8 @@ if ((!isInstalled()) || (!isAdminRegistered()))
   <td class=\"install\" align=\"right\">{--LANG_OUTPUT_MODE--}:&nbsp;&nbsp;</td>
   <td>
     <select name=\"omode\" size=\"1\" class=\"install_select\">
-      <option value=\"render\"");
-               if (constant('OUTPUT_MODE') == 'render') OUTPUT_HTML(' selected="selected"');
-               OUTPUT_HTML(">{--MODE_RENDER--}</option>
-      <option value=\"direct\"");
-               if (constant('OUTPUT_MODE') == 'direct') OUTPUT_HTML(' selected="selected"');
-               OUTPUT_HTML(">{--MODE_DIRECT--}</option>
+      <option value=\"render\">{--MODE_RENDER--}</option>
+      <option value=\"direct\">{--MODE_DIRECT--}</option>
     </select>
   </td>
 </tr>
@@ -213,12 +212,8 @@ if ((!isInstalled()) || (!isAdminRegistered()))
   <td class=\"install\" align=\"right\">{--WARN_NO_PASSWORD--}:&nbsp;&nbsp;</td>
   <td>
     <select name=\"warn_no_pass\" size=\"1\" class=\"install_select\">
-      <option value=\"true\"");
-               if (isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(' selected="selected"');
-               OUTPUT_HTML(">{--YES--}</option>
-      <option value=\"false\"");
-               if (!isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(' selected="selected"');
-               OUTPUT_HTML(">{--NO--}</option>
+      <option value=\"Y\">{--YES--}</option>
+      <option value=\"N\">{--NO--}</option>
     </select>
   </td>
 </tr>
@@ -227,12 +222,8 @@ if ((!isInstalled()) || (!isAdminRegistered()))
   <td class=\"install\" align=\"right\">{--LANG_WRITE_FOOTER--}:&nbsp;&nbsp;</td>
   <td>
     <select name=\"wfooter\" size=\"1\" class=\"install_select\">
-      <option value=\"true\"");
-               if (isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(' selected="selected"');
-               OUTPUT_HTML(">{--YES--}</option>
-      <option value=\"false\"");
-               if (!isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(' selected="selected"');
-               OUTPUT_HTML(">{--NO--}</option>
+      <option value=\"Y\">{--YES--}</option>
+      <option value=\"N\">{--NO--}</option>
     </select>
   </td>
 </tr>
@@ -241,12 +232,8 @@ if ((!isInstalled()) || (!isAdminRegistered()))
   <td class=\"install\" align=\"right\">{--INSTALL_ENABLE_BACKLINK--}:&nbsp;&nbsp;</td>
   <td>
     <select name=\"blink\" size=\"1\" class=\"install_select\">
-      <option value=\"true\"");
-               if (isBooleanConstantAndTrue('ENABLE_BACKLINK')) OUTPUT_HTML(' selected="selected"');
-               OUTPUT_HTML(">{--YES--}</option>
-      <option value=\"false\"");
-               if (!isBooleanConstantAndTrue('ENABLE_BACKLINK')) OUTPUT_HTML(' selected="selected"');
-               OUTPUT_HTML(">{--NO--}</option>
+      <option value=\"Y\">{--YES--}</option>
+      <option value=\"N\">{--NO--}</option>
     </select>
   </td>
 </tr>
@@ -272,7 +259,7 @@ if ((!isInstalled()) || (!isAdminRegistered()))
 </form>");
                break;
 
-       case "finalize": // Write captured data to files
+       case 'finalize': // Write captured data to files
                if ((REQUEST_ISSET_POST(('finalize'))) && (!isInstalled())) {
                        // You have submitted data then we have to reset the SQLs
                        INIT_SQLS();
@@ -283,7 +270,7 @@ if ((!isInstalled()) || (!isAdminRegistered()))
                                // Seems to work, also right database?
                                if (SQL_SELECT_DB($mysql['dbase'], __FILE__, __LINE__) === true) {
                                        // Automatically run install.sql
-                                       if ((isFileReadable(REQUEST_POST('spath').'install/tables.sql')) && (isFileReadable(REQUEST_POST('spath').'install/menu-'.getLanguage().'.sql'))) {
+                                       if ((isFileReadable(REQUEST_POST('spath') . 'install/tables.sql')) && (isFileReadable(REQUEST_POST('spath') . 'install/menu-'.getLanguage().'.sql'))) {
                                                // Both exists so import them
                                                foreach (array('tables', 'menu-'.getLanguage()) as $dump) {
                                                        // Should be save here because file_exists() is there but we check it again. :)
@@ -301,8 +288,8 @@ if ((!isInstalled()) || (!isAdminRegistered()))
                                                                        } // END - while
                                                                } // END - foreach
 
-                                                               // And split it up against ;\n ...
-                                                               SET_SQLS(merge_array(GET_SQLS(), explode(";\n", $fileContent)));
+                                                               // Split it up against ";\n" and merge it into existing SQLs
+                                                               MERGE_SQLS(explode(";\n", $fileContent));
                                                        } else {
                                                                // Not readable!
                                                                debug_report_bug(sprintf("SQL dump %s is not readable!", $dump));
@@ -319,26 +306,37 @@ if ((!isInstalled()) || (!isAdminRegistered()))
                                                // Now run all queries through and try to keep out empty or comment queries
                                                runFilterChain('run_sqls');
 
+                                               // Copy the config template and verify it
+                                               copyFileVerified(REQUEST_POST('spath') . 'inc/config-local.php.dist', REQUEST_POST('spath') . 'inc/cache/config-local.php', 0644);
+
                                                // Ok, all done. So we can write the config data to the php files
-                                               if (REQUEST_POST('spath') != constant('PATH')) changeDataInFile(REQUEST_POST('spath')."inc/config.php", "SERVER-PATH", "define('PATH', \"", "\");", REQUEST_POST('spath'), 0);
-                                               if (REQUEST_POST('burl')  != constant('URL'))  changeDataInFile(REQUEST_POST('spath')."inc/config.php", "HOST-URL", "define('URL', \"", "\");", REQUEST_POST('burl'), 0);
-                                               changeDataInFile(REQUEST_POST('spath')."inc/config.php", "MAIN_TITLE", "define('MAIN_TITLE', \"", "\");", REQUEST_POST('title'), 0);
-                                               changeDataInFile(REQUEST_POST('spath')."inc/config.php", "SLOGAN", "define('SLOGAN', \"", "\");", REQUEST_POST('slogan'), 0);
-                                               changeDataInFile(REQUEST_POST('spath')."inc/config.php", "WEBMASTER", "define('WEBMASTER', \"", "\");", REQUEST_POST('email'), 0);
-                                               changeDataInFile(REQUEST_POST('spath')."inc/config.php", "NULLPASS-WARNING", "define('warn_no_pass', ", ");", REQUEST_POST('warn_no_pass'), 0);
-                                               changeDataInFile(REQUEST_POST('spath')."inc/config.php", "WRITE-FOOTER", "define('WRITE_FOOTER', ", ");", REQUEST_POST('wfooter'), 0);
-                                               changeDataInFile(REQUEST_POST('spath')."inc/config.php", "BACKLINK", "define('ENABLE_BACKLINK', ", ");", REQUEST_POST('blink'), 0);
-                                               // DEACTIVATED: changeDataInFile(REQUEST_POST('spath')."inc/config.php", "OUTPUT-MODE", "define('OUTPUT_MODE', \"", "\");", REQUEST_POST('omode'), 0);
-                                               changeDataInFile(REQUEST_POST('spath')."inc/config.php", "MYSQL-HOST", "        'host'     => \"", "\",", $mysql['host'], 0);
-                                               changeDataInFile(REQUEST_POST('spath')."inc/config.php", "MYSQL-DBASE", "       'dbase'    => \"", "\",", $mysql['dbase'], 0);
-                                               changeDataInFile(REQUEST_POST('spath')."inc/config.php", "MYSQL-LOGIN", "       'login'    => \"", "\",", $mysql['login'], 0);
-                                               changeDataInFile(REQUEST_POST('spath')."inc/config.php", "MYSQL-PASSWORD", "    'password' => \"", "\",", $mysql['pass1'], 0);
-                                               changeDataInFile(REQUEST_POST('spath')."inc/config.php", "MYSQL-PREFIX", "define('_MYSQL_PREFIX', \"", "\");", $mysql['prefix'], 0);
-                                               changeDataInFile(REQUEST_POST('spath')."inc/config.php", "TABLE-TYPE", "define('_TABLE_TYPE', \"", "\");", $mysql['type'], 0);
-                                               changeDataInFile(REQUEST_POST('spath')."inc/config.php", "SMTP-HOSTNAME", "define('SMTP_HOSTNAME', \"", "\");", REQUEST_POST('smtp_host'), 0);
-                                               changeDataInFile(REQUEST_POST('spath')."inc/config.php", "SMTP-USER", "define('SMTP_USER', \"", "\");", REQUEST_POST('smtp_user'), 0);
-                                               changeDataInFile(REQUEST_POST('spath')."inc/config.php", "SMTP-PASSWORD", "define('SMTP_PASSWORD', \"", "\");", REQUEST_POST('smtp_pass1'), 0);
-                                               changeDataInFile(REQUEST_POST('spath')."inc/config.php", "INSTALLED", "define('mxchange_installed', ", ");", "true", 0);
+                                               if (REQUEST_POST('spath') != constant('PATH')) changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SERVER-PATH", "define('PATH', \"", "\");", REQUEST_POST('spath'), 0);
+                                               if (REQUEST_POST('burl')  != constant('URL'))  changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "HOST-URL", "define('URL', \"", "\");", REQUEST_POST('burl'), 0);
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MAIN-TITLE", "define('MAIN_TITLE', \"", "\");", REQUEST_POST('title'), 0);
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SLOGAN", "define('SLOGAN', \"", "\");", REQUEST_POST('slogan'), 0);
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "WEBMASTER", "define('WEBMASTER', \"", "\");", REQUEST_POST('email'), 0);
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "NULLPASS-WARNING", "setConfigEntry('WARN_NO_PASS', \"", "\");", REQUEST_POST('warn_no_pass'), 0);
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "WRITE-FOOTER", "setConfigEntry('WRITE_FOOTER', \"", "\");", REQUEST_POST('wfooter'), 0);
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "BACKLINK", "setConfigEntry('ENABLE_BACKLINK', \"", "\");", REQUEST_POST('blink'), 0);
+                                               // DEACTIVATED: changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "OUTPUT-MODE", "define('OUTPUT_MODE', \"", "\");", REQUEST_POST('omode'), 0);
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MYSQL-HOST", "  'host'     => \"", "\",", $mysql['host'], 0);
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MYSQL-DBASE", " 'dbase'    => \"", "\",", $mysql['dbase'], 0);
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MYSQL-LOGIN", " 'login'    => \"", "\",", $mysql['login'], 0);
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MYSQL-PASSWORD", "      'password' => \"", "\",", $mysql['pass1'], 0);
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MYSQL-PREFIX", "setConfigEntry('_MYSQL_PREFIX', \"", "\");", $mysql['prefix'], 0);
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "TABLE-TYPE", "setConfigEntry('_TABLE_TYPE', \"", "\");", $mysql['type'], 0);
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SMTP-HOSTNAME", "setConfigEntry('SMTP_HOSTNAME', \"", "\");", REQUEST_POST('smtp_host'), 0);
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SMTP-USER", "setConfigEntry('SMTP_USER', \"", "\");", REQUEST_POST('smtp_user'), 0);
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SMTP-PASSWORD", "setConfigEntry('SMTP_PASSWORD', \"", "\");", REQUEST_POST('smtp_pass1'), 0);
+
+                                               // Generate a long site key
+                                               $siteKey = generatePassword(50);
+
+                                               // And write it
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SITE-KEY", "setConfigEntry('SITE_KEY', \"", "\");", $siteKey, 0);
+
+                                               // Script is now installed
+                                               changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "INSTALLED", "setConfigEntry('MXCHANGE_INSTALLED', \"", "\");", 'Y', 0);
                                        } else {
                                                // Installation area not found!
                                                addFatalMessage(__FILE__, __LINE__, getMessage('INSTALL_MISSING_DUMPS'));
index 60ca78fb9cd89b7117f09d563e72c3f6170eecdd..9b2b5a6caa6570ae64fb68b2c626f1f148ae8038 100644 (file)
@@ -46,20 +46,19 @@ if (!defined('__SECURITY')) {
 $mx_lang = getSession('mx_lang');
 
 // Set default language if it is not (yet) set
-if (is_null($mx_lang)) $mx_lang = constant('DEFAULT_LANG');
+if (is_null($mx_lang)) $mx_lang = getConfig('DEFAULT_LANG');
 
 // Generate filename
 $INC = sprintf("inc/language/%s.php", SQL_ESCAPE($mx_lang));
 
-// Generate FQFN
-$FQFN = constant('PATH') . $INC;
-
 // Look for file
-if (!isFileReadable($FQFN)) {
+if (!isIncludeReadable($INC)) {
        // Switch to default (DO NOT CHANGE!!!)
-       $mx_lang = constant('DEFAULT_LANG');
-       setSession('mx_lang', $mx_lang);
-       $INC = sprintf("inc/language/%s.php", $mx_lang);
+       setSession('mx_lang', 'de');
+       $INC = 'inc/language/de.php';
+
+       // And set it temporarily
+       setConfigEntry('DEFAULT_LANG', 'de');
 } // END - if
 
 // Load language file
@@ -68,7 +67,7 @@ loadIncludeOnce($INC);
 // Check for installation mode
 if ((isInstalling()) || (!isInstalled()) || (!isAdminRegistered())) {
        // Load matching language file
-       loadInclude('inc/language/install_' . $mx_lang . '.php');
+       loadInclude('inc/language/install_' . getSession('mx_lang') . '.php');
 }
 
 // Remove no more needed variables
index 5cbb93947cad1a8a623a3cd2c932ec1e574d33df..5da63d96f038b92bb8c71227734bf72cc23c4a71 100644 (file)
@@ -65,8 +65,6 @@ define('BONUS_LOGIN_TURBO_NOTE', "Der Login-, Referal-, Klickrate-, Mailbuchungs
 define('BONUS_POINTS_TITLE', "Sonderbonus-{!POINTS!}");
 define('BONUS_RANK_YOU_ARE_NOT_FOUND', "Sie haben bis jetzt noch keine Aktiv-Verg&uuml;tung erhalten!");
 define('BONUS_RANK', "Platz");
-define('BONUS_SHOW_FOOTER_NOTE_1', "Wir w&uuml;nschen allen Gewinnern viel Gl&uuml;ck bei der monatlichen Aktiv-Rallye!");
-define('BONUS_SHOW_FOOTER_NOTE_2', "Es k&ouml;nnen nur die ersten {!__BONUS_TOTAL_RANKS!} die Aktiv-Rallye gewinnen. Der Rechtsweg ist ausgeschlossen.");
 define('BONUS_SHOW_HEADER_LINE_1', "Hier sehen Sie eine &Uuml;bersicht, wer alles");
 define('BONUS_SHOW_HEADER_LINE_2', "f&uuml;r die Mail");
 define('BONUS_SHOW_HEADER_LINE_3', "erhalten hat");
index ea12b6d0199649a49b3a5e21bcb864186db5e567..886903ebac5f84788f787b63b35fb10827bf358f 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Installation/setup
-define('CONFIG_IS_WRITE_PROTECTED', "Die Konfigurationsdatei <strong>inc/config.php</strong> ist schreibgesch&uuml;tzt. Bitte setzen Sie CHMOD 666 auf die Datei!");
+define('CONFIG_IS_WRITE_PROTECTED', "Die Konfigurationsdatei <strong>inc/cache/config-local.php</strong> ist schreibgesch&uuml;tzt. Bitte setzen Sie CHMOD 666 auf die Datei!");
 define('DUMMY_IS_WRITE_PROTECTED', "In dem Verzeichnis <strong>inc/</strong> kann keine Datei erzeugt werden. Bitte setzen Sie CHMOD 777 auf das Verzeichnis!");
 define('SECRET_IS_WRITE_PROTECTED', "In dem Verzeichnis <strong>inc/.secret/</strong> kann keine Datei erzeugt werden. Bitte setzen Sie CHMOD 777 auf das Verzeichnis oder probieren Sie auch 770 aus!");
 
@@ -69,9 +69,9 @@ define('META_KEYWORDS', "mailtausch, mailversand, kostenlos, kostenloser, mailex
 define('LANG_WARNING', "Warnung");
 define('DIE_CONFIG_CHANGED_YOU', "Sie haben Ihre Config-Datei editiert! Auf Wiedersehen...");
 define('DIE_RUN_INSTALL_MYSQL', "Bitte rufen Sie http://your-domain.com/install.php auf, um Ihre MySQL-Daten einzurichten!");
-define('WARN_NULL_PASSWORD', "Sie haben kein Passwort eingegeben! Bitte lesen Sie in der <strong>inc/config.php</strong> nach, wie Sie diese Warnung abschalten k&ouml;nnen.");
-define('FATAL_CONFIG_WRITABLE', "Ihre Datei inc/config.php ist beschreibbar! Dies ist ein m&ouml;gliches Sicherheitsrisiko!");
-define('FATAL_CANNOT_WRITE_CONFIG', "Kann Konfigurationsdaten nicht speichern, da ich keinen Schreibzugriff auf inc/config.php habe!");
+define('WARN_NULL_PASSWORD', "Sie haben kein Passwort eingegeben! Bitte lesen Sie in der <strong>inc/cache/config-local.php</strong> nach, wie Sie diese Warnung abschalten k&ouml;nnen.");
+define('FATAL_CONFIG_WRITABLE', "Ihre Datei inc/cache/config-local.php ist beschreibbar! Dies ist ein m&ouml;gliches Sicherheitsrisiko!");
+define('FATAL_CANNOT_WRITE_CONFIG', "Kann Konfigurationsdaten nicht speichern, da ich keinen Schreibzugriff auf inc/cache/config-local.php habe!");
 define('FATAL_CANNOT_CREATE_TMP', "Kann eine tempor&auml;re Datei nicht erzeugen! Bitte setzen Sie CHMOD 777 auf Verzeichnis inc!");
 define('FATAL_ERROR', "Fataler Fehler");
 define('LANG_NO_RENDER_DIRECT', "Sie haben weder 'render' noch 'direct' als Ausgabe-Modus eingestellt!");
@@ -168,7 +168,7 @@ define('CREATE_ACTION_FIRST', "Bitte erstellen Sie zuerst die action-xxxxx.php D
 define('IS_FIRST_MENU', "Ist das erste Hauptmen&uuml;");
 define('NO_DB_LINK', "Keine Verbindung zur Datenbank.");
 define('NO_DB_LINK_SHUTDOWN', "Keine Verbindung zur Datenbank beim Schliessen der Verbindung.");
-define('MYSQL_DATA_MISSING', "Die Konfiguration Ihrer Datenbankverbindung ist unnvollst&auml;ndig. Bitte in inc/config.php mindestens den Hostnamen, Datenbanknamen und Login zur Datenbank eingeben.");
+define('MYSQL_DATA_MISSING', "Die Konfiguration Ihrer Datenbankverbindung ist unnvollst&auml;ndig. Bitte in <strong>inc/cache/config-local.php</strong> mindestens den Hostnamen, Datenbanknamen und Login zur Datenbank eingeben.");
 define('REGISTER_PERSONAL_DATA', "Pers&ouml;nliche Daten");
 define('REGISTER_CATEGORIES', "Interessengebiete");
 define('REGISTER_MISC', "Passwort, maximale Mails pro Tag etc.");
index 978e0c5653bd841e16a6ade50f48e587dd26ef98..d0d476cc9f7f65e6b46844e934277486c97d20d1 100644 (file)
@@ -53,9 +53,9 @@ define('META_KEYWORDS', "Enter at least (1) 20 search keywords seperated by comm
 define('LANG_WARNING', "Warning");
 define('DIE_CONFIG_CHANGED_YOU', "You have edited your config.php file! I'm out here...");
 define('DIE_RUN_INSTALL_MYSQL', "Please run http://your-domain.com/install.php to setup your MySQL data.");
-define('WARN_NULL_PASSWORD', "You have a null-password! If you want to switch off this warning please have a look in <strong>inc/config.php</strong>.");
-define('FATAL_CONFIG_WRITABLE', "Your file inc/config.php is writeable! This is a possible security risk.");
-define('FATAL_CANNOT_WRITE_CONFIG', "Cannot write config data because I have no write permissions to inc/config.php.");
+define('WARN_NULL_PASSWORD', "You have a null-password! If you want to switch off this warning please have a look in <strong>inc/cache/config-local.php</strong>.");
+define('FATAL_CONFIG_WRITABLE', "Your file inc/cache/config-local.php is writeable! This is a possible security risk.");
+define('FATAL_CANNOT_WRITE_CONFIG', "Cannot write config data because I have no write permissions to inc/cache/config-local.php.");
 define('FATAL_ERROR', "Fatal error");
 define('LANG_NO_RENDER_DIRECT', "You did not setup the output mode weather to 'render' nor to 'direct'.");
 define('INSTALLATION', "Script installation");
index c3b6b5057b8de9f1bd652c17e46db368a31b2a17..9b222bb158dbbe6a6357eaa6c64bd7f9915d0e3d 100644 (file)
@@ -43,7 +43,8 @@ if (!defined('__SECURITY')) {
 }
 
 // Language definitions
-define('INSTALLATION_OF_MXCHANGE', "Installation von MXChange-{!MT_WORD!}-Script - %s");
+define('INSTALLATION_OF_MXCHANGE', "Installation von MXChange-{!MT_WORD!}-Script");
+define('SETUP_OF_MXCHANGE', "Installation von MXChange-{!MT_WORD!}-Script - %s");
 define('INSTALL_MISSING_DUMPS', "Die SQL-Dumps wurden nicht gefunden! Diese sollten auch mit hochgeladen werden und lesbar sein (CHMOD 644).");
 define('INSTALL_ENABLE_BACKLINK', "Backlink (=R&uuml;ckverlinkung zu mxchange.org setzen?) <em>rel=&quot;external&quot;</em> ist gesetzt. Bitte nicht den Backlink einbauen, und <strong>nofollow</strong> verwenden! Das schadet allen.");
 define('WRONG_PAGE', "Sie oder dieses Script haben eine falsche Seite ausgew&auml;hlt!");
index 86f375c200895a208233898a96ac6f3f77d23f03..1279145d40b2a8490589c7c6db979bbadaf520f9 100644 (file)
@@ -160,7 +160,7 @@ function adminsChangeAdminAccount ($POST) {
                // When both passwords match update admin account
                if ($POST['pass1'][$id] == $POST['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($POST['pass1'][$id]);
@@ -269,12 +269,12 @@ function adminsEditAdminAccount ($POST) {
                        // Shall we allow changing default ACL?
                        if ($currMode == "allow") {
                                // Allow chaning it
-                               $content['mode']    = generateOptionList("/ARRAY/", array("allow", "deny"), array(constant('ADMINS_ALLOW_MODE'), constant('ADMINS_DENY_MODE')), $content['mode']);
+                               $content['mode']    = generateOptionList('/ARRAY/', array("allow", "deny"), array(constant('ADMINS_ALLOW_MODE'), constant('ADMINS_DENY_MODE')), $content['mode']);
                        } else {
                                // Don't allow it
                                $content['mode'] = "&nbsp;";
                        }
-                       $content['la_mode'] = generateOptionList("/ARRAY/", array("global", "OLD", "NEW"), array(ADMINS_GLOBAL_LA_SETTING, ADMINS_OLD_LA_SETTING, ADMINS_NEW_LA_SETTING), $content['la_mode']);
+                       $content['la_mode'] = generateOptionList('/ARRAY/', array("global", "OLD", "NEW"), array(ADMINS_GLOBAL_LA_SETTING, ADMINS_OLD_LA_SETTING, ADMINS_NEW_LA_SETTING), $content['la_mode']);
 
                        // Load row template and switch color
                        $OUT .= LOAD_TEMPLATE("admin_edit_admins_row", true, $content);
@@ -349,7 +349,7 @@ function adminsRemoveAdminAccount ($POST) {
 
                        // Purge cache
                        cachePurgeAdminMenu($id);
-                       $cache_update = "1";
+                       $cache_update = '1';
                }
        }
 
index 109e740f1dfaed1f7a84b420c44fcf3d0677537a..d5a360e57cb9699117cca66dcc8d5c248e35f1af 100644 (file)
@@ -133,7 +133,7 @@ function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) {
                // Transfer data to template
                define('__YR_LEVEL' , $rank);
                define('__YR_POINTS', $points);
-               define('__YR_TMARK' , generateDateTime($mark, "1"));
+               define('__YR_TMARK' , generateDateTime($mark, '1'));
 
                // Load template
                define('__YOUR_RANKING_LINE', LOAD_TEMPLATE("show_bonus_yr", true));
@@ -194,12 +194,12 @@ function BONUS_POINTS_HANDLER ($mode) {
        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_uid') == '0')) {
+       if ((getConfig('bonus_mode') == 'UID') && (getConfig('bonus_uid') == '0')) {
                // Update database & config
                updateConfiguration('bonus_mode', 'JACKPOT');
        } // END - if
 
-       if ($mode == "login_bonus") {
+       if ($mode == 'login_bonus') {
                // Login bonus detected
                $points = getConfig('login_bonus');
        } else {
@@ -213,20 +213,20 @@ function BONUS_POINTS_HANDLER ($mode) {
        case 'JACKPOT': // ... jackpot
                if ((SUB_JACKPOT($points) == -1) && (getConfig('bonus_uid') > 0)) {
                        // Check points amount first...
-                       $total = GET_TOTAL_DATA(getConfig('bonus_uid'), "user_points", "points") - GET_TOTAL_DATA(getConfig('bonus_uid'), "user_data", "used_points");
+                       $total = GET_TOTAL_DATA(getConfig('bonus_uid'), 'user_points', 'points') - GET_TOTAL_DATA(getConfig('bonus_uid'), 'user_data', 'used_points');
                        if ($total >= $points) {
                                // Subtract points from userid's account
-                               SUB_POINTS("bonus_payout_jackpot", getConfig('bonus_uid'), $points);
+                               SUB_POINTS('bonus_payout_jackpot', getConfig('bonus_uid'), $points);
                        } // END - if
                } // END - if
                break;
 
-       case "UID": // ... userid's account
+       case 'UID': // ... userid's account
                // Check his amount first
-               $total = GET_TOTAL_DATA(getConfig('bonus_uid'), "user_points", "points") - GET_TOTAL_DATA(getConfig('bonus_uid'), "user_data", "used_points");
+               $total = GET_TOTAL_DATA(getConfig('bonus_uid'), 'user_points', 'points') - GET_TOTAL_DATA(getConfig('bonus_uid'), 'user_data', 'used_points');
                if ($total >= $points) {
                        // Subtract points from userid's account
-                       SUB_POINTS("bonus_payout_uid", getConfig('bonus_uid'), $points);
+                       SUB_POINTS('bonus_payout_uid', getConfig('bonus_uid'), $points);
                } else {
                        // Try to subtract from jackpot
                        $dummy = SUB_JACKPOT($points);
@@ -241,8 +241,9 @@ function BONUS_PURGE_EXPIRED_TURBO_BONUS() {
        $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE timemark < (UNIX_TIMESTAMP() - ".getConfig('bonus_timeout').")", __FUNCTION__, __LINE__);
        if (SQL_AFFECTEDROWS() > 0) {
                // Send out email to admin
-               sendAdminNotification(AUTOPURGE_ADMIN_TURBO_SUBJECT, "admin_autopurge_turbo", SQL_AFFECTEDROWS(), '');
-       }
+               sendAdminNotification(AUTOPURGE_ADMIN_TURBO_SUBJECT, 'admin_autopurge_turbo', SQL_AFFECTEDROWS(), '');
+       } // END - if
 }
+
 //
 ?>
index b5804821a5c00cb58aadc714b154d2156b655b87..1e38e1faf6763a3ba996c0b5ca1a358c0647789e 100644 (file)
@@ -119,7 +119,7 @@ class CacheSystem {
                // This will destory an existing cache file!
                if ($this->ret == $this->statusDone) {
                        // Create file
-                       if ($this->isCacheReadable()) chmod($this->fqfn, 0666);
+                       if ($this->isCacheReadable()) changeMode($this->fqfn, 0666);
                        $this->pointer = fopen($this->fqfn, 'w') or app_die(__METHOD__, __LINE__, "Cannot write to cache ".$this->fqfn." !");
 
                        // Add open PHP tag
@@ -172,7 +172,7 @@ class CacheSystem {
                        fclose($this->pointer);
 
                        // Set rights
-                       if ($this->isCacheReadable()) chmod($this->fqfn, 0666);
+                       if ($this->isCacheReadable()) changeMode($this->fqfn, 0666);
 
                        // Remove pointer
                        $this->pointer = false;
index 16179e2569aa7504027b4afbc10ec08f90e02bb6..e7b890c039ab4da30a7770e6a9d21d821f386713 100644 (file)
@@ -50,11 +50,11 @@ function DOUBLER_GENERATE_TABLE ($uid = '0', $done='N', $ref='N', $sort="ASC") {
        if ($uid > 0) {
                // Load entries only from a single user
                $add = " AND `userid`='".bigintval($uid)."'";
-               $mode = 'member'; $COLS = "4"; $DT_MODE = "2";
+               $mode = 'member'; $COLS = "4"; $DT_MODE = '2';
                $NOT_FOUND = getMessage('DOUBLER_MEMBER_NO_ENTRIES_FOUND');
        } else {
                // Guest mode!
-               $mode = 'guest'; $COLS = "3"; $DT_MODE = "3";
+               $mode = 'guest'; $COLS = '3'; $DT_MODE = '3';
                $NOT_FOUND = getMessage('DOUBLER_GUEST_NO_ENTRIES_FOUND');
        }
 
index 58dba68cb614096cf76c6b7b0ac012b3c2eb62d0..885c6551a7243c00edd5164907aad520fa4bad87 100644 (file)
@@ -69,8 +69,8 @@ LIMIT 1", array(bigintval($content['userid'])), __FUNCTION__, __LINE__, false));
 
                        // 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']
                        );
 
index e2bcafab29ba4b5cbae7b30e2389222daec74ac2..491afda732da7485bc2221496ddfd2da5f163414 100644 (file)
@@ -151,11 +151,11 @@ function HTML_INSERT_URLS ($text) {
        return COMPILE_CODE(str_replace("\n", "<br />\n", $text));
 }
 
-//
-function SEND_HTML_EMAIL($to, $subject, $message, $FROM) {
+// Sends a HTML mail to the user
+function sendHtmlEmail($to, $subject, $message, $FROM) {
        if (EXT_IS_ACTIVE('html_mail')) {
                // Send mail away as HTML
-               $FROM = "Content-Type: text/html\n".$FROM;
+               $FROM = "Content-Type: text/html\n" . $FROM;
                sendEmail($to, $subject, $message, 'N', $FROM);
        }
 }
index 9183a06d0d7df44a3472cb5dcdffa2b3766f159d..46e8c4584720e3d758b942abc7268a91f8cec122 100644 (file)
@@ -61,9 +61,9 @@ function RALLYE_AUTOSTART_RALLYES ($result) {
 
        // Transfer all neccessary data to the global $DATA array
        $DATA['uid_cnt']    = SQL_NUMROWS($result_user);
-       $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
 
@@ -293,9 +293,9 @@ VALUES ('%s','%s','0')",
 
                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;
@@ -330,9 +330,9 @@ function RALLYE_EXPIRE_RALLYES ($result) {
        $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;
@@ -442,7 +442,7 @@ VALUES ('NEW','RALLYE_EXPIRED','{--RALLYE_ADMIN_EXPIRED--}: %s','{--RALLYE_ADMIN
 //
 function RALLYE_LOAD_USER_DATA ($uids_array) {
        // Implode user ids
-       $uid_string = implode(",", $uids_array['uid']);
+       $uid_string = implode(',', $uids_array['uid']);
 
        // Init result string
        $ret = '';
@@ -642,9 +642,9 @@ WHERE end_time <= (UNIX_TIMESTAMP() - %s) AND expired='Y'",
                while ($content = SQL_FETCHARRAY($result_rallye)) {
                        // Prepare data for mail template
                        $DATA['title']  = $content['title'];
-                       $DATA['start']  = generateDateTime($content['start_time'], "1");
-                       $DATA['end']    = generateDateTime($content['end_time']  , "1");
-                       $DATA['now_t']  = generateDateTime(time(), "1");
+                       $DATA['start']  = generateDateTime($content['start_time'], '1');
+                       $DATA['end']    = generateDateTime($content['end_time']  , '1');
+                       $DATA['now_t']  = generateDateTime(time(), '1');
 
                        // Send mail to admin
                        sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_PURGED_SUBJ'), $content['title']), "admin_rallye_purged", '', 0);
index 8ed526a227bdc66e81344fd1b042fa6d70ae22c1..ceab0b90fec9ab015570c09f3a792c6c074e5ec3 100644 (file)
@@ -146,9 +146,9 @@ function registerGenerateCategoryTable ($mode, $return=false) {
                        );
 
                        if ((REQUEST_POST('cat', $content['id']) == 'Y') || ((getConfig('register_default') == 'Y') && (!REQUEST_ISSET_POST('cat', $content['id'])))) {
-                               $content['def_y'] = ' chkecked="checked"';
+                               $content['def_y'] = ' checked="checked"';
                        } else {
-                               $content['def_n'] = ' chkecked="checked"';
+                               $content['def_n'] = ' checked="checked"';
                        }
 
                        // Load template and switch color
index 9d1cf456250de2fb19a4f9403aa467bb0c7663d1..6e1084ce94a7c7181b4e5664ad049cb494260291 100644 (file)
@@ -90,7 +90,7 @@ if (!isset($_POST)) {
 // Generate arrays which holds the relevante chars to replace
 $GLOBALS['security_chars'] = array(
        // The chars we are looking for...
-       'from' => array("{", "}", '/', '.', "'", "$", "(", ")", '{--', '--}', "%", ';', "[", "]", ':', "--"),
+       'from' => array("{", "}", '/', '.', "'", "$", '(', ')', '{--', '--}', "%", ';', "[", "]", ':', "--"),
        // ... and we will replace to.
        'to'   => array(
                "{OPEN_ANCHOR2}",
@@ -163,15 +163,15 @@ if (!defined('_OB_CACHING')) {
        if (phpversion() >= '4.0.4pl1' && (strstr(getenv('HTTP_USER_AGENT'),'compatible') || (strstr(getenv('HTTP_USER_AGENT'), "Mozilla")))) {
                if ((extension_loaded('zlib')) && (function_exists('ob_start'))) {
                        // Start caching
-                       define('_OB_CACHING', "on");
+                       define('_OB_CACHING', 'on');
                        ob_start();
                } else {
                        // Extension not loaded or required function is missing
-                       define('_OB_CACHING', "404");
+                       define('_OB_CACHING', '404');
                }
        } else {
                // Old PHP version
-               define('_OB_CACHING', "old");
+               define('_OB_CACHING', 'old');
        }
 }
 
@@ -183,9 +183,9 @@ $SELF_DIR  = dirname($_SERVER['PHP_SELF']);
 $SELF_FILE = basename($_SERVER['PHP_SELF']);
 
 // Check for a .php inside the $SELF_DIR...
-while (ereg(".php", $SELF_DIR)) {
+while (ereg('.php', $SELF_DIR)) {
        // Correct the dirname
-       $SELF_DIR = substr($SELF_DIR, 0, (strpos($SELF_DIR, ".php") + 4));
+       $SELF_DIR = substr($SELF_DIR, 0, (strpos($SELF_DIR, '.php') + 4));
        // Rewrite filename...
        $SELF_FILE = basename($SELF_DIR);
        // ... and dirname
@@ -200,7 +200,7 @@ unset($SELF_DIR);
 unset($SELF_FILE);
 
 // Security system loaded...
-define('__SECURITY', "1");
+define('__SECURITY', '1');
 
 //
 ?>
index 1d19320d9319ee0f9f31bcb5244e820d866a7f9e..3db8ad7841761e759746b1b5478c141a616fcfc3 100644 (file)
@@ -142,7 +142,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $messageArray=array()
                        // Generate message
                        $message = SPONSOR_GET_MESSAGE(ADMIN_SPONSOR_UPDATED, "updated", $messageArray);
                        $ret = "updated";
-               } elseif ((!$ALREADY) || (($POST['force'] == "1") && (IS_ADMIN()))) {
+               } elseif ((!$ALREADY) || (($POST['force'] == '1') && (IS_ADMIN()))) {
                        // Add new sponsor, first add more data
                        $DATA['keys'][] = "sponsor_created"; $DATA['values'][] = time();
                        $DATA['keys'][] = 'status';
index 7c9f58af84b22c6dfbfbe5a8c8829127232a3856..82ae305ab19236c64445d92560b69567ddd75947 100644 (file)
@@ -374,13 +374,13 @@ function SURFBAR_MEMBER_DISPLAY_ACTION_FORM ($action, $urlData) {
        if ($action == 'edit') {
                // Default is not limited
                $urlData['limited_yes'] = '';
-               $urlData['limited_no']  = ' chkecked="checked"';
+               $urlData['limited_no']  = ' checked="checked"';
                $urlData['limited']     = 'false';
 
                // Is this URL limited?
                if ($urlData['views_max'] > 0) {
                        // Then rewrite form data
-                       $urlData['limited_yes'] = ' chkecked="checked"';
+                       $urlData['limited_yes'] = ' checked="checked"';
                        $urlData['limited_no']  = '';
                        $urlData['limited']     = 'true';
                } // END - if
@@ -664,8 +664,8 @@ function SURFBAR_NOTIFY_ADMIN ($messageType, $content) {
 
        // Translate some data if present
        if (isset($content['status']))        $content['status']        = surfbarTranslateUserStatus($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']);
@@ -697,8 +697,8 @@ function SURFBAR_NOTIFY_USER ($messageType, $content) {
 
        // Translate some data if present
        if (isset($content['status']))        $content['status']        = surfbarTranslateUserStatus($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']);
@@ -870,7 +870,7 @@ function SURFBAR_GET_TOTAL_URLS ($status = 'ACTIVE', $excludeUserId = 0) {
        // Get amount from database
        $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt
 FROM `{!_MYSQL_PREFIX!}_surfbar_urls`
-WHERE userid NOT IN (".implode(",", $UIDs['uid']).") AND `status`='%s'",
+WHERE userid NOT IN (".implode(',', $UIDs['uid']).") AND `status`='%s'",
                array($status), __FUNCTION__, __LINE__
        );
 
@@ -1162,7 +1162,7 @@ ORDER BY u.userid ASC", __FUNCTION__, __LINE__);
        SQL_FREERESULT($result);
 
        // Debug message
-       //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "UIDs::count=".count($UIDs)." (with own userid=".getUserId().")", false);
+       //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "UIDs::count=".count($UIDs)." (with own userid=".getUserId().')', false);
 
        // Return result
        return $UIDs;
@@ -1410,7 +1410,7 @@ LEFT JOIN `{!_MYSQL_PREFIX!}_surfbar_salts` AS sbs
 ON sbu.id=sbs.url_id
 LEFT JOIN `{!_MYSQL_PREFIX!}_surfbar_locks` AS l
 ON sbu.id=l.url_id
-WHERE sbu.userid NOT IN (".implode(",", $UIDs).") AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0)) AND sbu.`status`='ACTIVE'".$add."
+WHERE sbu.userid NOT IN (".implode(',', $UIDs).") AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0)) AND sbu.`status`='ACTIVE'".$add."
 GROUP BY sbu.id", __FUNCTION__, __LINE__);
 
        // Log last query
@@ -1484,10 +1484,10 @@ function SURFBAR_RELOAD_TO_STOP_PAGE ($page="stop") {
        // Internal or external?
        if ((getConfig('surfbar_pause_mode') == 'INTERNAL') || (getConfig('surfbar_pause_url') == '')) {
                // Reload to internal page
-               redirectToUrl("surfbar.php?frame=".$page);
+               redirectToUrl('surfbar.php?frame=' . $page);
        } else {
                // Reload to external page
-               LOAD_CONFIGURED_URL('surfbar_pause_url');
+               redirectToConfiguredUrl('surfbar_pause_url');
        }
 }
 
@@ -1510,11 +1510,11 @@ function SURFBAR_DETERMINE_NEXT_ID ($urlId = 0) {
                        $add = " AND sbu.id NOT IN (";
                        foreach ($USE as $url_id => $lid) {
                                // Add URL id
-                               $add .= $url_id.",";
+                               $add .= $url_id.',';
                        } // END - foreach
 
                        // Add closing bracket
-                       $add = substr($add, 0, -1) . ")";
+                       $add = substr($add, 0, -1) . ')';
                } // END - if
 
                // Determine depleted user account
@@ -1537,7 +1537,7 @@ LEFT JOIN `{!_MYSQL_PREFIX!}_surfbar_salts` AS sbs
 ON sbu.id=sbs.url_id
 LEFT JOIN `{!_MYSQL_PREFIX!}_surfbar_locks` AS l
 ON sbu.id=l.url_id
-WHERE sbu.userid NOT IN (".implode(",", $UIDs['uid']).") AND sbu.`status`='ACTIVE' AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0))".$add."
+WHERE sbu.userid NOT IN (".implode(',', $UIDs['uid']).") AND sbu.`status`='ACTIVE' AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0))".$add."
 GROUP BY sbu.id
 ORDER BY l.last_surfed ASC, sbu.id ASC
 LIMIT %s,1",
index 1b72e2065efaaf37f6da424ed89229d50bc92bc1..8ef78b4c6fcbd42d2619a1808fed3af7883a895f 100644 (file)
@@ -153,7 +153,7 @@ function ADD_PAGENAV ($PAGES, $offset, $show_form, $colspan,$return=false) {
 
        $OUT = '';
        for ($page = 1; $page <= $PAGES; $page++) {
-               if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == "1"))) {
+               if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == '1'))) {
                        $OUT .= "<strong>-";
                } else {
                        if (!REQUEST_ISSET_GET(('letter'))) REQUEST_SET_GET('letter', getMessage('_ALL2'));
@@ -172,7 +172,7 @@ function ADD_PAGENAV ($PAGES, $offset, $show_form, $colspan,$return=false) {
 
                $OUT .= $page;
 
-               if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == "1"))) {
+               if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == '1'))) {
                        $OUT .= "-</strong>";
                } else  {
                        $OUT .= "</a>";
@@ -222,7 +222,7 @@ WHERE `email`='%s'".$locked." LIMIT 1",
 }
 
 // Selects a random user id as the new referal id if they have at least X confirmed mails in this run
-function SELECT_RANDOM_REFID () {
+function determineRandomReferalId () {
        // Default is zero refid
        $refid = 0;
 
diff --git a/inc/load_config.php b/inc/load_config.php
new file mode 100644 (file)
index 0000000..26d35e6
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/04/2009 *
+ * ===============                              Last change: 04/04/2009 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : load_config.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Loader for configuration                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Lader fuer Konfiguration                         *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * Needs to be in all Files and every File needs "svn propset           *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
+       require($INC);
+} // END - if
+
+// Set some config entries which is required for installation phase
+setConfigEntry('OUTPUT_MODE' , 'render');
+setConfigEntry('WRITE_FOOTER', 'Y');
+setConfigEntry('_DB_TYPE'    , 'mysql3');
+
+// Is the local configuration there?
+if (isIncludeReadable('inc/cache/config-local.php')) {
+       // Then load it
+       loadIncludeOnce('inc/cache/config-local.php');
+} elseif (isInstalling()) {
+       // Set some essential constants
+       // @TODO Rewrite them to avoid this else block
+       define('MAIN_TITLE', 'Your mail-exchanger title');
+       define('SLOGAN'    , 'Your cool slogan here');
+       define('WEBMASTER' , 'you@some-hoster.tld.invalid');
+} else {
+       // Problem in application detected
+       debug_report_bug('Wether we are not installing nor config-local.php is created!');
+}
+
+//
+?>
index 3a3472bcc1e9686b908203ad2e99065bf132e1bc..a7c5c9146c7217bb53e4f7dcaa06a2951e72be1c 100644 (file)
@@ -70,7 +70,7 @@ if (!isAdminRegistered()) {
                switch ($ret)
                {
                case 'done':
-                       $done = changeDataInFile(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
+                       $done = changeDataInFile(constant('PATH') . 'inc/cache/config-local.php', "ADMIN-SETUP", "setConfigEntry('ADMIN_REGISTERED', \"", "\");", 'Y', 0);
                        if ($done === true) {
                                // Registering is done
                                redirectToUrl('modules.php?module=admin&amp;register=done');
@@ -98,7 +98,7 @@ if (!isAdminRegistered()) {
                        // Admin still not registered?
                        if (!isAdminRegistered()) {
                                // Write to config that registration is done
-                               changeDataInFile(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
+                               changeDataInFile(constant('PATH') . 'inc/cache/config-local.php', "ADMIN-SETUP", "setConfigEntry('ADMIN_REGISTERED', \"", "\");", 'Y', 0);
 
                                // Load URL for login
                                redirectToUrl('modules.php?module=admin');
index 889820cea98191d968cd0bc8454ba78a4517a131..af3e0ab424fe5be2d47a080a647e2a8936e36278 100644 (file)
@@ -69,7 +69,7 @@ function REGISTER_ADMIN ($user, $md5, $email) {
 // Only be executed on login procedure!
 function CHECK_ADMIN_LOGIN ($admin_login, $password) {
        // By default no admin is found
-       $ret = "404";
+       $ret = '404';
 
        // Get admin id
        $aid = GET_ADMIN_ID($admin_login);
@@ -131,7 +131,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) {
        $salt = __SALT;
 
        // Check if password is same
-       //* DEBUG: */ echo "*".$ret.",".$data['password'].",".$password.",".$salt."*<br >\n";
+       //* DEBUG: */ echo "*".$ret.','.$data['password'].','.$password.','.$salt."*<br >\n";
        if (($ret == 'pass') && ($data['password'] == generateHash($password, $salt)) && ((!empty($salt))) || ($data['password'] == $password)) {
                // Re-hash the plain passord with new random salt
                $data['password'] = generateHash($password);
@@ -218,13 +218,13 @@ function LOGIN_ADMIN ($adminLogin, $passHash) {
 // Only be executed on cookie checking
 function CHECK_ADMIN_COOKIES ($admin_login, $password) {
        // By default no admin cookies are found
-       $ret = "404"; $pass = '';
+       $ret = '404'; $pass = '';
 
        // Get hash
        $pass = GET_ADMIN_HASH(GET_ADMIN_ID($admin_login));
-       if ($pass != "-1") $ret = 'pass';
+       if ($pass != '-1') $ret = 'pass';
 
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):".generatePassString($pass)."(".strlen($pass).")/".$password."(".strlen($password).")<br />\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")<br />\n";
 
        // Check if password matches
        if (($ret == 'pass') && ((generatePassString($pass) == $password) || ($pass == $password) || ((strlen($pass) == 32) && (md5($password) == $pass)))) {
@@ -661,7 +661,7 @@ function ADMIN_MAKE_MENU_SELECTION ($menu, $type, $name, $default = '') {
        // Walk through all files
        foreach ($menuArray as $file) {
                // Is this a PHP script?
-               if ((!isDirectory($file)) && (strpos($file, "".$type.'-') > -1) && (strpos($file, ".php") > 0)) {
+               if ((!isDirectory($file)) && (strpos($file, "".$type.'-') > -1) && (strpos($file, '.php') > 0)) {
                        // Then test if the file is readable
                        $test = sprintf("%sinc/modules/%s/%s", constant('PATH'), $menu, $file);
 
@@ -993,7 +993,7 @@ function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFu
                                } // END - if
 
                                // Add id number
-                               $idList .= $id.",";
+                               $idList .= $id . ',';
                        } // END - foreach
 
                        // Run the query
index 504e74052384f2a9a5267fb69e2807d361abe568..14944df068121621c3e0ebbf08f50ee901f19518 100644 (file)
@@ -55,7 +55,7 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) {
        $extensionList = getArrayFromDirectory("inc/extensions/", "ext-", false, false);
        foreach ($extensionList as $file) {
                // Is this file an extension?
-               if ((substr($file, 0, 4) == "ext-") && (substr($file, -4) == ".php")) {
+               if ((substr($file, 0, 4) == "ext-") && (substr($file, -4) == '.php')) {
                        //* DEBUG: */ echo $file."<br />\n";
                        // Possible newly installed extension found so we extract extension's name
                        $ext_name = strtolower(substr($file, 4, -4)); // Keep always extension names on lower case!!!
@@ -421,7 +421,7 @@ LIMIT 1",
                                'admin'   => $content['assigned_admin'],
                                'uid'     => $content['userid'],
                                'type'    => $content['task_type_msg'],
-                               'created' => generateDateTime($content['task_created'], "2")
+                               'created' => generateDateTime($content['task_created'], '2')
                        ));
 
                        // Do we have extension task?
index bc85b8a7912f90834ee57b064db8e4663552a9bd..7c14e581392f9c1e81418e723fba34f9a98ebe83 100644 (file)
@@ -136,18 +136,13 @@ if (!IS_FORM_SENT())
        }
        $OUT = "    <select class=\"admin_select\" name=\"sort\" size=\"1\">
       <option value=\"0\">".IS_FIRST_MENU."</option>\n";
-       foreach ($below as $key => $m)
-       {
-               if (is_array($m))
-               {
-                       foreach ($m as $key2 => $m2)
-                       {
+       foreach ($below as $key => $m) {
+               if (is_array($m)) {
+                       foreach ($m as $key2 => $m2) {
                                $OUT .= "      <option value=\"".$m2."\">".$titles[$key][$key2];
-                               foreach ($menus as $k => $v)
-                               {
-                                       if (($v == $key) && (!is_array($v)))
-                                       {
-                                               $OUT .= " (".$titles[$k].")";
+                               foreach ($menus as $k => $v) {
+                                       if (($v == $key) && (!is_array($v))) {
+                                               $OUT .= " (" . $titles[$k] . ')';
                                        }
                                }
                                $OUT .= "</option>\n";
index f57381ce44d6235499280270d97fc95440f2a25f..e0528331ae3be7fd0ed6ab9b7a8c913767d25495 100644 (file)
@@ -54,8 +54,8 @@ if (REQUEST_ISSET_GET('admin')) {
        $aid = bigintval(REQUEST_GET('admin'));
 
        // Set required fields
-       REQUEST_SET_POST('edit', "1");
-       REQUEST_SET_POST(array('sel', $aid), "1");
+       REQUEST_SET_POST('edit', '1');
+       REQUEST_SET_POST(array('sel', $aid), '1');
 } // END - if
 
 if ((REQUEST_ISSET_POST('edit')) && (countPostSelection() > 0)) {
index 7d9bbc2c929bec3e09e7eec96f560495037bd164..6029cfd708628e6dcd4763f4cdc8813d3ca63ac7 100644 (file)
@@ -65,7 +65,7 @@ if (REQUEST_ISSET_POST('edit')) {
                                $OUT .=">{--ADMINS_ALL_ADMINS--}</option>\n";
                                if (EXT_IS_ACTIVE('events')) {
                                        $OUT .= "<option value=\"-1\"";
-                                       if ($content['admin_id'] == "-1") $OUT .= ' selected="selected"';
+                                       if ($content['admin_id'] == '-1') $OUT .= ' selected="selected"';
                                        $OUT .= ">{--ADMINS_TO_USER_EVENTS--}</option>\n";
                                }
                                $OUT .= generateOptionList('admins', "id", "login", $content['admin_id'], 'email');
index 47bd9301b0b7ab9ccc7281d845333b0283a5547b..ab6c8b395ab35c72fe904f9b1705ba091b75fa6d 100644 (file)
@@ -52,13 +52,13 @@ if (IS_FORM_SENT()) {
        switch (getConfig('admin_menu'))
        {
        case "NEW":
-               define('__ADMIN_MENU_NEW', ' chkecked="checked"');
+               define('__ADMIN_MENU_NEW', ' checked="checked"');
                define('__ADMIN_MENU_OLD'   , '');
                break;
 
        case "OLD":
                define('__ADMIN_MENU_NEW', '');
-               define('__ADMIN_MENU_OLD'   , ' chkecked="checked"');
+               define('__ADMIN_MENU_OLD'   , ' checked="checked"');
                break;
        }
 
index 24b9126b76f63ab4ce7dea31ec16cca845e09da4..481435be66e0091264f6a0a474f9bebdb6e2cf6f 100644 (file)
@@ -66,7 +66,7 @@ if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) {
                        'action_selection' => ADMIN_MENU_SELECTION("action", $act, $id),
                        'what_selection'   => ADMIN_MENU_SELECTION("what", $wht, $id),
                        'mode_options'     => generateOptionList(
-                               "/ARRAY/",
+                               '/ARRAY/',
                                array("allow", "deny"),
                                array(constant('ADMINS_ALLOW_MODE'), constant('ADMINS_DENY_MODE')),
                                $mode
@@ -261,7 +261,7 @@ VALUES ('%s','%s','%s','%s')",
        define('_WHAT_SELECTION'  , ADMIN_MENU_SELECTION("what"));
        define('_MODE_OPTIONS'    ,
                generateOptionList(
-                       "/ARRAY/",
+                       '/ARRAY/',
                        array("allow", "deny"),
                        array(
                                getMessage('ADMINS_ALLOW_MODE'),
index e980c5747f1f7883b1f10d1f1544edf06fdfc08c..77ae1fa39ead86ff6c3582992b618e52b803f6db 100644 (file)
@@ -71,11 +71,11 @@ if (IS_FORM_SENT()) {
        // Mail confirmation links
        define('_CFG_AUTO_PURGE', createTimeSelections(getConfig('auto_purge'), "auto_purge", "MWD"));
        if (getConfig('auto_purge_active') != 'Y') {
-               define('_CFG_AP_ACTIVE_N', ' chkecked="checked"');
+               define('_CFG_AP_ACTIVE_N', ' checked="checked"');
                define('_CFG_AP_ACTIVE_Y', '');
        } else {
                define('_CFG_AP_ACTIVE_N', '');
-               define('_CFG_AP_ACTIVE_Y', ' chkecked="checked"');
+               define('_CFG_AP_ACTIVE_Y', ' checked="checked"');
        }
 
        // Output template
index 7200379faf5d1bb5a074009d800818abc47685fd..babddaa4a8b142698507ea021710b9cf041a9ad3 100644 (file)
@@ -60,142 +60,121 @@ if (IS_FORM_SENT()) {
        setConfigEntry('beg_ral_di_notify', REQUEST_POST('beg_ral_di_notify'));
 } else {
        // Prepare constants for the template
-       define('__BEG_POINTS'           , translateComma(getConfig('beg_points')      , false));
-       define('__BEG_POINTS_MAX'       , translateComma(getConfig('beg_points_max')  , false));
-       define('__BEG_NOTIFY_BONUS'     , translateComma(getConfig('beg_notify_bonus'), false));
-       define('__BEG_TIMEOUT'          , createTimeSelections(getConfig('beg_timeout')    , "beg_timeout"    , "Dhm"));
-       define('__BEG_UID_TIMEOUT'      , createTimeSelections(getConfig('beg_uid_timeout'), "beg_uid_timeout", "Dhm"));
-       define('__BEG_REMOTE_IP_TIMEOUT', createTimeSelections(getConfig('beg_ip_timeout') , "beg_ip_timeout" , "Dhm"));
-       define('__WAIT_SELECTION'       , createTimeSelections(getConfig('beg_notify_wait'), "beg_notify_wait", "ms" ));
-       define('__BEG_RANKS'            , getConfig('beg_ranks'));
+       $content['points']           = translateComma(getConfig('beg_points')      , false);
+       $content['points_max']       = translateComma(getConfig('beg_points_max')  , false);
+       $content['notify_bonus']     = translateComma(getConfig('beg_notify_bonus'), false);
+       $content['timeout']          = createTimeSelections(getConfig('beg_timeout')    , 'beg_timeout'    , 'Dhm');
+       $content['uid_timeout']      = createTimeSelections(getConfig('beg_uid_timeout'), 'beg_uid_timeout', 'Dhm');
+       $content['ip_timeout']       = createTimeSelections(getConfig('beg_ip_timeout') , 'beg_ip_timeout' , 'Dhm');
+       $content['wait_selection']   = createTimeSelections(getConfig('beg_notify_wait'), 'beg_notify_wait', 'ms' );
+       $content['ranks']            = getConfig('beg_ranks');
 
        // Activate / Deactivate beg rallye (Y/N)
        switch (getConfig('beg_rallye'))
        {
        case 'Y':
-               define('__BEG_RALLYE_Y', ' chkecked="checked"');
-               define('__BEG_RALLYE_N', '');
+               $content['rallye_yes'] = ' checked="checked"';
+               $content['rallye_no']  = '';
                break;
 
        case 'N':
-               define('__BEG_RALLYE_Y', '');
-               define('__BEG_RALLYE_N', ' chkecked="checked"');
+               $content['rallye_yes'] = '';
+               $content['rallye_no']  = ' checked="checked"';
                break;
        }
 
        switch (getConfig('beg_active'))
        {
        case 'Y':
-               define('__BEG_ACTIVE_Y', ' chkecked="checked"');
-               define('__BEG_ACTIVE_N', '');
+               $content['active_yes'] = ' checked="checked"';
+               $content['active_no']  = '';
                break;
 
        case 'N':
-               define('__BEG_ACTIVE_Y', '');
-               define('__BEG_ACTIVE_N', ' chkecked="checked"');
+               $content['active_yes'] = '';
+               $content['active_no']  = ' checked="checked"';
                break;
        }
 
        switch (getConfig('beg_mode'))
        {
-       case "DIRECT":
-               define('__BEG_MODE_DIRECT', ' chkecked="checked"');
-               define('__BEG_MODE_REF'   , '');
+       case 'DIRECT':
+               $content['mode_direct'] = ' checked="checked"';
+               $content['mode_ref']    = '';
                break;
 
-       case "REF":
-               define('__BEG_MODE_DIRECT', '');
-               define('__BEG_MODE_REF'   , ' chkecked="checked"');
+       case 'REF':
+               $content['mode_direct'] = '';
+               $content['mode_ref']    = ' checked="checked"';
                break;
        }
 
        switch (getConfig('beg_ral_en_notify'))
        {
        case 'Y':
-               define('__BEG_RAL_EN_NOTIFY_Y', ' chkecked="checked"');
-               define('__BEG_RAL_EN_NOTIFY_N', '');
+               $content['ral_enable_notify_yes'] = ' checked="checked"';
+               $content['ral_enable_notify_no']  = '';
                break;
 
        case 'N':
-               define('__BEG_RAL_EN_NOTIFY_Y', '');
-               define('__BEG_RAL_EN_NOTIFY_N', ' chkecked="checked"');
+               $content['ral_enable_notify_yes'] = '';
+               $content['ral_enable_notify_no']  = ' checked="checked"';
                break;
        }
 
        switch (getConfig('beg_ral_di_notify'))
        {
        case 'Y':
-               define('__BEG_RAL_DI_NOTIFY_Y', ' chkecked="checked"');
-               define('__BEG_RAL_DI_NOTIFY_N', '');
+               $content['ral_disable_notify_yes'] = ' checked="checked"';
+               $content['ral_disable_notify_no']  = '';
                break;
 
        case 'N':
-               define('__BEG_RAL_DI_NOTIFY_Y', '');
-               define('__BEG_RAL_DI_NOTIFY_N', ' chkecked="checked"');
+               $content['ral_disable_notify_yes'] = '';
+               $content['ral_disable_notify_no']  = ' checked="checked"';
                break;
        }
 
        switch (getConfig('beg_new_mem_notify'))
        {
        case 'Y':
-               define('__BEG_NEW_MEMBER_NOTIFY_Y', ' chkecked="checked"');
-               define('__BEG_NEW_MEMBER_NOTIFY_N', '');
+               $content['new_member_notify_yes'] = ' checked="checked"';
+               $content['new_member_notify_no']  = '';
                break;
 
        case 'N':
-               define('__BEG_NEW_MEMBER_NOTIFY_Y', '');
-               define('__BEG_NEW_MEMBER_NOTIFY_N', ' chkecked="checked"');
+               $content['new_member_notify_yes'] = '';
+               $content['new_member_notify_no']  = ' checked="checked"';
                break;
        }
 
        switch (getConfig('beg_include_own'))
        {
        case 'Y':
-               define('__BEG_INCLUDE_OWN_Y', ' chkecked="checked"');
-               define('__BEG_INCLUDE_OWN_N', '');
+               $content['include_own_yes'] = ' checked="checked"';
+               $content['include_own_no']  = '';
                break;
 
        case 'N':
-               define('__BEG_INCLUDE_OWN_Y', '');
-               define('__BEG_INCLUDE_OWN_N', ' chkecked="checked"');
+               $content['include_own_yes'] = '';
+               $content['include_own_no']  = ' checked="checked"';
                break;
        }
 
-       switch (getConfig('beg_pay_mode')) {
-               case "IMG":
-                       define('__BEG_PAY_MODE_IMG' , ' selected="selected"');
-                       define('__BEG_PAY_MODE_JS'  , '');
-                       define('__BEG_PAY_MODE_BOTH', '');
-                       define('__BEG_PAY_MODE_NONE', '');
-                       break;
-
-               case "JS":
-                       define('__BEG_PAY_MODE_IMG' , '');
-                       define('__BEG_PAY_MODE_JS'  , ' selected="selected"');
-                       define('__BEG_PAY_MODE_BOTH', '');
-                       define('__BEG_PAY_MODE_NONE', '');
-                       break;
-
-               case "BOTH":
-                       define('__BEG_PAY_MODE_IMG' , '');
-                       define('__BEG_PAY_MODE_JS'  , '');
-                       define('__BEG_PAY_MODE_BOTH', ' selected="selected"');
-                       define('__BEG_PAY_MODE_NONE', '');
-                       break;
-
-               case "NONE":
-                       define('__BEG_PAY_MODE_IMG' , '');
-                       define('__BEG_PAY_MODE_JS'  , '');
-                       define('__BEG_PAY_MODE_BOTH', '');
-                       define('__BEG_PAY_MODE_NONE', ' selected="selected"');
-                       break;
-       }
+       // Init elements
+       $content['pay_mode_img']  = '';
+       $content['pay_mode_js']   = '';
+       $content['pay_mode_both'] = '';
+       $content['pay_mode_none'] = '';
+
+       // Set pay mode
+       $content['pay_mode_'.strtolower(getConfig('beg_pay_mode'))] = ' selected="selected"';
 
-       // Add data to constant __MEMBER_SELECTION
-       define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('beg_uid'), false, true, true, "beg_uid"));
+       // Member selection box
+       $content['member_selection'] = ADD_MEMBER_SELECTION_BOX(getConfig('beg_uid'), false, true, true, 'beg_uid');
 
        // Load form template
-       LOAD_TEMPLATE("admin_config_beg");
+       LOAD_TEMPLATE('admin_config_beg', false, $content);
 }
 
 //
index f93e242854a981ac7b22a507b498977c02bb9b21..6261ae22d25e30a308a001f0d10437adb49c1e1c 100644 (file)
@@ -54,25 +54,25 @@ if (IS_FORM_SENT()) {
        switch (getConfig('birthday_active'))
        {
        case 'Y':
-               define('__BIRTHDAY_ACTIVE_Y', ' chkecked="checked"');
-               define('__BIRTHDAY_ACTIVE_N', '');
+               $content['active_yes'] = ' checked="checked"';
+               $content['active_no']  = '';
                break;
 
        case 'N':
-               define('__BIRTHDAY_ACTIVE_Y', '');
-               define('__BIRTHDAY_ACTIVE_N', ' chkecked="checked"');
+               $content['active_yes'] = '';
+               $content['active_no']  = ' checked="checked"';
                break;
        }
        switch (getConfig('birthday_mode'))
        {
-       case "DIRECT":
-               define('__BIRTHDAY_MODE_DIRECT', ' chkecked="checked"');
-               define('__BIRTHDAY_MODE_REF'   , '');
+       case 'DIRECT':
+               $content['mode_direct'] = ' checked="checked"';
+               $content['mode_ref']    = '';
                break;
 
-       case "REF":
-               define('__BIRTHDAY_MODE_DIRECT', '');
-               define('__BIRTHDAY_MODE_REF'   , ' chkecked="checked"');
+       case 'REF':
+               $content['mode_direct'] = '';
+               $content['mode_ref']    = ' checked="checked"';
                break;
        }
 
index 1f2ff3bac7eb7b7054c71794042aafbb3c97a3ce..8d65db67a6330d0cd9d7fcc02221e7a3edbbcae4 100644 (file)
@@ -115,135 +115,135 @@ if (IS_FORM_SENT()) {
        $OUT .= "</ol>\n";
        define('__TRATES_LIST', $OUT);
 
-       define('__LOGIN_TIMEOUT_SELECTION', createTimeSelections(getConfig('login_timeout')    , "login_timeout"    , "WDh"));
-       define('__BONUS_TIMEOUT_SELECTION', createTimeSelections(getConfig('bonus_timeout')    , "bonus_timeout"    , "WDh"));
-       define('__WAIT_SELECTION'         , createTimeSelections(getConfig('bonus_notify_wait'), "bonus_notify_wait", "ms" ));
+       define('__LOGIN_TIMEOUT_SELECTION', createTimeSelections(getConfig('login_timeout')    , 'login_timeout'    , 'WDh'));
+       define('__BONUS_TIMEOUT_SELECTION', createTimeSelections(getConfig('bonus_timeout')    , 'bonus_timeout'    , 'WDh'));
+       $content['wait_selection']        = createTimeSelections(getConfig('bonus_notify_wait'), 'bonus_notify_wait', 'ms' );
 
        // Activate / Deactivate bonus active rallye (Y/N)
        switch (getConfig('bonus_active'))
        {
        case 'Y':
-               define('__BONUS_ACTIVE_Y', ' chkecked="checked"');
+               define('__BONUS_ACTIVE_Y', ' checked="checked"');
                define('__BONUS_ACTIVE_N', '');
                break;
 
        case 'N':
                define('__BONUS_ACTIVE_Y', '');
-               define('__BONUS_ACTIVE_N', ' chkecked="checked"');
+               define('__BONUS_ACTIVE_N', ' checked="checked"');
                break;
        }
        // Other bonus to de-/activate
        switch (getConfig('bonus_login_yn'))
        {
        case 'Y':
-               define('__BONUS_LOGIN_Y', ' chkecked="checked"');
+               define('__BONUS_LOGIN_Y', ' checked="checked"');
                define('__BONUS_LOGIN_N', '');
                break;
 
        case 'N':
                define('__BONUS_LOGIN_Y', '');
-               define('__BONUS_LOGIN_N', ' chkecked="checked"');
+               define('__BONUS_LOGIN_N', ' checked="checked"');
                break;
        }
        switch (getConfig('bonus_stats_yn'))
        {
        case 'Y':
-               define('__BONUS_STATS_Y', ' chkecked="checked"');
+               define('__BONUS_STATS_Y', ' checked="checked"');
                define('__BONUS_STATS_N', '');
                break;
 
        case 'N':
                define('__BONUS_STATS_Y', '');
-               define('__BONUS_STATS_N', ' chkecked="checked"');
+               define('__BONUS_STATS_N', ' checked="checked"');
                break;
        }
        switch (getConfig('bonus_order_yn'))
        {
        case 'Y':
-               define('__BONUS_ORDER_Y', ' chkecked="checked"');
+               define('__BONUS_ORDER_Y', ' checked="checked"');
                define('__BONUS_ORDER_N', '');
                break;
 
        case 'N':
                define('__BONUS_ORDER_Y', '');
-               define('__BONUS_ORDER_N', ' chkecked="checked"');
+               define('__BONUS_ORDER_N', ' checked="checked"');
                break;
        }
        switch (getConfig('bonus_ref_yn'))
        {
        case 'Y':
-               define('__BONUS_REF_Y', ' chkecked="checked"');
+               define('__BONUS_REF_Y', ' checked="checked"');
                define('__BONUS_REF_N', '');
                break;
 
        case 'N':
                define('__BONUS_REF_Y', '');
-               define('__BONUS_REF_N', ' chkecked="checked"');
+               define('__BONUS_REF_N', ' checked="checked"');
                break;
        }
        switch (getConfig('bonus_click_yn'))
        {
        case 'Y':
-               define('__BONUS_CLICK_Y', ' chkecked="checked"');
+               define('__BONUS_CLICK_Y', ' checked="checked"');
                define('__BONUS_CLICK_N', '');
                break;
 
        case 'N':
                define('__BONUS_CLICK_Y', '');
-               define('__BONUS_CLICK_N', ' chkecked="checked"');
+               define('__BONUS_CLICK_N', ' checked="checked"');
                break;
        }
        switch (getConfig('bonus_en_notify'))
        {
        case 'Y':
-               define('__BONUS_EN_NOTIFY_Y', ' chkecked="checked"');
+               define('__BONUS_EN_NOTIFY_Y', ' checked="checked"');
                define('__BONUS_EN_NOTIFY_N', '');
                break;
 
        case 'N':
                define('__BONUS_EN_NOTIFY_Y', '');
-               define('__BONUS_EN_NOTIFY_N', ' chkecked="checked"');
+               define('__BONUS_EN_NOTIFY_N', ' checked="checked"');
                break;
        }
        switch (getConfig('bonus_di_notify'))
        {
        case 'Y':
-               define('__BONUS_DI_NOTIFY_Y', ' chkecked="checked"');
+               define('__BONUS_DI_NOTIFY_Y', ' checked="checked"');
                define('__BONUS_DI_NOTIFY_N', '');
                break;
 
        case 'N':
                define('__BONUS_DI_NOTIFY_Y', '');
-               define('__BONUS_DI_NOTIFY_N', ' chkecked="checked"');
+               define('__BONUS_DI_NOTIFY_N', ' checked="checked"');
                break;
        }
        switch (getConfig('bonus_new_mem_notify'))
        {
        case 'Y':
-               define('__BONUS_NEW_MEMBER_NOTIFY_Y', ' chkecked="checked"');
+               define('__BONUS_NEW_MEMBER_NOTIFY_Y', ' checked="checked"');
                define('__BONUS_NEW_MEMBER_NOTIFY_N', '');
                break;
 
        case 'N':
                define('__BONUS_NEW_MEMBER_NOTIFY_Y', '');
-               define('__BONUS_NEW_MEMBER_NOTIFY_N', ' chkecked="checked"');
+               define('__BONUS_NEW_MEMBER_NOTIFY_N', ' checked="checked"');
                break;
        }
        switch (getConfig('bonus_include_own'))
        {
        case 'Y':
-               define('__BONUS_INCLUDE_OWN_Y', ' chkecked="checked"');
+               define('__BONUS_INCLUDE_OWN_Y', ' checked="checked"');
                define('__BONUS_INCLUDE_OWN_N', '');
                break;
 
        case 'N':
                define('__BONUS_INCLUDE_OWN_Y', '');
-               define('__BONUS_INCLUDE_OWN_N', ' chkecked="checked"');
+               define('__BONUS_INCLUDE_OWN_N', ' checked="checked"');
                break;
        }
 
        // Load final template
-       LOAD_TEMPLATE("admin_config_bonus", false);
+       LOAD_TEMPLATE('admin_config_bonus', false, $content);
 }
 //
 ?>
index d271c05deb616273771a967f8acfba0f4e29792e..86d588a7d4220ddfcb3b9e68135f0821b7b53dcc 100644 (file)
@@ -89,109 +89,109 @@ if (IS_FORM_SENT()) {
        // Prepare data
        switch (getConfig('cache_admins')) {
                case 'Y':
-                       define('__ADMINS_Y', ' chkecked="checked"');
+                       define('__ADMINS_Y', ' checked="checked"');
                        define('__ADMINS_N', '');
                        break;
 
                case 'N':
                        define('__ADMINS_Y', '');
-                       define('__ADMINS_N', ' chkecked="checked"');
+                       define('__ADMINS_N', ' checked="checked"');
                        break;
        }
 
        switch (getConfig('cache_acls')) {
                case 'Y':
-                       define('__ACLS_Y', ' chkecked="checked"');
+                       define('__ACLS_Y', ' checked="checked"');
                        define('__ACLS_N', '');
                        break;
 
                case 'N':
                        define('__ACLS_Y', '');
-                       define('__ACLS_N', ' chkecked="checked"');
+                       define('__ACLS_N', ' checked="checked"');
                        break;
        }
 
        switch (getConfig('cache_exts')) {
                case 'Y':
-                       define('__EXTS_Y', ' chkecked="checked"');
+                       define('__EXTS_Y', ' checked="checked"');
                        define('__EXTS_N', '');
                        break;
 
                case 'N':
                        define('__EXTS_Y', '');
-                       define('__EXTS_N', ' chkecked="checked"');
+                       define('__EXTS_N', ' checked="checked"');
                        break;
        }
 
        switch (getConfig('cache_config')) {
                case 'Y':
-                       define('__CONFIG_Y', ' chkecked="checked"');
+                       define('__CONFIG_Y', ' checked="checked"');
                        define('__CONFIG_N', '');
                        break;
 
                case 'N':
                        define('__CONFIG_Y', '');
-                       define('__CONFIG_N', ' chkecked="checked"');
+                       define('__CONFIG_N', ' checked="checked"');
                        break;
        }
 
        switch (getConfig('cache_modreg')) {
                case 'Y':
-                       define('__MODREG_Y', ' chkecked="checked"');
+                       define('__MODREG_Y', ' checked="checked"');
                        define('__MODREG_N', '');
                        break;
 
                case 'N':
                        define('__MODREG_Y', '');
-                       define('__MODREG_N', ' chkecked="checked"');
+                       define('__MODREG_N', ' checked="checked"');
                        break;
        }
 
        switch (getConfig('cache_refdepth')) {
                case 'Y':
-                       define('__REFDEPTH_Y', ' chkecked="checked"');
+                       define('__REFDEPTH_Y', ' checked="checked"');
                        define('__REFDEPTH_N', '');
                        break;
 
                case 'N':
                        define('__REFDEPTH_Y', '');
-                       define('__REFDEPTH_N', ' chkecked="checked"');
+                       define('__REFDEPTH_N', ' checked="checked"');
                        break;
        }
 
        switch (getConfig('cache_refsys')) {
                case 'Y':
-                       define('__REFSYS_Y', ' chkecked="checked"');
+                       define('__REFSYS_Y', ' checked="checked"');
                        define('__REFSYS_N', '');
                        break;
 
                case 'N':
                        define('__REFSYS_Y', '');
-                       define('__REFSYS_N', ' chkecked="checked"');
+                       define('__REFSYS_N', ' checked="checked"');
                        break;
        }
 
        switch (getConfig('cache_themes')) {
                case 'Y':
-                       define('__THEMES_Y', ' chkecked="checked"');
+                       define('__THEMES_Y', ' checked="checked"');
                        define('__THEMES_N', '');
                        break;
 
                case 'N':
                        define('__THEMES_Y', '');
-                       define('__THEMES_N', ' chkecked="checked"');
+                       define('__THEMES_N', ' checked="checked"');
                        break;
        }
 
        switch (getConfig('cache_admin_menu')) {
                case 'Y':
-                       define('__ADMIN_MENU_Y', ' chkecked="checked"');
+                       define('__ADMIN_MENU_Y', ' checked="checked"');
                        define('__ADMIN_MENU_N', '');
                        break;
 
                case 'N':
                        define('__ADMIN_MENU_Y', '');
-                       define('__ADMIN_MENU_N', ' chkecked="checked"');
+                       define('__ADMIN_MENU_N', ' checked="checked"');
                        break;
        }
 
index 303d52a515a535c345c9a1837dc29866ed746b7a..a4370e8659a4e30d161e9d08c371c96bd28914a4 100644 (file)
@@ -76,13 +76,13 @@ if (IS_FORM_SENT()) {
        switch (getConfig('doubler_jackpot'))
        {
        case 'Y':
-               define('__DOUBLER_JACKPOT_Y', ' chkecked="checked"');
+               define('__DOUBLER_JACKPOT_Y', ' checked="checked"');
                define('__DOUBLER_JACKPOT_N', '');
                break;
 
        case 'N':
                define('__DOUBLER_JACKPOT_Y', '');
-               define('__DOUBLER_JACKPOT_N', ' chkecked="checked"');
+               define('__DOUBLER_JACKPOT_N', ' checked="checked"');
                break;
        }
 
@@ -90,27 +90,27 @@ if (IS_FORM_SENT()) {
        switch (getConfig('doubler_own'))
        {
        case 'Y':
-               define('__DOUBLER_OWN_Y', ' chkecked="checked"');
+               define('__DOUBLER_OWN_Y', ' checked="checked"');
                define('__DOUBLER_OWN_N', '');
                break;
 
        case 'N':
                define('__DOUBLER_OWN_Y', '');
-               define('__DOUBLER_OWN_N', ' chkecked="checked"');
+               define('__DOUBLER_OWN_N', ' checked="checked"');
                break;
        }
 
        // Mail send mode
        switch (getConfig('doubler_send_mode'))
        {
-       case "DIRECT":
-               define('__DOUBLER_SEND_DIRECT', ' chkecked="checked"');
+       case 'DIRECT':
+               define('__DOUBLER_SEND_DIRECT', ' checked="checked"');
                define('__DOUBLER_SEND_RESET' , '');
                break;
 
        case "RESET":
                define('__DOUBLER_SEND_DIRECT', '');
-               define('__DOUBLER_SEND_RESET' , ' chkecked="checked"');
+               define('__DOUBLER_SEND_RESET' , ' checked="checked"');
                break;
        }
 
@@ -118,29 +118,30 @@ if (IS_FORM_SENT()) {
        switch (getConfig('doubler_sent_all'))
        {
        case 'Y':
-               define('__DOUBLER_SENT_ALL_Y', ' chkecked="checked"');
+               define('__DOUBLER_SENT_ALL_Y', ' checked="checked"');
                define('__DOUBLER_SENT_ALL_N', '');
                break;
 
        case 'N':
                define('__DOUBLER_SENT_ALL_Y', '');
-               define('__DOUBLER_SENT_ALL_N', ' chkecked="checked"');
+               define('__DOUBLER_SENT_ALL_N', ' checked="checked"');
                break;
        }
 
        // Transfer options (!!!) to __MEMBER_SELECTION
-       define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('doubler_uid'), false, true, true, "doubler_uid"));
+       define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('doubler_uid'), false, true, true, 'doubler_uid'));
 
        // Number of rows to display (option lines!!!)
-       define('__DOUBLER_DISPLAY_NEW', generateOptionList("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_new')));
-       define('__DOUBLER_DISPLAY_PAY', generateOptionList("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_pay')));
-       define('__DOUBLER_DISPLAY_OLD', generateOptionList("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_old')));
+       define('__DOUBLER_DISPLAY_NEW', generateOptionList('/ARRAY/', array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_new')));
+       define('__DOUBLER_DISPLAY_PAY', generateOptionList('/ARRAY/', array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_pay')));
+       define('__DOUBLER_DISPLAY_OLD', generateOptionList('/ARRAY/', array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_old')));
 
        // Timeout selection box or input box?
-       define('__DOUBLER_TIMEOUT', createTimeSelections(getConfig('doubler_timeout')  , "doubler_timeout"  , "WDh"));
+       define('__DOUBLER_TIMEOUT', createTimeSelections(getConfig('doubler_timeout')  , 'doubler_timeout'  , 'WDh'));
 
        // Load template
-       LOAD_TEMPLATE("admin_config_doubler");
+       LOAD_TEMPLATE('admin_config_doubler');
 }
+
 //
 ?>
index 2863d407716bdec24afa706dbb5a545d29f9be95..bd1d4e2605f8f275520679cfa9b0b762b3698dd4 100644 (file)
@@ -52,13 +52,13 @@ if (IS_FORM_SENT()) {
        // Prepare data
        switch (getConfig('verbose_sql')) {
                case 'Y':
-                       define('__VERBOSE_Y', ' chkecked="checked"');
+                       define('__VERBOSE_Y', ' checked="checked"');
                        define('__VERBOSE_N', '');
                        break;
 
                case 'N':
                        define('__VERBOSE_Y', '');
-                       define('__VERBOSE_N', ' chkecked="checked"');
+                       define('__VERBOSE_N', ' checked="checked"');
                        break;
        }
 
index cde0b8234a7fdd395dc4e01c51b1a347fec3a31d..ac6f9091e434e3ee552a944fb3a3824aa0f46590 100644 (file)
@@ -58,13 +58,13 @@ if (IS_FORM_SENT())
 
        switch (getConfig('holiday_mode')) {
        case "RESET":
-               define('__RESET_DEFAULT' , ' chkecked="checked"');
+               define('__RESET_DEFAULT' , ' checked="checked"');
                define('__DIRECT_DEFAULT', '');
                break;
 
-       case "DIRECT":
+       case 'DIRECT':
                define('__RESET_DEFAULT' , '');
-               define('__DIRECT_DEFAULT', ' chkecked="checked"');
+               define('__DIRECT_DEFAULT', ' checked="checked"');
                break;
        }
 
index 7d7a403aaa9585742b285d0878ae64c350f3d843..c719cc17299811493b97acf57e6e22335b007b30 100644 (file)
@@ -76,7 +76,7 @@ if (IS_FORM_SENT()) {
        // Start of this exchange
        if (getConfig('mt_start') > 0) {
                // Only show start
-               define('__MT_START', "<strong>".generateDateTime(getConfig('mt_start'), "3")."</strong>");
+               define('__MT_START', "<strong>".generateDateTime(getConfig('mt_start'), '3')."</strong>");
        } else {
                // Make start editable
                define('__MT_START',
index 584f71f5214c7ddccdf916e827f8e1d0fa3bf6a8..665e149a17ccb963fadc79c695591c6afb779663 100644 (file)
@@ -53,13 +53,13 @@ if (IS_FORM_SENT()) {
        switch (getConfig('order_max_full'))
        {
        case 'ORDER':
-               define('__ORDER_DEFAULT', ' chkecked="checked"');
+               define('__ORDER_DEFAULT', ' checked="checked"');
                define('__MAX_DEFAULT'  , '');
                break;
 
        case 'MAX':
                define('__ORDER_DEFAULT', '');
-               define('__MAX_DEFAULT'  , ' chkecked="checked"');
+               define('__MAX_DEFAULT'  , ' checked="checked"');
                break;
        }
 
@@ -85,11 +85,11 @@ if (IS_FORM_SENT()) {
        define('_CFG_MAX_TLENGTH'   , getConfig('max_tlength'));
 
        if (getConfig('test_text') != 'Y') {
-               define('_CFG_TEST_TEXT_N', ' chkecked="checked"');
+               define('_CFG_TEST_TEXT_N', ' checked="checked"');
                define('_CFG_TEST_TEXT_Y', '');
        } else {
                define('_CFG_TEST_TEXT_N', '');
-               define('_CFG_TEST_TEXT_Y', ' chkecked="checked"');
+               define('_CFG_TEST_TEXT_Y', ' checked="checked"');
        }
 
        switch (getConfig('repay_deleted_mails')) {
@@ -113,19 +113,19 @@ if (IS_FORM_SENT()) {
        }
 
        if (getConfig('test_subj') != 'Y') {
-               define('_CFG_TEST_SUBJ_N', ' chkecked="checked"');
+               define('_CFG_TEST_SUBJ_N', ' checked="checked"');
                define('_CFG_TEST_SUBJ_Y', '');
        } else {
                define('_CFG_TEST_SUBJ_N', '');
-               define('_CFG_TEST_SUBJ_Y', ' chkecked="checked"');
+               define('_CFG_TEST_SUBJ_Y', ' checked="checked"');
        }
 
        if (getConfig('url_blacklist') != 'Y') {
-               define('_CFG_URL_BLIST_N', ' chkecked="checked"');
+               define('_CFG_URL_BLIST_N', ' checked="checked"');
                define('_CFG_URL_BLIST_Y', '');
        } else {
                define('_CFG_URL_BLIST_N', '');
-               define('_CFG_URL_BLIST_Y', ' chkecked="checked"');
+               define('_CFG_URL_BLIST_Y', ' checked="checked"');
        }
 
        // Selection list
index 71971c0521d5b6f890c2bc96f885584e46182bb3..b333ac5b513de641d893f0f08d16011cf483ec09 100644 (file)
@@ -92,91 +92,91 @@ if (IS_FORM_SENT()) {
        define('_CFG_PROF_REUPDATE' , createTimeSelections(getConfig('resend_profile_update') , 'resend_profile_update', 'MWD'));
 
        if (getConfig('order_multi_page') != 'Y') {
-               define('_CFG_ORDER_MULTI_N', ' chkecked="checked"');
+               define('_CFG_ORDER_MULTI_N', ' checked="checked"');
                define('_CFG_ORDER_MULTI_Y', '');
        } else {
                define('_CFG_ORDER_MULTI_N', '');
-               define('_CFG_ORDER_MULTI_Y', ' chkecked="checked"');
+               define('_CFG_ORDER_MULTI_Y', ' checked="checked"');
        }
 
        if (getConfig('autosend_active') != 'Y') {
-               define('_CFG_AUTOSEND_ACTIVE_N', ' chkecked="checked"');
+               define('_CFG_AUTOSEND_ACTIVE_N', ' checked="checked"');
                define('_CFG_AUTOSEND_ACTIVE_Y', '');
        } else {
                define('_CFG_AUTOSEND_ACTIVE_N', '');
-               define('_CFG_AUTOSEND_ACTIVE_Y', ' chkecked="checked"');
+               define('_CFG_AUTOSEND_ACTIVE_Y', ' checked="checked"');
        }
 
        if (getConfig('send_prof_update') != 'Y') {
-               define('_CFG_SEND_UPDATE_N', ' chkecked="checked"');
+               define('_CFG_SEND_UPDATE_N', ' checked="checked"');
                define('_CFG_SEND_UPDATE_Y', '');
        } else {
                define('_CFG_SEND_UPDATE_N', '');
-               define('_CFG_SEND_UPDATE_Y', ' chkecked="checked"');
+               define('_CFG_SEND_UPDATE_Y', ' checked="checked"');
        }
 
        if (getConfig('admin_notify') != 'Y') {
-               define('_CFG_ADMIN_NOTIFY_N', ' chkecked="checked"');
+               define('_CFG_ADMIN_NOTIFY_N', ' checked="checked"');
                define('_CFG_ADMIN_NOTIFY_Y', '');
        } else {
                define('_CFG_ADMIN_NOTIFY_N', '');
-               define('_CFG_ADMIN_NOTIFY_Y', ' chkecked="checked"');
+               define('_CFG_ADMIN_NOTIFY_Y', ' checked="checked"');
        }
 
-       if (getConfig('css_php') == "DIRECT") {
-               define('_CFG_CSS_PHP_DIRECT', ' chkecked="checked"');
+       if (getConfig('css_php') == 'DIRECT') {
+               define('_CFG_CSS_PHP_DIRECT', ' checked="checked"');
                define('_CFG_CSS_PHP_FILE', '');
        } else {
                define('_CFG_CSS_PHP_DIRECT', '');
-               define('_CFG_CSS_PHP_FILE', ' chkecked="checked"');
+               define('_CFG_CSS_PHP_FILE', ' checked="checked"');
        }
 
        if (getConfig('guest_menu') == 'Y') {
-               define('_CFG_GUEST_MENU_ACTIVE', ' chkecked="checked"');
+               define('_CFG_GUEST_MENU_ACTIVE', ' checked="checked"');
                define('_CFG_GUEST_MENU_INACTIVE', '');
        } else {
                define('_CFG_GUEST_MENU_ACTIVE', '');
-               define('_CFG_GUEST_MENU_INACTIVE', ' chkecked="checked"');
+               define('_CFG_GUEST_MENU_INACTIVE', ' checked="checked"');
        }
 
        if (getConfig('member_menu') == 'Y') {
-               define('_CFG_MEMBER_MENU_ACTIVE', ' chkecked="checked"');
+               define('_CFG_MEMBER_MENU_ACTIVE', ' checked="checked"');
                define('_CFG_MEMBER_MENU_INACTIVE', '');
        } else {
                define('_CFG_MEMBER_MENU_ACTIVE', '');
-               define('_CFG_MEMBER_MENU_INACTIVE', ' chkecked="checked"');
+               define('_CFG_MEMBER_MENU_INACTIVE', ' checked="checked"');
        }
 
        if (getConfig('youre_here') == 'Y') {
-               define('_CFG_YOURE_HERE_ACTIVE', ' chkecked="checked"');
+               define('_CFG_YOURE_HERE_ACTIVE', ' checked="checked"');
                define('_CFG_YOURE_HERE_INACTIVE', '');
        } else {
                define('_CFG_YOURE_HERE_ACTIVE', '');
-               define('_CFG_YOURE_HERE_INACTIVE', ' chkecked="checked"');
+               define('_CFG_YOURE_HERE_INACTIVE', ' checked="checked"');
        }
 
        if (getConfig('show_timings') == 'Y') {
-               define('_CFG_SHOW_TIMINGS_Y', ' chkecked="checked"');
+               define('_CFG_SHOW_TIMINGS_Y', ' checked="checked"');
                define('_CFG_SHOW_TIMINGS_N', '');
        } else {
                define('_CFG_SHOW_TIMINGS_Y', '');
-               define('_CFG_SHOW_TIMINGS_N', ' chkecked="checked"');
+               define('_CFG_SHOW_TIMINGS_N', ' checked="checked"');
        }
 
        if (getConfig('show_points_unconfirmed') == 'Y') {
-               define('_CFG_SHOW_POINTS_UNCONFIRMED_Y', ' chkecked="checked"');
+               define('_CFG_SHOW_POINTS_UNCONFIRMED_Y', ' checked="checked"');
                define('_CFG_SHOW_POINTS_UNCONFIRMED_N', '');
        } else {
                define('_CFG_SHOW_POINTS_UNCONFIRMED_Y', '');
-               define('_CFG_SHOW_POINTS_UNCONFIRMED_N', ' chkecked="checked"');
+               define('_CFG_SHOW_POINTS_UNCONFIRMED_N', ' checked="checked"');
        }
 
        if (getConfig('mailid_error_redirect') == 'INDEX') {
-               define('_CFG_MAILID_REDIRECT_INDEX', ' chkecked="checked"');
+               define('_CFG_MAILID_REDIRECT_INDEX', ' checked="checked"');
                define('_CFG_MAILID_REDIRECT_REJECT', '');
        } else {
                define('_CFG_MAILID_REDIRECT_INDEX', '');
-               define('_CFG_MAILID_REDIRECT_REJECT', ' chkecked="checked"');
+               define('_CFG_MAILID_REDIRECT_REJECT', ' checked="checked"');
        }
 
        for ($i = 0; $i <= 5; $i++) {
index 874f8c79b9f610f946695a21b94e14d9fc4a6c17..df3046a98509252b7cc79c81ef8db8e0a8ef5694 100644 (file)
@@ -176,26 +176,26 @@ WHERE mails_confirmed < %s", $REF, $REF));
        // Including new add-mode for one-time referal bonus
        switch (getConfig('allow_direct_pay')) {
        case 'Y':
-               define('__DIRECT_Y', ' chkecked="checked"');
+               define('__DIRECT_Y', ' checked="checked"');
                define('__DIRECT_N', '');
                break;
 
        case 'N':
                define('__DIRECT_Y', '');
-               define('__DIRECT_N', ' chkecked="checked"');
+               define('__DIRECT_N', ' checked="checked"');
                break;
        }
 
        // One-time referal bonus add-mode
        switch (getConfig('reg_points_mode')) {
                case 'ref'   :
-                       define('__MODE_REF', ' chkecked="checked"');
+                       define('__MODE_REF', ' checked="checked"');
                        define('__MODE_DIRECT', '');
                        break;
 
                case 'direct':
                        define('__MODE_REF', '');
-                       define('__MODE_DIRECT', ' chkecked="checked"');
+                       define('__MODE_DIRECT', ' checked="checked"');
                        break;
        }
 
index 09915021bdea7fac8b168a17cb9827cbaaef906e..05af9628f26f4d65ef3990e494d59b32686e28f7 100644 (file)
@@ -254,8 +254,8 @@ WHERE d.admin_id=a.id ORDER BY start_time DESC", __FILE__, __LINE__);
                                'aid'        => $content['admin_id'],
                                'email_link' => generateMemberEmailLink($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
index 7cb27585865ac939e8b196dd8d5b499a35dd9577..9432f694822acae488f360e0b45bdf507c4aaca6 100644 (file)
@@ -58,13 +58,13 @@ if (IS_FORM_SENT()) {
        // Add more content
        switch (getConfig('refback_enabled')) {
                case 'Y': // Refback enabled
-                       $content['refback_enabled_y'] = ' chkecked="checked"';
+                       $content['refback_enabled_y'] = ' checked="checked"';
                        $content['refback_enabled_n'] = '';
                        break;
 
                case 'N': // Refback disabled
                        $content['refback_enabled_y'] = '';
-                       $content['refback_enabled_n'] = ' chkecked="checked"';
+                       $content['refback_enabled_n'] = ' checked="checked"';
                        break;
        }
 
index 626e23176e7ff27419e00c1a61e852dd4c4299d4..8967f1ef592ca5641f80f630e78d7c5915be632f 100644 (file)
@@ -52,97 +52,97 @@ if (IS_FORM_SENT()) {
        // Prepare data
        switch (getConfig('removeip_anon_ip')) {
                case 'Y':
-                       define('__CFG_REMOVEIP_ANON_IP_Y', ' chkecked="checked"');
+                       define('__CFG_REMOVEIP_ANON_IP_Y', ' checked="checked"');
                        define('__CFG_REMOVEIP_ANON_IP_N', '');
                        break;
 
                case 'N':
                        define('__CFG_REMOVEIP_ANON_IP_Y', '');
-                       define('__CFG_REMOVEIP_ANON_IP_N', ' chkecked="checked"');
+                       define('__CFG_REMOVEIP_ANON_IP_N', ' checked="checked"');
                        break;
        } // END - switch
 
        switch (getConfig('removeip_anon_host')) {
                case 'Y':
-                       define('__CFG_REMOVEIP_ANON_HOST_Y', ' chkecked="checked"');
+                       define('__CFG_REMOVEIP_ANON_HOST_Y', ' checked="checked"');
                        define('__CFG_REMOVEIP_ANON_HOST_N', '');
                        break;
 
                case 'N':
                        define('__CFG_REMOVEIP_ANON_HOST_Y', '');
-                       define('__CFG_REMOVEIP_ANON_HOST_N', ' chkecked="checked"');
+                       define('__CFG_REMOVEIP_ANON_HOST_N', ' checked="checked"');
                        break;
        } // END - switch
 
        switch (getConfig('removeip_anon_ua')) {
                case 'Y':
-                       define('__CFG_REMOVEIP_ANON_UA_Y', ' chkecked="checked"');
+                       define('__CFG_REMOVEIP_ANON_UA_Y', ' checked="checked"');
                        define('__CFG_REMOVEIP_ANON_UA_N', '');
                        break;
 
                case 'N':
                        define('__CFG_REMOVEIP_ANON_UA_Y', '');
-                       define('__CFG_REMOVEIP_ANON_UA_N', ' chkecked="checked"');
+                       define('__CFG_REMOVEIP_ANON_UA_N', ' checked="checked"');
                        break;
        } // END - switch
 
        switch (getConfig('removeip_anon_ref')) {
                case 'Y':
-                       define('__CFG_REMOVEIP_ANON_REF_Y', ' chkecked="checked"');
+                       define('__CFG_REMOVEIP_ANON_REF_Y', ' checked="checked"');
                        define('__CFG_REMOVEIP_ANON_REF_N', '');
                        break;
 
                case 'N':
                        define('__CFG_REMOVEIP_ANON_REF_Y', '');
-                       define('__CFG_REMOVEIP_ANON_REF_N', ' chkecked="checked"');
+                       define('__CFG_REMOVEIP_ANON_REF_N', ' checked="checked"');
                        break;
        } // END - switch
 
        switch (getConfig('removeip_admin_show')) {
                case 'Y':
-                       define('__CFG_REMOVEIP_ADMIN_SHOW_Y', ' chkecked="checked"');
+                       define('__CFG_REMOVEIP_ADMIN_SHOW_Y', ' checked="checked"');
                        define('__CFG_REMOVEIP_ADMIN_SHOW_N', '');
                        break;
 
                case 'N':
                        define('__CFG_REMOVEIP_ADMIN_SHOW_Y', '');
-                       define('__CFG_REMOVEIP_ADMIN_SHOW_N', ' chkecked="checked"');
+                       define('__CFG_REMOVEIP_ADMIN_SHOW_N', ' checked="checked"');
                        break;
        } // END - switch
 
        switch (getConfig('removeip_guest_show')) {
                case 'Y':
-                       define('__CFG_REMOVEIP_GUEST_SHOW_Y', ' chkecked="checked"');
+                       define('__CFG_REMOVEIP_GUEST_SHOW_Y', ' checked="checked"');
                        define('__CFG_REMOVEIP_GUEST_SHOW_N', '');
                        break;
 
                case 'N':
                        define('__CFG_REMOVEIP_GUEST_SHOW_Y', '');
-                       define('__CFG_REMOVEIP_GUEST_SHOW_N', ' chkecked="checked"');
+                       define('__CFG_REMOVEIP_GUEST_SHOW_N', ' checked="checked"');
                        break;
        } // END - switch
 
        switch (getConfig('removeip_member_show')) {
                case 'Y':
-                       define('__CFG_REMOVEIP_MEMBER_SHOW_Y', ' chkecked="checked"');
+                       define('__CFG_REMOVEIP_MEMBER_SHOW_Y', ' checked="checked"');
                        define('__CFG_REMOVEIP_MEMBER_SHOW_N', '');
                        break;
 
                case 'N':
                        define('__CFG_REMOVEIP_MEMBER_SHOW_Y', '');
-                       define('__CFG_REMOVEIP_MEMBER_SHOW_N', ' chkecked="checked"');
+                       define('__CFG_REMOVEIP_MEMBER_SHOW_N', ' checked="checked"');
                        break;
        } // END - switch
 
        switch (getConfig('removeip_sponsor_show')) {
                case 'Y':
-                       define('__CFG_REMOVEIP_SPONSOR_SHOW_Y', ' chkecked="checked"');
+                       define('__CFG_REMOVEIP_SPONSOR_SHOW_Y', ' checked="checked"');
                        define('__CFG_REMOVEIP_SPONSOR_SHOW_N', '');
                        break;
 
                case 'N':
                        define('__CFG_REMOVEIP_SPONSOR_SHOW_Y', '');
-                       define('__CFG_REMOVEIP_SPONSOR_SHOW_N', ' chkecked="checked"');
+                       define('__CFG_REMOVEIP_SPONSOR_SHOW_N', ' checked="checked"');
                        break;
        } // END - switch
 
index 111e06c2eed9d06502d7dd130688ac1e093b70c0..8c36ce73ff5e4e9ceafc3467d368e8a76a6db792 100644 (file)
@@ -73,12 +73,12 @@ if (IS_FORM_SENT()) {
                // Already registered module?
                if (ereg($content['module'], getConfig('rewrite_skip'))) {
                        // Found
-                       $y = ' chkecked="checked"';
+                       $y = ' checked="checked"';
                        $n = '';
                } else {
                        // Not found
                        $y = '';
-                       $n = ' chkecked="checked"';
+                       $n = ' checked="checked"';
                }
 
                // Remember data in array for the dynamic row template
index ee4f738d1dfe04e500e082dc897068d4cb0eec16..f1b04536c285976eb279e1439ef43f8c09b44ad4 100644 (file)
@@ -75,67 +75,67 @@ if (IS_FORM_SENT()) {
        // Prepare payment model for template
        if (getConfig('surfbar_pay_model') == 'STATIC') {
                // Static model
-               define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , ' chkecked="checked"');
+               define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , ' checked="checked"');
                define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', '');
        } else {
                // Dynamic model
                define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , '');
-               define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', ' chkecked="checked"');
+               define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', ' checked="checked"');
        }
 
        // Prepare auto-sart
        if (getConfig('surfbar_autostart') == 'Y') {
                // Yes selected
-               define('__CONFIG_SURFBAR_AUTOSTART_Y', ' chkecked="checked"');
+               define('__CONFIG_SURFBAR_AUTOSTART_Y', ' checked="checked"');
                define('__CONFIG_SURFBAR_AUTOSTART_N', '');
        } else {
                // No selected
                define('__CONFIG_SURFBAR_AUTOSTART_Y', '');
-               define('__CONFIG_SURFBAR_AUTOSTART_N', ' chkecked="checked"');
+               define('__CONFIG_SURFBAR_AUTOSTART_N', ' checked="checked"');
        }
 
        // Prepare notify limits
        if (getConfig('surfbar_notify_limits') == 'Y') {
                // Yes selected
-               define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', ' chkecked="checked"');
+               define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', ' checked="checked"');
                define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', '');
        } else {
                // No selected
                define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', '');
-               define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', ' chkecked="checked"');
+               define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', ' checked="checked"');
        }
 
        // Prepare notify admin about unlocked emails
        if (getConfig('surfbar_notify_admin_unlock') == 'Y') {
                // Yes selected
-               define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y', ' chkecked="checked"');
+               define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y', ' checked="checked"');
                define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', '');
        } else {
                // No selected
                define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y', '');
-               define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', ' chkecked="checked"');
+               define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', ' checked="checked"');
        }
 
        // Prepare order migration
        if (getConfig('surfbar_migrate_order') == 'Y') {
                // Yes selected
-               define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', ' chkecked="checked"');
+               define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', ' checked="checked"');
                define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', '');
        } else {
                // No selected
                define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', '');
-               define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', ' chkecked="checked"');
+               define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', ' checked="checked"');
        }
 
        // Pause URL mode
        if (getConfig('surfbar_pause_mode') == 'INTERNAL') {
                // Internal pause page
-               define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', ' chkecked="checked"');
+               define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', ' checked="checked"');
                define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', '');
        } else {
                // External pause page (if not empty)
                define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', '');
-               define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', ' chkecked="checked"');
+               define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', ' checked="checked"');
        }
 
        // Notification mode
index ccd6fbfbc5960633418c3b3911374f64851c3e6c..51016bf8172451f938000fd243beb8d4be59f9a1 100644 (file)
@@ -86,23 +86,23 @@ if (IS_FORM_SENT()) {
        // Prepare payout Y/N selection
        if (getConfig('wernis_payout_active') == 'Y') {
                // Payout allowed
-               define('__CFG_WERNIS_PAYOUT_ACTIVE_Y', ' chkecked="checked"');
+               define('__CFG_WERNIS_PAYOUT_ACTIVE_Y', ' checked="checked"');
                define('__CFG_WERNIS_PAYOUT_ACTIVE_N', '');
        } else {
                // Payout disabled
                define('__CFG_WERNIS_PAYOUT_ACTIVE_Y', '');
-               define('__CFG_WERNIS_PAYOUT_ACTIVE_N', ' chkecked="checked"');
+               define('__CFG_WERNIS_PAYOUT_ACTIVE_N', ' checked="checked"');
        }
 
        // Prepare withdraw Y/N selection
        if (getConfig('wernis_withdraw_active') == 'Y') {
                // Payout allowed
-               define('__CFG_WERNIS_WITHDRAW_ACTIVE_Y', ' chkecked="checked"');
+               define('__CFG_WERNIS_WITHDRAW_ACTIVE_Y', ' checked="checked"');
                define('__CFG_WERNIS_WITHDRAW_ACTIVE_N', '');
        } else {
                // Payout disabled
                define('__CFG_WERNIS_WITHDRAW_ACTIVE_Y', '');
-               define('__CFG_WERNIS_WITHDRAW_ACTIVE_N', ' chkecked="checked"');
+               define('__CFG_WERNIS_WITHDRAW_ACTIVE_N', ' checked="checked"');
        }
 
        // Load template
index c1f8af8e7649d2a3a75a6496de0df9803deb6f78..74cfcf05061e743d5e78eda7d76f14482449c4f3 100644 (file)
@@ -77,8 +77,8 @@ WHERE `id`=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
 
                        // 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
index 9cc0a1b92ca57fe1c7eb5bf9cff9c971cc7fa9fa..04f171e199ee916f93ee84d52a5aa4e7658dbb1f 100644 (file)
@@ -77,7 +77,7 @@ if (SQL_NUMROWS($result) > 0) {
                $content = array(
                        'sw'       => $SW,
                        'idx'      => $content['trans_id'],
-                       'stamp'    => generateDateTime($content['time_trans'], "3"),
+                       'stamp'    => generateDateTime($content['time_trans'], '3'),
                        'uid_from' => generateUserProfileLink($content['userid']),
                        'uid_to'   => generateUserProfileLink($content['to_uid']),
                        'reason'   => $content['reason'],
index 961edaec7e49d140959019b1dde541685115ec58..f86d378d2e4a9093dc9f4776eeac596acfc8b157 100644 (file)
@@ -58,7 +58,7 @@ $sql = "SELECT id, sender, subject, text, receivers, payment_id, data_type, time
 $result_normal = SQL_QUERY($sql, __FILE__, __LINE__);
 
 // Set offset an current page to default values
-if (!REQUEST_ISSET_GET('page'))   REQUEST_SET_GET('page'  , "1");
+if (!REQUEST_ISSET_GET('page'))   REQUEST_SET_GET('page'  , '1');
 if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', getConfig('mails_page'));
 
 // Add limitation to SQL string
@@ -76,8 +76,8 @@ if (SQL_NUMROWS($result) > 0) {
 
        // Add navigation table rows
        if ($PAGES > 1) {
-               define('__TOP_EMAIL_NAV'   , ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), true , "3", true));
-               define('__BOTTOM_EMAIL_NAV', ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true));
+               define('__TOP_EMAIL_NAV'   , ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), true , '3', true));
+               define('__BOTTOM_EMAIL_NAV', ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, '3', true));
        } else {
                define('__TOP_EMAIL_NAV'   , '');
                define('__BOTTOM_EMAIL_NAV', '');
index 8b1a87da3ac879b3230baca3c43988f69943f2b8..8fc1566d93ba306bd814d24a2b76f38eb9ce853f 100644 (file)
@@ -99,7 +99,7 @@ ORDER BY timestamp DESC";
 $result_normal = SQL_QUERY($sql, __FILE__, __LINE__);
 
 // Set offset an current page to default values
-if (!REQUEST_ISSET_GET('page')) REQUEST_SET_GET('page', "1");
+if (!REQUEST_ISSET_GET('page')) REQUEST_SET_GET('page', '1');
 
 if (!REQUEST_ISSET_GET('offset')) {
        if (isConfigEntrySet('mails_page')) {
@@ -181,7 +181,7 @@ if (SQL_NUMROWS($result_list) > 0) {
 
        // Add navigation (with change box and colspan=3)
        $content['nav'] = '';
-       if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true);
+       if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, '3', true);
 
        // Prepare content
        $content['rows'] = $OUT;
@@ -230,7 +230,7 @@ if ((EXT_IS_ACTIVE('bonus')) && ($WHO == _ALL)) {
 
                // Add navigation (without change box but with colspan=3)
                $content['nav'] = '';
-               if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true);
+               if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, '3', true);
 
                // Prepare content
                $content['rows'] = $OUT;
index f72bc83dcbe05c04e86ef4c7618add1fdd91a001..53abc64888c001907ff674f046df8056df910226 100644 (file)
@@ -114,7 +114,7 @@ if (REQUEST_ISSET_GET(('reg_ext'))) {
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_EXT_CHANGED'));
        } else {
                // Edit selected entries
-               $SW = "2"; $OUT = '';
+               $SW = 2; $OUT = '';
                foreach (REQUEST_POST('sel') as $ext_id => $sel) {
                        // Edit this extension?
                        if (($sel == 'Y') || ($sel == 'N')) {
index 7b9475afb560d9661f73bb4f04fe7d7ffe3419f0..f75c256fb5b5e0c76d361d49f50c97ce2890e58c 100644 (file)
@@ -141,18 +141,13 @@ WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
 
        $OUT = "    <select class=\"admin_select\" name=\"sort\" size=\"1\">
       <option value=\"0\">".IS_FIRST_MENU."</option>";
-       foreach ($below as $key => $m)
-       {
-               if (is_array($m))
-               {
-                       foreach ($m as $key2 => $m2)
-                       {
+       foreach ($below as $key => $m) {
+               if (is_array($m)) {
+                       foreach ($m as $key2 => $m2) {
                                $OUT .= "      <option value=\"".$m2."\">".$titles[$key][$key2];
-                               foreach ($menus as $k => $v)
-                               {
-                                       if (($v == $key) && (!is_array($v)))
-                                       {
-                                               $OUT .= " (".$titles[$k].")";
+                               foreach ($menus as $k => $v) {
+                                       if (($v == $key) && (!is_array($v))) {
+                                               $OUT .= " (" . $titles[$k] . ')';
                                        }
                                }
                                $OUT .= "</option>\n";
index dd93f3ba035637b9bfd4d80235f76b2604ac7af8..be29dfad9fabe69ffefbba69daa22548f6c9f676 100644 (file)
@@ -83,9 +83,9 @@ if (SQL_NUMROWS($result) > 0) {
                        'sname'    => $content['surname'],
                        'fname'    => $content['family'],
                        'email'    => "<a href=\"".generateMemberEmailLink($content['email'], "user_data")."\">".$content['email']."</a>",
-                       'joined'   => generateDateTime($content['joined'], "2"),
-                       'last'     => generateDateTime($content['last_online'], "2"),
-                       'notified' => generateDateTime($content['ap_notified'], "2"),
+                       'joined'   => generateDateTime($content['joined'], '2'),
+                       'last'     => generateDateTime($content['last_online'], '2'),
+                       'notified' => generateDateTime($content['ap_notified'], '2'),
                );
 
                // Load row template
index 3bb5aba71f942586923c3e552d17eecd63b77fee..ed8b864cd4847370035fe5f55aaa3148c60a0976 100644 (file)
@@ -91,7 +91,7 @@ ORDER BY beg_points DESC, last_online DESC, userid",
                                'sname'  => $content['surname'],
                                'fname'  => $content['family'],
                                'turbo'  => translateComma($content['beg_points']),
-                               'last'   => generateDateTime($content['last_online'], "2"),
+                               'last'   => generateDateTime($content['last_online'], '2'),
                                'sw'     => $SW,
                                'win1'   => $WIN1,
                                'win2'   => $WIN2,
@@ -116,7 +116,7 @@ ORDER BY beg_points DESC, last_online DESC, userid",
 
                // Prepare constant for timemark
                if (EXT_IS_ACTIVE('autopurge')) {
-                       define('__AUTOPURGE_TIMEOUT', generateDateTime(time() - getConfig('ap_inactive_since'), "2"));
+                       define('__AUTOPURGE_TIMEOUT', generateDateTime(time() - getConfig('ap_inactive_since'), '2'));
                } else {
                        define('__AUTOPURGE_TIMEOUT', sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'autopurge'));
                }
index 1a225c96f34836ffe89e8cc740750b81f907ea70..ef776061a6ecc49e7184c2926d1a97e7bf6cd173 100644 (file)
@@ -57,16 +57,16 @@ if (getConfig('bonus_active') == 'Y') {
 
        if (GET_EXT_VERSION('bonus') >= '0.6.9') {
                // Add more bonus points here
-               $USE = "(0";
-               if (getConfig('bonus_click_yn') == 'Y') $USE .= " + turbo_bonus";
-               if (getConfig('bonus_login_yn') == 'Y') $USE .= " + login_bonus";
-               if (getConfig('bonus_order_yn') == 'Y') $USE .= " + bonus_order";
-               if (getConfig('bonus_stats_yn') == 'Y') $USE .= " + bonus_stats";
-               if (getConfig('bonus_ref_yn')   == 'Y') $USE .= " + bonus_ref";
-               $USE .= ")";
+               $USE = '(0';
+               if (getConfig('bonus_click_yn') == 'Y') $USE .= " + `turbo_bonus`";
+               if (getConfig('bonus_login_yn') == 'Y') $USE .= " + `login_bonus`";
+               if (getConfig('bonus_order_yn') == 'Y') $USE .= " + `bonus_order`";
+               if (getConfig('bonus_stats_yn') == 'Y') $USE .= " + `bonus_stats`";
+               if (getConfig('bonus_ref_yn')   == 'Y') $USE .= " + `bonus_ref`";
+               $USE .= ')';
        } else {
                // Old version ???
-               $USE = "turbo_bonus";
+               $USE = 'turbo_bonus';
        }
 
        // Autopurge installed?
@@ -104,7 +104,7 @@ ORDER BY points DESC, last_online DESC, userid",
                        $content['email']  = generateMemberEmailLink($content['email'], "user_data");
                        $content['gender'] = translateGender($content['gender']);
                        $content['points'] = translateComma($content['points']);
-                       $content['last']   = generateDateTime($content['last'], "2");
+                       $content['last']   = generateDateTime($content['last'], '2');
                        $content['sw']     = $SW;
                        $content['win1']   = $WIN1;
                        $content['win2']   = $WIN2;
@@ -128,7 +128,7 @@ ORDER BY points DESC, last_online DESC, userid",
 
                // Prepare constant for timemark
                if (EXT_IS_ACTIVE('autopurge')) {
-                       define('__AUTOPURGE_TIMEOUT', generateDateTime(time() - getConfig('ap_inactive_since'), "2"));
+                       define('__AUTOPURGE_TIMEOUT', generateDateTime(time() - getConfig('ap_inactive_since'), '2'));
                } else {
                        define('__AUTOPURGE_TIMEOUT', sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'autopurge'));
                }
index 9a0a4a1f09c6e75a989ea496a5607a14883ace2a..0dc684b1498ee2a040bf33bddbefc142a7e6ae15 100644 (file)
@@ -64,11 +64,11 @@ if (SQL_NUMROWS($result) > 0) {
                        'sw'       => $SW,
                        'id'       => $content['id'],
                        'uid'      => 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'     => generateDateTime($content['last_online'], "3"),
+                       'last'     => generateDateTime($content['last_online'], '3'),
                );
 
                // Load row template and switch color
index bc34e3156c7b51506000241154ab7a8831c08243..ee0ec97d5e74d81eb22f3933efca112229a81df7 100644 (file)
@@ -50,7 +50,7 @@ $WHO = _ALL;
 $SQL2 = '';
 
 // Set offset an current page to default values
-if (!REQUEST_ISSET_GET('page'))   REQUEST_SET_GET('page'  , "1");
+if (!REQUEST_ISSET_GET('page'))   REQUEST_SET_GET('page'  , '1');
 if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', getConfig('mails_page'));
 
 if ((EXT_IS_ACTIVE('bonus')) && ($WHO == getMessage('_ALL'))) {
@@ -109,7 +109,7 @@ if ((EXT_IS_ACTIVE('bonus')) && (SQL_NUMROWS($result_max) > 0) && (!empty($SQL2)
 
                // Add navigation (without change box but with colspan=3)
                $content['nav'] = '';
-               if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true);
+               if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, '3', true);
 
                // Prepare content
                $content['rows'] = $OUT;
index 1215c5fa6db72bf5d14844fdf265cabcc480dbfe..5a63f110c453468f1e30d5d392e35f4b6b70f7c1 100644 (file)
@@ -258,7 +258,7 @@ ORDER BY p.payout_timestamp DESC", __FILE__, __LINE__);
                                'ptype'   => translateComma($content['payout_total'])." ".COMPILE_CODE($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'],
                        );
 
index cbb86b063c0da46c43f734fc246c610055195bbf..f2bddbfa2faf37d21a1288d373622c554e26a3d9 100644 (file)
@@ -58,7 +58,7 @@ if (SQL_NUMROWS($result) > 0) {
                $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']);
 
index 8f9e81d5fd3b3277160818b87d0ea30732b4d0f5..5d8c97163f4b550e24f8ad2251a63f53d87f9897 100644 (file)
@@ -57,7 +57,7 @@ if (REQUEST_ISSET_GET(('rallye'))) {
                // Activate / deactivate
                switch (REQUEST_GET('activate'))
                {
-               case "1": // Activate
+               case '1': // Activate
                        ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET is_active='Y' WHERE `id`=%s AND is_active='N' LIMIT 1");
                        break;
 
@@ -69,7 +69,7 @@ if (REQUEST_ISSET_GET(('rallye'))) {
                // Automatic notification
                switch (REQUEST_GET('notify'))
                {
-               case "1": // Activate
+               case '1': // Activate
                        ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET send_notify='Y' WHERE `id`=%s AND send_notify='N' LIMIT 1");
                        break;
 
@@ -81,7 +81,7 @@ if (REQUEST_ISSET_GET(('rallye'))) {
                // Automatic adding of new members
                switch (REQUEST_GET('auto'))
                {
-               case "1": // Activate
+               case '1': // Activate
                        ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET auto_add_new_user='Y' WHERE `id`=%s AND auto_add_new_user='N' LIMIT 1");
                        break;
 
index 77912df4965568d679556de2e5329a3cfaa7d7c3..4bfaa48adcc307294940a36f8c868253b8f2a573 100644 (file)
@@ -150,7 +150,7 @@ ORDER BY level ASC", __FILE__, __LINE__);
                                                                        'family'     => $data['family'],
                                                                        'email'      => "[<a href=\"".generateMemberEmailLink($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
@@ -202,7 +202,7 @@ ORDER BY level ASC", __FILE__, __LINE__);
                                                'family'     => $levels['family'],
                                                'email'      => "[<a href=\"".generateMemberEmailLink($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
index af15d3b2dbcecb40fc065e625844e35770b7da5d..efb727b5e62f556d7a08ec860d077619c1dd56f8 100644 (file)
@@ -94,9 +94,9 @@ WHERE `id`='%s' LIMIT 1",
                define('__SPONSOR_EMAIL_VALUE', $DATA['email']);
                define('__SPONSOR_URL'        , DEREFERER($DATA['url']));
                //  Timestamps
-               define('__SPONSOR_CREATED'    , generateDateTime($DATA['sponsor_created'], "2"));
-               define('__SPONSOR_LAST_ONLINE', generateDateTime($DATA['last_online'], "2"));
-               define('__SPONSOR_LAST_CHANGE', generateDateTime($DATA['last_change'], "2"));
+               define('__SPONSOR_CREATED'    , generateDateTime($DATA['sponsor_created'], '2'));
+               define('__SPONSOR_LAST_ONLINE', generateDateTime($DATA['last_online'], '2'));
+               define('__SPONSOR_LAST_CHANGE', generateDateTime($DATA['last_change'], '2'));
                //  Sponsor points
                define('__SPONSOR_AMOUNT'     , translateComma($DATA['points_amount']));
                define('__SPONSOR_USED'       , translateComma($DATA['points_used']));
@@ -161,8 +161,8 @@ FROM `{!_MYSQL_PREFIX!}_sponsor_data` ORDER BY `id`", __FILE__, __LINE__);
                                'fname'   => $content['family'],
                                'email'   => "mailto:".$content['email'],
                                'status'  => sponsorTranslateUserStatus($content['status']),
-                               'created' => generateDateTime($content['sponsor_created'], "2"),
-                               'last'    => generateDateTime($content['last_online'], "2"),
+                               'created' => generateDateTime($content['sponsor_created'], '2'),
+                               'last'    => generateDateTime($content['last_online'], '2'),
                                'points'  => translateComma($content['points_amount'] - $content['points_used']),
                                'ip'      => $content['remote_addr'],
                        );
index 3808ecf675e9b7e193bdc56fbbc176669abb6520..c4a7f8d21744a655afa6d4c32b883cd0edd7cd93 100644 (file)
@@ -167,7 +167,7 @@ ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __L
                                'admin'   => $content['assigned_admin'],
                                'uid'     => $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?
index 24cff28bedb412b1ea65e45a6c3b65b4ea8981df..17d79344fab0b36d8f6b074467f73cb28120319c 100644 (file)
@@ -57,7 +57,7 @@ if (SQL_NUMROWS($result) > 0)
                $content = array(
                        'sw'        => $SW,
                        'idx'       => $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_uid']),
                        'reason'    => wordwrap($content['reason'], 15),
index da4767d126da84a912920583403dcc0375417081..2d9cb3b7635514a5c39fb332870dec2726211088 100644 (file)
@@ -60,7 +60,7 @@ ON p.id=s.pool_id
 WHERE p.id='".REQUEST_GET('mid')."' LIMIT 1";
 
        // Column, type and ID for member's mail
-       $col = "stats_id"; $type = "NORMAL"; $ID = "-1";
+       $col = "stats_id"; $type = "NORMAL"; $ID = '-1';
 
        // Load admin_list_unconfirmed template
        $listed = true; $DATA = REQUEST_GET('mid'); $LINK = 'mailid';
@@ -92,7 +92,7 @@ if ($listed === true) {
                SQL_FREERESULT($result);
 
                // Transfer data to constants for the template
-               if (($stats_id > 0) && ($ID == "-1")) $ID = $stats_id;
+               if (($stats_id > 0) && ($ID == '-1')) $ID = $stats_id;
                if ($col == 'bonus_id') $sender = 0;
 
                // Load unconfirmed mail links. Hmmm, this select query is pretty cool
@@ -147,7 +147,7 @@ WHERE l.%s='%s' ORDER BY l.userid LIMIT %s",
                        'text'          => COMPILE_CODE($text),
                        'url'           => FRAMETESTER($url),
                        'unconfirmed'   => $unconfirmed,
-                       'stamp'         => generateDateTime($stamp, "2"),
+                       'stamp'         => generateDateTime($stamp, '2'),
                        'rows'          => $OUT
                );
 
index a13bbaf73243ebc10448c32ed1010025f6cff07f..c21ac0a8fc6e59048cb8601bf7d13c48e1230052 100644 (file)
@@ -92,7 +92,7 @@ if (EXT_IS_ACTIVE('country')) {
 // Init unset data (bad that we change $_GET here!)
 if (!REQUEST_ISSET_GET(('letter'))) { REQUEST_SET_GET('letter', getMessage('_ALL2')); }
 if (!REQUEST_ISSET_GET(('sortby'))) { REQUEST_SET_GET('sortby', 'userid');            }
-if (!REQUEST_ISSET_GET('page'))   { REQUEST_SET_GET('page'  , "1");                 }
+if (!REQUEST_ISSET_GET('page'))   { REQUEST_SET_GET('page'  , '1');                 }
 
 // Set base URL
 $base = "[<a href=\"{!URL!}/modules.php?module=admin";
@@ -129,10 +129,10 @@ LIMIT 1",
                // Is this above zero?
                if ($stamp > 0) {
                        // Then use it
-                       define('_BIRTHDAY', generateDateTime($stamp, "3"));
+                       define('_BIRTHDAY', generateDateTime($stamp, '3'));
                } else {
                        // Zero or below so set zero!
-                       define('_BIRTHDAY', generateDateTime(0, "3"));
+                       define('_BIRTHDAY', generateDateTime(0, '3'));
                }
 
                // Prepare data for template
@@ -151,7 +151,7 @@ LIMIT 1",
                $DATA['last_profile_sent'] = generateDateTime($DATA['last_profile_sent'], '0');
                $DATA['total']             = translateComma(GET_TOTAL_DATA($uid, "user_points", "points"));
                $DATA['locked']            = translateComma(GET_TOTAL_DATA($uid, "user_points", "locked_points"));
-               $DATA['lock_timestamp']    = generateDateTime($DATA['lock_timestamp'], "2");
+               $DATA['lock_timestamp']    = generateDateTime($DATA['lock_timestamp'], '2');
 
                // Is the lock reason not set?
                if (!isset($DATA['lock_reason'])) $DATA['lock_reason'] = '---';
@@ -250,7 +250,7 @@ LIMIT 1",
        // Activate the extension please!
        $PAGES = round(SQL_NUMROWS($result_master) / getConfig('user_limit') + 0.5);
 
-       if (!REQUEST_ISSET_GET('page'))   REQUEST_SET_GET('page'  , "1");
+       if (!REQUEST_ISSET_GET('page'))   REQUEST_SET_GET('page'  , '1');
        if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', getConfig('user_limit'));
 
        // Add limitation to SQL string and run him again
@@ -327,7 +327,7 @@ LIMIT 1",
                        $content['points'] = translateComma($pointsTotal);
                        $content['rate']   = translateComma($clickRate);
                        $content['locked'] = translateComma(GET_TOTAL_DATA($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']);
 
                        // Is the lock reason not set?
index 24501b427bd5a1d7d0b9553ae9315a69d81bcd11..cce8fb1049f3c0f4cd5848ac89bd061d758dae49 100644 (file)
@@ -58,7 +58,7 @@ if (SQL_NUMROWS($result) > 0) {
                $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']);
 
index 8d1c5823489e258f55fc0f599afc46811a071f24..df3a5872f02f9c5d6c38b599fb337d4d18d37575 100644 (file)
@@ -45,7 +45,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR('admin', __FILE__);
 
-if (REQUEST_ISSET_GET(('access'))) {
+if (REQUEST_ISSET_GET('access')) {
        // Secure input and construct FQFN
        $access = SQL_ESCAPE(strip_tags(REQUEST_GET('access')));
        $target = sprintf("%slogs/%s", constant('PATH'), $access);
@@ -62,15 +62,15 @@ if (REQUEST_ISSET_GET(('access'))) {
                clearOutputBuffer();
 
                // Set header
-               if (substr($access, -3, 3) == "log") {
+               if (substr($access, -3, 3) == 'log') {
                        // Output header
-                       header("Content-Type: text/plain");
-               } elseif (substr($access, -3, 3) == ".gz") {
+                       sendHeader('Content-Type: text/plain');
+               } elseif (substr($access, -3, 3) == '.gz') {
                        // @TODO Fix content-type here
-                       header("Content-Type: text/plain");
-               } elseif (substr($access, -3, 3) == ".bz2") {
+                       sendHeader('Content-Type: text/plain');
+               } elseif (substr($access, -3, 3) == '.bz2') {
                        // @TODO Fix content-type here
-                       header("Content-Type: text/plain");
+                       sendHeader('Content-Type: text/plain');
                } else {
                        // Restore old content
                        OUTPUT_HTML($OUTPUT);
@@ -90,13 +90,15 @@ if (REQUEST_ISSET_GET(('access'))) {
 } else {
        // List access logfiles
        $dir = constant('PATH') . getConfig('logs_base') . '/';
+
+       // Is the directory there?
        if (isDirectory($dir)) {
                // logs directory does exist
                OUTPUT_HTML("<ol>");
-               $handle = opendir($dir) or app_die(__FILE__, __LINE__, "Cannot open directory ".getConfig('logs_base').'!');
+               $handle = opendir($dir) or app_die(__FILE__, __LINE__, 'Cannot open directory '.getConfig('logs_base') . '!');
                while ($file = readdir($handle)) {
                        // We currenly only like files with "access" as prefix, should be more flexible!
-                       if (substr($file, 0, 6) == "access") {
+                       if (substr($file, 0, 6) == 'access') {
                                // Okay, let us print it out
                                OUTPUT_HTML("<li><a href=\"{!URL!}/modules.php?module=admin&amp;what=".$GLOBALS['what']."&amp;access=".urlencode($file)."\">".$file."</a></li>");
                        }
index 9a8f9cfee09515134b24dce842102040609f28df..d96a8491d99885fac9bc1e8883510d0c82f33fb7 100644 (file)
@@ -145,7 +145,7 @@ if (!IS_FORM_SENT()) {
                                $OUT .= "      <option value=\"".$m2."\">".$titles[$key][$key2];
                                foreach ($menus as $k => $v) {
                                        if (($v == $key) && (!is_array($v))) {
-                                               $OUT .= " (".$titles[$k].")";
+                                               $OUT .= " (" . $titles[$k] . ')';
                                        }
                                }
                                $OUT .= "</option>\n";
index bab476d6c1acb7dc2cc4f5353ac012cdea9ee5cc..857b516d6e2759e3dcfb5453133688a21705c9aa 100644 (file)
@@ -102,7 +102,7 @@ VALUES ('%s','%s','%s')",
        LOAD_TEMPLATE('admin_settings_saved', false, $content);
 } elseif (($SEL > 0) && (REQUEST_ISSET_POST('edit'))) {
        // Edit banner
-       $SW = ''; $OUT = '';
+       $SW = 2; $OUT = '';
        foreach (REQUEST_POST('sel') as $id => $sel) {
                // Load data
                $result = SQL_QUERY_ESC("SELECT url, alternate, visible FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE `id`=%s LIMIT 1",
index c93be0786546fb401926ca8e3bc6f12385b672c1..c96e883df0019b3d1babb21912953c00d23951c1 100644 (file)
@@ -84,7 +84,7 @@ ORDER BY userid ASC", __FILE__, __LINE__);
 } else {
        // Copy data into constants for the template and load it
        // @TODO Rewrite this constant
-       define('_DATESTAMP', generateDateTime(time(), "3"));
+       define('_DATESTAMP', generateDateTime(time(), '3'));
        if (EXT_IS_ACTIVE('html_mail')) {
                // Load template with HTML mode
                LOAD_TEMPLATE("admin_newsletter");
index 6637b61c9bbf52598479111542cabee57f435be1..05416d05f5ab21a81e347a81009ccbb589d43dac 100644 (file)
@@ -65,7 +65,7 @@ ORDER BY `userid` ASC",
                        // "Translate" some data
                        $content['userid']       = generateUserProfileLink($content['userid']);
                        $content['total_visits'] = translateComma($content['total_visits']);
-                       $content['last_online']  = generateDateTime($content['last_online'], "2");
+                       $content['last_online']  = generateDateTime($content['last_online'], '2');
                        $content['sw']           = $SW;
 
                        // Load row template
index 77067577374922c8153524ce1bfcf4d9960d0f28..993ecc443ba86f25165b39aa9aad92ae67dc6010 100644 (file)
@@ -127,7 +127,7 @@ if (($response[count($response) - 1] == "[EOF]") && ($response[0] != "[EOF]")) {
                        $OUT .= "<tr>
   <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".($idx + 1).".</td>
   <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\"><a href=\"".$LINK."\">".$name."</a></td>
-  <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".generateDateTime($THEMES['fctime'][$idx], "2")."</td>
+  <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".generateDateTime($THEMES['fctime'][$idx], '2')."</td>
   <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".translateComma(round($THEMES['fsize'][$idx] / 1.024) / 1000)." ".KBYTES."</td>
   <td align=\"center\" class=\"switch_sw".$SW." bottom2\">".$THEMES['ver'][$idx]." (".$THEMES['cver'][$idx].")</td>
 </tr>
index 20687f46a648aab96097cca5fb99abebe77b9406..7411003f73633a4828db2c27dd3ae6aa0a0fbf50 100644 (file)
@@ -212,7 +212,7 @@ LIMIT 1",
                                'cat_link'  => $content['category'],
                                'pay_title' => str_replace("\"", "&quot;", getPaymentTitlePrice($content['payment'], true)),
                                'pay_link'  => $content['payment'],
-                               'ordered'   => generateDateTime($content['timestamp'], "2"),
+                               'ordered'   => generateDateTime($content['timestamp'], '2'),
                                'tsend'     => $content['target_send'],
                        );
 
index e6e6866993d369deba3747d1cba97e46ceca321d..65418b104b5864f4332cc2e03673fc7747259304 100644 (file)
@@ -93,7 +93,7 @@ ORDER BY sp.pay_name",
                                                $data = array(
                                                        'aid'   => $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'],
                                                );
        
@@ -194,7 +194,7 @@ if (SQL_NUMROWS($result) > 0) {
                        'family'  => $content['family'],
                        'email'   => "mailto:".$content['email'],
                        'remote'  => $content['remote_addr'],
-                       'created' => generateDateTime($content['sponsor_created'], "2"),
+                       'created' => generateDateTime($content['sponsor_created'], '2'),
                );
 
                // Load row template and switch colors
index 411634ab67777e8721ad5a1922176c4c4f4d3aeb..de2c0a2dcd496f5ca0d9dd9344cec34759ad8d61 100644 (file)
@@ -132,7 +132,7 @@ if (empty($ONLINE['version'])) {
 } elseif (($ONLINE['version'] != constant('FULL_VERSION')) || ($ONLINE['revision'] != constant('CURR_SVN_REVISION'))) {
        // New full-version available (all previous released patches are included in this version!)
        define('__ONLINE_VERSION', $ONLINE['version']);
-       define('__ONLINE_CHANGE' , generateDateTime($ONLINE['changed'], "2"));
+       define('__ONLINE_CHANGE' , generateDateTime($ONLINE['changed'], '2'));
        define('__ONLINE_REVISION', $ONLINE['revision']);
 
        // Load template
index 7041ee31bfb6e4c234f7de3238c0027643c991ae..bd1a7e0378db7f35c3d1bf29b8d66abc094c1b17 100644 (file)
@@ -46,7 +46,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 ADD_DESCR('admin', __FILE__);
 
 // Base directory (should be moved to database)
-$usage = getConfig('usage_base').'/';
+$usage = getConfig('usage_base') . '/';
 
 if (REQUEST_ISSET_GET(('image'))) {
        if (REQUEST_GET('type') == 'usage') {
@@ -66,7 +66,7 @@ if (REQUEST_ISSET_GET(('image'))) {
 
        if (isFileReadable($FQFN)) {
                $image = imagecreatefrompng($FQFN);
-               header("Content-type: image/png");
+               sendHeader("Content-type: image/png");
                imagepng($image);
                imagedestroy($image);
        }
index aa8d40d7d7d0e182c90b95d2d120e7ec9692eca7..91595cf84aa762ef7f4b2821e89f602cc462e256 100644 (file)
@@ -108,7 +108,7 @@ if (REQUEST_ISSET_GET(('hash'))) {
                        } // END - if
 
                        // Account confirmed!
-                       if (defined('LEAD_CODE_ENABLED') && defined('LEAD_EXPIRY_TIME')) {
+                       if (EXT_IS_ACTIVE('lead')) {
                                // Set special lead cookie
                                setSession('lead_uid', bigintval($uid));
 
@@ -119,7 +119,7 @@ if (REQUEST_ISSET_GET(('hash'))) {
                                define('__UID', bigintval($uid));
                                LOAD_TEMPLATE("guest_confirm_table");
                        }
-               } elseif (defined('LEAD_CODE_ENABLED') && defined('LEAD_EXPIRY_TIME')) {
+               } elseif (EXT_IS_ACTIVE('lead')) {
                        // Set special lead cookie
                        setSession('lead_uid', bigintval($uid));
 
index 61303934d47c7fe202a2f722636047303a30e74c..c0f493ff823eb197e41efa43566c637860984017 100644 (file)
@@ -88,7 +88,7 @@ if (!REQUEST_ISSET_GET(('login')))     REQUEST_SET_GET('login'    , '');
 if (IS_MEMBER()) {
        // Login immidiately...
        $URL = 'modules.php?module=login';
-} elseif ((IS_FORM_SENT()) && (''.$uid.'' != ''.REQUEST_POST('id').'')) {
+} elseif ((IS_FORM_SENT()) && (''.$uid.'' != ''.REQUEST_POST('id') . '')) {
        // Invalid input (no nickname extension installed but nickname entered)
        $errorCode = getCode('EXTENSION_PROBLEM');
 } elseif (IS_FORM_SENT()) {
index be0254f732f50cc7d02dae0f81ee625bba5208b1..dd494cf90f877777051364886a2f5a03104364a7 100644 (file)
@@ -91,8 +91,8 @@ if (SQL_NUMROWS($result) == 1) {
        }
 
        // Set start and end time
-       define('__RALLYE_START', generateDateTime($start, "1"));
-       define('__RALLYE_END'  , generateDateTime($end  , "1"));
+       define('__RALLYE_START', generateDateTime($start, '1'));
+       define('__RALLYE_END'  , generateDateTime($end  , '1'));
 
        // Determine min_users
        define('__RALLYE_MAX_USERS', RALLYE_DETERMINE_MIN_USERS($min_users));
index 2c4368b4a92f3d7d3485bf7d0c889d293d261930..ea30251620eac9afdcd6df92894b141b1195d670 100644 (file)
@@ -69,7 +69,7 @@ if (!REQUEST_ISSET_POST(('street_nr')))    REQUEST_SET_POST('street_nr'   , '');
 if (!REQUEST_ISSET_POST('zip'))          REQUEST_SET_POST('zip'         , '');
 if (!REQUEST_ISSET_POST(('city')))         REQUEST_SET_POST('city'        , '');
 if (!REQUEST_ISSET_POST(('cntry')))        REQUEST_SET_POST('cntry'       , '');
-if (!REQUEST_ISSET_POST(('country_code'))) REQUEST_SET_POST('country_code', "1");
+if (!REQUEST_ISSET_POST(('country_code'))) REQUEST_SET_POST('country_code', '1');
 
 // Default refid is zero
 REQUEST_SET_POST('refid', 0);
@@ -190,7 +190,7 @@ if ((IS_FORM_SENT()) && ((!$FAILED) || (IS_ADMIN()))) {
        $lockedUsers      = GET_TOTAL_DATA('LOCKED', 'user_data', 'userid', 'status', true);
 
        // Generate hash which will be inserted into confirmation mail
-       $hash = generateHash(sha1($confirmedUsers.constant('ENCRYPT_SEPERATOR').$unconfirmedUsers.constant('ENCRYPT_SEPERATOR').$lockedUsers.constant('ENCRYPT_SEPERATOR').REQUEST_POST('month').'-'.REQUEST_POST('day').'-'.REQUEST_POST('year').constant('ENCRYPT_SEPERATOR').getenv('SERVER_NAME').constant('ENCRYPT_SEPERATOR').detectRemoteAddr().constant('ENCRYPT_SEPERATOR').detectUserAgent().'/'.constant('SITE_KEY').'/'.constant('DATE_KEY').'/'.constant('RAND_NUMBER')));
+       $hash = generateHash(sha1($confirmedUsers.getConfig('ENCRYPT_SEPERATOR').$unconfirmedUsers.getConfig('ENCRYPT_SEPERATOR').$lockedUsers.getConfig('ENCRYPT_SEPERATOR').REQUEST_POST('month') . '-'.REQUEST_POST('day') . '-'.REQUEST_POST('year').getConfig('ENCRYPT_SEPERATOR').getenv('SERVER_NAME').getConfig('ENCRYPT_SEPERATOR').detectRemoteAddr().getConfig('ENCRYPT_SEPERATOR').detectUserAgent().'/'.getConfig('SITE_KEY') . '/'.getConfig('DATE_KEY') . '/'.constant('RAND_NUMBER')));
 
        // Add design when extension sql_patches is v0.2.7 or greater
        // @TODO Rewrite these all to a single filter
@@ -198,7 +198,7 @@ if ((IS_FORM_SENT()) && ((!$FAILED) || (IS_ADMIN()))) {
        if (GET_EXT_VERSION('sql_patches') >= '0.2.7') {
                // Okay, add design here
                $ADD1 = ", `curr_theme`";
-               $ADD2 = ", '".getCurrentTheme()."'";
+               $ADD2 = ', ''.getCurrentTheme().''';
        } // END - if
 
        // Check if I shall disable sending mail to newly registered members out about active/begging rallye
index 2f4212d110ede3364b78caef0d67aa2414ad0fb9..2c217a39169a1d16d4e89a9c4bfb607d8f6a42a8 100644 (file)
@@ -72,12 +72,12 @@ switch (getConfig('guest_stats'))
 {
 case 'MEMBERS': // Statistics about your members
        // Members yesterday / today online
-       $ymem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE last_online >= ".constant('START_YDAY')." AND `last_online` < ".constant('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__));
-       $tmem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE last_online >= ".constant('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__));
+       $ymem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE last_online >= ".getConfig('START_YDAY')." AND `last_online` < ".getConfig('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__));
+       $tmem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE last_online >= ".getConfig('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__));
 
        // Yesterday / today registered
-       $yreg = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE joined >= ".constant('START_YDAY')." AND joined < ".constant('START_TDAY'), __FILE__, __LINE__));
-       $treg = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE joined >= ".constant('START_TDAY'), __FILE__, __LINE__));
+       $yreg = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE joined >= ".getConfig('START_YDAY')." AND joined < ".getConfig('START_TDAY'), __FILE__, __LINE__));
+       $treg = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE joined >= ".getConfig('START_TDAY'), __FILE__, __LINE__));
 
        // Only males / females
        $male   = GET_TOTAL_DATA('M', 'user_data', 'userid', 'gender', true, " AND `status`='CONFIRMED'");
index 60a4bd24d058d0388fdc3877d2d17b80323b6bbf..3acd9680593b5d5ac4b04e6b73d371816991fd7d 100644 (file)
@@ -79,7 +79,7 @@ while ($content = SQL_FETCHARRAY($result)) {
                'nick'   => $content['nickname'],
                'logins' => $content['total_logins'],
                'points' => translateComma(GET_TOTAL_DATA($content['userid'], "user_points", "points")),
-               'last'   => generateDateTime($content['last_online'], "3"),
+               'last'   => generateDateTime($content['last_online'], '3'),
        );
 
        // Load row template
@@ -149,7 +149,7 @@ while ($content = SQL_FETCHARRAY($result)) {
                'uid'    => $content['userid'],
                'nick'   => $content['nickname'],
                'points' => translateComma($content['points']),
-               'last'   => generateDateTime($content['last_online'], "3")
+               'last'   => generateDateTime($content['last_online'], '3')
        );
 
        // Load row template
@@ -220,7 +220,7 @@ while ($content = SQL_FETCHARRAY($result)) {
                'refs'   => $content['refs'],
                'nick'   => $content['nickname'],
                'points' => translateComma(GET_TOTAL_DATA($content['userid'], "user_points", "points")),
-               'last'   => generateDateTime($content['last_online'], "3")
+               'last'   => generateDateTime($content['last_online'], '3')
        );
 
        // Load row template
index bf3491770c4730dbc7304d81ce0b631d08c896f9..96444b1780f156ce053104ca1b4818ae043fcb5d 100644 (file)
@@ -55,7 +55,7 @@ OUTPUT_HTML("<div style=\"padding-left: 10px; padding-right: 10px\">");
 $rdf = new fase4_rdf();
 $rdf->use_dynamic_display(false);
 $rdf->set_CacheDir(constant('PATH')."inc/cache/");
-$rdf->set_salt(md5(constant('SITE_KEY')));
+$rdf->set_salt(md5(getConfig('SITE_KEY')));
 $rdf->set_max_item(10);
 $rdf->set_Options(
        array(
index eb333e70ceec20b46565b6fe537c3669c237b632..1c796983da8fd78f216d6af68b833c1993f33ca1 100644 (file)
@@ -42,7 +42,7 @@ if (!defined('__SECURITY')) {
        require($INC);
 } elseif (!IS_MEMBER()) {
        $URL = 'modules.php?module=index';
-       if ($check == 'mem_only') $URL .= '&amp;msg='.getCode('MODULE_MEM_ONLY').'&amp;mod='.$GLOBALS['module'];
+       if ($check == 'mem_only') $URL .= '&amp;msg='.getCode('MODULE_MEM_ONLY') . '&amp;mod='.$GLOBALS['module'];
        redirectToUrl($URL);
 }
 
index cee62bc19af883a0b1c75703724ccddd91353674..217b63ed43d4caa38c90a4578bd66be2c666096b 100644 (file)
@@ -76,7 +76,7 @@ if (SQL_NUMROWS($result) > 0) {
                        'cnt'    => $cnt,
                        'uid'    => bigintval($content['userid']),
                        'points' => translateComma($content['beg']),
-                       'last'   => generateDateTime($content['last_online'], "2"),
+                       'last'   => generateDateTime($content['last_online'], '2'),
                );
 
                // Load row template
index d44f96177622a75828fc8877debba5a6d326cb10..059b028234b0b3083b0765608e40be021bb22720 100644 (file)
@@ -92,7 +92,7 @@ if (SQL_NUMROWS($result) > 0) {
                $content['cnt']    = $cnt;
                $content['uid']    = bigintval($content['uid']);
                $content['points'] = translateComma($content['points']);
-               $content['last']   = generateDateTime($content['last'], "2");
+               $content['last']   = generateDateTime($content['last'], '2');
 
                // Load row template
                $OUT .= LOAD_TEMPLATE("member_bonus_row", true, $content);
index 93da79f9ab9e70e162492ae3eff8148b0d96ed87..9f2f814446bd8e5722794bf15e0cfdf5b6d362a5 100644 (file)
@@ -113,21 +113,21 @@ if ($cats > 0) {
                $OUT = ''; $SW = 2;
                while ($content = SQL_FETCHARRAY($result)) {
                        // Default he has not joined
-                       $content['jn'] = ' chkecked="checked"';
+                       $content['jn'] = ' checked="checked"';
                        $content['jy'] = '';
 
                        // When we found an entry don't read it, just change the jx elements
                        if (REQUEST_ISSET_POST(('cat'))) {
                                // Form sent?
                                if (REQUEST_POST('cat', $content['id']) =='Y') {
-                                       $content['jy'] = ' chkecked="checked"';
+                                       $content['jy'] = ' checked="checked"';
                                        $content['jn'] = '';
                                }
                        } else {
                                // Check if he has an entry
                                if (GET_TOTAL_DATA($UID, "user_cats", "id", 'userid', true, sprintf(" AND cat_id=%s", bigintval($content['id']))) == 1) {
                                        $content['jn'] = '';
-                                       $content['jy'] = ' chkecked="checked"';
+                                       $content['jy'] = ' checked="checked"';
                                }
                        }
 
index 7a1fa8642a0f8361cf9976cebbf86a2ad619a6e4..30863ddd6eaf5df03dde7862e3c6bef5e808b470 100644 (file)
@@ -151,8 +151,8 @@ WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
                        SQL_FREERESULT($result);
 
                        // Prepare it for the template
-                       define('__HOLIDAY_START', generateDateTime($start, "3"));
-                       define('__HOLIDAY_END'  , generateDateTime($end  , "3"));
+                       define('__HOLIDAY_START', generateDateTime($start, '3'));
+                       define('__HOLIDAY_END'  , generateDateTime($end  , '3'));
 
                        // Deactivate it now
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
index 90a6f7aadde8a04189d70b261f909ed50d28959f..7baa959b92f67b456fb42378366b90489212a49c 100644 (file)
@@ -64,10 +64,10 @@ if (IS_FORM_SENT()) {
        SQL_FREERESULT($result);
 
        if ($mode == 'Y') {
-               define('HTML_Y', ' chkecked="checked"');
+               define('HTML_Y', ' checked="checked"');
                define('HTML_N', '');
        } else {
-               define('HTML_N', ' chkecked="checked"');
+               define('HTML_N', ' checked="checked"');
                define('HTML_Y', '');
        }
        LOAD_TEMPLATE("member_html_mail_settings");
index 5cac3962b529e4b53346fc740078936b61a6b5c9..3294b49517c63fd164491c8d70a57c9931606643 100644 (file)
@@ -98,7 +98,7 @@ VALUES ('0','NEW','NL_UNSUBSCRIBE','{--ADMIN_NL_SUBJECT--}','".$admin_msg."', UN
 
        case 'N': // Does not receive the newsletter
                define('__STATUS_VALUE', getMessage('NL_MEMBER_OFF'));
-               define('__UNTIL_VALUE' , generateDateTime($until, "2"));
+               define('__UNTIL_VALUE' , generateDateTime($until, '2'));
                define('NL_SUBMIT'     , getMessage('NL_MEMBER_SUBMIT_ON'));
                break;
        }
index 0f1f3f6169feb083501a3d80e345bd81059181c6..78916d846e7890ac64402734dc65d2402543b318 100644 (file)
@@ -488,7 +488,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
 
                                        // Load timestamp from last order
                                        list($LORDER) = SQL_FETCHROW($result);
-                                       $LORDER = generateDateTime($LORDER, "1");
+                                       $LORDER = generateDateTime($LORDER, '1');
 
                                        // Free memory
                                        SQL_FREERESULT($result);
index 4eb6016eda609d4b49c727cf6125ff7ae4fc9cfa..3717af5a04ab1b2d496132751c2a7de3a1e2b444 100644 (file)
@@ -135,7 +135,7 @@ ORDER BY p.payout_timestamp DESC",
                                        'acc'    => $content['target_account'],
                                        'points' => translateComma($content['payout_total'])." ".COMPILE_CODE($content['type']),
                                        'bank'   => $content['target_bank'],
-                                       'stamp'  => generateDateTime($content['payout_timestamp'], "2"),
+                                       'stamp'  => generateDateTime($content['payout_timestamp'], '2'),
                                        'status' => $content['status']
                                );
 
index eb8b8136155cb2ca10371cdbaf68ca0b8b8f0910..078af8325ec816e136603e1f8e1b89d0c14d6caa 100644 (file)
@@ -94,7 +94,7 @@ if (!REQUEST_ISSET_GET(('mode'))) {
                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']),
index dbc3bce2b48210c2e5009699afb678ec7732df43..39f7f0ea03aa79b8c9b6349fba215e360849fda2 100644 (file)
@@ -97,8 +97,8 @@ if (SQL_NUMROWS($result) == 1) {
        define('__RALLYE_MAX_PRICES',  RALLYE_DETERMINE_MIN_PRICES($min_prices));
 
        // Set start and end time
-       define('__RALLYE_START', generateDateTime($start, "1"));
-       define('__RALLYE_END'  , generateDateTime($end  , "1"));
+       define('__RALLYE_START', generateDateTime($start, '1'));
+       define('__RALLYE_END'  , generateDateTime($end  , '1'));
 
        if ($expired === true) {
                define('__RALLYE_PRICES', RALLYE_LIST_WINNERS($id));
index 38d199573bc117adc710312fc2bc7ff45afd131d..c8ff9de9298fe4bd810df10681cd592cdf2697aa 100644 (file)
@@ -73,7 +73,7 @@ if (SQL_NUMROWS($result) > 0) {
                        'pay'   => getPaymentTitlePrice($data['payment_id']),
                        'subj'  => COMPILE_CODE($data['subject']),
                        'url'   => DEREFERER($data['url']),
-                       'stamp' => generateDateTime($data['timestamp'], "2"),
+                       'stamp' => generateDateTime($data['timestamp'], '2'),
                        'recs'  => $data['target_send'],
                        'type'  => translatePoolType($data['data_type']),
                        'zip'   => $data['zip']
@@ -115,9 +115,9 @@ if (SQL_NUMROWS($result) > 0) {
                        'pay'   => getPaymentTitlePrice($data[2]),
                        'subj'  => COMPILE_CODE($data[3]),
                        'url'   => DEREFERER($data[4]),
-                       'stamp' => generateDateTime($data[5], "2"),
+                       'stamp' => generateDateTime($data[5], '2'),
                        'recs'  => $data[6],
-                       'sent'  => generateDateTime($data[7], "2"),
+                       'sent'  => generateDateTime($data[7], '2'),
                        'clix'  => $data[8],
                        'perc'  => COMPILE_CODE($data[8] / $data[6] * 100)."%",
                );
index 747ea4078d6bb296024bf6e16c484ab17fbc1ec7..ab4a5b950f551c62caf1157e1326594afea59d0a 100644 (file)
@@ -88,7 +88,7 @@ if ((!IS_FORM_SENT()) || (!REQUEST_ISSET_POST(('qsummary')))) {
 
        // Drop a message in the admin's area
        SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (userid, assigned_admin, status, task_type, subject, text, task_created) VALUES ('%s','0','NEW','SUPPORT_MEMBER','%s','%s', UNIX_TIMESTAMP())",
-               array(getUserId(), $subj_a, REQUEST_POST('qsummary').':'.array('text' => REQUEST_POST('qdetails'))), __FILE__, __LINE__);
+               array(getUserId(), $subj_a, REQUEST_POST('qsummary') . ':'.array('text' => REQUEST_POST('qdetails'))), __FILE__, __LINE__);
 
        // Form sent
        LOAD_TEMPLATE("member_support_contcted");
index b2494b9b00f412ca3d7a48638a4dce62d814cb57..6de11b2e39d54688783594e98259ae075dfbe8e7 100644 (file)
@@ -77,8 +77,8 @@ if ((IS_FORM_SENT()) && (REQUEST_ISSET_POST(('action'))) && (REQUEST_ISSET_POST(
                        // Include link to stats
                        $content['views_total'] = "[<a href=\"{!URL!}/modules.php?module=login&amp;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']      = surfbarTranslateUserStatus($content['status']);
                if (empty($content['lock_reason'])) {
index 923ef52a4e03941842fe1b31bd65eba52fa596f2..aa017d8a3a8dbf9cbea8446edc35c309cc078095 100644 (file)
@@ -335,7 +335,7 @@ case "list_out": // List only outgoing transactions
                        $content = array(
                                'sw'     => $SW,
                                'tid'    => $id,
-                               'stamp'  => generateDateTime($stamp, "3"),
+                               'stamp'  => generateDateTime($stamp, '3'),
                                'uid'    => $uid,
                                'reason' => $reason,
                                'points' => translateComma($points)
@@ -425,7 +425,7 @@ array(getUserId(), getConfig('transfer_max')), __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
@@ -517,14 +517,14 @@ case "": // Overview page
        switch ($opt_in)
        {
        case 'Y':
-               define('__TRANSFER_ALLOW_Y', ' chkecked="checked"');
+               define('__TRANSFER_ALLOW_Y', ' checked="checked"');
                define('__TRANSFER_ALLOW_N', '');
                define('__TRANSFER_NEW_LINK', "<a href=\"{!URL!}/modules.php?module=login&amp;what=transfer&amp;mode=new\">{--TRANSFER_NOW_LINK--}</a>");
                break;
 
        case 'N':
                define('__TRANSFER_ALLOW_Y', '');
-               define('__TRANSFER_ALLOW_N', ' chkecked="checked"');
+               define('__TRANSFER_ALLOW_N', ' checked="checked"');
                define('__TRANSFER_NEW_LINK', getMessage('TRANSFER_PLEASE_ALLOW_OPT_IN'));
                break;
        }
@@ -542,7 +542,7 @@ LIMIT 1", array(getConfig('transfer_timeout'), getUserId()), __FILE__, __LINE__)
                // Load newest transaction
                list($newest) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
-               define('__TRANSFER_SETTINGS_CONTENT', sprintf(getMessage('TRANSFER_LATEST_IS'), generateDateTime($newest, "3")));
+               define('__TRANSFER_SETTINGS_CONTENT', sprintf(getMessage('TRANSFER_LATEST_IS'), generateDateTime($newest, '3')));
        }
 
        // Load template
index c7fa6d1532dda70582c997bcbb5ce1bcd79b2d65..9e5768ee17a9bafe2b2e7f74601194584dff72aa 100644 (file)
@@ -94,7 +94,7 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
                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']),
index bf986e0d7b6b7fa2f098ccb5e151d70dafbe5878..96ce1e5b2e571e8809b0a5871ede776d6e6b5ac4 100644 (file)
@@ -95,13 +95,13 @@ if (SQL_NUMROWS($result) == 1) {
                        // Make yes/no selection
                        switch ($content['receive_warnings']) {
                                case 'Y':
-                                       define('__YES', ' chkecked="checked"');
+                                       define('__YES', ' checked="checked"');
                                        define('__NO', '');
                                        break;
 
                                case 'N':
                                        define('__YES', '');
-                                       define('__NO', ' chkecked="checked"');
+                                       define('__NO', ' checked="checked"');
                                        break;
                        }
 
index 6e257ae8042df648001cd7537f94dedb6b0c2880..8693a51c6b33fac51b5028e2b12f7dc643401cc0 100644 (file)
@@ -45,6 +45,9 @@ if (!defined('__SECURITY')) {
 // Non-database functions
 require('inc/functions.php');
 
+// Wrapper functions
+require('inc/wrapper-functions.php');
+
 // Load more function libraries or includes
 foreach (array('request-functions', 'session-functions', 'config-functions', 'code-functions', 'inc-functions', 'filters', 'mysql-manager', 'extensions', 'db/lib', 'handler', 'hooks') as $lib) {
        // Load special functions
@@ -54,28 +57,28 @@ foreach (array('request-functions', 'session-functions', 'config-functions', 'co
 // Set error handler
 set_error_handler('__errorHandler');
 
+// Load configuration file(s) here
+loadIncludeOnce('inc/load_config.php');
+
+// Set important header_sent
+$GLOBALS['header_sent'] = 0;
+
 // Check if the user setups his MySQL stuff...
-if ((empty($MySQL['login'])) && (!isInstalling()) && (!REQUEST_ISSET_GET('installing')) && (isInstalled())) {
+if ((empty($GLOBALS['mysql']['login'])) && (!isInstalling()) && (!REQUEST_ISSET_GET('installing')) && (isInstalled())) {
        // No login entered and outside installation mode
-       OUTPUT_HTML("<strong>{--LANG_WARNING--}:</strong> ");
+       OUTPUT_HTML('<strong>{--LANG_WARNING--}:</strong> ');
        if (isInstalled()) {
                // You have changed my configuration file!
-               app_die(__FILE__, __LINE__, "{--DIE_CONFIG_CHANGED_YOU--}");
+               app_die(__FILE__, __LINE__, '{--DIE_CONFIG_CHANGED_YOU--}');
        } else {
                // Please run the installation script (maybe again)
-               app_die(__FILE__, __LINE__, "{--DIE_RUN_INSTALL_MYSQL--}");
+               app_die(__FILE__, __LINE__, '{--DIE_RUN_INSTALL_MYSQL--}');
        }
-} elseif ((!isInstalling()) && (empty($MySQL['password'])) && (isBooleanConstantAndTrue('warn_no_pass'))) {
+} elseif ((!isInstalling()) && (empty($GLOBALS['mysql']['password'])) && (getConfig('WARN_NO_PASS') == 'Y')) {
        // No database password entered!!!
-       OUTPUT_HTML("<div>{--LANG_WARNING--}:</div> {--WARN_NULL_PASSWORD--}");
+       OUTPUT_HTML('<div>{--LANG_WARNING--}:</div> {--WARN_NULL_PASSWORD--}');
 }
 
-// Set dummy config array
-initConfig();
-
-// Set important header_sent
-$GLOBALS['header_sent'] = 0;
-
 // Init fatal messages
 initFatalMessages();
 
@@ -88,19 +91,19 @@ if ((!isInstalling()) && (isInstalled())) {
        // CSS array
        EXT_INIT_CSS_FILES();
 
-       if ((!empty($MySQL['host'])) && (!empty($MySQL['login'])) && (!empty($MySQL['password'])) && (!empty($MySQL['dbase']))) {
+       if ((!empty($GLOBALS['mysql']['host'])) && (!empty($GLOBALS['mysql']['login'])) && (!empty($GLOBALS['mysql']['password'])) && (!empty($GLOBALS['mysql']['dbase']))) {
                // Connect to DB
-               SQL_CONNECT($MySQL['host'], $MySQL['login'], $MySQL['password'], __FILE__, __LINE__);
+               SQL_CONNECT($GLOBALS['mysql']['host'], $GLOBALS['mysql']['login'], $GLOBALS['mysql']['password'], __FILE__, __LINE__);
 
                // Is the link valid?
                if (SQL_IS_LINK_UP()) {
                        // Is it a valid resource?
-                       if (SQL_SELECT_DB($MySQL['dbase'], __FILE__, __LINE__) === true) {
+                       if (SQL_SELECT_DB($GLOBALS['mysql']['dbase'], __FILE__, __LINE__) === true) {
                                // This is required for extension 'optimize' to work
-                               define('__DB_NAME', $MySQL['dbase']);
+                               define('__DB_NAME', $GLOBALS['mysql']['dbase']);
 
                                // Remove MySQL array from namespace
-                               unset($MySQL);
+                               unset($GLOBALS['mysql']);
 
                                // Load configuration stuff
                                loadConfiguration();
@@ -115,7 +118,7 @@ if ((!isInstalling()) && (isInstalled())) {
                                loadIncludeOnce('inc/versions.php');
 
                                // Loading patching system is required here...
-                               loadIncludeOnce('inc/patch-system.php'); // Initialize patch system
+                               loadIncludeOnce('inc/patch-system.php');
 
                                // Run daily reset
                                loadIncludeOnce('inc/check-reset.php');
index be375eea693240de433a91fd2ff6667ca89417d4..a8532d69974104018b6e6dc2a1f02ed7d169f53e 100644 (file)
@@ -92,7 +92,7 @@ function getModuleDescription ($mode, $wht, $column = 'what') {
        } // END - if
 
        // Default is not found
-       $ret = "??? (".$wht.")";
+       $ret = "??? (".$wht.')';
 
        // Look for title
        $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE %s='%s' LIMIT 1",
@@ -237,7 +237,7 @@ function checkModulePermissions ($mod) {
                        $ret = checkModulePermissions($mod_chk);
                } else {
                        // Module not found we don't add it to the database
-                       $ret = "404";
+                       $ret = '404';
                }
        } elseif (!$found) {
                // Problem with module detected
@@ -328,7 +328,7 @@ function ADD_DESCR ($ACC_LVL, $FQFN, $return = false, $output = true) {
        $prefix .= "&nbsp;-&gt;&nbsp;";
 
        // We need to remove .php and the end
-       if (substr($search, -4, 4) == ".php") {
+       if (substr($search, -4, 4) == '.php') {
                // Remove the .php
                $search = substr($search, 0, -4);
        } // END - i
@@ -441,7 +441,7 @@ function ADD_MENU ($mode, $act, $wht) {
                                                }
 
                                                // Navigation link
-                                               $OUT .= "<a name=\"menu\" class=\"menu_blur\" href=\"{!URL!}/modules.php?module=".$GLOBALS['module']."&amp;what=".$content['sub_what'].addUrlData("")."\" target=\"_self\">";
+                                               $OUT .= "<a name=\"menu\" class=\"menu_blur\" href=\"{!URL!}/modules.php?module=".$GLOBALS['module']."&amp;what=".$content['sub_what']."\" target=\"_self\">";
                                        } else {
                                                $OUT .= "<em>";
                                        }
@@ -664,7 +664,7 @@ function addMaxReceiveList ($mode, $default = '', $return = false) {
                        $OUT .= "      <option value=\"".$content['value']."\"";
                        if (REQUEST_POST('max_mails') == $content['value']) $OUT .= ' selected="selected"';
                        $OUT .= ">".$content['value']." {--PER_DAY--}";
-                       if (!empty($content['comment'])) $OUT .= " (".$content['comment'].")";
+                       if (!empty($content['comment'])) $OUT .= " (".$content['comment'].')';
                        $OUT .= "</option>\n";
                }
                define('__MAX_RECEIVE_OPTIONS', $OUT);
@@ -1606,7 +1606,6 @@ WHERE p.userid=%s", array(bigintval($uid)), __FUNCTION__, __LINE__);
        if (SQL_NUMROWS($result) == 1) {
                // Save his points to add them to the jackpot
                list($points) = SQL_FETCHROW($result);
-               SQL_FREERESULT($result);
 
                // Delete points entries as well
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_points` WHERE userid=%s", array(bigintval($uid)), __FUNCTION__, __LINE__);
@@ -1619,7 +1618,10 @@ WHERE p.userid=%s", array(bigintval($uid)), __FUNCTION__, __LINE__);
 
                // Now, when we have all his points adds them do the jackpot!
                ADD_JACKPOT($points);
-       }
+       } // END - if
+
+       // Free the result
+       SQL_FREERESULT($result);
 
        // Delete category selections as well...
        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s",
@@ -1629,10 +1631,10 @@ WHERE p.userid=%s", array(bigintval($uid)), __FUNCTION__, __LINE__);
        if (EXT_IS_ACTIVE('rallye')) {
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE userid=%s",
                        array(bigintval($uid)), __FUNCTION__, __LINE__);
-       }
+       } // END - if
 
        // Now a mail to the user and that's all...
-       $msg = LOAD_EMAIL_TEMPLATE("del-user", array('text' => $reason), $uid);
+       $msg = LOAD_EMAIL_TEMPLATE('del-user', array('text' => $reason), $uid);
        sendEmail($uid, getMessage('ADMIN_DEL_ACCOUNT'), $msg);
 
        // Ok, delete the account!
@@ -1644,7 +1646,7 @@ function generateMetaDescriptionCode ($mod, $wht) {
        // Exclude admin and member's area
        if (($mod != 'admin') && ($mod != 'login')) {
                // Construct dynamic description
-               $DESCR = '{!MAIN_TITLE!} '.trim(getConfig('title_middle')).' '.ADD_DESCR('guest', 'what-'.$wht, true);
+               $DESCR = '{!MAIN_TITLE!} '.trim(getConfig('title_middle')) . ' ' . ADD_DESCR('guest', 'what-'.$wht, true);
 
                // Output it directly
                OUTPUT_HTML('<meta name="description" content="' . $DESCR . '" />');
@@ -1655,7 +1657,7 @@ function generateMetaDescriptionCode ($mod, $wht) {
 }
 
 // Adds points to the jackpot
-function ADD_JACKPOT($points) {
+function ADD_JACKPOT ($points) {
        $result = SQL_QUERY("SELECT points FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FUNCTION__, __LINE__);
        if (SQL_NUMROWS($result) == 0) {
                // Create line
@@ -1671,7 +1673,7 @@ function ADD_JACKPOT($points) {
 }
 
 // Subtracts points from the jackpot
-function SUB_JACKPOT($points) {
+function SUB_JACKPOT ($points) {
        // First failed
        $ret = '-1';
 
@@ -2176,7 +2178,7 @@ function reduceRecipientReceivedMails ($column, $id, $count) {
 
                // Now update all user accounts
                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `emails_received`=`emails_received`-1 WHERE `userid` IN (%s) LIMIT %s",
-                       array(implode(",", $UIDs), count($UIDs)), __FUNCTION__, __LINE__);
+                       array(implode(',', $UIDs), count($UIDs)), __FUNCTION__, __LINE__);
        } // END - if
 
        // Free result
@@ -2219,6 +2221,11 @@ function SET_SQL_KEY ($key, $value) {
        $GLOBALS['sqls'][$key] = (string) $value;
 }
 
+// Merge SQLs together
+function MERGE_SQLS ($SQLs) {
+       SET_SQLS(merge_array(GET_SQLS(), $SQLs));
+}
+
 // Counter for SQLs array
 function COUNT_SQLS () {
        // Default is false
index 1be90b21c5237e05f7c1b614d8169a339487eaeb..3613f38d1f0a092190d4fbe0b7bfb2fa8eff4cd9 100644 (file)
@@ -129,7 +129,7 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                list($stats_id) = SQL_FETCHROW($result_stats);
 
                                                // Mark this user as "spammed" ;-) And place a line for him...
-                                               //* DEBUG: */ echo "?L:".__LINE__.'/'.$dummy.'/'.$key.'/'.$uid."(".$DATA[1].")/".$DATA[0].'/'.$stats_id."?<br />";
+                                               //* DEBUG: */ echo "?L:".__LINE__.'/'.$dummy.'/'.$key.'/'.$uid.'('.$DATA[1].")/".$DATA[0].'/'.$stats_id."?<br />";
                                                switch (removeReceiver($dummy, $key, bigintval($uid), bigintval($DATA[0]), bigintval($stats_id)))
                                                {
                                                case 'done':
@@ -317,13 +317,13 @@ if (SQL_NUMROWS($result_main) > 0) {
                                        $mailText = LOAD_EMAIL_TEMPLATE("back-member", $content, bigintval($uid));
 
                                        // Send mail out to member
-                                       sendEmail($email, getMessage('MEMBER_BACK_JACKPOT')." (".$uid.")", $mailText);
+                                       sendEmail($email, getMessage('MEMBER_BACK_JACKPOT')." (".$uid.')', $mailText);
                                } else {
                                        // Add to jackpot
                                        ADD_JACKPOT($PB);
 
                                        // Send mail out to admin
-                                       sendAdminNotification(getMessage('ADMIN_BACK_JACKPOT')." (".$uid.")", "back-admin", $content, 'admin');
+                                       sendAdminNotification(getMessage('ADMIN_BACK_JACKPOT')." (".$uid.')', "back-admin", $content, 'admin');
                                }
                        } // END - if
                } // END - foreach
index a98000981bb9fb3ac8f57b839e9cae0a3fb37499..d8e3660b10c9dc5c287a54426e9d63aaf63861f9 100644 (file)
@@ -74,9 +74,9 @@ LIMIT 1",
 
                        // 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
index d48a53441934e718a1f5621de945c718947550dc..3944e24ebb81e5f1c525160de7bd6eb6e0ada5a2 100644 (file)
@@ -75,17 +75,6 @@ if (isSessionVariableSet('userid')) {
        } // END - if
 } // END - if
 
-// Test session if index.php or modules.php is loaded
-if ((basename($_SERVER['PHP_SELF']) == 'index.php') || (basename($_SERVER['PHP_SELF']) == 'modules.php') || (isInstalling())) {
-       if (count($_SESSION) > 0) {
-               // Session variables accepted!
-               define('__COOKIES', true);
-       } else {
-               // Cookies rejected!
-               define('__COOKIES', false);
-       }
-} // END - if
-
 //* DEBUG: */ print('<pre>'.print_r($_SESSION, true).'</pre>');
 
 //
index 1f67d01d93161a4715799d0e4b38aa8204471841..b13a2ff7bd33a061a720af6ae1eca0f74174d083 100644 (file)
@@ -59,7 +59,7 @@ if (SQL_NUMROWS($result_bonus) > 0) {
                        array(getConfig('bonus_stats'), 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
                $msg = LOAD_EMAIL_TEMPLATE("member_stats_bonus", $content, bigintval($content['userid']));
index a7312b5589155be7af4c275cb0d994eefe521747..3748c130d14b6ebc7bb08875c69b5070933029a7 100644 (file)
@@ -44,17 +44,17 @@ if (!defined('__SECURITY')) {
 
 // Default styles
 $STYLES = array(
-               "general.css",
+               'general.css',
 );
 
 // Add stylesheet for installation
-if ((isInstalling()) || (!isInstalled())) $STYLES[] = "install.css";
+if ((isInstalling()) || (!isInstalled())) $STYLES[] = 'install.css';
 
 // When no CSS output-mode is set, set it to file-output
-if (!isConfigEntrySet('css_php')) setConfigEntry('css_php', "FILE");
+if (!isConfigEntrySet('css_php')) setConfigEntry('css_php', 'FILE');
 
 // Output CSS files or content or link to css.php ?
-if (($GLOBALS['output_mode'] == "1") || (getConfig('css_php') == "DIRECT")) {
+if (($GLOBALS['output_mode'] == '1') || (getConfig('css_php') == 'DIRECT')) {
        // Load CSS files
        $STYLES = merge_array($STYLES, EXT_GET_CSS_FILES());
 
@@ -67,13 +67,17 @@ if (($GLOBALS['output_mode'] == "1") || (getConfig('css_php') == "DIRECT")) {
                // Do include only existing files and whose are not empty
                if ((isFileReadable($FQFN)) && (filesize($FQFN) > 0)) {
                        switch (getConfig('css_php')) {
-                               case 'DIRECT':
+                               case 'DIRECT': // Just link them (unsupported)
                                        OUTPUT_HTML('<link rel="stylesheet" type="text/css" href="{!URL!}/theme/' . getCurrentTheme() . '/' . $value . '" />');
                                        break;
 
-                               case 'FILE':
+                               case 'FILE': // Output contents
                                        OUTPUT_HTML(readFromFile($FQFN));
                                        break;
+
+                               default: // Invalid mode!
+                                       debug_report_bug(sprintf("Invalid css_php value %s detected.", getConfig('css_php')));
+                                       break;
                        } // END - switch
                } // END - if
        } // END - foreach
diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php
new file mode 100644 (file)
index 0000000..6803dfc
--- /dev/null
@@ -0,0 +1,376 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/04/2009 *
+ * ===============                              Last change: 04/04/2009 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : wrapper-functions.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Wrapper functions                                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Wrapper-Funktionen                               *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * Needs to be in all Files and every File needs "svn propset           *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
+       require($INC);
+} // END - if
+
+// Read a given file
+function readFromFile ($FQFN, $sqlPrepare = false) {
+       // Load the file
+       if (function_exists('file_get_contents')) {
+               // Use new function
+               $content = file_get_contents($FQFN);
+       } else {
+               // Fall-back to implode-file chain
+               $content = implode('', file($FQFN));
+       }
+
+       // Prepare SQL queries?
+       if ($sqlPrepare === true) {
+               // Remove some unwanted chars
+               $content = str_replace("\r", '', $content);
+               $content = str_replace("\n\n", "\n", $content);
+       } // END - if
+
+       // Return the content
+       return $content;
+}
+
+// Writes content to a file
+function writeToFile ($FQFN, $content) {
+       // Is the file writeable?
+       if ((isFileReadable($FQFN)) && (!is_writeable($FQFN)) && (!changeMode($FQFN, 0644))) {
+               // Not writeable!
+               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("File %s not writeable.", basename($FQFN)));
+
+               // Failed! :(
+               return false;
+       } // END - if
+
+       // By default all is failed...
+       $return = false;
+
+       // Is the function there?
+       if (function_exists('file_put_contents')) {
+               // Write it directly
+               $return = file_put_contents($FQFN, $content);
+       } else {
+               // Write it with fopen
+               $fp = fopen($FQFN, 'w') or app_die(__FUNCTION__, __LINE__, "Cannot write file ".basename($FQFN).'!');
+               fwrite($fp, $content);
+               fclose($fp);
+
+               // Set CHMOD rights
+               $return = changeMode($FQFN, 0644);
+       }
+
+       // Return status
+       return $return;
+}
+
+// Clears the output buffer. This function does *NOT* backup sent content.
+function clearOutputBuffer () {
+       // Trigger an error on failure
+       if (!ob_end_clean()) {
+               // Failed!
+               debug_report_bug(__FUNCTION__.': Failed to clean output buffer.');
+       } // END - if
+}
+
+// Loads an include file and logs any missing files for debug purposes
+function loadInclude ($INC) {
+       // Add the path. This is why we need a trailing slash in config.php
+       $FQFN = constant('PATH') . $INC;
+
+       // Is the include file there?
+       if (!isIncludeReadable($INC)) {
+               // Not there so log it
+               debug_report_bug(sprintf("Include file %s not found.", $INC));
+               return false;
+       } // END - if
+
+       // Try to load it
+       require($FQFN);
+}
+
+// Loads an include file once
+function loadIncludeOnce ($INC) {
+       // Is it not loaded?
+       if (!isset($GLOBALS['load_once'][$INC])) {
+               // Then try to load it
+               loadInclude($INC);
+
+               // And mark it as loaded
+               $GLOBALS['load_once'][$INC] = "loaded";
+       } // END - if
+}
+
+// Checks wether an include file (non-FQFN better) is readable
+function isIncludeReadable ($INC) {
+       // Construct FQFN
+       $FQFN = constant('PATH') . $INC;
+
+       // Is it readable?
+       return isFileReadable($FQFN);
+}
+
+// Encode strings
+// @TODO Implement $compress
+function encodeString ($str, $compress = true) {
+       $str = urlencode(base64_encode(compileUriCode($str)));
+       return $str;
+}
+
+// Decode strings encoded with encodeString()
+// @TODO Implement $decompress
+function decodeString ($str, $decompress = true) {
+       $str = compileUriCode(base64_decode(urldecode(compileUriCode($str))));
+       return $str;
+}
+
+// Smartly adds slashes
+function smartAddSlashes ($unquoted) {
+       $unquoted = str_replace("\\", '', $unquoted);
+       return addslashes($unquoted);
+}
+
+// Decode entities in a nicer way
+function decodeEntities ($str) {
+       // Decode the entities to UTF-8 now
+       $decodedString = html_entity_decode($str, ENT_NOQUOTES, 'UTF-8');
+
+       // Return decoded string
+       return $decodedString;
+}
+
+// Merges an array together but only if both are arrays
+function merge_array ($array1, $array2) {
+       // Are both an array?
+       if ((is_array($array1)) && (is_array($array2))) {
+               // Merge all together
+               return array_merge($array1, $array2);
+       } elseif (is_array($array1)) {
+               // Return left array
+               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("array2 is not an array. array != %s", gettype($array2)));
+               return $array1;
+       } elseif (is_array($array2)) {
+               // Return right array
+               DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("array1 is not an array. array != %s", gettype($array1)));
+               return $array2;
+       }
+
+       // Both are not arrays
+       debug_report_bug(__FUNCTION__.": No arrays provided!");
+}
+
+// Check if given FQFN is a readable file
+function isFileReadable ($FQFN) {
+       // Check all...
+       return ((file_exists($FQFN)) && (is_file($FQFN)) && (is_readable($FQFN)));
+}
+
+// Checks wether the given FQFN is a directory and not .,.. or .svn
+function isDirectory ($FQFN) {
+       // Generate baseName
+       $baseName = basename($FQFN);
+
+       // Check it
+       $isDirectory = ((is_dir($FQFN)) && ($baseName != '.') && ($baseName != '..') && ($baseName != '.svn'));
+
+       // Return the result
+       return $isDirectory;
+}
+
+// "Getter" for remote IP number
+function detectRemoteAddr () {
+       // Get remote ip from environment
+       $remoteAddr = determineRealRemoteAddress();
+
+       // Is removeip installed?
+       if (EXT_IS_ACTIVE('removeip')) {
+               // Then anonymize it
+               $remoteAddr = GET_ANONYMOUS_REMOTE_ADDR($remoteAddr);
+       } // END - if
+
+       // Return it
+       return $remoteAddr;
+}
+
+// "Getter" for remote hostname
+function detectRemoteHostname () {
+       // Get remote ip from environment
+       $remoteHost = getenv('REMOTE_HOST');
+
+       // Is removeip installed?
+       if (EXT_IS_ACTIVE('removeip')) {
+               // Then anonymize it
+               $remoteHost = GET_ANONYMOUS_REMOTE_HOST($remoteHost);
+       } // END - if
+
+       // Return it
+       return $remoteHost;
+}
+
+// "Getter" for user agent
+function detectUserAgent () {
+       // Get remote ip from environment
+       $userAgent = getenv('HTTP_USER_AGENT');
+
+       // Is removeip installed?
+       if (EXT_IS_ACTIVE('removeip')) {
+               // Then anonymize it
+               $userAgent = GET_ANONYMOUS_USER_AGENT($userAgent);
+       } // END - if
+
+       // Return it
+       return $userAgent;
+}
+
+// "Getter" for referer
+function detectReferer () {
+       // Get remote ip from environment
+       $referer = getenv('HTTP_REFERER');
+
+       // Is removeip installed?
+       if (EXT_IS_ACTIVE('removeip')) {
+               // Then anonymize it
+               $referer = GET_ANONYMOUS_REFERER($referer);
+       } // END - if
+
+       // Return it
+       return $referer;
+}
+
+// Check wether we are installing
+function isInstalling () {
+       $installing = ((isset($GLOBALS['mxchange_installing'])) || (REQUEST_ISSET_GET('installing')));
+       //* DEBUG: */ var_dump($installing);
+       return $installing;
+}
+
+// Check wether this script is installed
+function isInstalled () {
+       return (getConfig('MXCHANGE_INSTALLED') == 'Y');
+}
+
+// Check wether an admin is registered
+function isAdminRegistered () {
+       return (getConfig('ADMIN_REGISTERED') == 'Y');
+}
+
+// Checks wether the reset mode is active
+function isResetModeEnabled () {
+       // Now simply check it
+       return ((isset($GLOBALS['reset_enabled'])) && ($GLOBALS['reset_enabled'] === true));
+}
+
+// Checks wether the debug mode is enabled
+function isDebugModeEnabled () {
+       // Simply check it
+       return (getConfig('DEBUG_MODE') == 'Y');
+}
+
+// Checks wether the cache instance is valid
+function isCacheInstanceValid () {
+       return ((isset($GLOBALS['cache_instance'])) && (is_object($GLOBALS['cache_instance'])));
+}
+
+// Copies a file from source to destination and verifies if that goes fine.
+// This function should wrap the copy() command and make a nicer debug backtrace
+// even if there is no xdebug extension installed.
+function copyFileVerified ($source, $dest, $chmod = '') {
+       // Failed is the default
+       $status = false;
+
+       // Is the source file there?
+       if (!isFileReadable($source)) {
+               // Then abort here
+               debug_report_bug('Cannot read from source file ' . basename($source) . '.');
+       } // END - if
+
+       // Is the target directory there?
+       if (!isDirectory(dirname($dest))) {
+               // Then abort here
+               debug_report_bug('Cannot find directory ' . str_replace(constant('PATH'), '', dirname($dest)) . '.');
+       } // END - if
+
+       // Now try to copy it
+       if (!copy($source, $dest)) {
+               // Something went wrong
+               debug_report_bug('copy() has failed to copy the file.');
+       } // END - if
+
+       // If there are chmod rights set, apply them
+       if (!empty($chmod)) {
+               // Try to apply them
+               $status = changeMode($dest, $chmod);
+       } else {
+               // All fine
+               $status = true;
+       }
+
+       // All fine
+       return $status;
+}
+
+// Wrapper function for header()
+// Send a header but checks before if we can do so
+function sendHeader ($header) {
+       // Is the header already sent?
+       if (headers_sent()) {
+               // Then abort here
+               debug_report_bug('Headers already sent!');
+       } // END - if
+
+       // Send the header
+       header($header);
+}
+
+// Wrapper function for chmod()
+// @TODO Do some more sanity check here
+function changeMode ($FQFN, $mode) {
+       // Is the file/directory there?
+       if ((!isFile($FQFN)) && (!isDirectory($FQFN))) {
+               // Neither, so abort here
+               debug_report_bug('Cannot chmod() on ' . basename($FQFN) . '.');
+       } // END - if
+
+       // Try to set them
+       chmod($FQFN, $mode);
+}
+
+// Wrapper for $_POST['sel']
+function countPostSelection () {
+       return countSelection(REQUEST_POST('sel'));
+}
+
+// [EOF]
+?>
index 16cf25a4328bad567ca58ac8ce3c9615ea36efe7..04c39262426a79035faf6639b1af1532b08543c3 100644 (file)
--- a/index.php
+++ b/index.php
@@ -51,7 +51,7 @@ $GLOBALS['module'] = 'index';
 $GLOBALS['output_mode'] = '0';
 
 // Load config.php
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Is the script installed?
 if (isInstalled()) {
@@ -74,13 +74,13 @@ if (isInstalled()) {
                }
 
                // Template laden
-               LOAD_TEMPLATE('index', false, addUrlData(''));
+               LOAD_TEMPLATE('index');
 
                // Shall I insert an automated forward?
                if (getConfig('index_delay') > 0) {
                        // This will be a JavaScript-redirect!
                        define('__DELAY_VALUE', (getConfig('index_delay') * 1000 + 500));
-                       define('__MOD_VALUE'  , addUrlData('index'));
+                       define('__MOD_VALUE'  , 'index');
                        LOAD_TEMPLATE('index_forward');
                } // END - if
        } else {
index 788f7bfa026a2f11065b1b0d47b399c01b4e5198..d632be4e43ead547dd2e729d3660306079fab085 100644 (file)
@@ -63,7 +63,7 @@ $GLOBALS['output_mode'] = 0;
 $GLOBALS['module'] = 'install';
 
 // Load config file
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Header
 loadInclude('inc/header.php');
diff --git a/js.php b/js.php
index 830bec24ea0c53100b8294a23b96c7540c6e3761..6ec94157d83b4d8d7d1ee2b584b1e8a0670e31c9 100644 (file)
--- a/js.php
+++ b/js.php
@@ -36,9 +36,6 @@
  * MA  02110-1301  USA                                                  *
  ************************************************************************/
 
-// Deactivate caching system in fake-CSS mode
-define('_OB_CACHING', "old");
-
 // Load security stuff here
 require('inc/libs/security_functions.php');
 
@@ -57,19 +54,19 @@ $GLOBALS['output_mode'] = '1';
 $GLOBALS['module'] = 'js';
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Is this script installed and a JavaScript tag is provied?
-if ((isInstalled()) && (REQUEST_ISSET_GET(('tag')))) {
+if ((isInstalled()) && (REQUEST_ISSET_GET('tag'))) {
        // Set header
-       header('Content-type: text/javascript');
+       sendHeader('Content-type: text/javascript');
 
        // Load header
        loadIncludeOnce('inc/header.php');
 
        // Prepare include file for looking
        $INC = sprintf("inc/js/tag-%s.php",
-               REQUEST_GET(('tag'))
+               REQUEST_GET('tag')
        );
 
        // Is that file readable?
index 24c3e4d2b7deefe22088e83c3a3d1737faf66ec5..3078aa5b47e7bc33869c4e14d79385810e94910c 100644 (file)
@@ -51,7 +51,7 @@ $GLOBALS['module'] = 'lead-confirm';
 $GLOBALS['output_mode'] = '0';
 
 // Load config.php
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Is the script installed?
 if (isInstalled()) {
index 218b3c4414103c6527bc12fe7060cf5fbd4099c2..9a0c074af2cdf0ee5406627a1941ac8efc7af7da 100644 (file)
--- a/login.php
+++ b/login.php
@@ -50,7 +50,7 @@ $GLOBALS['module'] = 'login';
 $GLOBALS['output_mode'] = '0';
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Is the script installed?
 if (isInstalled()) {
index de8018f6bca925c267dcbb8204e140b0f334fd4e..b08e29be383a28fbf8ecaa9270a371c5168be1cf 100644 (file)
@@ -48,11 +48,11 @@ $GLOBALS['module'] = 'mailid';
 $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 if (isInstalled()) {
        // Is the extension active?
-       REDIRECT_ON_UNINSTALLED_EXTENSION('mailid');
+       redirectOnUninstalledExtension('mailid');
 
        // Init
        $url_uid = 0; $url_bid = 0; $url_mid = 0;
@@ -97,7 +97,7 @@ if (isInstalled()) {
 
                        case 'BONUS':
                                // Is the bonus extension active?
-                               REDIRECT_ON_UNINSTALLED_EXTENSION('bonus');
+                               redirectOnUninstalledExtension('bonus');
 
                                // Bonus-Mails
                                $result = SQL_QUERY_ESC("SELECT id, url, subject FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s LIMIT 1",
@@ -107,13 +107,16 @@ if (isInstalled()) {
 
                        if (SQL_NUMROWS($result) == 1) {
                                // Load data
-                               list($pool, $URL, $EXTRA_TITLE) = SQL_FETCHROW($result);
+                               list($pool, $URL, $title) = SQL_FETCHROW($result);
 
                                // Free result
                                SQL_FREERESULT($result);
 
                                // Compile extra title
-                               $EXTRA_TITLE = COMPILE_CODE($EXTRA_TITLE);
+                               $title = COMPILE_CODE($title);
+
+                               // Set it
+                               setExtraTitle($title);
 
                                // Is the user's ID unlocked?
                                $result = SQL_QUERY_ESC("SELECT status, gender, surname, family FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
@@ -204,7 +207,7 @@ if (isInstalled()) {
                                break;
 
                        case 'REJECT': // Redirect to rejection page
-                               LOAD_CONFIGURED_URL('reject_url');
+                               redirectToConfiguredUrl('reject_url');
                                break;
 
                        default:
index 0a16e40af6ff294e4ecfe5ed6f6da711e104bc20..c292aaf2ddb35ef49f149ac91e0dc97e54e9a02a 100644 (file)
@@ -48,11 +48,11 @@ $GLOBALS['module'] = 'mailid';
 $GLOBALS['output_mode'] = 0;
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 if (isInstalled()) {
        // Is the extension active
-       REDIRECT_ON_UNINSTALLED_EXTENSION('mailid');
+       redirectOnUninstalledExtension('mailid');
 
        // Secure all data
        $url_uid = 0; $url_bid = 0; $url_mid = 0; $code = 0; $mode = '';
index 85703b5e056b5332a9a043b5ca6c4f3a41b44d76..8b2c771373866a359b42bbbd39fd0fc8ac626fda 100644 (file)
@@ -50,7 +50,7 @@ $GLOBALS['action'] = '';
 $GLOBALS['module'] = '';
 
 // Needed include files
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Fix missing module to 'index'
 if (!REQUEST_ISSET_GET('module')) REQUEST_SET_GET('module', 'index');
@@ -63,7 +63,7 @@ if (IS_MEMBER()) {
        if (SQL_NUMROWS($result) == 1) {
                // Load surname and family's name and build the username
                list($s, $f) = SQL_FETCHROW($result);
-               $username = $s.' '.$f;
+               $username = $s . ' ' . $f;
 
                // Additionally admin?
                if (IS_ADMIN()) {
diff --git a/ref.php b/ref.php
index b331326ec45f1bf9b498fdce9c5c3abe0a20667a..55e8ef358572ea0789e365c1852683d22153b563 100644 (file)
--- a/ref.php
+++ b/ref.php
@@ -48,7 +48,7 @@ $GLOBALS['module'] = 'ref';
 $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Redirect only to registration page when this script is installed
 if (isInstalled()) {
index 99d7cc431057c6386a57b3168ec2b07f9998d7ed..d8dc4bf7d087b3a92311196fb4c420541315b90f 100644 (file)
@@ -49,10 +49,10 @@ $GLOBALS['module'] = 'show_bonus';
 $GLOBALS['output_mode'] = 0;
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Is the 'bonus' extension active?
-REDIRECT_ON_UNINSTALLED_EXTENSION('bonus');
+redirectOnUninstalledExtension('bonus');
 
 // List only rankings when script is installed
 if (isInstalled()) {
@@ -93,46 +93,43 @@ LIMIT 1",
                                $content = SQL_FETCHARRAY($result);
 
                                // Prepare constants for the pre-template
-                               define('__GENDER'   , translateGender($content['gender']));
-                               define('__SNAME'    , $content['surname']);
-                               define('__FNAME'    , $content['family']);
-                               define('__RANK'     , BIGINTVAL($content['level']));
-                               define('__POINTS'   , translateComma($content['points']));
-                               define('__MAILID'   , bigintval(REQUEST_GET('d')));
-                               define('__RANK_ROWS', BONUS_MAKE_RANK_ROWS(bigintval(REQUEST_GET('d')), $t, bigintval(REQUEST_GET('uid'))));
+                               $content['gender'] = translateGender($content['gender']);
+                               $content['points'] = translateComma($content['points']);
+                               $content['mailid'] = bigintval(REQUEST_GET('d'));
+                               $content['rows']   = BONUS_MAKE_RANK_ROWS(bigintval(REQUEST_GET('d')), $t, bigintval(REQUEST_GET('uid')));
 
                                // Constant created within previous function which contains informations for current user's ranking position:
                                //   __YOUR_RANKING_LINE
 
                                // Load pre-template
-                               define('__BONUS_MSG', LOAD_TEMPLATE('show_bonus_msg', true));
+                               $content['msg'] = LOAD_TEMPLATE('show_bonus_msg', true, $content);
                        } else {
                                // No data found
-                               define('__BONUS_MSG', "<span class=\"guest_failed\">{--BONUS_SHOW_NO_DATA--}</span>");
+                               $content['msg'] = "<span class=\"guest_failed\">{--BONUS_SHOW_NO_DATA--}</span>";
                        }
 
                        // Free memory
                        SQL_FREERESULT($result);
                } else {
                        // Wrong type entered
-                       define('__BONUS_MSG', "<span class=\"guest_failed\">{--BONUS_SHOW_WRONG_TYPE--}</span>");
+                       $content['msg'] = "<span class=\"guest_failed\">{--BONUS_SHOW_WRONG_TYPE--}</span>";
                }
        } else {
                // Wrong call!
-               define('__BONUS_MSG', "<span class=\"guest_failed\">{--BONUS_SHOW_WRONG_CALL--}</span>");
+               $content['msg'] = "<span class=\"guest_failed\">{--BONUS_SHOW_WRONG_CALL--}</span>";
        }
 
        // Load send_bonus header template (for your banners, e.g.?)
-       define('__BONUS_HEADER', LOAD_TEMPLATE('show_bonus_header', true));
+       $content['header'] = LOAD_TEMPLATE('show_bonus_header', true);
 
        // Load show_bonus footer template (for your banners, e.g.?)
-       define('__BONUS_FOOTER', LOAD_TEMPLATE('show_bonus_footer', true));
+       $content['footer'] = LOAD_TEMPLATE('show_bonus_footer', true);
 
        // Total ranks who can win
-       define('__BONUS_TOTAL_RANKS', getConfig('bonus_ranks'));
+       $content['total_ranks'] = getConfig('bonus_ranks');
 
        // Load final template
-       LOAD_TEMPLATE('show_bonus');
+       LOAD_TEMPLATE('show_bonus', false, $content);
 
        // Include footer
        loadInclude('inc/footer.php');
index b630cb1daf1193c1a02e4868726012f2b0813877..59f734fcfe3bfc2caeabad029d306db2f3de23c8 100644 (file)
@@ -49,7 +49,7 @@ $GLOBALS['module'] = 'sponsor_confirm';
 $GLOBALS['output_mode'] = '0';
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Is the script installed?
 if (isInstalled()) {
index 762e38bf3ebeff23e1f61ee756f5a1e5fd416207..b1cdd9b4791fa51ac8f8d0b8dcbad3671e46cf62 100644 (file)
@@ -49,7 +49,7 @@ $GLOBALS['module'] = 'sponsor_ref';
 $GLOBALS['output_mode'] = '0';
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Redirect only to registration page when this script is installed
 if (isInstalled()) {
index ae518872b55dcacb762de6beef15db49f5966e64..f6f0ca1d4bd06e8510023dde7df589e71b9b2ca5 100644 (file)
@@ -52,12 +52,12 @@ $GLOBALS['output_mode'] = 0;
 $msg = null;
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 // Is the script installed?
 if (isInstalled()) {
        // Only logged in users may use this surfbar!
-       REDIRECT_ON_UNINSTALLED_EXTENSION('surfbar');
+       redirectOnUninstalledExtension('surfbar');
 
        // No member?
        if (!IS_MEMBER()) {
index 91fcada2b045d32585137eb126ecd2a919e36014..eba5dae7274bb3f715e2355dd1fa6970cffd0df2 100644 (file)
@@ -2,29 +2,32 @@
 <table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed" width="500">
        <tr>
                <td colspan="3" align="center" class="admin_title bottom2" height="30">
-               <strong>{--ADMIN_EDIT_BEG_SETTINGS--}</strong></td>
+                       <strong>{--ADMIN_EDIT_BEG_SETTINGS--}</strong>
+               </td>
        </tr>
        <tr>
                <td colspan="3" class="seperator" height="5">&nbsp;</td>
        </tr>
        <tr>
                <td align="right" width="200" height="20">
-               {--ADMIN_BEG_POINTS--}:</td>
+                       {--ADMIN_BEG_POINTS--}:
+               </td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td width="295" align="center"><input type="text"
-                       name="beg_points" class="admin_normal" size="7" maxlength="10"
-                       value="{!__BEG_POINTS!}"></td>
+               <td width="295" align="center">
+                       <input type="text" name="beg_points" class="admin_normal" size="7" maxlength="10" value="$content[points]" />
+               </td>
        </tr>
        <tr>
                <td colspan="3" class="seperator" height="5">&nbsp;</td>
        </tr>
        <tr>
                <td align="right" width="300" height="20">
-               {--ADMIN_BEG_POINTS_MAX--}:</td>
+                       {--ADMIN_BEG_POINTS_MAX--}:
+               </td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td width="195" align="center"><input type="text"
-                       name="beg_points_max" class="admin_normal" size="7" maxlength="10"
-                       value="{!__BEG_POINTS_MAX!}"></td>
+               <td width="195" align="center">
+                       <input type="text" name="beg_points_max" class="admin_normal" size="7" maxlength="10" value="$content[points_max]" />
+               </td>
        </tr>
        <tr>
                <td colspan="3" class="seperator" height="5">&nbsp;</td>
@@ -32,7 +35,7 @@
        <tr>
                <td align="right" height="20">{--ADMIN_CONFIG_BEG_TIMEOUT--}:</td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td align="center">{!__BEG_TIMEOUT!}</td>
+               <td align="center">$content[timeout]</td>
        </tr>
        <tr>
                <td colspan="3" class="seperator" height="5">&nbsp;</td>
                <td align="right" height="20">
                {--ADMIN_CONFIG_BEG_UID_TIMEOUT--}:</td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td align="center">{!__BEG_UID_TIMEOUT!}</td>
+               <td align="center">$content[uid_timeout]</td>
        </tr>
        <tr>
                <td colspan="3" class="seperator" height="5">&nbsp;</td>
        </tr>
        <tr>
                <td align="right" height="20">
-               {--ADMIN_CONFIG_BEG_REMOTE_IP_TIMEOUT--}:</td>
+                       {--ADMIN_CONFIG_BEG_REMOTE_IP_TIMEOUT--}:
+               </td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td align="center">{!__BEG_REMOTE_IP_TIMEOUT!}</td>
+               <td align="center">$content[ip_timeout]</td>
        </tr>
        <tr>
                <td colspan="3" class="seperator" height="5">&nbsp;</td>
@@ -59,7 +63,7 @@
                <td align="right" height="20">{--ADMIN_BEG_USERID--}:</td>
                <td class="seperator" width="5">&nbsp;</td>
                <td align="center">
-                       {!__MEMBER_SELECTION!}
+                       $content[member_selection]
                </td>
        </tr>
        <tr>
        </tr>
        <tr>
                <td colspan="3" align="center" class="admin_title bottom2" height="30">
-               <strong>{--ADMIN_SELECT_BEG_MODE--}:</strong></td>
+                       <strong>{--ADMIN_SELECT_BEG_MODE--}:</strong>
+               </td>
        </tr>
        <tr>
                <td colspan="3" class="seperator" height="5">&nbsp;</td>
        </tr>
        <tr>
-               <td align="right" height="20"><input type="radio" name="beg_mode"
-                       class="admin_normal" value="DIRECT"{!__BEG_MODE_DIRECT!}>&nbsp;{--BEG_MODE_DIRECT--}<br />
+               <td align="right" height="20">
+                       <input type="radio" name="beg_mode" class="admin_normal" value="DIRECT"$content[mode_direct] />&nbsp;{--BEG_MODE_DIRECT--}
                </td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td align="center"><input type="radio" name="beg_mode"
-                       class="admin_normal" value="REF"{!__BEG_MODE_REF!}>&nbsp;{--BEG_MODE_REF--}
+               <td align="center">
+                       <input type="radio" name="beg_mode" class="admin_normal" value="REF"$content[mode_ref] />&nbsp;{--BEG_MODE_REF--}
                </td>
        </tr>
        <tr>
@@ -86,7 +91,8 @@
        </tr>
        <tr>
                <td colspan="3" align="center" class="admin_title bottom2" height="30">
-               <strong>{--ADMIN_EDIT_BEG_RALLYE_SETTINGS--}</strong></td>
+                       <strong>{--ADMIN_EDIT_BEG_RALLYE_SETTINGS--}</strong>
+               </td>
        </tr>
        <tr>
                <td colspan="3" class="seperator" height="5">&nbsp;</td>
        <tr>
                <td align="right" height="20">{--ADMIN_BEG_RALLYE_ACTIVE--}</td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td align="center"><input type="radio" name="beg_rallye"
-                       class="admin_normal" value="Y"{!__BEG_RALLYE_Y!} />&nbsp;{--YES--}<br />
-               <input type="radio" name="beg_rallye" class="admin_normal" value="N"{!__BEG_RALLYE_N!} />&nbsp;{--NO--}
+               <td align="center">
+                       <input type="radio" name="beg_rallye" class="admin_normal" value="Y"$content[rallye_yes] />&nbsp;{--YES--}<br />
+                       <input type="radio" name="beg_rallye" class="admin_normal" value="N"$content[rallye_no] />&nbsp;{--NO--}
                </td>
        </tr>
        <tr>
        <tr>
                <td align="right" height="20">{--ADMIN_BEG_INCLUDE_OWN--}</td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td align="center"><input type="radio" name="beg_include_own"
-                       class="admin_normal" value="Y"{!__BEG_INCLUDE_OWN_Y!} />&nbsp;{--YES--}<br />
-               <input type="radio" name="beg_include_own" class="admin_normal"
-                       value="N"{!__BEG_INCLUDE_OWN_N!} />&nbsp;{--NO--}</td>
+               <td align="center">
+                       <input type="radio" name="beg_include_own" class="admin_normal" value="Y"$content[include_own_yes] />&nbsp;{--YES--}<br />
+                       <input type="radio" name="beg_include_own" class="admin_normal" value="N"$content[include_own_no] />&nbsp;{--NO--}
+               </td>
        </tr>
        <tr>
                <td colspan="3" class="seperator" height="5">&nbsp;</td>
        <tr>
                <td align="right" height="20">{--ADMIN_BEG_RANKS--}</td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td align="center"><input type="text" name="beg_ranks"
-                       class="admin_normal" size="3" maxlength="7" value="{!__BEG_RANKS!}" />
+               <td align="center">
+                       <input type="text" name="beg_ranks" class="admin_normal" size="3" maxlength="7" value="$content[ranks]" />
                </td>
        </tr>
        <tr>
                        {--ADMIN_BEG_RALLYE_ONLY_ACTIVE--}
                </td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td align="center"><input type="radio" name="beg_active"
-                       class="admin_normal" value="Y"{!__BEG_ACTIVE_Y!} />&nbsp;{--YES--}<br />
-               <input type="radio" name="beg_active" class="admin_normal" value="N"{!__BEG_ACTIVE_N!} />&nbsp;{--NO--}
+               <td align="center">
+                       <input type="radio" name="beg_active" class="admin_normal" value="Y"$content[active_yes] />&nbsp;{--YES--}<br />
+                       <input type="radio" name="beg_active" class="admin_normal" value="N"$content[active_no] />&nbsp;{--NO--}
                </td>
        </tr>
        <tr>
                <td class="seperator" width="5">&nbsp;</td>
                <td align="center">
                        <select name="beg_pay_mode" size="1">
-                               <option value="IMG"{!__BEG_PAY_MODE_IMG!}>{--ADMIN_BEG_PAY_MODE_IMG--}</option>
-                               <option value="JS"{!__BEG_PAY_MODE_JS!}>{--ADMIN_BEG_PAY_MODE_JS--}</option>
-                               <option value="BOTH"{!__BEG_PAY_MODE_BOTH!}>{--ADMIN_BEG_PAY_MODE_BOTH--}</option>
-                               <option value="NONE"{!__BEG_PAY_MODE_NONE!}>{--ADMIN_BEG_PAY_MODE_NONE--}</option>
+                               <option value="IMG"$content[pay_mode_img]>{--ADMIN_BEG_PAY_MODE_IMG--}</option>
+                               <option value="JS"$content[pay_mode_js]>{--ADMIN_BEG_PAY_MODE_JS--}</option>
+                               <option value="BOTH"$content[pay_mode_both]>{--ADMIN_BEG_PAY_MODE_BOTH--}</option>
+                               <option value="NONE"$content[pay_mode_none]>{--ADMIN_BEG_PAY_MODE_NONE--}</option>
                        </select>
                </td>
        </tr>
        <tr>
                <td align="right" height="20">{--ADMIN_BEG_RAL_EN_NOTIFY--}</td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td align="center"><input type="radio" name="beg_ral_en_notify"
-                       class="admin_normal" value="Y"{!__BEG_RAL_EN_NOTIFY_Y!} />&nbsp;{--YES--}<br />
-               <input type="radio" name="beg_ral_en_notify" class="admin_normal"
-                       value="N"{!__BEG_RAL_EN_NOTIFY_N!} />&nbsp;{--NO--}</td>
+               <td align="center">
+                       <input type="radio" name="beg_ral_en_notify" class="admin_normal" value="Y"$content[ral_enable_notify_yes] />&nbsp;{--YES--}<br />
+                       <input type="radio" name="beg_ral_en_notify" class="admin_normal" value="N"$content[ral_enable_notify_no] />&nbsp;{--NO--}
+               </td>
        </tr>
        <tr>
                <td colspan="3" class="seperator" height="5">&nbsp;</td>
        <tr>
                <td align="right" height="20">{--ADMIN_BEG_RAL_DI_NOTIFY--}</td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td align="center"><input type="radio" name="beg_ral_di_notify"
-                       class="admin_normal" value="Y"{!__BEG_RAL_DI_NOTIFY_Y!} />&nbsp;{--YES--}<br />
-               <input type="radio" name="beg_ral_di_notify" class="admin_normal"
-                       value="N"{!__BEG_RAL_DI_NOTIFY_N!} />&nbsp;{--NO--}</td>
+               <td align="center">
+                       <input type="radio" name="beg_ral_di_notify" class="admin_normal" value="Y"$content[ral_disable_notify_yes] />&nbsp;{--YES--}<br />
+                       <input type="radio" name="beg_ral_di_notify" class="admin_normal" value="N"$content[ral_disable_notify_no] />&nbsp;{--NO--}
+               </td>
        </tr>
        <tr>
                <td colspan="3" class="seperator" height="5">&nbsp;</td>
        <tr>
                <td align="right" height="20">{--ADMIN_BEG_NEW_MEMBER_NOTIFY--}</td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td align="center"><input type="radio" name="beg_new_mem_notify"
-                       class="admin_normal" value="Y"{!__BEG_NEW_MEMBER_NOTIFY_Y!} />&nbsp;{--YES--}<br />
-               <input type="radio" name="beg_new_mem_notify" class="admin_normal"
-                       value="N"{!__BEG_NEW_MEMBER_NOTIFY_N!} />&nbsp;{--NO--}</td>
+               <td align="center">
+                       <input type="radio" name="beg_new_mem_notify" class="admin_normal" value="Y"$content[new_member_notify_yes] />&nbsp;{--YES--}<br />
+                       <input type="radio" name="beg_new_mem_notify" class="admin_normal" value="N"$content[new_member_notify_no] />&nbsp;{--NO--}
+               </td>
        </tr>
        <tr>
                <td colspan="3" class="seperator" height="5">&nbsp;</td>
        <tr>
                <td align="right" height="20">{--ADMIN_BEG_NOTIFY_BONUS--}</td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td align="center"><input type="text" name="beg_notify_bonus"
-                       class="admin_normal" size="3" maxlength="7"
-                       value="{!__BEG_NOTIFY_BONUS!}"></td>
+               <td align="center">
+                       <input type="text" name="beg_notify_bonus" class="admin_normal" size="3" maxlength="7" value="$content[notify_bonus]" />
+               </td>
        </tr>
        <tr>
                <td colspan="3" class="seperator" height="5">&nbsp;</td>
        <tr>
                <td align="right" height="20">{--ADMIN_BEG_NOTIFY_WAIT--}</td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td align="center">{!__WAIT_SELECTION!}</td>
+               <td align="center">$content[wait_selection]</td>
        </tr>
        <tr>
                <td colspan="3" class="bottom2 seperator" height="5">&nbsp;</td>
        </tr>
        <tr>
-               <td colspan="3" class="admin_footer"><input
-                       type="reset" class="admin_reset" value="{--CLEAR_FORM--}" />
-               <input type="submit" name="ok" class="admin_submit"
-                       value="{--SAVE_SETTINGS--}" /></td>
+               <td colspan="3" class="admin_footer">
+                       <input type="reset" class="admin_reset" value="{--CLEAR_FORM--}" />
+                       <input type="submit" name="ok" class="admin_submit" value="{--SAVE_SETTINGS--}" />
+               </td>
        </tr>
 </table>
 </form>
index a0d4f433f9f5f308f3acdd85ccb6822f2abbcc9f..f7586e4ca299055fe7dc00455e77ba442aefbc26 100644 (file)
@@ -3,7 +3,8 @@
 <table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
        <tr>
                <td colspan="3" align="center" class="admin_title bottom2" height="30">
-               <strong>{--ADMIN_CONFIG_BIRTHDAY_HEADER--}</strong></td>
+                       <strong>{--ADMIN_CONFIG_BIRTHDAY_HEADER--}</strong>
+               </td>
        </tr>
        <tr>
                <td colspan="3" class="seperator" height="5">&nbsp;</td>
                <td width="400" align="right">{--ADMIN_BIRTHDAY_POINTS--}:
                <span class="admin_note">({--ADMIN_BIRTHDAY_POINTS_NOTE--})</span></td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td width="170"><input type="text" name="birthday_points"
-                       class="admin_normal" value="{!__POINTS_VALUE!}" size="4"
-                       maxlength="6">&nbsp;<div class="tiny">({!POINTS!})</div></td>
+               <td width="170">
+                       <input type="text" name="birthday_points" class="admin_normal" value="{!__POINTS_VALUE!}" size="4" maxlength="6" />
+                       <div class="tiny">({!POINTS!})</div>
+               </td>
        </tr>
        <tr>
                <td colspan="3" class="seperator bottom2" height="5">&nbsp;</td>
        <tr>
                <td align="right" height="20">{--ADMIN_BIRTHDAY_ONLY_ACTIVE--}</td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td align="center"><input type="radio" name="birthday_active"
-                       class="admin_normal" value="Y"{!__BIRTHDAY_ACTIVE_Y!} />&nbsp;{--YES--}<br />
-               <input type="radio" name="birthday_active" class="admin_normal"
-                       value="N"{!__BIRTHDAY_ACTIVE_N!} />&nbsp;{--NO--}</td>
+               <td align="center">
+                       <input type="radio" name="birthday_active" class="admin_normal" value="Y"$content[active_yes] />&nbsp;{--YES--}<br />
+                       <input type="radio" name="birthday_active" class="admin_normal" value="N"$content[active_no] />&nbsp;{--NO--}
+               </td>
        </tr>
        <tr>
                <td colspan="3" class="bottom2 seperator" height="5">&nbsp;</td>
        </tr>
        <tr>
                <td colspan="3" align="center" class="admin_title bottom2" height="30">
-               <strong>{--ADMIN_SELECT_BIRTHDAY_MODE--}:</strong></td>
+                       <strong>{--ADMIN_SELECT_BIRTHDAY_MODE--}:</strong>
+               </td>
        </tr>
        <tr>
                <td colspan="3" class="seperator" height="5">&nbsp;</td>
        </tr>
        <tr>
-               <td align="right" height="20"><input type="radio"
-                       name="birthday_mode" class="admin_normal" value="DIRECT"{!__BIRTHDAY_MODE_DIRECT!}>&nbsp;{--BIRTHDAY_MODE_DIRECT--}<br />
+               <td align="right" height="20">
+                       <input type="radio" name="birthday_mode" class="admin_normal" value="DIRECT"$content[mode_direct] />&nbsp;{--BIRTHDAY_MODE_DIRECT--}
                </td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td align="center"><input type="radio" name="birthday_mode"
-                       class="admin_normal" value="REF"{!__BIRTHDAY_MODE_REF!}>&nbsp;{--BIRTHDAY_MODE_REF--}
+               <td align="center">
+                       <input type="radio" name="birthday_mode" class="admin_normal" value="REF"$content[mode_ref] />&nbsp;{--BIRTHDAY_MODE_REF--}
                </td>
        </tr>
        <tr>
                <td colspan="3" class="bottom2 seperator" height="5">&nbsp;</td>
        </tr>
        <tr>
-               <td colspan="3" class="admin_footer"><input
-                       type="reset" class="admin_reset" value="{--CLEAR_FORM--}" />&nbsp;<input
-                       type="submit" name="ok" class="admin_submit"
-                       value="{--SAVE_SETTINGS--}" /></td>
+               <td colspan="3" class="admin_footer">
+                       <input type="reset" class="admin_reset" value="{--CLEAR_FORM--}" />
+                       <input type="submit" name="ok" class="admin_submit" value="{--SAVE_SETTINGS--}" />
+               </td>
        </tr>
 </table>
 </form>
index ad3853a5f5df7173280e2139f2fbae8252d73108..f9971b53031fe2319daf4aabb6b495a73843c6e8 100644 (file)
                <td align="right" width="300" height="20">
                {--ADMIN_BONUS_RALLYE_NOTIFY_WAIT--}:</td>
                <td class="seperator" width="5">&nbsp;</td>
-               <td width="195" align="center">{!__WAIT_SELECTION!}</td>
+               <td width="195" align="center">$content[wait_selection]</td>
        </tr>
        <tr>
                <td colspan="3" class="bottom2 seperator" height="5">&nbsp;</td>
index c2536b18a36feb2721cfe650c4b82467114588d8..e33128224f81d08184393fd7dae910fed454cc75 100644 (file)
@@ -13,7 +13,8 @@
                        </tr>
                        <tr>
                                <td align="center" height="120" class="beg_msg bottom2">
-                               {!__BEG_MSG!}</td>
+                               $content[msg]
+                               </td>
                        </tr>
                        <tr>
                                <td align="center" height="30"><a
index 5d23308db70ddcc190af050d27ba65362a69659a..5cc32235d5206ce288fe7be6bfc839ae636a5814 100644 (file)
@@ -1,11 +1,17 @@
 <table border="0" cellspacing="0" cellpadding="0" width="100%" style="height: 100%">
 <tr>
-       <td height="10%" align="center">{!__BIRTHDAY_HEADER!}</td>
+       <td height="10%" align="center">
+               $content[header]
+       </td>
 </tr>
 <tr>
-       <td height="80%" align="center">{!__MSG!}</td>
+       <td height="80%" align="center">
+               $content[msg]
+       </td>
 </tr>
 <tr>
-       <td height="10%" align="center">{!__BIRTHDAY_FOOTER!}</td>
+       <td height="10%" align="center">
+               $content[footer]
+       </td>
 </tr>
 </table>
index d06a4ae596bf374c30ce85cb69e69e44b6ee1cdc..17a05701cca7afb611d41aaafc43ffaa836429fa 100644 (file)
@@ -1,8 +1,8 @@
-<div class="big">Herzlichen Gl&uuml;ckwunsch zum Geburtstag!</div> <br />
+<div class="big">Herzlichen Gl&uuml;ckwunsch zum Geburtstag!</div><br />
 <br />
-Hallo {!__GENDER!} {!__SNAME!} {!__FNAME!}!<br />
+Hallo $content[gender] $content[surname] $content[family]!<br />
 <br />
 Wir das Team von <span class="nobr">{!MAIN_TITLE!}</span> w&uuml;schen Ihnen
 alles Gute und Gesundheit zum Geburtstag. Als kleines Geschenk von uns haben wir
-Ihnen soeben <span class="nobr">{!__GIFT!} {!POINTS!}</span> Ihrem Account
+Ihnen soeben <span class="nobr">$content[points] {!POINTS!}</span> Ihrem Account
 gutgeschrieben!
index d1a91d7c0f9263c73b418df713a1144df9b034f8..eb0cef1c5d1432811a2c09cfb2ae9d53cc41590c 100644 (file)
@@ -1,11 +1,12 @@
 <div align="center">
 <div class="footer_box">
-<div class="footer_lines">
-       {!TITLE!} v{!FULL_VERSION!} R{!CURR_SVN_REVISION!}<br />
+<div class="footer_lines" style="float:left">
+       {!TITLE!}
+       v{!FULL_VERSION!} R{!CURR_SVN_REVISION!}<br />
        {!COPY!}
 </div>
 
-<div class="footer_lines">
+<div class="footer_lines" style="float:right">
        This website&#39;s engine is free software which is released under the GNU
        GPL either version 2 of the License.
 </div>
diff --git a/templates/de/html/ext/ext_lead.tpl b/templates/de/html/ext/ext_lead.tpl
new file mode 100644 (file)
index 0000000..01265f5
--- /dev/null
@@ -0,0 +1,21 @@
+Diese Erweiterung bietet Ihnen die M&ouml;glichkeit an, Lead-Code von
+Sponsornetzwerken in die Mitgliederanmeldung einzubinden. Dazu m&uuml;ssen
+Sie derzeit den Lead-Code in das Template <u>lead_code.tpl</u> einbinden
+(mehrere Lead-Codes sind auch m&ouml;glich!).<br />
+<br />
+Meistens m&uuml;ssen Sie irgentwelche eindeutigen Daten an den Lead-Code
+&uuml;bergeben. Dies k&ouml;nnen z.B. doe User-Id und/oder die Email-Adresse
+sein. Beides wird von diesem Script derzeit auch unterst&uuml;tzt.<br />
+<br />
+Wenn Sie die User-Id &uuml;bertragen m&ouml;chten, so verwenden Sie die
+Template-Variable <u>lead_uid</u>, m&ouml;chten Sie die Email-Adresse von der
+Anmeldung &uuml;bertragen, verwenden Sie <u>lead_email</u>. Dazu ein
+Beispielcode:<br />
+<br />
+&lt;img border=&quot;0&quot; alt=&quot;Lead&quot; width=&quot;1&quot; height=&quot;1&quot;
+ src=&quot;http://some-sponsor-network/lead-image.php?campaign=xxx&amp;user_data=&#36;content[lead_uid]_$content[lead_email]&quot; /&gt;
+<br />
+Sollten Sie dazu noch Fragen haben, so kommen Sie doch einfach <a target="_blank"
+ href="http://forum.mxchange.org" title="Direkt-Link zum Support-Forum">in das
+Forum</a>. Mein Support-Team und ich beantworten Ihnen gerne Ihre Fragen dazu
+und helfen Ihnen bei Schwierigkeiten weiter.
index 8f335100bf1c9b73149187fd40e2b3f5b211e743..a71da4d4434f8077856fb2e9ff59407fb12f4e8c 100644 (file)
@@ -1,6 +1,5 @@
 <div align="center">
-<table border="0" cellspacing="0" cellpadding="0"
-       class="beg_table dashed" width="500">
+<table border="0" cellspacing="0" cellpadding="0" class="beg_table dashed" width="500">
        <tr>
                <td width="10" rowspan="10" class="seperator">&nbsp;</td>
                <td height="5" class="seperator">&nbsp;</td>
index 978897310476b9429a1faf02b9c05d16fea48e8f..e596704e9fe8ac11c9e56f070a6656dbe330672c 100644 (file)
@@ -6,7 +6,7 @@
                <table border="0" cellspacing="0" cellpadding="0" width="100%">
                        <tr>
                                <td align="center"><a target="_parent"
-                                       href="{!URL!}/modules.php?module=index&amp;what=welcome$content">
+                                       href="{!URL!}/modules.php?module=index&amp;what=welcome">
                                <!-- <img src="{!THEME_URL!}/images/index_logo.jpg" alt="{!MAIN_TITLE!}" title="{!MAIN_TITLE!}" border="0"> //-->
                                <div class="big">{!MAIN_TITLE!}</div> </a></td>
                        </tr>
@@ -22,7 +22,7 @@
        <tr>
                <td align="center" height="26%"><div class="big">[&nbsp;<a
                        target="_parent"
-                       href="{!URL!}/modules.php?module=index&amp;what=welcome$content">Weiter...</a>&nbsp;]</div>
+                       href="{!URL!}/modules.php?module=index&amp;what=welcome">Weiter...</a>&nbsp;]</div>
                </td>
        </tr>
        <tr>
index c38ae9392df756cf087faab3cc179a940c743f50..ae712fe076517490846554446c83bb823b040f16 100644 (file)
@@ -1,5 +1,4 @@
-<table border="0" cellspacing="0" cellpadding="0"
-       class="beg_table dashed" width="500">
+<table border="0" cellspacing="0" cellpadding="0" class="beg_table dashed" width="500">
        <tr>
                <td width="10" rowspan="9" class="seperator">&nbsp;</td>
                <td height="5" class="seperator">&nbsp;</td>
index 90174b132154a5bcd098c411fa3005cf36d0ee99..5cc32235d5206ce288fe7be6bfc839ae636a5814 100644 (file)
@@ -1,12 +1,17 @@
-<table border="0" cellspacing="0" cellpadding="0" width="100%"
-       style="height: 100%">
-       <tr>
-               <td height="10%" align="center">{!__BONUS_HEADER!}</td>
-       </tr>
-       <tr>
-               <td height="80%" align="center">{!__BONUS_MSG!}</td>
-       </tr>
-       <tr>
-               <td height="10%" align="center">{!__BONUS_FOOTER!}</td>
-       </tr>
-</table>
\ No newline at end of file
+<table border="0" cellspacing="0" cellpadding="0" width="100%" style="height: 100%">
+<tr>
+       <td height="10%" align="center">
+               $content[header]
+       </td>
+</tr>
+<tr>
+       <td height="80%" align="center">
+               $content[msg]
+       </td>
+</tr>
+<tr>
+       <td height="10%" align="center">
+               $content[footer]
+       </td>
+</tr>
+</table>
index 4fffd92e26680f7f95347a60408b94b3f01a5a1e..b0d869c9040eb3df8ab82cef9fc9d97b265ec130 100644 (file)
@@ -1,10 +1,10 @@
-{--HELLO--} {!__GENDER!} {!__SNAME!} {!__FNAME!}!
+{--HELLO--} $content[gender] $content[surname] $content[family]!
 <br />
 <br />
 {--BONUS_SHOW_HEADER_LINE_1--}
 <strong>{!POINTS!}</strong>
 {--BONUS_SHOW_HEADER_LINE_2--}
-<strong>{!__MAILID!}</strong>
+<strong>$content[mailid]</strong>
 {--BONUS_SHOW_HEADER_LINE_3--}:
 <br />
 <br />
@@ -14,7 +14,7 @@
                <td width="120" align="center" class="member_header bottom2"><strong>{!_UID!}:</strong></td>
                <td width="100" align="center" class="member_header bottom2"><strong>{!POINTS!}:</strong></td>
        </tr>
-       {!__RANK_ROWS!}
+       $content[rows]
        <tr>
                <td colspan="3" class="member_footer" align="center"><div class="tiny member_note">&nbsp;</div></td>
        </tr>
@@ -23,6 +23,6 @@
 <div>{!__YOUR_RANKING_LINE!}</div>
 
 <div class="member_note">
-       {--BONUS_SHOW_FOOTER_NOTE_1--}<br />
-       {--BONUS_SHOW_FOOTER_NOTE_2--}
+       Wir w&uuml;nschen allen Gewinnern viel Gl&uuml;ck bei der monatlichen Aktiv-Rallye!<br />
+       Es k&ouml;nnen nur die ersten <u>$content[total_ranks]</u> die Aktiv-Rallye gewinnen. Der Rechtsweg ist ausgeschlossen.
 </div>
index f933089bbbc7ce6c190fd12b584ab656129ef0d7..0834ed3adc514e1883bdc9e2a9a1d388e641475d 100644 (file)
--- a/view.php
+++ b/view.php
@@ -48,7 +48,7 @@ $GLOBALS['module'] = 'view';
 $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
 
 if (((REQUEST_ISSET_GET(('user'))) || (REQUEST_ISSET_GET(('reseller')))) && (REQUEST_ISSET_GET(('banner')))) {
        // for later things... ;-)
@@ -61,7 +61,7 @@ if (((REQUEST_ISSET_GET(('user'))) || (REQUEST_ISSET_GET(('reseller')))) && (REQ
                        array(bigintval(REQUEST_GET('banner'))), __FILE__, __LINE__);
 
                $type = substr($url, -3);
-               header ('Content-Type: image/' . $type);
+               sendHeader('Content-Type: image/' . $type);
                redirectToUrl($url, false);
        } else {
                // Free memory