]> git.mxchange.org Git - mailer.git/commitdiff
More rewrites from double- to single-quote
authorRoland Häder <roland@mxchange.org>
Tue, 17 Mar 2009 00:15:21 +0000 (00:15 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 17 Mar 2009 00:15:21 +0000 (00:15 +0000)
38 files changed:
admin.php
inc/autopurge/purge-inact.php
inc/extensions.php
inc/filters.php
inc/functions.php
inc/language/order_de.php
inc/libs/holiday_functions.php
inc/libs/order_functions.php
inc/libs/task_functions.php
inc/libs/user_functions.php
inc/mails/beg_mails.php
inc/mails/bonus_mails.php
inc/modules/admin.php
inc/modules/admin/action-logout.php
inc/modules/admin/what-add_rallye.php
inc/modules/admin/what-del_holiday.php
inc/modules/admin/what-del_sponsor.php
inc/modules/admin/what-extensions.php
inc/modules/admin/what-list_autopurge.php
inc/modules/admin/what-list_country.php
inc/modules/admin/what-lock_sponsor.php
inc/modules/frametester.php
inc/modules/guest/what-admin.php
inc/modules/guest/what-login.php
inc/modules/guest/what-mediadata.php
inc/modules/guest/what-sponsor_login.php
inc/modules/index.php
inc/modules/member/what-holiday.php
inc/modules/member/what-html_mail.php
inc/modules/member/what-logout.php
inc/modules/member/what-order.php
inc/modules/member/what-unconfirmed.php
inc/modules/order.php
inc/mysql-manager.php
inc/reset/reset_holiday.php
inc/session.php
templates/de/html/admin/admin_config_order.tpl
templates/de/html/admin/admin_config_order_form.tpl

index 29886806c58f3d5a2ff8180e9a53b96e73d47a48..d8c4f7cec6633a3aec73d533678b9e126cdb7ec7 100644 (file)
--- a/admin.php
+++ b/admin.php
@@ -55,10 +55,10 @@ if (isInstalled()) {
        // Is the admin logged-in and no sql_patches installed?
        if ((IS_ADMIN()) && (!EXT_IS_ACTIVE('sql_patches'))) {
                // Extension 'sql_patches' is missing!
-               LOAD_URL("modules.php?module=admin&amp;sql_patches=1");
+               LOAD_URL('modules.php?module=admin&amp;sql_patches=1');
        } else {
                // Default redirect
-               LOAD_URL("modules.php?module=admin");
+               LOAD_URL('modules.php?module=admin');
        }
 } else {
        // You have to install first!
index 9d630b20583f9ef5374fcf727425bc4eb81c6519..a69541665e5dbfade803f367d2da1e2535ba807b 100644 (file)
@@ -70,7 +70,7 @@ if (getConfig('autopurge_inactive') == 'Y') {
        // Check for new holiday extension
        if (GET_EXT_VERSION('holiday') >= '0.1.3') {
                // Include only users with no active holiday
-               $EXCLUDE_LIST .= " AND d.holiday_active='N'";
+               $EXCLUDE_LIST .= " AND d.`holiday_active`='N'";
        } // END - if
 
        // Check for all accounts
index 0d542d6d38f9af262fbe026b7e4d02c884177a7f..2f89c57450bba192a7ebd7bf58f58c8362a27ceb 100644 (file)
@@ -325,7 +325,7 @@ function REGISTER_EXTENSION ($ext_name, $task_id, $dry_run = false, $logout = tr
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ": LOAD!");
                if ($logout === true) {
                        // Then redirect to logout
-                       LOAD_URL("modules.php?module=admin&amp;logout=1&amp;".$EXT_LOAD_MODE."=sql_patches");
+                       LOAD_URL('modules.php?module=admin&amp;logout=1&amp;' . $EXT_LOAD_MODE . '=sql_patches');
                } else {
                        // Add temporary filter
                        REGISTER_FILTER('shutdown', 'REDIRECT_TO_LOGOUT_SQL_PATCHES', true, true);
@@ -395,7 +395,7 @@ function EXTENSION_RUN_SQLS ($ext_id, $load_mode) {
        if ((EXT_GET_CURR_NAME() == 'sql_patches') && (($load_mode == 'register') || ($load_mode == 'remove'))) {
                // Then redirect to logout
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ": LOAD!");
-               LOAD_URL("modules.php?module=admin&amp;logout=1&amp;".$load_mode."=sql_patches");
+               LOAD_URL('modules.php?module=admin&amp;logout=1&amp;' . $load_mode . '=sql_patches');
        } // END - if
 }
 
@@ -405,7 +405,7 @@ function EXT_IS_ACTIVE ($ext_name) {
        if ((!isInstalled()) || (isInstalling()) || (empty($ext_name))) return false;
 
        // Not active is the default
-       $active = "N";
+       $active = 'N';
 
        // Check cache
        if (isset($GLOBALS['cache_array']['extensions']['ext_active'][$ext_name])) {
index b98a265a72c202bb21470e0eecd13b8e81c26367..0c3b092e284dd80ba34a96ed8b5e90250f62124c 100644 (file)
@@ -349,11 +349,11 @@ function FILTER_REDIRECT_TO_LOGOUT_SQL_PATCHES () {
        // Is the element set?
        if (isset($GLOBALS['ext_load_mode'])) {
                // Redirect here
-               LOAD_URL("modules.php?module=admin&amp;logout=1&amp;".$GLOBALS['ext_load_mode']."=sql_patches");
+               LOAD_URL('modules.php?module=admin&amp;logout=1&amp;' . $GLOBALS['ext_load_mode'] . '=sql_patches');
        } // END - if
 
        // This should not happen!
-       DEBUG_LOG(__FUNCTION__, __LINE__, "Cannot auto-logout because no extension load-mode has been set.");
+       DEBUG_LOG(__FUNCTION__, __LINE__, 'Cannot auto-logout because no extension load-mode has been set.');
 }
 
 // Filter for auto-activation of a extension
index a04e852dad9b564f858186f52dee27e6c79bedd6..8a2ad0e162084d1993b525b9b2c694a59ef05d77 100644 (file)
@@ -621,7 +621,7 @@ function DEREFERER ($URL) {
        // Don't de-refer our own links!
        if (substr($URL, 0, strlen(URL)) != URL) {
                // De-refer this link
-               $URL = "modules.php?module=loader&amp;url=".encodeString(compileUriCode($URL));
+               $URL = 'modules.php?module=loader&amp;url=' . encodeString(compileUriCode($URL));
        } // END - if
 
        // Return link
@@ -631,13 +631,13 @@ function DEREFERER ($URL) {
 // Translate Uni*-like gender to human-readable
 function TRANSLATE_GENDER ($gender) {
        // Default
-       $ret = "!{$gender}!";
+       $ret = '!' . $gender . '!';
 
        // Male/female or company?
        switch ($gender) {
-               case "M": $ret = getMessage('GENDER_M'); break;
-               case "F": $ret = getMessage('GENDER_F'); break;
-               case "C": $ret = getMessage('GENDER_C'); break;
+               case 'M': $ret = getMessage('GENDER_M'); break;
+               case 'F': $ret = getMessage('GENDER_F'); break;
+               case 'C': $ret = getMessage('GENDER_C'); break;
                default:
                        // Log unknown gender
                        DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown gender %s detected.", $gender));
@@ -667,21 +667,23 @@ function SELECTION_COUNT ($array) {
        }
        return $ret;
 }
+
 //
 function IMG_CODE ($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."\">";
+       return '<IMG border="0" alt="Code" src="{!URL!}/mailid_top.php?uid=' . $uid . '&amp;' . $type . '=' . $DATA . '&amp;mode=img&amp;code=' . $code . '" />';
 }
+
 //
 function TRANSLATE_STATUS ($status) {
        switch ($status)
        {
-       case "UNCONFIRMED":
-       case "CONFIRMED":
-       case "LOCKED":
+       case 'UNCONFIRMED':
+       case 'CONFIRMED':
+       case 'LOCKED':
                $ret = getMessage(sprintf("ACCOUNT_%s", $status));
                break;
 
-       case "":
+       case '':
        case null:
                $ret = getMessage('ACCOUNT_DELETED');
                break;
@@ -712,7 +714,7 @@ function GET_LANGUAGE() {
                $ret = $GLOBALS['cache_array']['language'];
        } elseif (!empty($lang)) {
                // Check if main language file does exist
-               if (FILE_READABLE(constant('PATH')."inc/language/".$lang.".php")) {
+               if (FILE_READABLE(constant('PATH').'inc/language/'.$lang.'.php')) {
                        // Okay found, so let's update cookies
                        SET_LANGUAGE($lang);
                }
@@ -739,14 +741,14 @@ function SET_LANGUAGE ($lang) {
        set_session('mx_lang', $lang);
 }
 //
-function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") {
+function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID='0') {
        global $DATA, $_CONFIG;
 
        // Make sure all template names are lowercase!
        $template = strtolower($template);
 
        // Default 'nickname' if extension is not installed
-       $nick = "---";
+       $nick = '---';
 
        // Prepare IP number and User Agent
        $REMOTE_ADDR     = GET_REMOTE_ADDR();
index 5efc8729d91d5a2375750c52b4931567ba595e2c..6b931a8a38397819248d62d88111b97dc3f91082 100644 (file)
@@ -45,13 +45,13 @@ if (!defined('__SECURITY')) {
 // Language definitions
 define('ADMIN_ORDER_SETTINGS', "Einstellungen - Mailbuchung");
 define('ADMIN_ORDER_MISC_SETTINGS', "Weitere Einstellungen");
-define('ORDER_MAX_ORDER_SELECT', "Wie viele Mailbuchungen sollen die Mitglieder maximal versenden k&ouml;nnen?");
-define('ORDER_MIN_RECEIVER_PER_ORDER', "Minimale Empf&auml;nger pro Mailbuchung");
+define('ADMIN_ORDER_MAX_ORDER_SELECT', "Wie viele Mailbuchungen sollen die Mitglieder maximal versenden k&ouml;nnen?");
+define('ADMIN_ORDER_MIN_RECEIVER_PER_ORDER', "Minimale Empf&auml;nger pro Mailbuchung");
 define('ADMIN_ORDER_MAX', "So viele wie m&ouml;glich.");
 define('ADMIN_ORDER_ORDER', "So viele wie auf Empfang eingestellt.");
-define('ORDER_ALLOWED_RECEIVE', "Sie k&ouml;nnen heute noch <u>%s</u> von <u>%s</u> Mailbuchungen aufgeben.");
-define('ORDER_ALLOWED_MAX', "Sie k&ouml;nnen solange Mailbuchungen aufgeben, bis alle Mitglieder nicht mehr empfangsbereit sind.");
-define('ORDER_ALLOWED_UNKNOWN', "Fehler in Konfiguration erkannt! Bitte den Administrator benachrichtigen.");
+define('MEMBER_ORDER_ALLOWED_RECEIVE', "Sie k&ouml;nnen heute noch <u>%s</u> von <u>%s</u> Mailbuchungen aufgeben.");
+define('MEMBER_ORDER_ALLOWED_MAX', "Sie k&ouml;nnen solange Mailbuchungen aufgeben, bis alle Mitglieder nicht mehr empfangsbereit sind.");
+define('MEMBER_ORDER_ALLOWED_UNKNOWN', "Fehler in Konfiguration erkannt! Bitte den Administrator benachrichtigen.");
 define('ADMIN_ORDER_SELECTION_COLUMN', "Tabellenspalte, nach der umsortiert werden soll");
 define('ADMIN_ORDER_SELECTION_MODE', "Sortierreihenfolge");
 define('ADMIN_ORDER_SELECTION_SETTINGS', "Auswahlverfahren der Empf&auml;nger");
index 8be463ca2b7fae06b722e197c9b529869c9d06bd..6f62bfac5fd95252ba60f261af826bd78c2721f7 100644 (file)
@@ -63,7 +63,7 @@ ORDER BY userid", __FUNCTION__, __LINE__);
 
                        // Unlock account
                        ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
-SET holiday_active='N', holiday_activated='0'
+SET `holiday_active`='N', holiday_activated='0'
 WHERE userid=%s LIMIT 1", array(bigintval($content['userid'])), __FUNCTION__, __LINE__, false));
 
                        // Prepare array
index bae9a830512891883af608152fd4a349c9f3f3a5..e839164e538f3412de31a32ebe5fa322936923bf 100644 (file)
@@ -42,15 +42,15 @@ if (!defined('__SECURITY')) {
        require($INC);
 }
 
-function ORDER_SELECT_OPTION_LIST($default) {
+function ORDER_SELECT_OPTION_LIST ($default) {
        // Currenty the list is hardcoded...
-       $LIST = array('userid', "zip", 'country', 'email', "birth_year", "last_online", "ref_clicks", "total_logins", "mail_orders");
+       $LIST = array('userid', 'zip', 'country', 'email', 'birth_year', 'last_online', 'ref_clicks', 'total_logins', 'mail_orders');
        $OUT = '';
        foreach ($LIST as $item) {
                $selected = '';
                if ($item == $default) $selected = ' selected="selected"';
-               $OUT .= "<option value=\"".$item."\"".$selected.">{--ORDER_SELECT_COLUMN_".strtoupper($item)."--}</option>\n";
-       }
+               $OUT .= '<option value="' . $item . '"' . $selected . '>{--ORDER_SELECT_COLUMN_' . strtoupper($item) . '--}</option>';
+       } // END - foreach
 
        // Return the output
        return $OUT;
index e06194c93f21b9af1a2c6e4a743314897ed46a18..8d9e24c187edba13d46f425116cfe3ff97d2cf4d 100644 (file)
@@ -262,7 +262,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) {
                if (EXT_IS_ACTIVE('beg'))                  $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_uid')."";
                if (EXT_IS_ACTIVE('bonus'))                $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_uid')."";
                if (EXT_IS_ACTIVE('doubler'))              $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_uid')."";
-               if (GET_EXT_VERSION('holiday') >= '0.1.3') $EXCLUDE_LIST .= " AND d.holiday_active='N'";
+               if (GET_EXT_VERSION('holiday') >= '0.1.3') $EXCLUDE_LIST .= " AND d.`holiday_active`='N'";
 
                // Check for all accounts
                ADD_SQL("SELECT DISTINCT d.userid, d.email, d.last_online
index 0f4afe124c34f7038c065b1f8d4c0a4c64b69d91..32be05f4b6aed24ae2c5d0a3234322fae09e436e 100644 (file)
@@ -211,7 +211,7 @@ WHERE `email`='%s'".$locked." LIMIT 1",
                list($uid) = SQL_FETCHROW($result);
 
                // Rewrite email address to contact link
-               $email = "{!URL!}/modules.php?module=".$mod."&amp;what=user_contct&amp;uid=".bigintval($uid);
+               $email = '{!URL!}/modules.php?module=' . $mod . '&amp;what=user_contct&amp;uid=' . bigintval($uid);
        } // END - if
 
        // Free memory
@@ -227,7 +227,7 @@ function SELECT_RANDOM_REFID () {
        $refid = 0;
 
        // Is the extension version fine?
-       if (GET_EXT_VERSION('user') >= "0.3.4") {
+       if (GET_EXT_VERSION('user') >= '0.3.4') {
                // Get all user ids
                $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", 'userid', "status", true, " AND `rand_confirmed` >= ".getConfig('user_min_confirmed')."");
 
@@ -267,16 +267,16 @@ function USER_DO_LOGIN ($uid, $passwd) {
        // Add last_login if available
        $lastOnline = ''; 
        if (GET_EXT_VERSION('sql_patches') >= '0.2.8') {
-               $lastOnline = ", last_login";
+               $lastOnline = ', last_login';
        } // END - if
 
        // Init array
        $content = array(
-               'password'    => "",
-               'userid'      => "",
+               'password'    => '',
+               'userid'      => '',
                'last_online' => 0,
                'last_login'  => 0,
-               'hash'        => ""
+               'hash'        => ''
        );
 
        // Check login data
@@ -351,18 +351,18 @@ function USER_DO_LOGIN ($uid, $passwd) {
                                        // Procedure to checking for login data
                                        if (($GLOBALS['bonus_payed']) && (EXT_IS_ACTIVE('bonus'))) {
                                                // Bonus added (just displaying!)
-                                               $URL = "modules.php?module=chk_login&amp;mode=bonus";
+                                               $URL = 'modules.php?module=chk_login&amp;mode=bonus';
                                        } else {
                                                // Bonus not added
-                                               $URL = "modules.php?module=chk_login&amp;mode=login";
+                                               $URL = 'modules.php?module=chk_login&amp;mode=login';
                                        }
                                } else {
                                        // Cannot update counter!
-                                       $URL = "modules.php?module=index&amp;what=login&amp;login=".getCode('CNTR_FAILED');
+                                       $URL = 'modules.php?module=index&amp;what=login&amp;login='.getCode('CNTR_FAILED');
                                }
                        } else {
                                // Cookies not setable!
-                               $URL = "modules.php?module=index&amp;what=login&amp;login=".getCode('NO_COOKIES');
+                               $URL = 'modules.php?module=index&amp;what=login&amp;login='.getCode('NO_COOKIES');
                        }
                } elseif (GET_EXT_VERSION('sql_patches') >= '0.6.1') {
                        // Update failture counter
@@ -370,7 +370,7 @@ function USER_DO_LOGIN ($uid, $passwd) {
                                array($uid), __FUNCTION__, __LINE__);
 
                        // Wrong password!
-                       $URL = "modules.php?module=index&amp;what=login&amp;login=".getCode('WRONG_PASS');
+                       $URL = 'modules.php?module=index&amp;what=login&amp;login='.getCode('WRONG_PASS');
                }
        } elseif ((($probe_nickname) && (!empty($content['userid']))) || ($content['userid'] == $uid)) {
                // Other account status?
@@ -391,10 +391,10 @@ function USER_DO_LOGIN ($uid, $passwd) {
                }
 
                // Construct URL
-               $URL = "modules.php?module=index&amp;what=login&amp;login=".$errorCode;
+               $URL = 'modules.php?module=index&amp;what=login&amp;login='.$errorCode;
        } else {
                // ID not found!
-               $URL = "modules.php?module=index&amp;what=login&amp;login=".getCode('WRONG_ID');
+               $URL = 'modules.php?module=index&amp;what=login&amp;login='.getCode('WRONG_ID');
        }
 
        // Return URL
@@ -404,7 +404,7 @@ function USER_DO_LOGIN ($uid, $passwd) {
 // Try to send a new password for the given user account
 function USER_DO_NEW_PASSWORD ($email, $uid) {
        // Compile email when found in address (only secure chars!)
-       if (!empty($email)) $email = str_replace("{DOT}", '.', $email);
+       if (!empty($email)) $email = str_replace('{DOT}', '.', $email);
 
        // Init result and error
        $errorCode = '';
@@ -425,7 +425,7 @@ function USER_DO_NEW_PASSWORD ($email, $uid) {
                        array($email), __FUNCTION__, __LINE__);
        } else {
                // Userid not set!
-               DEBUG_LOG(__FUNCTION__, __LINE__, "Userid is not set! BUG!");
+               DEBUG_LOG(__FUNCTION__, __LINE__, 'Userid is not set! BUG!');
                $errorCode = getCode('WRONG_ID');
        }
 
@@ -434,14 +434,14 @@ function USER_DO_NEW_PASSWORD ($email, $uid) {
                // This data is valid, so we create a new pass... :-)
                list($uid, $status) = SQL_FETCHROW($result);
 
-               if ($status == "CONFIRMED") {
+               if ($status == 'CONFIRMED') {
                        // Ooppps, this was missing! ;-) We should update the database...
                        $NEW_PASS = GEN_PASS();
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET password='%s' WHERE userid=%s LIMIT 1",
                                array(generateHash($NEW_PASS), $uid), __FUNCTION__, __LINE__);
 
                        // Prepare data and message for email
-                       $msg = LOAD_EMAIL_TEMPLATE("new-pass", array('new_pass' => $NEW_PASS), $uid);
+                       $msg = LOAD_EMAIL_TEMPLATE('new-pass', array('new_pass' => $NEW_PASS), $uid);
 
                        // ... and send it away
                        SEND_EMAIL($uid, getMessage('GUEST_NEW_PASSWORD'), $msg);
@@ -453,11 +453,11 @@ function USER_DO_NEW_PASSWORD ($email, $uid) {
                        $errorCode = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status);
 
                        // Load URL
-                       LOAD_URL("modules.php?module=index&amp;what=login&amp;login=".$errorCode);
+                       LOAD_URL('modules.php?module=index&amp;what=login&amp;login='.$errorCode);
                }
        } else {
                // ID or email is wrong
-               LOAD_TEMPLATE('admin_settings_saved', false, "<span class=\"guest_failed\">{--GUEST_WRONG_ID_EMAIL--}</span>");
+               LOAD_TEMPLATE('admin_settings_saved', false, '<span class="guest_failed">{--GUEST_WRONG_ID_EMAIL--}</span>');
        }
 
        // Return the error code
index 5cb68c554b569bb2006d5d785d174570cc0033ed..c8d1c964e8001a137c2e32b785f801a0bebca9fa 100644 (file)
@@ -131,7 +131,7 @@ LIMIT 1",
                                $UIDs[] = $content['userid'];
                        } else {
                                // Send normal notification mail to the members
-                               $message = LOAD_EMAIL_TEMPLATE("beg_".$MODE."_notify", array(), $content['userid']);
+                               $message = LOAD_EMAIL_TEMPLATE('beg_' . $MODE . '_notify', array(), $content['userid']);
                                SEND_EMAIL($content['email'], $subject, $message);
                        }
                } // END - while
@@ -142,7 +142,7 @@ LIMIT 1",
                        $RECEIVER = implode(';', $UIDs);
 
                        // Prepare URL
-                       $URL = "modules.php?module=index&amp;what=login";
+                       $URL = 'modules.php?module=index&amp;what=login';
 
                        // Insert mail
                        ADD_BONUS_MAIL_TO_QUEUE($subject, $message, $RECEIVER, getConfig('beg_notify_bonus'), getConfig('beg_notify_wait'), $URL, 0, 'normal', SQL_NUMROWS($result_main));
index 6104e5597fb5804ce66d314a15bcd9d21970dadf..041fd602f89d3a493e073d92fa4ba43867d36f3e 100644 (file)
@@ -89,7 +89,7 @@ if (!empty($sql)) {
        $subject = constant('BONUS_RALLYE_'.strtoupper($MODE).'_NOTIFY');
 
        // Load message body for bonus mails
-       $message = LOAD_EMAIL_TEMPLATE("bonus_en_notify_body", '', "{PER}uid{PER}");
+       $message = LOAD_EMAIL_TEMPLATE('bonus_en_notify_body', '', '{PER}uid{PER}');
        $RECEIVER = ''; $UIDs = array();
 
        // Check for accounts to be notified
@@ -110,7 +110,7 @@ LIMIT 1",
                                $UIDs[] = $content['userid'];
                        } else {
                                // Send normal notification mail to the members
-                               $message = LOAD_EMAIL_TEMPLATE("bonus_".$MODE."_notify", array(), $content['userid']);
+                               $message = LOAD_EMAIL_TEMPLATE('bonus_' . $MODE . '_notify', array(), $content['userid']);
                                SEND_EMAIL($content['email'], $subject, $message);
                        }
                } // END - while
@@ -121,7 +121,7 @@ LIMIT 1",
                        $RECEIVER = implode(';', $UIDs);
 
                        // Prepare URL
-                       $URL = "modules.php?module=index&amp;what=login";
+                       $URL = 'modules.php?module=index&amp;what=login';
 
                        // Insert mail
                        ADD_BONUS_MAIL_TO_QUEUE($subject, $message, $RECEIVER, getConfig('bonus_notify_points'), getConfig('bonus_notify_wait'), $URL, 0, 'normal', SQL_NUMROWS($result_main));
index df7b6b569307515b038657295c35ca9d8e857137..f92332230e8a55c3b6dfee8ee3604326db46d28c 100644 (file)
@@ -73,26 +73,26 @@ if (!isAdminRegistered()) {
                        $done = changeDataInFile(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
                        if ($done === true) {
                                // Registering is done
-                               LOAD_URL("modules.php?module=admin&amp;register=done");
+                               LOAD_URL('modules.php?module=admin&amp;register=done');
                        } else {
                                $ret = getMessage('ADMIN_CANNOT_COMPLETE');
                        }
                        break;
 
-               case "failed":
+               case 'failed':
                        $ret = getMessage('ADMIN_REGISTER_FAILED');
                        break;
 
-               case "already":
+               case 'already':
                default:
-                       if ($ret == "already") {
+                       if ($ret == 'already') {
                                // Admin does already exists!
                                $ret = getMessage('ADMIN_LOGIN_ALREADY_REG');
                        } else {
                                // Any other kind will be logged and interpreted as 'done'
                                DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown return code %s from CHECK_ADMIN_LOGIN() and interpreted as 'done'!", $ret));
                                // @TODO Why is this set to 'done'?
-                               $ret = "done";
+                               $ret = 'done';
                        }
 
                        // Admin still not registered?
@@ -101,23 +101,23 @@ if (!isAdminRegistered()) {
                                changeDataInFile(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
 
                                // Load URL for login
-                               LOAD_URL("modules.php?module=admin");
+                               LOAD_URL('modules.php?module=admin');
                        } // END - if
                        break;
                }
        }
 
        // Whas that action okay?
-       if ($ret != "done") {
-               // Fixes another "Notice"
+       if ($ret != 'done') {
+               // Fixes another notice
                if (REQUEST_ISSET_POST(('login'))) {
                        define('__LOGIN_VALUE', REQUEST_POST('login'));
                } else {
                        define('__LOGIN_VALUE', '');
                }
 
-               // Yet-another "Notice" fix
-               if ((IS_FORM_SENT()) && (REQUEST_POST('ok') == "***")) {
+               // Yet-another notice-fix
+               if ((IS_FORM_SENT()) && (REQUEST_POST('ok') == '***')) {
                        // No login entered?
                        if (!REQUEST_ISSET_POST(('login'))) $loginMessage = getMessage('ADMIN_NO_LOGIN');
 
@@ -131,8 +131,8 @@ if (!isAdminRegistered()) {
                        if (strlen(REQUEST_POST('pass')) < 4) $passwdMessage = getMessage('ADMIN_SHORT_PASS');
 
                        // Output error messages
-                       define('__MSG_LOGIN', LOAD_TEMPLATE("admin_login_msg", true, $loginMessage));
-                       define('__MSG_PASS',  LOAD_TEMPLATE("admin_login_msg", true, $passwdMessage));
+                       define('__MSG_LOGIN', LOAD_TEMPLATE('admin_login_msg', true, $loginMessage));
+                       define('__MSG_PASS',  LOAD_TEMPLATE('admin_login_msg', true, $passwdMessage));
 
                        // Reset variables
                        $loginMessage = ''; $passwdMessage = '';
@@ -146,7 +146,7 @@ if (!isAdminRegistered()) {
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_NOT_REGISTERED'));
 
                // Load register template
-               LOAD_TEMPLATE("admin_reg_form");
+               LOAD_TEMPLATE('admin_reg_form');
        }
 } elseif (REQUEST_ISSET_GET(('reset_pass'))) {
        // Is the form submitted?
@@ -158,7 +158,7 @@ if (!isAdminRegistered()) {
                LOAD_TEMPLATE('admin_settings_saved', false, $OUT);
        } elseif (REQUEST_ISSET_GET(('hash'))) {
                // Output form for hash validation
-               LOAD_TEMPLATE("admin_validate_reset_hash_form", false, REQUEST_GET('hash'));
+               LOAD_TEMPLATE('admin_validate_reset_hash_form', false, REQUEST_GET('hash'));
        } elseif ((REQUEST_ISSET_POST(('validate_hash'))) && (REQUEST_ISSET_POST(('login'))) && (REQUEST_ISSET_POST(('hash')))) {
                // Validate the login data and hash
                $valid = ADMIN_VALIDATE_RESET_LINK_HASH_LOGIN(REQUEST_POST('hash'), REQUEST_POST('login'));
@@ -172,7 +172,7 @@ if (!isAdminRegistered()) {
                        );
 
                        // Validation okay so display form for final password change
-                       LOAD_TEMPLATE("admin_reset_password_form", false, $content);
+                       LOAD_TEMPLATE('admin_reset_password_form', false, $content);
                } else {
                        // Cannot validate the login data and hash
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED'));
@@ -184,58 +184,58 @@ if (!isAdminRegistered()) {
                        $OUT = ADMIN_RESET_PASSWORD(REQUEST_POST('login'), REQUEST_POST('pass1'));
 
                        // Output result
-                       LOAD_TEMPLATE("admin_reset_pass_done", false, $OUT);
+                       LOAD_TEMPLATE('admin_reset_pass_done', false, $OUT);
                } else {
                        // Validation failed
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED2'));
                }
        } else {
                // Output reset password form
-               LOAD_TEMPLATE("admin_send_reset_link");
+               LOAD_TEMPLATE('admin_send_reset_link');
        }
 } elseif ((!isSessionVariableSet('admin_login')) || (!isSessionVariableSet('admin_md5')) || (!isSessionVariableSet('admin_last')) || (!isSessionVariableSet('admin_to')) || ((get_session('admin_last') + bigintval(get_session('admin_to')) * 3600 * 24) < time())) {
        // At leat one administrator account was created
        if ((isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5')) && (isSessionVariableSet('admin_last')) && (isSessionVariableSet('admin_to'))) {
                // Timeout for last login, we have to logout first!
-               LOAD_URL("modules.php?module=admin&amp;logout=1");
+               LOAD_URL('modules.php?module=admin&amp;logout=1');
        } // END - if
 
        if (REQUEST_ISSET_GET(('register'))) {
                // Registration of first admin is done
-               if (REQUEST_GET('register') == "done") LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_REGISTER_DONE'));
+               if (REQUEST_GET('register') == 'done') LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_REGISTER_DONE'));
        } // END - if
 
        // Check if the admin has submitted data or not
        if ((IS_FORM_SENT()) && ((!REQUEST_ISSET_POST(('login'))) || (!REQUEST_ISSET_POST(('pass'))) || (strlen(REQUEST_POST('pass')) < 4))) {
-               REQUEST_SET_POST('ok', "***");
+               REQUEST_SET_POST('ok', '***');
        } // END - if
 
-       if ((IS_FORM_SENT()) && (REQUEST_POST('ok') != "***")) {
+       if ((IS_FORM_SENT()) && (REQUEST_POST('ok') != '***')) {
                // All required data was entered so we check his account
                $ret = CHECK_ADMIN_LOGIN(REQUEST_POST('login'), REQUEST_POST('pass'));
 
                // Which status do we have?
                switch ($ret)
                {
-               case "done": // Admin and password are okay, so we log in now
+               case 'done': // Admin and password are okay, so we log in now
                        // Construct URL and redirect
-                       $URL = "modules.php?module=admin&amp;";
+                       $URL = 'modules.php?module=admin&amp;';
 
                        // Rewrite overview module
-                       if ($GLOBALS['what'] == "overview") {
+                       if ($GLOBALS['what'] == 'overview') {
                                $GLOBALS['action'] = GET_ACTION($GLOBALS['module'], $GLOBALS['what']);
                        } // END - if
 
                        // Add data to URL
-                       if (!empty($GLOBALS['what'])) $URL .= "what=".$GLOBALS['what'];
-                        elseif (!empty($GLOBALS['action'])) $URL .= "action=".$GLOBALS['action'];
-                        elseif (REQUEST_ISSET_GET('area')) $URL .= "area=".REQUEST_GET('area');
+                       if (!empty($GLOBALS['what'])) $URL .= 'what='.$GLOBALS['what'];
+                        elseif (!empty($GLOBALS['action'])) $URL .= 'action='.$GLOBALS['action'];
+                        elseif (REQUEST_ISSET_GET('area')) $URL .= 'area='.REQUEST_GET('area');
 
                        // Load URL
                        LOAD_URL($URL);
                        break;
 
-               case "404": // Administrator login not found
+               case '404': // Administrator login not found
                        REQUEST_SET_POST('ok', $ret);
                        $ret = getMessage('ADMIN_NOT_FOUND');
                        destroyAdminSession();
@@ -243,7 +243,7 @@ if (!isAdminRegistered()) {
 
                case 'pass': // Wrong password
                        REQUEST_SET_POST('ok', $ret);
-                       $ret = "{--WRONG_PASS--} [<a href=\"{!URL!}/modules.php?module=admin&amp;reset_pass=1\">{--ADMIN_RESET_PASS--}</a>]\n";
+                       $ret = '{--WRONG_PASS--} [<a href="{!URL!}/modules.php?module=admin&amp;reset_pass=1">{--ADMIN_RESET_PASS--}</a>]';
                        destroyAdminSession();
                        break;
 
@@ -255,7 +255,7 @@ if (!isAdminRegistered()) {
 
        // Error detected?
        // @TODO Rewrite all these constants
-       if ($ret != "done") {
+       if ($ret != 'done') {
                if (REQUEST_ISSET_POST(('login'))) {
                        define('__LOGIN_VALUE', REQUEST_POST('login'));
                } else {
@@ -270,7 +270,7 @@ if (!isAdminRegistered()) {
                        if (!REQUEST_ISSET_POST(('login'))) $loginMessage = getMessage('ADMIN_NO_LOGIN');
 
                        // An error comes back from login?
-                       if ((!empty($ret)) && (REQUEST_POST('ok') == "404")) $loginMessage = $ret;
+                       if ((!empty($ret)) && (REQUEST_POST('ok') == '404')) $loginMessage = $ret;
 
                        // No password entered?
                        if (!REQUEST_ISSET_POST(('pass'))) $passwdMessage = getMessage('ADMIN_NO_PASS');
@@ -282,8 +282,8 @@ if (!isAdminRegistered()) {
                        if ((!empty($ret)) && (REQUEST_POST('ok') == 'pass')) $passwdMessage = $ret;
 
                        // Load message template
-                       define('__MSG_LOGIN', LOAD_TEMPLATE("admin_login_msg", true, $loginMessage));
-                       define('__MSG_PASS' , LOAD_TEMPLATE("admin_login_msg", true, $passwdMessage));
+                       define('__MSG_LOGIN', LOAD_TEMPLATE('admin_login_msg', true, $loginMessage));
+                       define('__MSG_PASS' , LOAD_TEMPLATE('admin_login_msg', true, $passwdMessage));
 
                        // Reset variables
                        unset($loginMessage);
@@ -297,25 +297,25 @@ if (!isAdminRegistered()) {
                // Load login form
                if (!empty($GLOBALS['what'])) {
                        // Restore old what value
-                       $content = array('target' => "what", 'value' => $GLOBALS['what']);
+                       $content = array('target' => 'what', 'value' => $GLOBALS['what']);
                } elseif (!empty($GLOBALS['action'])) {
-                       if ($GLOBALS['action'] != "logout") {
+                       if ($GLOBALS['action'] != 'logout') {
                                // Restore old action value
-                               $content = array('target' => "action", 'value' => $GLOBALS['action']);
+                               $content = array('target' => 'action', 'value' => $GLOBALS['action']);
                        } else {
                                // Set default values
-                               $content = array('target' => "action", 'value' => "login");
+                               $content = array('target' => 'action', 'value' => 'login');
                        }
                } elseif (REQUEST_ISSET_GET('area')) {
                        // Restore old area value
-                       $content = array('target' => "area", 'value' => REQUEST_GET('area'));
+                       $content = array('target' => 'area', 'value' => REQUEST_GET('area'));
                } else {
                        // Set default values
-                       $content = array('target' => "action", 'value' => "login");
+                       $content = array('target' => 'action', 'value' => 'login');
                }
 
                // Load login form template
-               LOAD_TEMPLATE("admin_login_form", false, $content);
+               LOAD_TEMPLATE('admin_login_form', false, $content);
        } // END - if
 } elseif (REQUEST_ISSET_GET(('logout'))) {
        // Only try to remove cookies
@@ -335,11 +335,11 @@ if (!isAdminRegistered()) {
                        LOAD_TEMPLATE(sprintf("admin_logout_%s_remove", $remove));
                } else {
                        // Logged out normally
-                       LOAD_TEMPLATE("admin_logout");
+                       LOAD_TEMPLATE('admin_logout');
                }
        } else {
                // Something went wrong here...
-               LOAD_TEMPLATE('admin_settings_saved', false, "<div class=\"admin_fatal\">{--ADMIN_LOGOUT_FAILED--}</div>");
+               LOAD_TEMPLATE('admin_settings_saved', false, '<div class="admin_fatal">{--ADMIN_LOGOUT_FAILED--}</div>');
 
                // Add fatal message
                addFatalMessage(__FILE__, __LINE__, getMessage('CANNOT_UNREG_SESS'));
@@ -349,25 +349,25 @@ if (!isAdminRegistered()) {
        $ret = CHECK_ADMIN_COOKIES(get_session('admin_login'), get_session('admin_md5'));
        switch ($ret)
        {
-       case "done":
+       case 'done':
                // Check for access control line of current menu entry
                $GLOBALS['acl_allow'] = runFilterChain('check_admin_acl');
 
                // When type of admin menu is not set fallback to old menu system
-               if (!isConfigEntrySet('admin_menu')) setConfigEntry('admin_menu', "OLD");
+               if (!isConfigEntrySet('admin_menu')) setConfigEntry('admin_menu', 'OLD');
 
-               // Check for version and switch between old menu system and new "intelligent menu system"
-               if ((ADMIN_CHECK_MENU_MODE() == "NEW") && (INCLUDE_READABLE("inc/modules/admin/lasys-inc.php"))) {
+               // Check for version and switch between old menu system and new intelligent menu system
+               if ((ADMIN_CHECK_MENU_MODE() == 'NEW') && (INCLUDE_READABLE('inc/modules/admin/lasys-inc.php'))) {
                        // Default area is the entrance, of course
-                       $area = "entrance";
+                       $area = 'entrance';
 
                        // Check for similar URL variable
                        if (REQUEST_ISSET_GET('area')) $area = REQUEST_GET('area');
 
-                       // Load "logical-area menu-system" file
-                       LOAD_INC_ONCE("inc/modules/admin/lasys-inc.php");
+                       // Load logical-area menu-system file
+                       LOAD_INC_ONCE('inc/modules/admin/lasys-inc.php');
 
-                       // Create new-style menu system will "logical areas"
+                       // Create new-style menu system will logical areas
                        ADMIN_LOGICAL_AREA_SYSTEM($area, $act, $GLOBALS['what']);
                } else {
                        // This little call constructs the whole default old and lacky menu system
@@ -376,7 +376,7 @@ if (!isAdminRegistered()) {
                }
                break;
 
-       case "404": // Administrator login not found
+       case '404': // Administrator login not found
                REQUEST_SET_POST('ok', $ret);
                destroyAdminSession();
                addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_NOT_FOUND'));
index fc24f4b30b9ae1e8d32d40f590fc6e3e11f1cab1..6a640501a6d46f9d732a6cf79dcc30bf95f1498a 100644 (file)
@@ -47,14 +47,14 @@ ADD_DESCR('admin', __FILE__);
 
 if (REQUEST_ISSET_POST(('no'))) {
        // Do not logout now
-       LOAD_URL("admin.php");
-} elseif ((REQUEST_ISSET_POST(('yes'))) && ($GLOBALS['action'] == "logout")) {
+       LOAD_URL('admin.php');
+} elseif ((REQUEST_ISSET_POST(('yes'))) && ($GLOBALS['action'] == 'logout')) {
        // Redirect to logout link
-       LOAD_URL("modules.php?module=admin&amp;logout=1");
+       LOAD_URL('modules.php?module=admin&amp;logout=1');
 }
 
 // Load logout form template
-LOAD_TEMPLATE("admin_logout_form");
+LOAD_TEMPLATE('admin_logout_form');
 
 //
 ?>
index ad906910864051d0ee8b20ff09837f03e4db6bf7..2e18ce09b537a79492ee8f0b945cc653ffd2bdeb 100644 (file)
@@ -78,7 +78,7 @@ VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
 
                if (!empty($id)) {
                        // Reload to prices...
-                       LOAD_URL("modules.php?module=admin&amp;what=config_rallye_prices&amp;rallye=".$id);
+                       LOAD_URL('modules.php?module=admin&amp;what=config_rallye_prices&amp;rallye='.$id);
                } else {
                        // Problem detected...
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('RALLYE_PROBLEM_CREATE'));
@@ -93,36 +93,36 @@ VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
 }
 
 // Prepare some constants for the template
-define('_AUTO_ADD_OPTIONS', ADD_OPTION_LINES("/ARRAY/", array('Y','N'), array(YES, NO )));
-define('_ACTIVE_OPTIONS'  , ADD_OPTION_LINES("/ARRAY/", array('N','Y'), array(NO , YES)));
-define('_NOTIFY_OPTIONS'  , ADD_OPTION_LINES("/ARRAY/", array('Y','N'), array(YES, NO )));
+define('_AUTO_ADD_OPTIONS', ADD_OPTION_LINES('/ARRAY/', array('Y','N'), array(YES, NO )));
+define('_ACTIVE_OPTIONS'  , ADD_OPTION_LINES('/ARRAY/', array('N','Y'), array(NO , YES)));
+define('_NOTIFY_OPTIONS'  , ADD_OPTION_LINES('/ARRAY/', array('Y','N'), array(YES, NO )));
 
 // Starting day
-define('_START_SEC'  , ADD_SELECTION("sec"  , "0"              , "start"));
-define('_START_MIN'  , ADD_SELECTION("min"  , "0"              , "start"));
-define('_START_HOUR' , ADD_SELECTION("hour" , date("G", time()), "start"));
-define('_START_DAY'  , ADD_SELECTION("day"  , date("d", time()), "start"));
-define('_START_MONTH', ADD_SELECTION("month", date("m", time()), "start"));
-define('_START_YEAR' , ADD_SELECTION("year" , date('Y', time()), "start"));
+define('_START_SEC'  , ADD_SELECTION('sec'  , '0'              , 'start'));
+define('_START_MIN'  , ADD_SELECTION('min'  , '0'              , 'start'));
+define('_START_HOUR' , ADD_SELECTION('hour' , date('G', time()), 'start'));
+define('_START_DAY'  , ADD_SELECTION('day'  , date('d', time()), 'start'));
+define('_START_MONTH', ADD_SELECTION('month', date('m', time()), 'start'));
+define('_START_YEAR' , ADD_SELECTION('year' , date('Y', time()), 'start'));
 
 // Calcualte ending date
-$D = date("d", time() + (getConfig('one_day') * 7));
-$M = date("m", time() + (getConfig('one_day') * 7));
+$D = date('d', time() + (getConfig('one_day') * 7));
+$M = date('m', time() + (getConfig('one_day') * 7));
 $Y = date('Y', time() + (getConfig('one_day') * 7));
 
 // Ending day
-define('_END_SEC'  , ADD_SELECTION("sec"  , "0"              , "end"));
-define('_END_MIN'  , ADD_SELECTION("min"  , "0"              , "end"));
-define('_END_HOUR' , ADD_SELECTION("hour" , date("G", time()), "end"));
-define('_END_DAY'  , ADD_SELECTION("day"  , $D               , "end"));
-define('_END_MONTH', ADD_SELECTION("month", $M               , "end"));
-define('_END_YEAR' , ADD_SELECTION("year" , $Y               , "end"));
+define('_END_SEC'  , ADD_SELECTION('sec'  , '0'              , 'end'));
+define('_END_MIN'  , ADD_SELECTION('min'  , '0'              , 'end'));
+define('_END_HOUR' , ADD_SELECTION('hour' , date('G', time()), 'end'));
+define('_END_DAY'  , ADD_SELECTION('day'  , $D               , 'end'));
+define('_END_MONTH', ADD_SELECTION('month', $M               , 'end'));
+define('_END_YEAR' , ADD_SELECTION('year' , $Y               , 'end'));
 
 // Transfer (maybe found) templates into constant for the template
 define('_TEMPLATES', RALLYE_TEMPLATE_SELECTION());
 
 // Load template
-LOAD_TEMPLATE("admin_add_rallye");
+LOAD_TEMPLATE('admin_add_rallye');
 
 //
 ?>
index dcd4455412443a5d3d47bb429d3d6b2073583081..e28913976a9583a79912f5edae4a10cc43f71e77 100644 (file)
@@ -68,7 +68,7 @@ WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
 
                        // Update user's account
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
-SET holiday_active='N', holiday_activated='0'
+SET `holiday_active`='N', holiday_activated='0'
 WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__);
 
                        // Remove holiday
index bf0236f70dee581c75b74546b692297d6d1191e1..1367f1718245f81cb1df86c33dfe388f0637682a 100644 (file)
@@ -79,7 +79,7 @@ if (REQUEST_ISSET_GET(('id'))) {
                        LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_DELETED'), bigintval(REQUEST_GET('id'))));
                } elseif (REQUEST_ISSET_POST(('no'))) {
                        // Do not delete him...
-                       LOAD_URL("modules.php?module=admin&amp;what=list_sponsor&amp;id=".bigintval(REQUEST_GET('id')));
+                       LOAD_URL('modules.php?module=admin&amp;what=list_sponsor&amp;id='.bigintval(REQUEST_GET('id')));
                } else {
                        // Load data
                        list ($email, $gender, $sname, $fname) = SQL_FETCHROW($result);
@@ -92,7 +92,7 @@ if (REQUEST_ISSET_GET(('id'))) {
                        define('__UID'   , bigintval(REQUEST_GET('id')));
 
                        // Display form
-                       LOAD_TEMPLATE("admin_del_sponsor");
+                       LOAD_TEMPLATE('admin_del_sponsor');
                }
        } else {
                // Sponsor not found!
index 6928fe89deec0c9187a4fbae356e24fe329e35ae..42ee66b7d77e47693277c7d6b87b66396df48f20 100644 (file)
@@ -318,25 +318,26 @@ case 'register': // Register new extension
 
                                        // Show next link
                                        if (EXT_IS_ACTIVE('task')) {
-                                               LOAD_TEMPLATE("admin_next_link", false, array(
-                                                       'url'   => "modules.php?module=admin&amp;what=list_task",
+                                               LOAD_TEMPLATE('admin_next_link', false, array(
+                                                       'url'   => 'modules.php?module=admin&amp;what=list_task',
                                                        'title' => getMessage('ADMIN_EXT_REGISTER_NEXT_LINK')
                                                ));
                                        } else {
-                                               LOAD_TEMPLATE("admin_next_link", false, array(
-                                                       'url'   => "modules.php?module=admin",
+                                               LOAD_TEMPLATE('admin_next_link', false, array(
+                                                       'url'   => 'modules.php?module=admin',
                                                        'title' => getMessage('ADMIN_EXT_REGISTER_NEXT_LINK')
                                                ));
                                        }
 
                                        // Do we need to update cache file?
-                                       if ((EXT_IS_ACTIVE('cache')) && ($GLOBALS['cache_mode'] != "no")) {
+                                       // @TODO Rewrite this to a filter
+                                       if ((EXT_IS_ACTIVE('cache')) && ($GLOBALS['cache_mode'] != 'no')) {
                                                // Remove cache file (will be auto-created again!)
-                                               if ($GLOBALS['cache_instance']->loadCacheFile("config")) $GLOBALS['cache_instance']->destroyCacheFile();
-                                               if ($GLOBALS['cache_instance']->loadCacheFile("extensions", true)) $GLOBALS['cache_instance']->destroyCacheFile();
-                                               if ($GLOBALS['cache_instance']->loadCacheFile("modreg")) $GLOBALS['cache_instance']->destroyCacheFile();
+                                               if ($GLOBALS['cache_instance']->loadCacheFile('config')) $GLOBALS['cache_instance']->destroyCacheFile();
+                                               if ($GLOBALS['cache_instance']->loadCacheFile('extensions', true)) $GLOBALS['cache_instance']->destroyCacheFile();
+                                               if ($GLOBALS['cache_instance']->loadCacheFile('modreg')) $GLOBALS['cache_instance']->destroyCacheFile();
                                        } // END - if
-                               } elseif (GET_EXT_VERSION($ext_name) != "") {
+                               } elseif (GET_EXT_VERSION($ext_name) != '') {
                                        // Notify the admin that we have a problem here...
                                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_REG_FAILED_ALREADY'));
                                } else {
@@ -351,7 +352,7 @@ case 'register': // Register new extension
                        // Extension was not found in task management
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_REG_FAILED_ID_404'));
                }
-       } elseif ($task_found == "0") {
+       } elseif ($task_found == '0') {
                // No longer assigned or old task
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_REG_FAILED_ASSIGED'));
        } else {
index dade5fa98ffd75e1402330891b76bc3addf12a99..5e1dce2fd94e545db63ec6720ff7e7f3a1cb8b8c 100644 (file)
@@ -56,7 +56,7 @@ if (getConfig('def_refid') > 0) {
 if (EXT_IS_ACTIVE('beg'))                  $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_uid')."";
 if (EXT_IS_ACTIVE('bonus'))                $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_uid')."";
 if (EXT_IS_ACTIVE('doubler'))              $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_uid')."";
-if (GET_EXT_VERSION('holiday') >= '0.1.3') $EXCLUDE_LIST .= " AND d.holiday_active='N'";
+if (GET_EXT_VERSION('holiday') >= '0.1.3') $EXCLUDE_LIST .= " AND d.`holiday_active`='N'";
 
 // Check for all accounts
 $result = SQL_QUERY_ESC("SELECT DISTINCT d.userid, d.gender, d.surname, d.family, d.email, d.joined, d.last_online, d.ap_notified
index 61d404a6b4ec0be2b7f97692d456b7237081b97a..5739f8d512d5d53ffedb05a38ffaf11ae9bd1dd9 100644 (file)
@@ -76,25 +76,25 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_
        ADMIN_CHANGE_ACTIVATION_STATUS(REQUEST_POST('id'), "countries", "is_active");
 
        // Show next link
-       LOAD_TEMPLATE("admin_next_link", false, array(
-               'url'   => "modules.php?module=admin&amp;what=list_country",
+       LOAD_TEMPLATE('admin_next_link', false, array(
+               'url'   => 'modules.php?module=admin&amp;what=list_country',
                'title' => getMessage('ADMIN_COUNTRY_ACTIVATION_NEXT_LINK')
        ));
 } elseif (((REQUEST_ISSET_POST('edit')) || (REQUEST_ISSET_POST('delete'))) && (REQUEST_ISSET_POST(('id')))) {
        if (count(REQUEST_POST('id')) > 0) {
                if (REQUEST_ISSET_POST('edit')) {
                        // Edit template
-                       $row    = "admin_list_country_edit_row";
+                       $row    = 'admin_list_country_edit_row';
                        $post   = 'modify';
-                       $class  = "admin_submit";
+                       $class  = 'admin_submit';
                        $submit = getMessage('ADMIN_COUNTRY_EDIT_NOW');
                        $title  = getMessage('ADMIN_COUNTRY_EDIT_TITLE');
-                       $reset  = "<input type=\"reset\" class=\"admin_reset\" value=\"{!UNDO_SELECTIONS!}\" />&nbsp;*\n";
+                       $reset  = '<input type="reset" class="admin_reset" value="{!UNDO_SELECTIONS!}" />&nbsp;*';
                } else {
                        // Delete template
-                       $row    = "admin_list_country_del_row";
+                       $row    = 'admin_list_country_del_row';
                        $post   = 'remove';
-                       $class  = "admin_delete";
+                       $class  = 'admin_delete';
                        $submit = getMessage('ADMIN_COUNTRY_DELETE_NOW');
                        $title  = getMessage('ADMIN_COUNTRY_DELETE_TITLE');
                        $reset  = '';
@@ -121,7 +121,7 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_
 
                                if ($post == 'modify') {
                                        // Generate default selection in edit-mode
-                                       $content['status'] = ADD_OPTION_LINES("/ARRAY/", array("Y","N"), array(YES, NO ), $status);
+                                       $content['status'] = ADD_OPTION_LINES('/ARRAY/', array('Y', 'N'), array(getMessage('YES'), getMessage('NO')), $status);
                                } else {
                                        // Only display status when in delete-mode
                                        $content['status'] = TRANSLATE_YESNO($status);
@@ -140,7 +140,7 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_
                define('__COUNTRY_RESET' , $reset);
 
                // Load main template
-               LOAD_TEMPLATE("admin_list_country_form");
+               LOAD_TEMPLATE('admin_list_country_form');
        }
 } else {
        // Shall we modify / remove entries now?
@@ -148,15 +148,15 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_
        if ((REQUEST_ISSET_POST(('modify'))) && (REQUEST_ISSET_POST(('id')))) {
                // Modify
                foreach (REQUEST_POST('id') as $id => $sel) {
-                       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_countries` SET code='".REQUEST_POST('code', $id)."', descr='".REQUEST_POST('descr', $id)."', is_active='".REQUEST_POST('is_active', $id)."' WHERE id='".$id."' LIMIT 1");
+                       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_countries` SET `code`='".REQUEST_POST('code', $id)."', `descr`='".REQUEST_POST('descr', $id)."', `is_active`='".REQUEST_POST('is_active', $id)."' WHERE `id`='".$id."' LIMIT 1");
                }
 
                // Create message
                $message = getMessage('ADMIN_COUNTRIES_MODIFIED');
        } elseif ((REQUEST_ISSET_POST('remove')) && (REQUEST_ISSET_POST(('id')))) {
                // Remove
-               $IDs = implode(",", array_keys(REQUEST_POST('id')));
-               ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_countries` WHERE id IN (".$IDs.") LIMIT ".count(REQUEST_POST('id'))."");
+               $IDs = implode(',', array_keys(REQUEST_POST('id')));
+               ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_countries` WHERE `id` IN (".$IDs.") LIMIT ".count(REQUEST_POST('id'))."");
 
                // Create message
                $message = getMessage('ADMIN_COUNTRIES_REMOVED');
@@ -171,7 +171,8 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_
        }
 
        // Load currenty setup country codes to list
-       $result = SQL_QUERY("SELECT id, code, descr, is_active FROM `{!_MYSQL_PREFIX!}_countries` ORDER BY code", __FILE__, __LINE__);
+       $result = SQL_QUERY('SELECT id, code, descr, is_active FROM `{!_MYSQL_PREFIX!}_countries` ORDER BY code',
+               __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0) {
                // List all countries
                $OUT = ''; $SW = 2;
@@ -188,7 +189,7 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_
                        );
 
                        // Load row template and switch colors
-                       $OUT .= LOAD_TEMPLATE("admin_list_country_row", true, $content);
+                       $OUT .= LOAD_TEMPLATE('admin_list_country_row', true, $content);
                        $SW = 3 - $SW;
                }
 
@@ -196,17 +197,17 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_
                SQL_FREERESULT($result);
        } else {
                // No code setup so far (not possible by this software! 'DE' for 'Deutschland' is default
-               $OUT = LOAD_TEMPLATE("admin_list_country_no_row", true);
+               $OUT = LOAD_TEMPLATE('admin_list_country_no_row', true);
        }
 
        // Add list to constant for the template
        define('__COUNTRY_ROWS', $OUT);
 
        // Include add template
-       define('__ADD_COUNTRY_FORM', LOAD_TEMPLATE("admin_add_country", true));
+       define('__ADD_COUNTRY_FORM', LOAD_TEMPLATE('admin_add_country', true));
 
        // Load main template
-       LOAD_TEMPLATE("admin_list_country");
+       LOAD_TEMPLATE('admin_list_country');
 }
 
 //
index d62a40bc111068640dc01c3766aaae5e7491f13e..e43494f1053a876d471cd95d509523a294209d71 100644 (file)
@@ -87,10 +87,10 @@ if (REQUEST_ISSET_GET(('id'))) {
                                        array(bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
                        } elseif (REQUEST_ISSET_POST(('no'))) {
                                // No don't lock / unlock now!
-                               LOAD_URL("modules.php?module=admin&amp;what=list_sponsor&amp;id=".bigintval(REQUEST_GET('id')));
+                               LOAD_URL('modules.php?module=admin&amp;what=list_sponsor&amp;id='.bigintval(REQUEST_GET('id')));
                        } else {
                                // Create header and text messages
-                               if ($status == "CONFIRMED") {
+                               if ($status == 'CONFIRMED') {
                                        // Messages when sponsor's account is confirmed
                                        define('__HEADER_MESSAGE', getMessage('SPONSOR_LOCK_SPONSOR_HEADER'));
                                        define('__TEXT_MESSAGE'  , getMessage('SPONSOR_LOCK_SPONSOR_TEXT'));
@@ -101,10 +101,10 @@ if (REQUEST_ISSET_GET(('id'))) {
                                }
 
                                // Create email link
-                               define('__EMAIL_LINK', "<a href=\"mailto:".$email."\">{!__GENDER!} {!__SURNAME!} {!__FAMILY!}</a>");
+                               define('__EMAIL_LINK', '<a href="mailto:' . $email . '">{!__GENDER!} {!__SURNAME!} {!__FAMILY!}</a>');
 
                                // Display form
-                               LOAD_TEMPLATE("admin_lock_sponsor");
+                               LOAD_TEMPLATE('admin_lock_sponsor');
                        }
                } else {
                        // Cannot change status on unconfirmed or pending accounts!
index 7f6311215f0ab655d4caebd3e38a494db33f999d..a83c024353b029df817ac0b31cb48a66ed0611d6 100644 (file)
@@ -63,14 +63,14 @@ if (REQUEST_ISSET_GET(('order'))) {
                        $MODE = 'member';
                } else {
                        // Matching line not found!
-                       LOAD_URL("modules.php?module=index&amp;what=login");
+                       LOAD_URL('modules.php?module=index&amp;what=login');
                }
 
                // Free memory
                SQL_FREERESULT($result);
        } else {
                // He is no longer logged in
-               LOAD_URL("modules.php?module=index&amp;what=login");
+               LOAD_URL('modules.php?module=index&amp;what=login');
        }
 }
 
@@ -79,7 +79,7 @@ if ((REQUEST_ISSET_POST(('url'))) || (REQUEST_ISSET_GET(('url'))) || (REQUEST_IS
        $url = constant('URL');
 
        // Decode URL if set in GET parameters
-       if (REQUEST_ISSET_GET(('url')))  $url = decodeString(str_replace(" ", "+", compileUriCode(urldecode(REQUEST_GET('url')))));
+       if (REQUEST_ISSET_GET(('url')))  $url = decodeString(str_replace(' ', '+', compileUriCode(urldecode(REQUEST_GET('url')))));
 
        // Use URL from POST data if set
        if (REQUEST_ISSET_POST(('url'))) $url = REQUEST_POST('url');
@@ -89,38 +89,38 @@ if ((REQUEST_ISSET_POST(('url'))) || (REQUEST_ISSET_GET(('url'))) || (REQUEST_IS
        if (REQUEST_ISSET_GET(('frame'))) $frame = REQUEST_GET(('frame'));
        switch ($frame)
        {
-       case "":
+       case '':
                switch ($MODE)
                {
                case 'member':
                        // Build frameset
                        define('__ORDER_VALUE', bigintval(REQUEST_GET('order')));
                        define('__URL_VALUE'  , DEREFERER($url));
-                       LOAD_TEMPLATE("member_order_frametester");
+                       LOAD_TEMPLATE('member_order_frametester');
                        break;
 
                case 'guest':
                        define('__URL_VALUE'  , DEREFERER($url));
-                       LOAD_TEMPLATE("guest_frametester");
+                       LOAD_TEMPLATE('guest_frametester');
                        break;
                }
                break;
 
-       case "test_top":
-               LOAD_TEMPLATE('admin_settings_saved', false, "<div class=\"guest_done\">{--GUEST_FRAMETESTER_TOP--}</span>");
+       case 'test_top':
+               LOAD_TEMPLATE('admin_settings_saved', false, '<div class="guest_done">{--GUEST_FRAMETESTER_TOP--}</span>');
                break;
 
-       case "back": // Back buttom
-               LOAD_TEMPLATE("member_order_back", false, REQUEST_GET('order'));
+       case 'back': // Back buttom
+               LOAD_TEMPLATE('member_order_back', false, REQUEST_GET('order'));
                break;
 
-       case "send": // Send mail away
-               LOAD_TEMPLATE("member_order_send", false, REQUEST_GET('order'));
+       case 'send': // Send mail away
+               LOAD_TEMPLATE('member_order_send', false, REQUEST_GET('order'));
                break;
        }
 } else {
        // Go away...
-       LOAD_URL("modules.php?module=login");
+       LOAD_URL('modules.php?module=login');
 }
 //
 ?>
index b02fe22de9ba41446c592757ed614381ab9155e7..125a7531464e5a1611e97c755d0e8bdf034a31e7 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 }
 
 // A simple redirect...
-LOAD_URL("modules.php?module=admin");
+LOAD_URL('modules.php?module=admin');
 
 //
 ?>
index 5cb1ee209a4e8d0144dea3d64ff170e1453c4a18..98abf6a52c5802d66c2eb4bb555ecab4235eea16 100644 (file)
@@ -87,8 +87,8 @@ 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')."")) {
+       $URL = 'modules.php?module=login';
+} 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()) {
@@ -159,9 +159,9 @@ if (!empty($errorCode)) {
 
 // Display login form with resend-password form
 if (EXT_IS_ACTIVE('nickname')) {
-       LOAD_TEMPLATE("guest_nickname_login");
+       LOAD_TEMPLATE('guest_nickname_login');
 } else {
-       LOAD_TEMPLATE("guest_login");
+       LOAD_TEMPLATE('guest_login');
 }
 
 // Was an URL constructed?
@@ -169,7 +169,7 @@ if (!empty($URL)) {
        // URL was constructed
        if (getTotalFatalErrors()) {
                // Fatal errors!
-               LOAD_INC_ONCE("inc/fatal_errors.php");
+               LOAD_INC_ONCE('inc/fatal_errors.php');
        } else {
                // Load URL
                LOAD_URL($URL);
index 159521752cc92b8753e7d97d012e0b68a3599c84..8db112f1a4381045d560f632ecac5f7a9df1e051 100644 (file)
@@ -246,7 +246,7 @@ if (EXT_IS_ACTIVE('holiday')) {
 FROM `{!_MYSQL_PREFIX!}_user_holidays` AS h
 LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d
 ON h.userid=d.userid
-WHERE d.holiday_active='Y'",
+WHERE d.`holiday_active`='Y'",
  __FILE__, __LINE__);
        list($holiday) = SQL_FETCHROW($result);
        if (empty($holiday)) $holiday = 0;
index 2090b96c3421be91548d53e3d024548061a037ba..e34b2f126b4a5fa13479545736a34de7d98e6fc8 100644 (file)
@@ -37,7 +37,7 @@
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4).'/security.php';
        require($INC);
 } elseif ((!EXT_IS_ACTIVE('sponsor'))) {
        addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'sponsor');
@@ -53,7 +53,7 @@ if (REQUEST_ISSET_GET(('mode'))) {
        switch (REQUEST_GET('mode'))
        {
                case 'activate' : $MODE = 'activate';  break; // Activation link requested
-               case "lost_pass": $MODE = "lost_pass"; break; // Request new password
+               case 'lost_pass': $MODE = 'lost_pass'; break; // Request new password
        }
 } // END - if
 
@@ -77,20 +77,20 @@ LIMIT 1", array(REQUEST_GET('hash')), __FILE__, __LINE__);
                $SPONSOR['pay']    = TRANSLATE_COMMA($SPONSOR['pay']);
 
                // Unconfirmed account or changed email address?
-               if ($SPONSOR['status'] == "UNCONFIRMED") {
+               if ($SPONSOR['status'] == 'UNCONFIRMED') {
                        // Set account to pending
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET `status`='PENDING'
 WHERE id='%s' AND hash='%s' AND `status`='UNCONFIRMED' LIMIT 1",
- array(bigintval($SPONSOR['id']), REQUEST_GET('hash')), __FILE__, __LINE__);
                              array(bigintval($SPONSOR['id']), REQUEST_GET('hash')), __FILE__, __LINE__);
 
                        // Check on success
                        if (SQL_AFFECTEDROWS() == 1) {
                                // Prepare mail and send it to the sponsor
-                               $message = LOAD_EMAIL_TEMPLATE("sponsor_pending", $SPONSOR);
+                               $message = LOAD_EMAIL_TEMPLATE('sponsor_pending', $SPONSOR);
                                SEND_EMAIL($SPONSOR['email'], getMessage('SPONSOR_ACCOUNT_PENDING_SUBJ'), $message);
 
                                // Send email to admin
-                               SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_SPONSOR'), "admin_sponsor_pending", $SPONSOR);
+                               SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_SPONSOR'), 'admin_sponsor_pending', $SPONSOR);
 
                                // Sponsor account set to pending
                                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSOR_ACCOUNT_IS_PENDING'));
@@ -98,11 +98,11 @@ WHERE id='%s' AND hash='%s' AND `status`='UNCONFIRMED' LIMIT 1",
                                // Could not unlock account!
                                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSOR_ACCOUNT_PENDING_FAILED'));
                        }
-               } elseif ($SPONSOR['status'] == "EMAIL") {
+               } elseif ($SPONSOR['status'] == 'EMAIL') {
                        // Changed email adress need to be confirmed
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET `status`='CONFIRMED'
 WHERE id='%s' AND hash='%s' AND `status`='EMAIL' LIMIT 1",
- array(bigintval($SPONSOR['id']), REQUEST_GET('hash')), __FILE__, __LINE__);
                              array(bigintval($SPONSOR['id']), REQUEST_GET('hash')), __FILE__, __LINE__);
 
                        // Check on success 
                        if (SQL_AFFECTEDROWS() == 1) {
@@ -147,12 +147,12 @@ WHERE email='%s' AND (`status`='UNCONFIRMED' OR `status`='EMAIL') LIMIT 1",
                        $SPONSOR['sponsor_created'] = MAKE_DATETIME($SPONSOR['sponsor_created']);
 
                        // Prepare email and send it to the sponsor
-                       if ($SPONSOR['status'] == "UNCONFIRMED") {
+                       if ($SPONSOR['status'] == 'UNCONFIRMED') {
                                // Unconfirmed accounts
-                               $msg_sponsor = LOAD_EMAIL_TEMPLATE("sponsor_activate", $SPONSOR);
+                               $msg_sponsor = LOAD_EMAIL_TEMPLATE('sponsor_activate', $SPONSOR);
                        } else {
                                // Confirmed email address
-                               $msg_sponsor = LOAD_EMAIL_TEMPLATE("sponsor_email", $SPONSOR);
+                               $msg_sponsor = LOAD_EMAIL_TEMPLATE('sponsor_email', $SPONSOR);
                        }
                        SEND_EMAIL(REQUEST_POST('email'), SPONSOR_ACTIVATION_LINK_SUBJ, $msg_sponsor);
 
@@ -167,9 +167,9 @@ WHERE email='%s' AND (`status`='UNCONFIRMED' OR `status`='EMAIL') LIMIT 1",
                SQL_FREERESULT($result);
        } else {
                // Load form
-               LOAD_TEMPLATE("guest_sponsor_activate");
+               LOAD_TEMPLATE('guest_sponsor_activate');
        }
-} elseif ($MODE == "lost_pass") {
+} elseif ($MODE == 'lost_pass') {
        // Send new password
        if (IS_FORM_SENT()) {
                // Check submitted data
@@ -182,6 +182,7 @@ WHERE email='%s' AND (`status`='UNCONFIRMED' OR `status`='EMAIL') LIMIT 1",
 FROM `{!_MYSQL_PREFIX!}_sponsor_data`
 WHERE email='%s' AND id='%s' AND `status`='CONFIRMED' LIMIT 1",
                        array(REQUEST_POST('email'), bigintval(REQUEST_POST('id'))), __FILE__, __LINE__);
+
                // Entry found?
                if (SQL_NUMROWS($result) == 1) {
                        // Unconfirmed sponsor account found so let's load the requested data
@@ -195,13 +196,13 @@ WHERE email='%s' AND id='%s' AND `status`='CONFIRMED' LIMIT 1",
                        $SPONSOR['password']        = GEN_PASS();
 
                        // Prepare email and send it to the sponsor
-                       $msg_sponsor = LOAD_EMAIL_TEMPLATE("sponsor_lost", $SPONSOR);
+                       $msg_sponsor = LOAD_EMAIL_TEMPLATE('sponsor_lost', $SPONSOR);
                        SEND_EMAIL(REQUEST_POST('email'), SPONSOR_LOST_PASSWORD_SUBJ, $msg_sponsor);
 
                        // Update password
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET password='%s'
 WHERE id='%s' LIMIT 1",
- array(md5($SPONSOR['password']), bigintval($SPONSOR['id'])), __FILE__, __LINE__);
                              array(md5($SPONSOR['password']), bigintval($SPONSOR['id'])), __FILE__, __LINE__);
 
                        // Output message
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSOR_LOST_PASSWORD_SENT'));
@@ -214,31 +215,32 @@ WHERE id='%s' LIMIT 1",
                SQL_FREERESULT($result);
        } else {
                // Load form
-               LOAD_TEMPLATE("guest_sponsor_lost");
+               LOAD_TEMPLATE('guest_sponsor_lost');
        }
 } elseif (IS_FORM_SENT()) {
        // Check status and login data ...
        $result = SQL_QUERY_ESC("SELECT status FROM `{!_MYSQL_PREFIX!}_sponsor_data`
 WHERE id='%s' AND password='%s' LIMIT 1",
                array(bigintval(REQUEST_POST('sponsorid')), md5(REQUEST_POST('pass'))), __FILE__, __LINE__);
+
        if (SQL_NUMROWS($result) == 1) {
                // Okay, first login data check passed, now has he/she an approved (CONFIRMED) account?
                list($status) = SQL_FETCHROW($result);
-               if ($status == "CONFIRMED") {
+               if ($status == 'CONFIRMED') {
                        // Is confirmed so both is fine and we can continue with login procedure
                        $login = ((set_session('sponsorid'  , bigintval(REQUEST_POST('sponsorid')))) &&
                                  (set_session('sponsorpass', md5(REQUEST_POST('pass'))           ))
                        );
 
-                       if ($login) {
+                       if ($login === true) {
                                // Cookie setup successfull so we can forward to sponsor area
-                               LOAD_URL("modules.php?module=sponsor");
+                               LOAD_URL('modules.php?module=sponsor');
                        } else {
                                // Cookie setup failed!
                                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSPOR_COOKIE_SETUP_FAILED'));
 
                                // Login formular and other links
-                               LOAD_TEMPLATE("guest_sponsor_login");
+                               LOAD_TEMPLATE('guest_sponsor_login');
                        }
                } else {
                        // Status is not fine
@@ -246,21 +248,21 @@ WHERE id='%s' AND password='%s' LIMIT 1",
                        LOAD_TEMPLATE('admin_settings_saved', false, $content);
 
                        // Login formular and other links
-                       LOAD_TEMPLATE("guest_sponsor_login");
+                       LOAD_TEMPLATE('guest_sponsor_login');
                }
        } else {
-               // Account missing or wrong pass! We shall not find this out for the "hacker folks"...
+               // Account missing or wrong pass! We shall not find this out for the "cracker folks"...
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSOR_LOGIN_FAILED_404_WRONG_PASS'));
 
                // Login formular and other links
-               LOAD_TEMPLATE("guest_sponsor_login");
+               LOAD_TEMPLATE('guest_sponsor_login');
        }
 
        // Free memory
        SQL_FREERESULT($result);
 } else {
        // Login formular and other links
-       LOAD_TEMPLATE("guest_sponsor_login");
+       LOAD_TEMPLATE('guest_sponsor_login');
 }
 
 //
index ff21a48c258f0de5aecf113ce561ad4cf0f04fc2..751947117ce4b7178a304b1bba092bce05ead1a6 100644 (file)
@@ -42,20 +42,20 @@ if (!defined('__SECURITY')) {
        require($INC);
 } elseif (!EXT_IS_ACTIVE('sql_patches')) {
        // The extension 'sql_patches' *MUST* be activated or you have lot's of problems!
-       LOAD_URL("admin.php");
+       LOAD_URL('admin.php');
 }
 
 // Load adverstising template
-define('__GUEST_ADVERT', LOAD_TEMPLATE("guest_advert", true));
+define('__GUEST_ADVERT', LOAD_TEMPLATE('guest_advert', true));
 
 // Generate a tableset for the menu title and content
-LOAD_TEMPLATE("guest_header");
+LOAD_TEMPLATE('guest_header');
 
 // Add code-message here
 handleCodeMessage();
 
 // Some of you needs this to be extracted into a template... ???
-LOAD_TEMPLATE("guest_menu_td");
+LOAD_TEMPLATE('guest_menu_td');
 
 // When no what value is provided take the "home" value
 if (empty($GLOBALS['what'])) $GLOBALS['what'] = getConfig('index_home');
@@ -73,7 +73,7 @@ if ((getConfig('guest_menu') == 'Y') || (!EXT_IS_ACTIVE('sql_patches', true))) {
 } // END - if
 
 // TDs between menu and content
-LOAD_TEMPLATE("guest_menu_content");
+LOAD_TEMPLATE('guest_menu_content');
 
 // Disable block-mode by default
 $GLOBALS['block_mode'] = false;
@@ -92,20 +92,20 @@ if ((INCLUDE_READABLE($INC)) && (VALIDATE_MENU_ACTION('guest', $GLOBALS['action'
 
 if ((getConfig('guest_menu') == 'Y') || (!EXT_IS_ACTIVE('sql_patches', true))) {
        // Right side of content (hint: a good place for 120x600 skyscraper banner!)
-       LOAD_TEMPLATE("guest_content_footer");
+       LOAD_TEMPLATE('guest_content_footer');
 
        // Some advertising stuff?
-       LOAD_TEMPLATE("guest_advert2");
+       LOAD_TEMPLATE('guest_advert2');
 
        OUTPUT_HTML("  </td>
 </tr>");
 
        // Goto TOP template
-       LOAD_TEMPLATE("guest_goto_top");
+       LOAD_TEMPLATE('guest_goto_top');
 } // END - if
 
 // Footer template (Thanx to Mr. Glaus!)
-LOAD_TEMPLATE("guest_footer");
+LOAD_TEMPLATE('guest_footer');
 
 //
 ?>
index e8d025f3f661d73bb572d3e98d81a47d6100a754..caec2a85415b346f672004e7faaf0e23619c3108 100644 (file)
@@ -79,7 +79,7 @@ if ((SQL_NUMROWS($result1) == 1) || (SQL_NUMROWS($result2) == 1)) {
                }
 
                // Display message and exit here
-               LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('HOLIDAY_MEMBER_ORDER'), MAKE_DATETIME($stamp, "1")));
+               LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('HOLIDAY_MEMBER_ORDER'), MAKE_DATETIME($stamp, '1')));
                return;
        }
 }
@@ -88,8 +88,7 @@ if ((SQL_NUMROWS($result1) == 1) || (SQL_NUMROWS($result2) == 1)) {
 SQL_FREERESULT($result1);
 SQL_FREERESULT($result2);
 
-if (IS_FORM_SENT())
-{
+if (IS_FORM_SENT()) {
        // Check holiday request...
        $START = mktime(0, 0, 0, REQUEST_POST('start_month'), REQUEST_POST('start_day'), REQUEST_POST('start_year'));
        $END   = mktime(0, 0, 0, REQUEST_POST('end_month')  , REQUEST_POST('end_day')  , REQUEST_POST('end_year')  );
@@ -106,7 +105,7 @@ if (IS_FORM_SENT())
 
                // Activate holiday system
                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
-SET holiday_active='N', holiday_activated=UNIX_TIMESTAMP()
+SET `holiday_active`='N', holiday_activated=UNIX_TIMESTAMP()
 WHERE userid=%s LIMIT 1",
                 array(getUserId()), __FILE__, __LINE__);
 
@@ -119,15 +118,15 @@ WHERE userid=%s LIMIT 1",
                define('_END_YEAR'   , REQUEST_POST('end_year'));
 
                // Send mail to member
-               $msg = LOAD_EMAIL_TEMPLATE("member_holiday_request", REQUEST_POST('comments'), getUserId());
+               $msg = LOAD_EMAIL_TEMPLATE('member_holiday_request', REQUEST_POST('comments'), getUserId());
                SEND_EMAIL(getUserId(), getMessage('HOLIDAY_MEMBER_SUBJECT'), $msg);
 
                // Send mail to all admins
-               SEND_ADMIN_NOTIFICATION(getMessage('HOLIDAY_ADMIN_SUBJECT'), "admin_holiday_request", REQUEST_POST('comments'), getUserId());
+               SEND_ADMIN_NOTIFICATION(getMessage('HOLIDAY_ADMIN_SUBJECT'), 'admin_holiday_request', REQUEST_POST('comments'), getUserId());
 
                // Create task
                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (userid, assigned_admin, status, task_type, subject, text, task_created) VALUES ('%s','0','NEW','HOLIDAY_REQUEST','{--HOLIDAY_ADMIN_SUBJECT--}','%s', UNIX_TIMESTAMP())",
-                array(getUserId(), $msg), __FILE__, __LINE__);
+                       array(getUserId(), $msg), __FILE__, __LINE__);
 
                // Display message
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('HOLIDAY_IS_ACTIVATED_NOW'));
@@ -135,21 +134,18 @@ WHERE userid=%s LIMIT 1",
 }
 
 // Holiday shall be ended now
-if (REQUEST_ISSET_POST(('stop')))
-{
+if (REQUEST_ISSET_POST(('stop'))) {
        // Okay, end the holiday here...
        $result = SQL_QUERY_ESC("SELECT holiday_active, holiday_activated FROM `{!_MYSQL_PREFIX!}_user_data`
 WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
        list($active, $locked) = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
 
-       if (($active == 'Y') && (($locked + getConfig('holiday_lock')) < time()))
-       {
+       if (($active == 'Y') && (($locked + getConfig('holiday_lock')) < time())) {
                // Load data
                $result = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM `{!_MYSQL_PREFIX!}_user_holidays`
 WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
-               if (SQL_NUMROWS($result) == 1)
-               {
+               if (SQL_NUMROWS($result) == 1) {
                        // Data was found
                        list($start, $end) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
@@ -160,7 +156,7 @@ WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
 
                        // Deactivate it now
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
-SET holiday_active='N', holiday_activated='0'
+SET `holiday_active`='N', holiday_activated='0'
 WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
 
                        // Remove entry
@@ -168,7 +164,7 @@ WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
 WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
 
                        // Send email to admin
-                       SEND_ADMIN_NOTIFICATION(getMessage('HOLIDAY_ADMIN_DEAC_SUBJ'), "admin_holiday_deactivated", array(), getUserId());
+                       SEND_ADMIN_NOTIFICATION(getMessage('HOLIDAY_ADMIN_DEAC_SUBJ'), 'admin_holiday_deactivated', array(), getUserId());
 
                        // Display message to user
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('HOLIDAY_MEMBER_DEACTIVATED_NOW'));
@@ -183,8 +179,7 @@ WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
 }
 
 // If something is wrong or link in menu is just clicked display form
-if ((!IS_FORM_SENT()) && (!REQUEST_ISSET_POST(('stop'))))
-{
+if ((!IS_FORM_SENT()) && (!REQUEST_ISSET_POST(('stop'))) {
        // Check if user is in holiday...
        $result = SQL_QUERY_ESC("SELECT holiday_active, holiday_activated FROM `{!_MYSQL_PREFIX!}_user_data`
 WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
@@ -192,8 +187,7 @@ WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
        SQL_FREERESULT($result);
 
        // Check for lock
-       if (($locked + getConfig('holiday_lock')) < time())
-       {
+       if (($locked + getConfig('holiday_lock')) < time()) {
                // User can deactivate his holiday request
                switch ($active)
                {
@@ -201,55 +195,52 @@ WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
                        // Load starting and ending date
                        $result = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM `{!_MYSQL_PREFIX!}_user_holidays`
 WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
-                       if (SQL_NUMROWS($result) == 1)
-                       {
+                       if (SQL_NUMROWS($result) == 1) {
                                // Data was found
                                list($start, $end) = SQL_FETCHROW($result);
                                SQL_FREERESULT($result);
 
                                // Prepare it for the template
-                               define('__HOLIDAY_START', MAKE_DATETIME($start , "3"));
-                               define('__HOLIDAY_END'  , MAKE_DATETIME($end   , "3"));
-                               define('__HOLIDAY_LOCK' , MAKE_DATETIME($locked, "1"));
+                               define('__HOLIDAY_START', MAKE_DATETIME($start , '3'));
+                               define('__HOLIDAY_END'  , MAKE_DATETIME($end   , '3'));
+                               define('__HOLIDAY_LOCK' , MAKE_DATETIME($locked, '1'));
 
                                // Load template
-                               LOAD_TEMPLATE("member_holiday_deactivate");
-                       }
-                        else
-                       {
+                               LOAD_TEMPLATE('member_holiday_deactivate');
+                       } else {
                                // Free memory
                                SQL_FREERESULT($result);
 
                                // Remove entry and reload URL
                                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
-SET holiday_active='N'
+SET `holiday_active`='N'
 WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
-                               LOAD_URL("modules.php?module=login&amp;what=holiday");
+                               LOAD_URL('modules.php?module=login&amp;what=holiday');
                                return;
                        }
                        break;
 
                case 'N': // Display activation form
                        // Starting day
-                       define('_START_DAY'  , ADD_SELECTION("day"  , date("d", (time() + getConfig('one_day'))), "start"));
-                       define('_START_MONTH', ADD_SELECTION("month", date("m", (time() + getConfig('one_day'))), "start"));
-                       define('_START_YEAR' , ADD_SELECTION("year" , date('Y', (time() + getConfig('one_day'))), "start"));
+                       define('_START_DAY'  , ADD_SELECTION('day'  , date('d', (time() + getConfig('one_day'))), 'start'));
+                       define('_START_MONTH', ADD_SELECTION('month', date('m', (time() + getConfig('one_day'))), 'start'));
+                       define('_START_YEAR' , ADD_SELECTION('year' , date('Y', (time() + getConfig('one_day'))), 'start'));
 
                        // Calcualte ending date
-                       $D = date("d", time() + getConfig('one_day') + (getConfig('one_day') * getConfig('holiday_max')));
-                       $M = date("m", time() + getConfig('one_day') + (getConfig('one_day') * getConfig('holiday_max')));
+                       $D = date('d', time() + getConfig('one_day') + (getConfig('one_day') * getConfig('holiday_max')));
+                       $M = date('m', time() + getConfig('one_day') + (getConfig('one_day') * getConfig('holiday_max')));
                        $Y = date('Y', time() + getConfig('one_day') + (getConfig('one_day') * getConfig('holiday_max')));
 
                        // Ending day
-                       define('_END_DAY'  , ADD_SELECTION("day"  , $D, "end"));
-                       define('_END_MONTH', ADD_SELECTION("month", $M, "end"));
-                       define('_END_YEAR' , ADD_SELECTION("year" , $Y, "end"));
+                       define('_END_DAY'  , ADD_SELECTION('day'  , $D, 'end'));
+                       define('_END_MONTH', ADD_SELECTION('month', $M, 'end'));
+                       define('_END_YEAR' , ADD_SELECTION('year' , $Y, 'end'));
 
                        // Copy value from configuration
                        define('__HOLIDAY_MAX', getConfig('holiday_max'));
 
                        // Output form
-                       LOAD_TEMPLATE("member_holiday_form");
+                       LOAD_TEMPLATE('member_holiday_form');
                        break;
                }
        } else {
index e44cb64794b98dd63d5a6922e0d91942064f0a13..58726d02919fe26a38cab29ed9d3010061262771 100644 (file)
@@ -53,7 +53,7 @@ ADD_DESCR('member', __FILE__);
 // Class was found and loaded
 if (IS_FORM_SENT()) {
        // Save settings
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET html='%s' WHERE userid=%s LIMIT 1",
+       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `html`='%s' WHERE userid=%s LIMIT 1",
                array(REQUEST_POST('html'), getUserId()), __FILE__, __LINE__);
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('MEMBER_SETTINGS_SAVED'));
 } else {
index 22fdd1e15219fe3cc0653d1beb09caf42e0bd468..dd905f4329f77902645faae1c7b04ef3037c6e04 100644 (file)
@@ -45,11 +45,11 @@ if (!defined('__SECURITY')) {
 }
 
 // Base URL for redirection (both cases)
-$URL = "modules.php?module=index&amp;msg=";
+$URL = 'modules.php?module=index&amp;msg=';
 
 if (destroy_user_session()) {
        // Remove theme cookie as well
-       set_session("mxchange_theme", '');
+       set_session('mxchange_theme', '');
 
        // Logout completed
        $URL .= getCode('LOGOUT_DONE');
index 4c1055a2404e53e5552895b0e100d6143d178908..f6e64164522cb5c99a49704eafd919bfddff1e66 100644 (file)
@@ -376,7 +376,7 @@ array(
                                }
 
                                // ID is received so we can redirect the user, used points will be added when he send's out the mail
-                               $URL = "modules.php?module=frametester&amp;order=".$id."";
+                               $URL = 'modules.php?module=frametester&amp;order=' . $id;
                        } elseif ($MAX_SEND == 0) {
                                // Not enougth receivers found which can receive mails
                                $URL = 'modules.php?module=login&amp;what=order&amp;msg=' . getCode('MORE_RECEIVERS2');
@@ -389,13 +389,13 @@ array(
                        $URL = 'modules.php?module=login&amp;what=order&amp;msg=' . getCode('NO_RECS_LEFT');
                }
        }
-} elseif (REQUEST_POST('receiver') == "0") {
+} elseif (REQUEST_POST('receiver') == '0') {
        // Not enougth receivers selected
        $URL = 'modules.php?module=login&amp;what=order&amp;msg=' . getCode('MORE_RECEIVERS1');
 } elseif (($ALLOWED == 0) && (getConfig('order_max_full') == 'ORDER')) {
        // No more mail orders allowed
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('MEMBER_ORDER_ALLOWED_EXHAUSTED'));
-} elseif (($links < getConfig('unconfirmed')) && ($mmails == "1")) {
+} elseif (($links < getConfig('unconfirmed')) && ($mmails == '1')) {
        // Display order form
        $result_cats = SQL_QUERY("SELECT id, cat FROM `{!_MYSQL_PREFIX!}_cats`".$whereStatement." ORDER BY `sort`", __FILE__, __LINE__);
        if (SQL_NUMROWS($result_cats) > 0) {
@@ -408,11 +408,12 @@ array(
                        );
 
                        // Enable HTML checking
+                       // @TODO Rewrite this to a filter
                        $HTML = ''; $HOLIDAY = false; $HOL_STRING = '';
-                       if ((EXT_IS_ACTIVE('html_mail')) && (REQUEST_POST('html') == 'Y')) $HTML = " AND html='Y'";
+                       if ((EXT_IS_ACTIVE('html_mail')) && (REQUEST_POST('html') == 'Y')) $HTML = " AND `html`='Y'";
                        if (GET_EXT_VERSION('holiday') >= '0.1.3') {
                                // Extension's version is fine
-                               $HOLIDAY = true; $HOL_STRING = " AND holiday_active='N'";
+                               $HOLIDAY = true; $HOL_STRING = " AND `holiday_active`='N'";
                        } // END - if
 
                        // ... and begin loading stuff
@@ -433,7 +434,7 @@ array(
                                                $result_holiday = SQL_QUERY_ESC("SELECT DISTINCT d.userid FROM `{!_MYSQL_PREFIX!}_user_data` AS d
 LEFT JOIN `{!_MYSQL_PREFIX!}_user_holidays` AS h
 ON d.userid=h.userid
-WHERE d.userid=%s AND d.receive_mails > 0 AND d.`status`='CONFIRMED' AND d.holiday_active='Y'
+WHERE d.userid=%s AND d.receive_mails > 0 AND d.`status`='CONFIRMED' AND d.`holiday_active`='Y'
 AND h.holiday_start < UNIX_TIMESTAMP() AND h.holiday_end > UNIX_TIMESTAMP()
 LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
                                                if (SQL_NUMROWS($result_holiday) == 1) {
@@ -581,16 +582,16 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
                                switch (getConfig('order_max_full'))
                                {
                                case 'MAX': // He is allowed to send as much as possible
-                                       define('ORDER_MAX_VALUE', getMessage('ORDER_ALLOWED_MAX'));
+                                       define('ORDER_MAX_VALUE', getMessage('MEMBER_ORDER_ALLOWED_MAX'));
                                        break;
 
                                case 'ORDER': // He is allowed to send as much as he setup the receiving value
-                                       define('ORDER_MAX_VALUE', sprintf(getMessage('ORDER_ALLOWED_RECEIVE'), $ALLOWED, $MAXI));
+                                       define('ORDER_MAX_VALUE', sprintf(getMessage('MEMBER_ORDER_ALLOWED_RECEIVE'), $ALLOWED, $MAXI));
                                        break;
 
                                default: // Unknown/invalid
                                        DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown order_mas_full config detected.", getConfig('order_max_full')));
-                                       define('ORDER_MAX_VALUE', getMessage('ORDER_ALLOWED_UNKNOWN'));
+                                       define('ORDER_MAX_VALUE', getMessage('MEMBER_ORDER_ALLOWED_UNKNOWN'));
                                        break;
                                }
 
index ec5fa1d0740af589120e0849ff3090813229814c..78449324e601d0ac5834007b6017014b4bea87d7 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 } elseif (!IS_MEMBER()) {
        LOAD_URL('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('mailid')) && (!IS_ADMIN())) {
-       LOAD_URL("modules.php?module=login");
+       LOAD_URL('modules.php?module=login');
 }
 
 // Add description as navigation point
@@ -60,10 +60,10 @@ WHERE id=%s LIMIT 1",
        // Load data
        $content = SQL_FETCHARRAY($result_data);
 
-       // "Translate some data
+       // Translate some data
        $content['subject']   = COMPILE_CODE($content['subject']);
        $content['text']      = COMPILE_CODE($content['text']);
-       $content['timestamp'] = MAKE_DATETIME($content['timestamp'], "2");
+       $content['timestamp'] = MAKE_DATETIME($content['timestamp'], '2');
        $content['category']  = GET_CATEGORY($content['cat_id']);
        $content['points']    = TRANSLATE_COMMA($content['points']);
        $content['is_notify'] = TRANSLATE_YESNO($content['is_notify']);
@@ -73,11 +73,11 @@ WHERE id=%s LIMIT 1",
 
        // Get timestamp from insert
        $content['user_status'] = sprintf(getMessage('MEMBER_MAIL_BONUS_CONFIRMED_ON'),
-               MAKE_DATETIME(USER_STATS_GET_TIMESTAMP('bonusid', $content['id']), "2")
+               MAKE_DATETIME(USER_STATS_GET_TIMESTAMP('bonusid', $content['id']), '2')
        );
 
        // Display it depending on mail (data) type
-       LOAD_TEMPLATE("member_mail_bonus_".strtolower($content['data_type']), false, $content);
+       LOAD_TEMPLATE('member_mail_bonus_'.strtolower($content['data_type']), false, $content);
 
        // Free result
        SQL_FREERESULT($result_data);
@@ -95,10 +95,10 @@ WHERE s.id=%s LIMIT 1",
        // Load data
        $content = SQL_FETCHARRAY($result_data);
 
-       // "Translate some data
+       // Translate some data
        $content['subject']   = COMPILE_CODE($content['subject']);
        $content['text']      = COMPILE_CODE($content['text']);
-       $content['timestamp'] = MAKE_DATETIME($content['timestamp'], "2");
+       $content['timestamp'] = MAKE_DATETIME($content['timestamp'], '2');
        $content['category']  = GET_CATEGORY($content['cat_id']);
        $content['points']    = TRANSLATE_COMMA($content['points']);
        $content['time']      = CREATE_FANCY_TIME($content['time']);
@@ -106,11 +106,11 @@ WHERE s.id=%s LIMIT 1",
 
        // Get timestamp from insert
        $content['user_status'] = sprintf(getMessage('MEMBER_MAIL_NORMAL_CONFIRMED_ON'),
-               MAKE_DATETIME(USER_STATS_GET_TIMESTAMP('mailid', $content['id']), "2")
+               MAKE_DATETIME(USER_STATS_GET_TIMESTAMP('mailid', $content['id']), '2')
        );
 
        // Display it depending on mail (data) type
-       LOAD_TEMPLATE("member_mail_normal_".strtolower($content['data_type']), false, $content);
+       LOAD_TEMPLATE('member_mail_normal_'.strtolower($content['data_type']), false, $content);
 
        // Free result
        SQL_FREERESULT($result_data);
@@ -137,7 +137,7 @@ if (SQL_NUMROWS($result) > 0) {
                $cat = ''; $result_data = false;
                switch ($type)
                {
-               case "NORMAL":
+               case 'NORMAL':
                        $result_data = SQL_QUERY_ESC("SELECT s.subject, s.timestamp_ordered, s.cat_id, s.payment_id, p.sender
 FROM `{!_MYSQL_PREFIX!}_user_stats` AS s
 LEFT JOIN `{!_MYSQL_PREFIX!}_pool` AS p
@@ -148,7 +148,7 @@ LIMIT 1",
                        $type = 'mailid'; $DATA = $id; $PROBLEM = getMessage('NORMAL_MAIL_PROBLEM');
                        break;
 
-               case "BONUS":
+               case 'BONUS':
                        $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id, points, 0 FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
                         array(bigintval($id2)), __FILE__, __LINE__);
                        $type = 'bonusid'; $DATA = $id2; $PROBLEM = getMessage('BONUS_MAIL_PROBLEM');
@@ -193,16 +193,16 @@ LIMIT 1",
                                'type'    => $type,
                                'subject' => $subject,
                                'sender'  => $sender,
-                               'stamp'   => MAKE_DATETIME($timestamp, "2"),
+                               'stamp'   => MAKE_DATETIME($timestamp, '2'),
                                'cat'     => GET_CATEGORY($cat),
                                'points'  => TRANSLATE_COMMA($pay),
                        );
 
                        // Load row template
                        if (getConfig('show_points_unconfirmed') == 'Y') {
-                               $OUT .= LOAD_TEMPLATE("member_unconfirmed_row", true, $content);
+                               $OUT .= LOAD_TEMPLATE('member_unconfirmed_row', true, $content);
                        } else {
-                               $OUT .= LOAD_TEMPLATE("member_unconfirmed_row_nopoints", true, $content);
+                               $OUT .= LOAD_TEMPLATE('member_unconfirmed_row_nopoints', true, $content);
                        }
 
                        // Count points
@@ -217,9 +217,9 @@ LIMIT 1",
 
                        // Display points or not?
                        if (getConfig('show_points_unconfirmed') == 'Y') {
-                               $OUT .= LOAD_TEMPLATE("member_unconfirmed_404", true, $content);
+                               $OUT .= LOAD_TEMPLATE('member_unconfirmed_404', true, $content);
                        } else {
-                               $OUT .= LOAD_TEMPLATE("member_unconfirmed_404_nopoints", true, $content);
+                               $OUT .= LOAD_TEMPLATE('member_unconfirmed_404_nopoints', true, $content);
                        }
                }
 
@@ -241,9 +241,9 @@ LIMIT 1",
 
        // Load main template
        if (getConfig('show_points_unconfirmed') == 'Y') {
-               LOAD_TEMPLATE("member_unconfirmed_table");
+               LOAD_TEMPLATE('member_unconfirmed_table');
        } else {
-               LOAD_TEMPLATE("member_unconfirmed_table_nopoints");
+               LOAD_TEMPLATE('member_unconfirmed_table_nopoints');
        }
 } else {
        // No mails left to confirm... :)
index 1a5ab8f90d1b500d15162dc920150ab3e06a0166..5d448c102191f5a00837be72fcac18e3efd8b269 100644 (file)
@@ -49,7 +49,7 @@ if (!defined('__SECURITY')) {
        $URL = 'modules.php?module=index';
 } elseif (!REQUEST_ISSET_GET(('order'))) {
        // You cannot call this module directly!
-       $URL = "modules.php?module=login&amp;what=order";
+       $URL = 'modules.php?module=login&amp;what=order';
 }
 
 // When URL is empty nothing bad happend here
@@ -59,12 +59,12 @@ if (empty($URL)) {
                // Auto-send is active
                define('ADMIN_AUTOSEND',  getMessage('ADMIN_AUTOSEND_ACTIVE'));
                define('MEMBER_AUTOSEND', getMessage('MEMBER_AUTOSEND_ACTIVE'));
-               $type = "NEW";
+               $type = 'NEW';
        } else {
                // Auto-send is inactive
                define('ADMIN_AUTOSEND',  getMessage('ADMIN_AUTOSEND_INACTIVE'));
                define('MEMBER_AUTOSEND', getMessage('MEMBER_AUTOSEND_INACTIVE'));
-               $type = "ADMIN";
+               $type = 'ADMIN';
        }
 
        // Update sending pool
@@ -91,7 +91,7 @@ if (empty($URL)) {
 
                // Update used points
                $add = '';
-               if (getConfig('order_max_full') == 'ORDER') $add = ", mail_orders=mail_orders+1";
+               if (getConfig('order_max_full') == 'ORDER') $add = ', mail_orders=mail_orders+1';
                SUB_POINTS('order', getUserId(), $USED);
 
                // Prepare content
@@ -105,17 +105,17 @@ if (empty($URL)) {
                );
 
                // Send an email to the user
-               $msg_mem = LOAD_EMAIL_TEMPLATE("order-member", $content, getUserId());
+               $msg_mem = LOAD_EMAIL_TEMPLATE('order-member', $content, getUserId());
                SEND_EMAIL($email, getMessage('MEMBER_NEW_QUEUE'), $msg_mem);
 
                // Notify admins about this
-               SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_QUEUE'), "order-admin", $content, getUserId());
+               SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_QUEUE'), 'order-admin', $content, getUserId());
 
                // Output back bottom
-               LOAD_TEMPLATE("member_order-back", false);
+               LOAD_TEMPLATE('member_order-back', false);
        } else {
-               // Matching line not found or already "placed" in send queue
-               LOAD_URL("modules.php?module=login");
+               // Matching line not found or already 'placed' in send queue
+               LOAD_URL('modules.php?module=login');
        }
 } else {
        // Redirect...
index df617a629951422bd7c1b2882d50772e4352b592..909b85dd9726e6b14e0ae53154abe221ba031028 100644 (file)
@@ -944,7 +944,7 @@ function GET_ACTION ($MODE, &$wht) {
                if (isAdminRegistered()) {
                        // Redirect
                        // @TODO Why does this lead into an endless loop but we still need it???
-                       // @TODO Commented out LOAD_URL("admin.php");
+                       // @TODO Commented out LOAD_URL('admin.php');
                } // END - if
        }
 
@@ -958,7 +958,7 @@ function GET_CATEGORY ($cid) {
        $ret = getMessage('_CATEGORY_404');
 
        // Is the category id set?
-       if ($cid == "0") {
+       if ($cid == '0') {
                // No category
                $ret = getMessage('_CATEGORY_NONE');
        } elseif ($cid > 0) {
@@ -994,7 +994,7 @@ function GET_PAYMENT ($pid, $full=false) {
                } else {
                        // Return title and price
                        list($t, $p) = SQL_FETCHROW($result);
-                       $ret = $t." / ".TRANSLATE_COMMA($p)." {!POINTS!}";
+                       $ret = $t.' / '.TRANSLATE_COMMA($p).' {!POINTS!}';
                }
        }
 
@@ -1006,8 +1006,8 @@ function GET_PAYMENT ($pid, $full=false) {
 }
 
 // Get (basicly) the price of given payment id
-function GET_PAY_POINTS ($pid, $lookFor = "price") {
-       $ret = "-1";
+function GET_PAY_POINTS ($pid, $lookFor = 'price') {
+       $ret = '-1';
        $result = SQL_QUERY_ESC("SELECT %s FROM `{!_MYSQL_PREFIX!}_payments` WHERE id=%s LIMIT 1",
                array($lookFor, $pid), __FUNCTION__, __LINE__);
        if (SQL_NUMROWS($result) == 1) {
@@ -1019,9 +1019,9 @@ function GET_PAY_POINTS ($pid, $lookFor = "price") {
 }
 
 // Remove a receiver's ID from $receivers and add a link for him to confirm
-function REMOVE_RECEIVER (&$receivers, $key, $uid, $pool_id, $stats_id="", $bonus=false) {
+function REMOVE_RECEIVER (&$receivers, $key, $uid, $pool_id, $stats_id='', $bonus=false) {
        // Default is not removed
-       $ret = "failed";
+       $ret = 'failed';
 
        // Is the userid valid?
        if ($uid > 0) {
@@ -1031,8 +1031,8 @@ function REMOVE_RECEIVER (&$receivers, $key, $uid, $pool_id, $stats_id="", $bonu
                // Is there already a line for this user available?
                if ($stats_id > 0) {
                        // Only when we got a real stats ID continue searching for the entry
-                       $type = "NORMAL"; $rowName = "stats_id";
-                       if ($bonus) { $type = "BONUS"; $rowName = 'bonus_id'; }
+                       $type = 'NORMAL'; $rowName = 'stats_id';
+                       if ($bonus) { $type = 'BONUS'; $rowName = 'bonus_id'; }
 
                        // Try to look the entry up
                        $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_links` WHERE %s='%s' AND userid=%s AND link_type='%s' LIMIT 1",
@@ -1043,10 +1043,10 @@ function REMOVE_RECEIVER (&$receivers, $key, $uid, $pool_id, $stats_id="", $bonu
                                // So we add one!
                                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_links` (%s, userid, link_type) VALUES ('%s','%s','%s')",
                                        array($rowName, $stats_id, bigintval($uid), $type), __FUNCTION__, __LINE__);
-                               $ret = "done";
+                               $ret = 'done';
                        } else {
                                // Already found
-                               $ret = "already";
+                               $ret = 'already';
                        }
 
                        // Free memory
@@ -1059,10 +1059,10 @@ function REMOVE_RECEIVER (&$receivers, $key, $uid, $pool_id, $stats_id="", $bonu
 }
 
 // Calculate sum (default) or count records of given criteria
-function GET_TOTAL_DATA ($search, $tableName, $lookFor = "id", $whereStatement = 'userid', $countRows = false, $add = "") {
+function GET_TOTAL_DATA ($search, $tableName, $lookFor = 'id', $whereStatement = 'userid', $countRows = false, $add = '') {
        $ret = 0;
-       //* DEBUG: */ echo $search."/".$tableName."/".$lookFor."/".$whereStatement."/".$add."<br />\n";
-       if ((empty($search)) && ($search != "0")) {
+       //* DEBUG: */ echo $search.'/'.$tableName.'/'.$lookFor.'/'.$whereStatement.'/'.$add.'<br />\n';
+       if ((empty($search)) && ($search != '0')) {
                // Count or sum whole table?
                if ($countRows === true) {
                        // Count whole table
@@ -1092,18 +1092,18 @@ function GET_TOTAL_DATA ($search, $tableName, $lookFor = "id", $whereStatement =
        SQL_FREERESULT($result);
 
        // Fix empty values
-       if ((empty($ret)) && ($lookFor != "counter") && ($lookFor != "id") && ($lookFor != 'userid')) {
+       if ((empty($ret)) && ($lookFor != 'counter') && ($lookFor != 'id') && ($lookFor != 'userid')) {
                // Float number
-               $ret = "0.00000";
-       } elseif ("".$ret."" == "") {
+               $ret = '0.00000';
+       } elseif (''.$ret.'' == '') {
                // Fix empty result
-               $ret = "0";
+               $ret = '0';
        }
 
        // Return value
        return $ret;
 }
-// "Getter fro ref level percents
+// Getter fro ref level percents
 function GET_REF_LEVEL_PERCENTS ($level) {
        // Default is zero
        $per = 0;
@@ -1150,7 +1150,7 @@ function GET_REF_LEVEL_PERCENTS ($level) {
  * add_mode    = Add points only to $uid or also refs? (WARNING! Changing "ref" to "direct"
  *               for default value will cause no referal will get points ever!!!)
  */
-function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid="0", $locked=false, $add_mode="ref") {
+function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid='0', $locked=false, $add_mode='ref') {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
        global $DATA;
 
@@ -1158,7 +1158,7 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid
        $add_mode = strtolower($add_mode);
 
        // When $uid = 0 add points to jackpot
-       if ($uid == "0") {
+       if ($uid == '0') {
                // Add points to jackpot
                ADD_JACKPOT($points);
                return;
@@ -1182,10 +1182,10 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid
        }
 
        // Default is 'normal' points
-       $data = "points";
+       $data = 'points';
 
        // Which points, locked or normal?
-       if ($locked) $data = "locked_points";
+       if ($locked) $data = 'locked_points';
 
        // Check user account
        $result_user = SQL_QUERY_ESC("SELECT refid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND `status`='CONFIRMED' LIMIT 1",
@@ -1244,7 +1244,7 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid
                                );
 
                                // Load email template
-                               $msg = LOAD_EMAIL_TEMPLATE("confirm-referal", $content, bigintval($uid));
+                               $msg = LOAD_EMAIL_TEMPLATE('confirm-referal', $content, bigintval($uid));
 
                                SEND_EMAIL($email, THANX_REFERRAL_ONE, $msg);
                        } elseif (($send_notify) && ($ref == 0) && (!$locked) && ($add_mode == "direct") && (!defined('__POINTS_VALUE'))) {
@@ -1258,7 +1258,7 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid
                                );
 
                                // Load message
-                               $msg = LOAD_EMAIL_TEMPLATE("add-points", $content, $uid);
+                               $msg = LOAD_EMAIL_TEMPLATE('add-points', $content, $uid);
 
                                // And sent it away
                                SEND_EMAIL($email, getMessage('SUBJECT_DIRECT_PAYMENT'), $msg);
@@ -1266,7 +1266,7 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid
                        }
 
                        // Maybe there's another ref?
-                       if (($ref > 0) && ($points > 0) && ($ref != $uid) && ($add_mode == "ref")) {
+                       if (($ref > 0) && ($points > 0) && ($ref != $uid) && ($add_mode == 'ref')) {
                                // Then let's credit him here...
                                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},points={$points} - ADVANCE!<br />\n";
                                ADD_POINTS_REFSYSTEM(sprintf("%s_ref:%s", $subject, $GLOBALS['ref_level']), $ref, $points, $send_notify, $ref, $locked);
@@ -1316,7 +1316,7 @@ function UPDATE_REF_COUNTER ($uid) {
        } elseif ((($ref == $uid) || ($ref == 0)) && (GET_EXT_VERSION('cache') >= '0.1.2')) {
                // Remove cache here
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - CACHE!<br />\n";
-               rebuildCacheFiles("refsystem", "refsystem");
+               rebuildCacheFiles('refsystem', 'refsystem');
        }
 
        // "Walk" back here
@@ -1347,7 +1347,7 @@ function SEND_ADMIN_EMAILS ($subj, $msg) {
 // Get ID number from administrator's login name
 function GET_ADMIN_ID ($login) {
        // By default no admin is found
-       $ret = "-1";
+       $ret = '-1';
 
        // Check cache
        if (isset($GLOBALS['cache_array']['admins']['aid'][$login])) {
@@ -1385,7 +1385,7 @@ function GET_CURRENT_ADMIN_ID () {
 // Get password hash from administrator's login name
 function GET_ADMIN_HASH ($aid) {
        // By default an invalid hash is returned
-       $ret = "-1";
+       $ret = '-1';
 
        if (isset($GLOBALS['cache_array']['admins']['password'][$aid])) {
                // Check cache
@@ -1403,7 +1403,7 @@ function GET_ADMIN_HASH ($aid) {
 
                        // Set cache
                        $GLOBALS['cache_array']['admins']['password'][$aid] = $ret;
-               }
+               } // END - if
 
                // Free result
                SQL_FREERESULT($result);
@@ -1413,7 +1413,7 @@ function GET_ADMIN_HASH ($aid) {
 //
 function GET_ADMIN_LOGIN ($aid) {
        // By default a non-existent login is returned (other functions react on this!)
-       $ret = "***";
+       $ret = '***';
 
        if (isset($GLOBALS['cache_array']['admins']['login'][$aid])) {
                // Get cache
@@ -1441,7 +1441,7 @@ function GET_ADMIN_LOGIN ($aid) {
 // Get email address of admin id
 function GET_ADMIN_EMAIL ($aid) {
        // By default an invalid emails is returned
-       $ret = "***";
+       $ret = '***';
 
        if (isset($GLOBALS['cache_array']['admins']['email'][$aid])) {
                // Get cache
@@ -1471,12 +1471,12 @@ function GET_ADMIN_EMAIL ($aid) {
 // Get default ACL  of admin id
 function GET_ADMIN_DEFAULT_ACL ($aid) {
        // By default an invalid ACL value is returned
-       $ret = "***";
+       $ret = '***';
 
        // Is sql_patches there and was it found in cache?
        if (!EXT_IS_ACTIVE('sql_patches')) {
                // Not found, which is bad, so we need to allow all
-               $ret =  "allow";
+               $ret =  'allow';
        } elseif (isset($GLOBALS['cache_array']['admins']['def_acl'][$aid])) {
                // Use cache
                $ret = $GLOBALS['cache_array']['admins']['def_acl'][$aid];
@@ -1503,22 +1503,22 @@ function GET_ADMIN_DEFAULT_ACL ($aid) {
        return $ret;
 }
 //
-function ADD_OPTION_LINES ($table, $id, $name, $default="", $special="", $where="") {
+function ADD_OPTION_LINES ($table, $id, $name, $default='', $special='', $where='') {
        $ret = '';
-       if ($table == "/ARRAY/") {
+       if ($table == '/ARRAY/') {
                // Selection from array
                if (is_array($id) && is_array($name) && count($id) == count($name)) {
                        // Both are arrays
                        foreach ($id as $idx => $value) {
-                               $ret .= "<option value=\"".$value."\"";
+                               $ret .= '<option value="' . $value . '"';
                                if ($default == $value) $ret .= ' selected="selected"';
-                               $ret .= ">".$name[$idx]."</option>\n";
+                               $ret .= '>' . $name[$idx] . '</option>';
                        } // END - foreach
                } // END - if
        } else {
                // Data from database
-               $SPEC = ", ".$id;
-               if (!empty($special)) $SPEC = ", ".$special;
+               $SPEC = ', '.$id;
+               if (!empty($special)) $SPEC = ', '.$special;
                $ORDER = $name.$SPEC;
                if ($table == 'country') $ORDER = $special;
                $result = SQL_QUERY_ESC("SELECT %s, %s".$SPEC." FROM `{!_MYSQL_PREFIX!}_%s` ".$where." ORDER BY %s",
@@ -1528,17 +1528,17 @@ function ADD_OPTION_LINES ($table, $id, $name, $default="", $special="", $where=
                        // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
                        while (list($value, $title, $add) = SQL_FETCHROW($result)) {
                                if (empty($special)) $add = '';
-                               $ret .= "<option value=\"".$value."\"";
+                               $ret .= '<option value="' . $value . '"';
                                if ($default == $value) $ret .= ' selected="selected"';
-                               if (!empty($add)) $add = " (".$add.")";
-                               $ret .= ">".$title.$add."</option>\n";
+                               if (!empty($add)) $add = ' ('.$add.')';
+                               $ret .= '>' . $title . $add . '</option>';
                        } // END - while
 
                        // Free memory
                        SQL_FREERESULT($result);
                } else {
                        // No data found
-                       $ret = "<option value=\"x\">{--SELECT_NONE--}</option>\n";
+                       $ret = '<option value="x">{--SELECT_NONE--}</option>';
                }
        }
 
@@ -1554,13 +1554,13 @@ function activateExchange () {
        } // END - if
 
        // Check total amount of users
-       $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", 'userid', "status", true, " AND max_mails > 0");
+       $totalUsers = GET_TOTAL_DATA('CONFIRMED', 'user_data', 'userid', 'status', true, ' AND max_mails > 0');
 
        if ($totalUsers >= getConfig('activate_xchange')) {
                // Activate System
                SET_SQLS(array(
                        "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='N', `hidden`='N', `mem_only`='Y' WHERE `module`='order' LIMIT 1",
-                       "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='order' OR `what`='unconfirmed' LIMIT 2",
+                       "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what='order' OR `what`='unconfirmed' LIMIT 2",
                        "UPDATE `{!_MYSQL_PREFIX!}_config` SET activate_xchange='0' WHERE config=0 LIMIT 1"
                ));
 
@@ -1568,13 +1568,14 @@ function activateExchange () {
                runFilterChain('run_sqls');
 
                // Rebuild caches
-               rebuildCacheFiles("config", "config");
-               rebuildCacheFiles("modreg", "modreg");
+               // @TODO Rewrite this to a filter
+               rebuildCacheFiles('config', 'config');
+               rebuildCacheFiles('modreg', 'modreg');
        } // END - if
 }
+
 //
-function DELETE_USER_ACCOUNT($uid, $reason)
-{
+function DELETE_USER_ACCOUNT ($uid, $reason) {
        $points = 0;
        $result = SQL_QUERY_ESC("SELECT (SUM(p.points) - d.used_points) AS points
 FROM `{!_MYSQL_PREFIX!}_user_points` AS p
@@ -1620,12 +1621,12 @@ WHERE p.userid=%s", array(bigintval($uid)), __FUNCTION__, __LINE__);
 //
 function META_DESCRIPTION ($mod, $wht) {
        // Exclude admin and member's area
-       if (($mod != 'admin') && ($mod != "login")) {
+       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."\" />");
+               OUTPUT_HTML('<meta name="description" content="' . $DESCR . '" />');
        } // END - if
 
        // Remove depth
@@ -1649,7 +1650,7 @@ function ADD_JACKPOT($points) {
 //
 function SUB_JACKPOT($points) {
        // First failed
-       $ret = "-1";
+       $ret = '-1';
 
        // Get current points
        $result = SQL_QUERY("SELECT points FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FUNCTION__, __LINE__);
@@ -1670,7 +1671,8 @@ function SUB_JACKPOT($points) {
        // Free memory
        SQL_FREERESULT($result);
 }
-//
+
+// Checks wether the extension demo is actuve and the admin login is demo (password needs to be demo, too!)
 function IS_DEMO () {
        return ((EXT_IS_ACTIVE('demo')) && (get_session('admin_login') == 'demo'));
 }
@@ -1688,13 +1690,13 @@ function GET_WHAT ($modCheck) {
        switch ($modCheck)
        {
        case 'admin':
-               $wht = "overview";
+               $wht = 'overview';
                break;
 
-       case "login":
+       case 'login':
        case 'index':
-               $wht = "welcome";
-               if (($modCheck == 'index') && (getConfig('index_home') != "")) $wht = getConfig('index_home');
+               $wht = 'welcome';
+               if (($modCheck == 'index') && (getConfig('index_home') != '')) $wht = getConfig('index_home');
                break;
 
        default:
@@ -1726,9 +1728,9 @@ function SUB_POINTS ($subject, $uid, $points) {
 }
 
 // Update config entries
-function UPDATE_CONFIG ($entries, $values, $updateMode="") {
+function UPDATE_CONFIG ($entries, $values, $updateMode='') {
        // Do not update config in CSS mode
-       if (($GLOBALS['output_mode'] == "1") || ($GLOBALS['output_mode'] == -1)) {
+       if (($GLOBALS['output_mode'] == '1') || ($GLOBALS['output_mode'] == -1)) {
                return;
        } // END - if
 
@@ -1747,7 +1749,7 @@ function UPDATE_CONFIG ($entries, $values, $updateMode="") {
                                if (($values[$idx] + 0) === $values[$idx]) {
                                        // Number detected
                                        $all .= sprintf("%s=%s,", $entry, (float)$values[$idx]);
-                               } elseif ($values[$idx] == "UNIX_TIMESTAMP()") {
+                               } elseif ($values[$idx] == 'UNIX_TIMESTAMP()') {
                                        // Function UNIX_TIMESTAMP() detected
                                        $all .= sprintf("%s=%s,", $entry, $values[$idx]);
                                } else {
@@ -1783,7 +1785,7 @@ function UPDATE_CONFIG ($entries, $values, $updateMode="") {
        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):entries={$entries},affectedRows={$affectedRows}<br />\n";
 
        // Rebuild cache
-       rebuildCacheFiles("config", "config");
+       rebuildCacheFiles('config', 'config');
 }
 
 // Prepares an SQL statement part for HTML mail and/or holiday depency
@@ -1792,10 +1794,10 @@ function PREPARE_SQL_HTML_HOLIDAY ($mode) {
        $MORE = '';
 
        // HTML mail?
-       if ($mode == 'html') $MORE = " AND html='Y'";
+       if ($mode == 'html') $MORE = " AND `html`='Y'";
        if (GET_EXT_VERSION('holiday') >= '0.1.3') {
                // Add something for the holiday extension
-               $MORE .= " AND holiday_active='N'";
+               $MORE .= " AND `holiday_active`='N'";
        } // END - if
 
        // Return result
@@ -1875,11 +1877,11 @@ WHERE userid=%s AND `status`='CONFIRMED' AND receive_mails > 0".PREPARE_SQL_HTML
                $OUT = '';
                foreach ($CATS['id'] as $key => $value) {
                        if (strlen($CATS['name'][$key]) > 20) $CATS['name'][$key] = substr($CATS['name'][$key], 0, 17)."...";
-                       $OUT .= "      <option value=\"".$value."\">".$CATS['name'][$key]." (".$CATS['uids'][$key]." {--USER_IN_CAT--})</option>\n";
+                       $OUT .= '      <option value="' . $value . '">' . $CATS['name'][$key] . ' (' . $CATS['uids'][$key] . ' {--USER_IN_CAT--})</option>';
                } // END - foreach
        } else {
                // No cateogries are defined yet
-               $OUT = "<option class=\"member_failed\">{!MEMBER_NO_CATS!}</option>\n";
+               $OUT = '<option class="member_failed">{!MEMBER_NO_CATS!}</option>';
        }
 
        // Return HTML code
@@ -1909,10 +1911,10 @@ function ADD_BONUS_MAIL_TO_QUEUE ($subject, $text, $receiverList, $points, $seco
        // HTML extension active?
        if (EXT_IS_ACTIVE('html_mail')) {
                // No HTML by default
-               $HTML = "N";
+               $HTML = 'N';
 
                // HTML mode?
-               if ($mode == 'html') $HTML = "Y";
+               if ($mode == 'html') $HTML = 'Y';
 
                // Add HTML mail
                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_bonus`
@@ -1977,12 +1979,12 @@ function GENERATE_RECEIVER_LIST ($cat, $receiver, $mode="") {
        // Exclude users in holiday?
        if (GET_EXT_VERSION('holiday') >= '0.1.3') {
                // Add something for the holiday extension
-               $CAT_WHERE .= " AND d.holiday_active='N'";
+               $CAT_WHERE .= " AND d.`holiday_active`='N'";
        } // END - if
 
        if ((EXT_IS_ACTIVE('html_mail')) && ($mode == 'html')) {
                // Only include HTML receivers
-               $result = SQL_QUERY_ESC("SELECT d.userid FROM `{!_MYSQL_PREFIX!}_user_data` AS d ".$CAT_TABS." WHERE d.`status`='CONFIRMED' AND d.html='Y'".$CAT_WHERE." ORDER BY d.%s %s LIMIT %s",
+               $result = SQL_QUERY_ESC("SELECT d.userid FROM `{!_MYSQL_PREFIX!}_user_data` AS d ".$CAT_TABS." WHERE d.`status`='CONFIRMED' AND d.`html`='Y'".$CAT_WHERE." ORDER BY d.%s %s LIMIT %s",
                        array($cat, getConfig('order_select'), getConfig('order_mode'), $receiver), __FUNCTION__, __LINE__);
        } else {
                // Include all
@@ -2073,7 +2075,7 @@ function GET_USER_REF_POINTS ($uid, $level) {
 
        // Do we have nickname extension installed?
        if (EXT_IS_ACTIVE('nickname')) {
-               $add = ", ud.nickname";
+               $add = ', ud.nickname';
        } // END - if
 
        // Get refs from database
@@ -2092,10 +2094,10 @@ ORDER BY ur.refid ASC",
                // Fetch all entries
                while ($row = SQL_FETCHARRAY($result)) {
                        // Get total points of this user
-                       $row['points'] = GET_TOTAL_DATA($row['refid'], "user_points", "points") - GET_TOTAL_DATA($row['refid'], "user_data", "used_points");
+                       $row['points'] = GET_TOTAL_DATA($row['refid'], 'user_points', 'points') - GET_TOTAL_DATA($row['refid'], 'user_data', 'used_points');
 
                        // Get unconfirmed mails
-                       $row['unconfirmed']  = GET_TOTAL_DATA($row['refid'], "user_links", "id", 'userid', true);
+                       $row['unconfirmed']  = GET_TOTAL_DATA($row['refid'], 'user_links', 'id', 'userid', true);
 
                        // Init clickrate with zero
                        $row['clickrate'] = 0;
index f7752968ece7ae4412747f21b3e7caf7bdee8621..ccfca682f4265fddcd45c445896a652e164f810a 100644 (file)
@@ -51,7 +51,7 @@ if (($GLOBALS['output_mode'] == 1) || ((!isResetModeEnabled()) && (getConfig('ho
 // Check for holidays we need to enable and send email to user
 $result_main = SQL_QUERY("SELECT userid, holiday_activated
 FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE holiday_activated > 0 AND holiday_activated < UNIX_TIMESTAMP() AND holiday_active='N'
+WHERE holiday_activated > 0 AND holiday_activated < UNIX_TIMESTAMP() AND `holiday_active`='N'
 ORDER BY holiday_activated",
        __FILE__, __LINE__);
 
@@ -85,7 +85,7 @@ LIMIT 1",
 
                        // Update account
                        ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
-SET holiday_active='Y'
+SET `holiday_active`='Y'
 WHERE userid=%s
 LIMIT 1",
                                array(bigintval($content['userid'])), __FILE__, __LINE__, false));
index 3e3ec38bbaa51d417b28545bb9705098290efca9..1e156d17e7174a386df97f29b8425f89374dd8ea 100644 (file)
@@ -76,7 +76,7 @@ if (isSessionVariableSet('userid')) {
 } // 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 ((basename($_SERVER['PHP_SELF']) == 'index.php') || (basename($_SERVER['PHP_SELF']) == 'modules.php') || (isInstalling())) {
        if (count($_SESSION) > 0) {
                // Session variables accepted!
                define('__COOKIES', true);
index 7f0babad2b9de46e699619d5f3a7bd90596f6c3c..5b6023eb836ff85b15055a5ff83dacbe180573a6 100644 (file)
@@ -15,7 +15,7 @@
        <tr>
                <td width="10" class="seperator">&nbsp;</td>
                <td align="center" width="275" colspan="3">
-                       {--ORDER_MAX_ORDER_SELECT--}
+                       {--ADMIN_ORDER_MAX_ORDER_SELECT--}
                </td>
                <td width="10" class="seperator">&nbsp;</td>
        </tr>
        <tr>
                <td width="10" class="seperator">&nbsp;</td>
                <td align="right" width="275">
-               {--ORDER_MIN_RECEIVER_PER_ORDER--}:</td>
+               {--ADMIN_ORDER_MIN_RECEIVER_PER_ORDER--}:</td>
                <td width="10" class="seperator">&nbsp;</td>
                <td align="center" width="275"><input type="input"
                        name="order_min" class="admin_normal" value="{!__MIN_VALUE!}"
index 5d90e41115053f7bbcad6be2da8eead973a3e913..94908868073da1cea86e89093fbd62e47b525a7b 100644 (file)
@@ -12,7 +12,7 @@
        <tr>
                <td width="10" class="seperator">&nbsp;</td>
                <td align="center" width="275" colspan="3">
-               {--ORDER_MAX_ORDER_SELECT--}</td>
+               {--ADMIN_ORDER_MAX_ORDER_SELECT--}</td>
                <td width="10" class="seperator">&nbsp;</td>
        </tr>
        <tr>
        <tr>
                <td width="10" class="seperator">&nbsp;</td>
                <td align="center" width="275">{--ADMIN_ORDER_MAX--}:&nbsp;<input
-                       type="radio" name="order_max_full" class="admin_normal" value="MAX"{!__MAX_DEFAULT!}>
+                       type="radio" name="order_max_full" class="admin_normal" value="MAX"{!__MAX_DEFAULT!} />
                </td>
                <td width="10" class="seperator">&nbsp;</td>
                <td align="center" width="275">{--ADMIN_ORDER_ORDER--}:&nbsp;<input
-                       type="radio" name="order_max_full" class="admin_normal" value="ORDER"{!__ORDER_DEFAULT!}>
+                       type="radio" name="order_max_full" class="admin_normal" value="ORDER"{!__ORDER_DEFAULT!} />
                </td>
                <td width="10" class="seperator">&nbsp;</td>
        </tr>
@@ -46,7 +46,7 @@
        <tr>
                <td width="10" class="seperator">&nbsp;</td>
                <td align="right" width="275">
-                       {--ORDER_MIN_RECEIVER_PER_ORDER--}:
+                       {--ADMIN_ORDER_MIN_RECEIVER_PER_ORDER--}:
                </td>
                <td width="10" class="seperator">&nbsp;</td>
                <td align="center" width="275">
@@ -66,4 +66,4 @@
                <td width="10" class="admin_footer seperator">&nbsp;</td>
        </tr>
 </table>
-</form>
\ No newline at end of file
+</form>