inc/cache/.htaccess -text
inc/check-reset.php -text
inc/config-functions.php -text
+inc/config-global.php -text
+inc/config-local.php.dist -text
inc/config.php -text
inc/databases.php -text
inc/db/.htaccess -text
inc/extensions/ext-holiday.php -text
inc/extensions/ext-html_mail.php -text
inc/extensions/ext-iso3166.php -text
+inc/extensions/ext-lead.php -text
inc/extensions/ext-logs.php -text
inc/extensions/ext-mailid.php -text
inc/extensions/ext-maintenance.php -text
inc/libs/wernis_functions.php -text
inc/libs/yoomedia_functions.php -text
inc/load_cache.php -text
+inc/load_config.php -text
inc/load_extensions.php -text
inc/loader/.htaccess -text
inc/loader/load_cache-admin.php -text
inc/weekly/.htaccess -text
inc/weekly/weekly_ -text
inc/weekly/weekly_surfbar.php -text
+inc/wrapper-functions.php -text
/index.php -text
/install.php -text
install/menu-de.sql -text
templates/de/html/ext/ext_events.tpl -text
templates/de/html/ext/ext_holiday.tpl -text
templates/de/html/ext/ext_html_mail.tpl -text
+templates/de/html/ext/ext_lead.tpl -text
templates/de/html/ext/ext_logs.tpl -text
templates/de/html/ext/ext_mailid.tpl -text
templates/de/html/ext/ext_maintenance.tpl -text
inc/cache/*.cache
inc/cache/*.log
inc/cache/.revision
+inc/cache/config-local.php
$GLOBALS['output_mode'] = -1;
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
// Is the script installed?
if (isInstalled()) {
$GLOBALS['output_mode'] = -1;
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
// Is the script installed?
if (isInstalled()) {
$msg = null;
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
// Is the 'beg' extension active?
REDIRCT_ON_UNINSTALLED_EXTENSION('beg');
$pay = false;
// Validate if it is not a number
- if ("".(REQUEST_GET('uid') + 0)."" !== "".REQUEST_GET('uid')."") {
+ if (''.(REQUEST_GET('uid') + 0).'' !== ''.REQUEST_GET('uid').'') {
if (EXT_IS_ACTIVE('nickname')) {
// Maybe we have found a nickname?
$result = SQL_QUERY_ESC("SELECT userid, beg_clicks, ref_payout, status, last_online FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1",
}
// Check if locked in so don't pay points
- $status = "failed";
+ $status = 'failed';
// Check if account was found
if (SQL_NUMROWS($result) == 1) {
// Set nickname / userid for the template(s
define('__BEG_UID' , REQUEST_GET('uid'));
define('__BEG_CLICKS', ($clicks + 1));
- define('__BEG_BANNER', LOAD_TEMPLATE("beg_banner", true));
+ define('__BEG_BANNER', LOAD_TEMPLATE('beg_banner', true));
define('__BEG_POINTS', translateComma($points));
} else {
// Other status
array($uid, detectRemoteAddr(), session_id()), __FILE__, __LINE__);
// Entry not found, points set and not logged in?
- if (((SQL_NUMROWS($result) == 0) || (IS_ADMIN())) && ($points > 0) && (!IS_MEMBER()) && (getConfig('beg_pay_mode') == "NONE")) {
+ if (((SQL_NUMROWS($result) == 0) || (IS_ADMIN())) && ($points > 0) && (!IS_MEMBER()) && (getConfig('beg_pay_mode') == 'NONE')) {
// Admin is testing?
if (!IS_ADMIN()) {
array($uid, detectRemoteAddr(), session_id()), __FILE__, __LINE__);
// Was is successfull?
- if (SQL_AFFECTEDROWS() == 1) {
- // Okay!
- $pay = true;
- } // END - if
+ $pay (SQL_AFFECTEDROWS() == 1);
} else {
// Is admin!
$pay = true;
// Add points to user or begging rallye account
if (BEG_ADD_POINTS($uid, $points)) {
// Set 'done' message
- define('__BEG_MSG', LOAD_TEMPLATE("beg_done", true));
+ $content['msg'] = LOAD_TEMPLATE('beg_done', true));
} else {
// Error!
- define('__BEG_MSG', LOAD_TEMPLATE("beg_failed", true));
+ $content['msg'] = LOAD_TEMPLATE('beg_failed', true));
}
} else {
// Error!
- define('__BEG_MSG', LOAD_TEMPLATE("beg_failed", true));
+ $content['msg'] = LOAD_TEMPLATE('beg_failed', true));
}
} elseif (IS_MEMBER()) {
// Logged in user found!
- define('__BEG_MSG', LOAD_TEMPLATE("beg_login", true));
- } elseif (getConfig('beg_pay_mode') != "NONE") { // Other pay-mode active!
+ $content['msg'] = LOAD_TEMPLATE('beg_login', true));
+ } elseif (getConfig('beg_pay_mode') != 'NONE') { // Other pay-mode active!
// Prepare content for template
$content = array(
'clicks' => constant('__BEG_CLICKS'),
);
// Load message template depending on pay-mode
- define('__BEG_MSG', LOAD_TEMPLATE("beg_pay_mode_".strtolower(getConfig('beg_pay_mode')), true, $content));
+ $content['msg'] = LOAD_TEMPLATE('beg_pay_mode_'.strtolower(getConfig('beg_pay_mode')), true, $content));
$pay = true;
} else {
// Clicked received while reload lock is active
- define('__BEG_MSG', LOAD_TEMPLATE("beg_failed", true));
+ $content['msg'] = LOAD_TEMPLATE('beg_failed', true));
}
// Free memory
loadIncludeOnce('inc/header.php');
// Load final template
- LOAD_TEMPLATE("beg_link");
+ LOAD_TEMPLATE('beg_link', false, $content);
// Tracker code enabled? (We don't track users here!
- if ((getConfig('beg_pay_mode') != "NONE") && ($pay)) {
+ if ((getConfig('beg_pay_mode') != 'NONE') && ($pay === true)) {
// Prepare content for template
// @TODO Opps, what is missing here???
$content = array(
);
// Include config-depending template
- LOAD_TEMPLATE("beg_pay_code_".strtolower(getConfig('beg_pay_mode')), false, $content);
- } elseif ((!$pay) && (!defined('__BEG_MSG'))) {
+ LOAD_TEMPLATE('beg_pay_code_'.strtolower(getConfig('beg_pay_mode')), false, $content);
+ } elseif ((!$pay) && (!isset($content['msg']))) {
// Cannot pay! :-(
- define('__BEG_MSG', LOAD_TEMPLATE("beg_failed", true));
+ $content['msg'] = LOAD_TEMPLATE('beg_failed', true));
}
// Include footer
loadIncludeOnce('inc/footer.php');
- } elseif (($status != 'CONFIRMED') && ($status != "failed")) {
+ } elseif (($status != 'CONFIRMED') && ($status != 'failed')) {
// Maybe locked/unconfirmed account?
$msg = generateErrorCodeFromUserStatus($status);
- } elseif (($uid == '0') || ($status == "failed")) {
+ } elseif (($uid == '0') || ($status == 'failed')) {
// Inalid or locked account, so let's find out
$result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1",
array(REQUEST_GET('uid')), __FILE__, __LINE__);
$GLOBALS['output_mode'] = -1;
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
// Is the 'birthday' extension active?
-REDIRECT_ON_UNINSTALLED_EXTENSION('birthday');
+redirectOnUninstalledExtension('birthday');
// Is the script installed?
if (isInstalled()) {
array($uid, $chk), __FILE__, __LINE__);
//* DEBUG: */ echo "uid=".$uid.",chk=".$chk." (".strlen($chk).'/'.strlen(REQUEST_GET('check')).'/'.SQL_NUMROWS($result).")<br />\n";
+ // Prepare content
+ $content = array();
+
// Is an entry there?
if (SQL_NUMROWS($result) == 1) {
// Ok, congratulation again! Here's your gift from us...
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_birthday` WHERE userid=%s AND chk_value='%s' LIMIT 1",
array($uid, $chk), __FILE__, __LINE__);
- // Transfer data to constants for the template
- define('__GENDER', translateGender($data['gender']));
- define('__SNAME' , $data['surname']);
- define('__FNAME' , $data['family']);
- define('__GIFT' , translateComma($data['points']));
+ // "Translate" some data
+ $data['gender'] = translateGender($data['gender']);
+ $data['points'] = translateComma($data['points']);
// Load message from template
- define('__MSG', LOAD_TEMPLATE('birthday_msg', true));
+ $content['msg'] = LOAD_TEMPLATE('birthday_msg', true, $data);
} else {
// Unconfirmed / locked accounts cannot get points
- define('__MSG', sprintf(getMessage('BIRTHDAY_CANNOT_STATUS'), translateUserStatus($data['status'])));
+ $content['msg'] = sprintf(getMessage('BIRTHDAY_CANNOT_STATUS'), translateUserStatus($data['status']));
}
} else {
// Cannot load data!
- define('__MSG', getMessage('BIRTHDAY_CANNOT_LOAD_DATA'));
+ $content['msg'] = getMessage('BIRTHDAY_CANNOT_LOAD_DATA');
}
// Free memory
loadInclude('inc/header.php');
// Load birthday header template (for your banners, e.g.?)
- define('__BIRTHDAY_HEADER', LOAD_TEMPLATE('birthday_header', true));
+ $content['header'] = LOAD_TEMPLATE('birthday_header', true);
// Load birthday footer template (for your banners, e.g.?)
- define('__BIRTHDAY_FOOTER', LOAD_TEMPLATE('birthday_footer', true));
+ $content['footer'] = LOAD_TEMPLATE('birthday_footer', true);
// Load final template and output it
- LOAD_TEMPLATE('birthday_confirm');
+ LOAD_TEMPLATE('birthday_confirm', false, $content);
// Include footer
loadInclude('inc/footer.php');
$GLOBALS['output_mode'] = -1;
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
if (((REQUEST_ISSET_GET(('user'))) || (REQUEST_ISSET_GET(('reseller')))) && (REQUEST_ISSET_GET(('banner')))) {
// Update clicks counter...
$GLOBALS['output_mode'] = -1;
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
// Is the script installed?
if ((isInstalled()) && (isAdminRegistered())) {
require('inc/libs/security_functions.php');
// Footer is disabled in CSS mode
-$GLOBALS['footer_sent'] = "-1";
+$GLOBALS['footer_sent'] = '-1';
// Init variables
$GLOBALS['what'] = '';
$GLOBALS['output_mode'] = '1';
$GLOBALS['module'] = 'css';
-// Set header
-header('Content-type: text/css');
-
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
+
+// Set header
+sendHeader('Content-type: text/css');
// Load header
loadInclude('inc/header.php');
$GLOBALS['output_mode'] = -1;
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
// Redirect only to registration page when this script is installed
if ((isInstalled()) && (getTotalFatalErrors() == 0)) {
$GLOBALS['output_mode'] = 0;
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
// Is the 'doubler' extension active?
-REDIRECT_ON_UNINSTALLED_EXTENSION('doubler');
+redirectOnUninstalledExtension('doubler');
// Is the script installed?
if (isInstalled()) {
$GLOBALS['output_mode'] = -1;
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
// Script installed?
if (isInstalled()) {
if (REQUEST_ISSET_GET(('code'))) {
// Generate image
GENERATE_IMAGE(bigintval(REQUEST_GET('code')));
- } elseif (REQUEST_ISSET_GET(('tag'))) {
+ } elseif (REQUEST_ISSET_GET('tag')) {
// Tag set so create the IFN (Include-FileName)
$INC = sprintf("inc/img/tag-%s.php",
- REQUEST_GET(('tag'))
+ REQUEST_GET('tag')
);
// Include is readable?
}
// Getter for $_CONFIG entries
-function getConfig ($entry) {
+function getConfig ($configEntry) {
global $_CONFIG;
// Default value
$value = null;
// Is the entry there?
- if (isConfigEntrySet($entry)) {
+ if (isConfigEntrySet($configEntry)) {
// Then use it
- $value = $_CONFIG[$entry];
+ $value = $_CONFIG[$configEntry];
} // END - if
// Return it
}
// Setter for $_CONFIG entries
-function setConfigEntry ($entry, $value) {
+function setConfigEntry ($configEntry, $value) {
global $_CONFIG;
// Secure the entry name
- $entry = SQL_ESCAPE($entry);
+ if (function_exists('SQL_ESCAPE')) {
+ // Use our secure function
+ $configEntry = SQL_ESCAPE($configEntry);
+ } else {
+ // Use maybe insecure function
+ $configEntry = smartAddSlashes($configEntry);
+ }
// And set it
- $_CONFIG[$entry] = $value;
+ $_CONFIG[$configEntry] = $value;
}
// Checks wether the given config entry is set
-function isConfigEntrySet ($entry) {
+function isConfigEntrySet ($configEntry) {
global $_CONFIG;
- return (isset($_CONFIG[$entry]));
+ return (isset($_CONFIG[$configEntry]));
}
// Increment or init with given value or 1 as default the given config entry
// Init the config array
function initConfig () {
global $_CONFIG;
+ debug_report_bug('Reached!');
// Set a minimum dummy configuration
$_CONFIG = array(
// Load configuration and return it as an arry
function loadConfiguration ($no = '0') {
- global $_CONFIG;
-
// Check for cache extension, cache-array and if the requested configuration is in cache
- if ((is_array($GLOBALS['cache_array'])) && (isset($GLOBALS['cache_array']['config'][$no])) && (is_array($GLOBALS['cache_array']['config'][$no]))) {
+ if ((isset($GLOBALS['cache_array'])) && (is_array($GLOBALS['cache_array'])) && (isset($GLOBALS['cache_array']['config'][$no])) && (is_array($GLOBALS['cache_array']['config'][$no]))) {
// Load config from cache
//* DEBUG: */ echo gettype($GLOBALS['cache_array']['config'][$no])."<br />\n";
foreach ($GLOBALS['cache_array']['config'][$no] as $key => $value) {
- $_CONFIG[$key] = $value;
+ setConfigEntry($key, $value);
} // END - foreach
// Count cache hits if exists
- if ((isset($_CONFIG['cache_hits'])) && (EXT_IS_ACTIVE('cache'))) {
- $_CONFIG['cache_hits']++;
+ if ((isConfigEntrySet('cache_hits')) && (EXT_IS_ACTIVE('cache'))) {
+ incrementConfigEntry('cache_hits');
} // END - if
} elseif ((!EXT_IS_ACTIVE('cache')) || (!isset($GLOBALS['cache_array']['config'][$no]))) {
// Load config from DB
// Is the config there?
if (SQL_NUMROWS($result_config) == 1) {
// Get config from database
- $_CONFIG = SQL_FETCHARRAY($result_config);
+ mergeConfig(SQL_FETCHARRAY($result_config));
} // END - if
// Free result
SQL_FREERESULT($result_config);
// Remember this config in the array
- $GLOBALS['cache_array']['config'][$no] = $_CONFIG;
+ $GLOBALS['cache_array']['config'][$no] = getConfigArray();
}
}
function getConfigArray () {
global $_CONFIG;
- // Return it
- return $_CONFIG;
+ // Default is null
+ $return = null;
+
+ // Is the config set?
+ if (isConfigLoaded()) {
+ // Then use it
+ $return = $_CONFIG;
+ } // END - if
+
+ // Return result
+ return $return;
}
// [EOF]
--- /dev/null
+<?php
+/************************************************************************
+ * MXChange v0.2.1 Start: 04/03/2009 *
+ * =============== Last change: 04/03/2009 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : config-global.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Global configuration *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Globale Konfiguration *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
+ require($INC);
+} // END - if
+
+/************************************************************************
+ * PLEASE DO NOT EDIT THE COMMENTS! install.php NEEDS THEM! *
+ ************************************************************************/
+
+if (function_exists('date_default_timezone_set')) {
+ // CFG: TIME-ZONE
+ @date_default_timezone_set('Europe/Berlin');
+} // END - if
+
+// CFG: ERROR_REPORTING
+@error_reporting(0);
+
+// CFG: REGISTER-GLOBALS
+@import_request_variables('');
+
+// These constants should be rewritten
+define('VERSION', 'v0.2.1');
+define('AUTHOR' , 'Roland Häder');
+define('TITLE', 'MXChange - Mail Exchange');
+define('COPY', 'Copyright © 2003 - 2008, by Roland Häder');
+
+// Auto-detection... (patched by "Stelzi" aka. profi-concept, thanks again!)
+$URL = 'http://' . getenv('SERVER_NAME') . str_replace("\\", '/', dirname($_SERVER['PHP_SELF']));
+while (substr($URL, -1, 1) == '/') { $URL = substr($URL, 0, -1); }
+$PATH = str_replace("\\", '/', substr(dirname(__FILE__), 0, -3));
+
+// CFG: SERVER-PATH
+define('PATH', $PATH);
+
+// CFG: HOST-URL (without trailing '/' !)
+define('URL', $URL);
+
+// Connect to the MySQL database...
+require(constant('PATH') . 'inc/mysql-connect.php');
+
+//
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * MXChange v0.2.1 Start: 04/03/2009 *
+ * =============== Last change: 04/03/2009 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : config-local.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Local configuration *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Lokale Konfiguration *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
+ require($INC);
+} // END - if
+
+/************************************************************************
+ * PLEASE DO NOT EDIT THE COMMENTS! install.php NEEDS THEM! *
+ ************************************************************************/
+
+// CFG: SITE-KEY
+setConfigEntry('SITE_KEY', "");
+
+// CFG: DATE-KEY
+setConfigEntry('DATE_KEY', date("d-m-Y (l-F-T)", time()));
+
+// CFG: DEFAULT-LANGUAGE
+setConfigEntry('DEFAULT_LANG', "de");
+
+// CFG: NULLPASS-WARNING
+setConfigEntry('WARN_NO_PASS', "Y");
+
+// CFG: WRITE-FOOTER
+setConfigEntry('WRITE_FOOTER', "Y");
+
+// CFG: OUTPUT-MODE
+setConfigEntry('OUTPUT_MODE', "render");
+
+// CFG: INSTALLED
+setConfigEntry('MXCHANGE_INSTALLED', "N");
+
+// CFG: ADMIN-SETUP
+setConfigEntry('ADMIN_REGISTERED', "N");
+
+// CFG: MYSQL-PREIFX
+setConfigEntry('_MYSQL_PREFIX', "mxchange");
+
+// CFG: TABLE-TYPE
+setConfigEntry('_TABLE_TYPE', "MyISAM");
+
+// CFG: DATABASE-TYPE
+setConfigEntry('_DB_TYPE', "mysql3");
+
+// CFG: DEBUG-MODE (if enabled all mails will be *displayed* and *not* send!)
+setConfigEntry('DEBUG_MODE', "Y");
+
+// CFG: BACKLINK (Enable backlink to mxchange.org in footer? rel=external is set!)
+setConfigEntry('ENABLE_BACKLINK', 'Y');
+
+// CFG: DEBUG-RESET (comment in to test daily reset, comment out to not test)
+//setConfigEntry('DEBUG_RESET', "Y");
+
+// CFG: DEBUG-MONTHLY (comment in to test monthly reset, comment out to not test)
+//setConfigEntry('DEBUG_MONTHLY', "Y");
+
+// CFG: DEBUG-WEEKLY (comment in to test weekly reset, comment out to not test)
+//setConfigEntry('DEBUG_WEEKLY', "Y");
+
+// Your MySQL data (we don't like M$ SQL ;-) )
+$GLOBALS['mysql'] = array(
+ // CFG: MYSQL-HOST
+ 'host' => "localhost",
+ // CFG: MYSQL-DBASE
+ 'dbase' => "db",
+ // CFG: MYSQL-LOGIN
+ 'login' => "user",
+ // CFG: MYSQL-PASSWORD
+ 'password' => "pass",
+);
+
+// SMTP-Subsystem (keep all empty to use legacy mail() command!)
+// CFG: SMTP-HOSTNAME
+setConfigEntry('SMTP_HOSTNAME', "");
+// CFG: SMTP-USER
+setConfigEntry('SMTP_USER' , "");
+// CFG: SMTP-PASSWORD
+setConfigEntry('SMTP_PASSWORD', "");
+
+// @TODO Rewrite the following three constants, somehow...
+// CFG: MAIN-TITLE
+define('MAIN_TITLE', "Your mail-exchanger title");
+
+// CFG: SLOGAN
+define('SLOGAN', "Your cool slogan here");
+
+// CFG: WEBMASTER
+define('WEBMASTER', "you@some-hoster.tld.invalid");
+
+//
+?>
<?php
-/************************************************************************
- * MXChange v0.2.1 Start: 08/25/2003 *
- * =============== Last change: 04/16/2004 *
- * *
- * -------------------------------------------------------------------- *
- * File : config.php *
- * -------------------------------------------------------------------- *
- * Short description : Your configuration data (MySQL) *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung : Ihre Konfigurationsdaten (MySQL) *
- * -------------------------------------------------------------------- *
- * $Revision:: $ *
- * $Date:: $ *
- * $Tag:: 0.2.1-FINAL $ *
- * $Author:: $ *
- * Needs to be in all Files and every File needs "svn propset *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder *
- * For more information visit: http://www.mxchange.org *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
- * MA 02110-1301 USA *
- ************************************************************************/
-
-// Some security stuff...
-if (!defined('__SECURITY'))
-{
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
- require($INC);
-}
-
-/************************************************************************
- * PLEASE DO NOT EDIT THE COMMENTS! install.php NEEDS THEM! *
- ************************************************************************/
-
-if (function_exists('date_default_timezone_set')) {
- // CFG: TIME-ZONE
- @date_default_timezone_set("Europe/Berlin");
-}
-
-// Most of these constants are old and deprecated. We don't use them either.
-// You can still feel free to use them in your templates / scripts if you like :-)
-define('VERSION', "v0.2.1");
-define('AUTHOR' , "Roland Häder");
-define('TITLE', "MXChange - Mail Exchange");
-define('COPY', "Copyright © 2003 - 2008, by Roland Häder");
-
-// CFG: ERROR_REPORTING
-@error_reporting(0);
-
-// CFG: REGISTER-GLOBALS
-@import_request_variables('');
-
-// CFG: SITE-KEY
-define('SITE_KEY', "gg42ny8-4yng23498-mf423igum-mtu248utn42-mf4839gun43");
-
-// CFG: DATE-KEY
-define('DATE_KEY', date("d-m-Y (l-F-T)", time()));
-
-// CFG: DEFAULT-LANGUAGE
-define('DEFAULT_LANG', "de");
-
-// CFG: NULLPASS-WARNING
-define('warn_no_pass', true);
-
-// CFG: WRITE-FOOTER
-define('WRITE_FOOTER', true);
-
-// CFG: OUTPUT-MODE
-define('OUTPUT_MODE', "render");
-
-// CFG: MAIN_TITLE
-define('MAIN_TITLE', "Your mail-exchanger title");
-
-// CFG: SLOGAN
-define('SLOGAN', "Your cool slogan here");
-
-// Auto-detection... (patched by "Stelzi" aka. profi-concept, thanks again!)
-$URL = "http://".getenv('SERVER_NAME') . str_replace("\\", '/', dirname($_SERVER['PHP_SELF']));
-while (substr($URL, -1, 1) == '/') { $URL = substr($URL, 0, -1); }
-$PATH = str_replace("\\", '/', substr(dirname(__FILE__), 0, -3));
-
-// CFG: HOST-URL (without trailing '/' !)
-define('URL', $URL);
-
-// CFG: SERVER-PATH
-define('PATH', $PATH);
-
-// CFG: WEBMASTER
-define('WEBMASTER', "you@some-hoster.tld.invalid");
-
-// CFG: INSTALLED
-define('mxchange_installed', false);
-
-// CFG: ADMIN-SETUP
-define('admin_registered', false);
-
-// CFG: FRAMESET
-define('frameset_active', false);
-
-// CFG: DEBUG-MODE (if enabled all mails will be *displayed* and *not* send!)
-define('DEBUG_MODE', false);
-
-// CFG: DEBUG-MAIL (turn this on if you need to debug mails, only affects if DEBUG_MODE is true)
-//define('DEBUG_MAIL', true);
-
-// CFG: DEBUG-RESET (comment in to test daily reset, comment out to not test)
-//define('DEBUG_RESET', true);
-
-// CFG: DEBUG-MONTHLY (comment in to test monthly reset, comment out to not test)
-//define('DEBUG_MONTHLY', true);
-
-// CFG: DEBUG-WEEKLY (comment in to test weekly reset, comment out to not test)
-//define('DEBUG_WEEKLY', true);
-
-// Your MySQL data (we don't like M$ SQL ;-) )
-$MySQL = array(
- // CFG: MYSQL-HOST
- 'host' => "localhost",
- // CFG: MYSQL-DBASE
- 'dbase' => "db",
- // CFG: MYSQL-LOGIN
- 'login' => "user",
- // CFG: MYSQL-PASSWORD
- 'password' => "pass",
-);
-
-// CFG: MYSQL-PREIFX
-define('_MYSQL_PREFIX', "mxchange");
-
-// CFG: TABLE-TYPE
-define('_TABLE_TYPE', "MyISAM");
-
-// CFG: DATABASE-TYPE
-define('_DB_TYPE', "mysql3");
-
-// Lead-Code data
-define('LEAD_CODE_ENABLED', true);
-define('LEAD_EXPIRY_TIME' , (30*24*60*60)); // == 30 days
-
-// SMTP-Subsystem (keep all empty to use legacy mail() command!)
-// CFG: SMTP-HOSTNAME
-define('SMTP_HOSTNAME', "");
-// CFG: SMTP-USER
-define('SMTP_USER' , "");
-// CFG: SMTP-PASSWORD
-define('SMTP_PASSWORD', "");
-
-// SSL cookies? (enable only if you have SSL, URLs will begin with https://)
-define('SSL_COOKIES', false);
-
-// CFG: BACKLINK (Enable backlink to mxchange.org in footer? rel=external is set!)
-define('ENABLE_BACKLINK', true);
-
-// Connect to the MySQL database...
-require(constant('PATH')."inc/mysql-connect.php");
-
-//
+// @DEPRECATED
?>
//
// Timestamp for yesterday, today ... all at 00:00 am
-define('START_YDAY', makeTime(0, 0, 0, time() - getConfig('one_day')));
-define('START_TDAY', makeTime(0, 0, 0, time()));
+setConfigEntry('START_YDAY', makeTime(0, 0, 0, time() - getConfig('one_day')));
+setConfigEntry('START_TDAY', makeTime(0, 0, 0, time()));
// Take a prime number which is long (if you know a longer one please try it out!)
-define('_PRIME', 591623);
+setConfigEntry('_PRIME', 591623);
// Calculate "entropy" with the prime number (for code generation)
-define('_ADD', (constant('_PRIME') * constant('_PRIME') / (pi() * getConfig('code_length') + 1)));
+setConfigEntry('_ADD', (getConfig('_PRIME') * getConfig('_PRIME') / (pi() * getConfig('code_length') + 1)));
// Random number for e.g. the "cache-buster" used in OpenX script
define('CACHE_BUSTER', mt_rand(1000000, 9999999));
// CFG: DEBUG-SQL (if enabled and DEBUG_MODE is enabled all SQL queries will be logged to debug.log)
-define('DEBUG_SQL', false);
+setConfigEntry('DEBUG_SQL', 'N');
// CFG: ENCRYPT-SEPERATOR
-define('ENCRYPT_SEPERATOR', ':');
+setConfigEntry('ENCRYPT_SEPERATOR', ':');
// Extra title is empty by default
-$EXTRA_TITLE = '';
+setExtraTitle('');
//
?>
$sql_string = str_replace("\t", " ", str_replace("\n", " ", str_replace("\r", " ", $sql_string)));
// Replace {!_MYSQL_PREFIX!} with constant, closes #84. Thanks to profi-concept
- $sql_string = str_replace("{!_MYSQL_PREFIX!}", constant('_MYSQL_PREFIX'), $sql_string);
+ $sql_string = str_replace("{!_MYSQL_PREFIX!}", getConfig('_MYSQL_PREFIX'), $sql_string);
// Replace {!_TABLE_TYPE!} with constant
- $sql_string = str_replace("{!_TABLE_TYPE!}", constant('_TABLE_TYPE'), $sql_string);
+ $sql_string = str_replace("{!_TABLE_TYPE!}", getConfig('_TABLE_TYPE'), $sql_string);
// Starting time
$querytimeBefore = array_sum(explode(' ', microtime()));
// Debug output
//* DEBUG: */ print "Query=<pre>".$sql_string."</pre>, affected=<strong>".SQL_AFFECTEDROWS()."</strong>, numrows=<strong>".SQL_NUMROWS($result)."</strong><br />\n";
- if (($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1") && (isDebugModeEnabled()) && (isBooleanConstantAndTrue('DEBUG_SQL'))) {
+ if (($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1') && (isDebugModeEnabled()) && (getConfig('DEBUG_SQL') == 'Y')) {
//
// Debugging stuff...
//
- $fp = fopen(constant('PATH')."inc/cache/mysql.log", 'a') or app_die(__FILE__, __LINE__, "Cannot write mysql.log!");
+ $fp = fopen(constant('PATH') . 'inc/cache/mysql.log', 'a') or app_die(__FILE__, __LINE__, "Cannot write mysql.log!");
if (!isset($GLOBALS['sql_first_entry'])) {
// Write first entry
fwrite($fp, "Module=".$GLOBALS['module']."\n");
// Debugging
//
//* DEBUG: */ $fp = fopen(constant('PATH')."inc/cache/escape_debug.log", 'a') or app_die(__FILE__, __LINE__, "Cannot write debug.log!");
- //* DEBUG: */ fwrite($fp, $F."(".$L."): ".str_replace("\r", '', str_replace("\n", " ", $eval))."\n");
+ //* DEBUG: */ fwrite($fp, $F.'('.$L."): ".str_replace("\r", '', str_replace("\n", " ", $eval))."\n");
//* DEBUG: */ fclose($fp);
// Run the code
$result = false;
// Determine index/fulltext/unique word
- // 12 3 3 2 2 3 3 2 2 3 3 21
- $noIndex = ((ereg("INDEX", $sql) == false) && (ereg("FULLTEXT", $sql) == false) && (ereg("UNIQUE", $sql) == false));
+ $noIndex = (
+ (
+ strpos($sql, 'INDEX') === false
+ ) && (
+ strpos($sql, 'FULLTEXT') === false
+ ) && (
+ strpos($sql, 'UNIQUE') === false
+ )
+ );
// Extract table name
$tableArray = explode(" ", $sql);
- $tableName = str_replace("`", '', $tableArray[2]);
+ $tableName = str_replace('`', '', $tableArray[2]);
// Shall we add/drop?
- if (((ereg("ADD", $sql)) || (ereg("DROP", $sql))) && ($noIndex)) {
+ if (((strpos($sql, 'ADD') !== false) || (strpos($sql, 'DROP') !== false)) && ($noIndex === true)) {
// And column name as well
- $columnName = str_replace("`", '', $tableArray[4]);
+ $columnName = str_replace('`', '', $tableArray[4]);
// Get column information
$result = SQL_QUERY_ESC("SHOW COLUMNS FROM %s LIKE '%s'",
array($tableName, $columnName), __FILE__, __LINE__);
// Do we have no entry on ADD or an entry on DROP?
- // 123 4 4 3 3 4 432 23 4 4 3 3 4 4321
- if (((SQL_NUMROWS($result) == 0) && (ereg("ADD", $sql))) || ((SQL_NUMROWS($result) == 1) && (ereg("DROP", $sql)))) {
+ // 123 4 4 3 3 4 4 32 23 4 4 3 3 4 4 321
+ if (((SQL_NUMROWS($result) == 0) && (strpos($sql, 'ADD') !== false)) || ((SQL_NUMROWS($result) == 1) && (strpos($sql, 'DROP') !== false))) {
// Do the query
//* DEBUG: */ print __LINE__.':'.$sql."<br />\n";
$result = SQL_QUERY($sql, $F, $L, false);
} // END - if
- } elseif ((constant('_TABLE_TYPE') == "InnoDB") && (ereg("FULLTEXT", $sql))) {
+ } elseif ((getConfig('_TABLE_TYPE') == 'InnoDB') && (strpos($sql, 'FULLTEXT') !== false)) {
// Skip this query silently
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Skipped FULLTEXT: sql=%s,file=%s,line=%s", $sql, $F, $L));
} elseif (!$noIndex) {
// And column name as well
- $columnName = str_replace("`", '', $tableArray[4]);
+ $columnName = str_replace('`', '', $tableArray[4]);
// Is this "UNIQUE" or so? FULLTEXT has been handled the elseif() block above
- if (in_array(strtoupper($columnName), array("INDEX", "UNIQUE", "KEY", "FULLTEXT"))) {
+ if (in_array(strtoupper($columnName), array('INDEX', 'UNIQUE', 'KEY', 'FULLTEXT'))) {
// Init loop
- $begin = 1; $columnName = ",";
- while (strpos($columnName, ",") !== false) {
+ $begin = 1; $columnName = ',';
+ while (strpos($columnName, ',') !== false) {
// Use last
- $columnName = str_replace("`", '', $tableArray[count($tableArray) - $begin]);
+ $columnName = str_replace('`', '', $tableArray[count($tableArray) - $begin]);
//* DEBUG: */ print __LINE__.':'.$columnName."----------------".$begin."<br />\n";
// Remove brackes
- $columnName = str_replace("(", '', str_replace(")", '', $columnName));
+ $columnName = str_replace('(', '', str_replace(')', '', $columnName));
//* DEBUG: */ print __LINE__.':'.$columnName."----------------".$begin."<br />\n";
// Continue
} // END - if
// Show indexes
- $result = SQL_QUERY_ESC("SHOW INDEX FROM %s",
+ $result = SQL_QUERY_ESC("SHOW INDEX FROM `%s`",
array($tableName), __FILE__, __LINE__);
// Walk through all
if (!defined('__SECURITY')) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
-}
+} // END - if
-// Select MySQL 3 as default database type
-if (!defined('_DB_TYPE')) define('_DB_TYPE', "mysql3");
+// Is it not set?
+if (!isConfigEntrySet('_DB_TYPE')) setConfigEntry('_DB_TYPE', 'mysql3');
// Create include file name
-$INC = sprintf("inc/db/lib-%s.php", constant('_DB_TYPE'));
+$INC = sprintf("inc/db/lib-%s.php", getConfig('_DB_TYPE'));
if (isIncludeReadable($INC)) {
// Include abstraction layer
loadIncludeOnce($INC);
} else {
// Bye, bye...
- die("Cannot load database abstraction layer ".constant('_DB_TYPE')." -> R.I.P.");
+ die('Cannot load database abstraction layer <u>' . getConfig('_DB_TYPE') . '</u> -> R.I.P.');
}
//
// Doubled points
'points' => translateComma($content['points']),
// Timemark
- 'when' => generateDateTime($content['timemark'], "2"),
+ 'when' => generateDateTime($content['timemark'], '2'),
// IP number when the member submitted the doubling form
'ip' => $content['remote_ip'],
);
}
// Redirects if the provided extension is not installed
-function REDIRECT_ON_UNINSTALLED_EXTENSION ($ext_name) {
+function redirectOnUninstalledExtension ($ext_name) {
// So is the extension there?
if (!EXT_IS_ACTIVE($ext_name)) {
// Redirect to index
--- /dev/null
+<?php
+/************************************************************************
+ * MXChange v0.2.1 Start: 09/25/2004 *
+ * ================ Last change: 09/25/2004 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : ext- *
+ * -------------------------------------------------------------------- *
+ * Short description : *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
+ require($INC);
+}
+
+// Version number
+EXT_SET_VERSION('0.0');
+
+// Version history array (add more with , '0.1.0' and so on)
+EXT_SET_VER_HISTORY(array('0.0'));
+
+switch ($EXT_LOAD_MODE)
+{
+case 'register': // Do stuff when installation is running (modules.php?module=admin&action=login is called)
+ // SQL commands to run
+ break;
+
+case 'remove': // Do stuff when removing extension
+ // SQL commands to run
+ break;
+
+case 'activate': // Do stuff when admin activates this extension
+ // SQL commands to run
+ break;
+
+case 'deactivate': // Do stuff when admin deactivates this extension
+ // SQL commands to run
+ break;
+
+case 'update': // Update an extension
+ switch ($EXT_VER)
+ {
+ case '0.0.1': // SQL queries for v0.0.1
+ ADD_EXT_SQL("");
+
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("");
+ break;
+ }
+ break;
+
+case 'modify': // When the extension got modified
+ break;
+
+case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
+ break;
+
+default: // Do stuff when extension is loaded
+ break;
+}
+
+//
+?>
// Don't use these chars in links... ;-)
//
$GLOBALS['url_ends'] = array(
- " ",
+ ' ',
"\n",
"\r",
- ")",
+ ')',
);
// Valid email chars (without @, or do you want to have another @ inside your email addy?)
// Filter for initializing randomizer
function FILTER_INIT_RANDOMIZER () {
// Simply init the randomizer with seed and _ADD value
- mt_srand(generateSeed() + constant('_ADD'));
+ mt_srand(generateSeed() + getConfig('_ADD'));
}
// Filter for removing updates
// Footer disabled or already sent?
// 1234 5 54 45 5 5 543 3 321
-if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != "1") && ($GLOBALS['footer_sent'] != "2"))) && ($GLOBALS['output_mode'] != "1"))) {
+if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != '1') && ($GLOBALS['footer_sent'] != '2'))) && ($GLOBALS['output_mode'] != '1'))) {
// Output the generated HTML code or do nothing in direct-mode
if (getTotalFatalErrors() > 0) {
// Output fatal error messages
} // END - if
// Shall we display the copyright notice?
- if ((!REQUEST_ISSET_GET(('frame'))) && (basename($_SERVER['PHP_SELF']) != "mailid_top.php") && (isBooleanConstantAndTrue('WRITE_FOOTER')) && ($GLOBALS['header_sent'] == "2")) {
+ if ((!REQUEST_ISSET_GET(('frame'))) && (basename($_SERVER['PHP_SELF']) != "mailid_top.php") && (getConfig('WRITE_FOOTER') == 'Y') && ($GLOBALS['header_sent'] == '2')) {
// Backlink enabled?
- if (isBooleanConstantAndTrue('ENABLE_BACKLINK')) {
+ if ((getConfig('ENABLE_BACKLINK') == 'Y') || (isInstalling())) {
// Copyright with backlink, thanks! :-)
LOAD_TEMPLATE("copyright_backlink");
} else {
} // END - if
// Shall we display the parsing time and number of queries?
- if ((GET_EXT_VERSION('sql_patches') >= '0.4.1') && (getConfig('show_timings') == 'Y') && (!REQUEST_ISSET_GET(('frame'))) && ($GLOBALS['header_sent'] == "2")) {
+ if ((GET_EXT_VERSION('sql_patches') >= '0.4.1') && (getConfig('show_timings') == 'Y') && (!REQUEST_ISSET_GET(('frame'))) && ($GLOBALS['header_sent'] == '2')) {
// Then display it here
displayParsingTime();
} // END - if
require($INC);
}
-// Output HTML code directly or "render" it. You addionally switch the new-line character off
+// Output HTML code directly or 'render' it. You addionally switch the new-line character off
function OUTPUT_HTML ($HTML, $newLine = true) {
// Some global variables
global $OUTPUT;
// Do we have HTML-Code here?
if (!empty($HTML)) {
// Yes, so we handle it as you have configured
- switch (constant('OUTPUT_MODE'))
+ switch (getConfig('OUTPUT_MODE'))
{
- case "render":
+ case 'render':
// That's why you don't need any \n at the end of your HTML code... :-)
- if (constant('_OB_CACHING') == "on") {
+ if (constant('_OB_CACHING') == 'on') {
// Output into PHP's internal buffer
outputRawCode($HTML);
case 'direct':
// If we are switching from render to direct output rendered code
- if ((!empty($OUTPUT)) && (constant('_OB_CACHING') != "on")) { outputRawCode($OUTPUT); $OUTPUT = ''; }
+ if ((!empty($OUTPUT)) && (constant('_OB_CACHING') != 'on')) { outputRawCode($OUTPUT); $OUTPUT = ''; }
// The same as above... ^
outputRawCode($HTML);
default:
// Huh, something goes wrong or maybe you have edited config.php ???
- DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Invalid renderer %s detected.", constant('OUTPUT_MODE')));
+ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Invalid renderer %s detected.", getConfig('OUTPUT_MODE')));
app_die(__FUNCTION__, __LINE__, "<strong>{--FATAL_ERROR--}:</strong> {--LANG_NO_RENDER_DIRECT--}");
break;
}
- } elseif ((constant('_OB_CACHING') == "on") && (isset($GLOBALS['footer_sent'])) && ($GLOBALS['footer_sent'] == 1)) {
+ } elseif ((constant('_OB_CACHING') == 'on') && (isset($GLOBALS['footer_sent'])) && ($GLOBALS['footer_sent'] == 1)) {
// Headers already sent?
if (headers_sent()) {
// Log this error
} // END - if
// Send HTTP header
- header("HTTP/1.1 200");
+ sendHeader('HTTP/1.1 200');
// Used later
$now = gmdate('D, d M Y H:i:s') . ' GMT';
// General headers for no caching
- header("Expired: " . $now); // RFC2616 - Section 14.21
- header("Last-Modified: " . $now);
- header("Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0"); // HTTP/1.1
- header("Pragma: no-cache"); // HTTP/1.0
- header("Connection: Close");
+ sendHeader('Expired: ' . $now); // RFC2616 - Section 14.21
+ sendHeader('Last-Modified: ' . $now);
+ sendHeader('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
+ sendHeader('Pragma: no-cache'); // HTTP/1.0
+ sendHeader('Connection: Close');
// Extension 'rewrite' installed?
- if ((EXT_IS_ACTIVE('rewrite')) && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) {
+ if ((EXT_IS_ACTIVE('rewrite')) && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) {
$OUTPUT = rewriteLinksInCode($OUTPUT);
} // END - if
// Output code here, DO NOT REMOVE! ;-)
outputRawCode($OUTPUT);
- } elseif ((constant('OUTPUT_MODE') == "render") && (!empty($OUTPUT))) {
+ } elseif ((getConfig('OUTPUT_MODE') == 'render') && (!empty($OUTPUT))) {
// Rewrite links when rewrite extension is active
- if ((EXT_IS_ACTIVE('rewrite')) && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) {
+ if ((EXT_IS_ACTIVE('rewrite')) && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) {
$OUTPUT = rewriteLinksInCode($OUTPUT);
} // END - if
// Output stripped HTML code to avoid broken JavaScript code, etc.
echo stripslashes(stripslashes($HTML));
- // Flush the output if only constant('_OB_CACHING') is not "on"
- if (constant('_OB_CACHING') != "on") {
+ // Flush the output if only constant('_OB_CACHING') is not 'on'
+ if (constant('_OB_CACHING') != 'on') {
// Flush it
flush();
} // END - if
} // END - if
// Generate date/time string
- $date_time = generateDateTime(time(), "1");
+ $date_time = generateDateTime(time(), '1');
// Base directory
$basePath = sprintf("%stemplates/%s/html/", constant('PATH'), getLanguage());
$ret = "<!-- Template ".$template." - Start -->\n".$ret."<!-- Template ".$template." - End -->\n";
} elseif ((IS_ADMIN()) || ((isInstalling()) && (!isInstalled()))) {
// Only admins shall see this warning or when installation mode is active
- $ret = "<br /><span class=\"guest_failed\">".TEMPLATE_404."</span><br />
+ $ret = "<br /><span class=\"guest_failed\">{--TEMPLATE_404--}</span><br />
(".basename($FQFN).")<br />
<br />
-".TEMPLATE_CONTENT."
+{--TEMPLATE_CONTENT--}
<pre>".print_r($content, true)."</pre>
-".TEMPLATE_DATA."
+{--TEMPLATE_DATA--}
<pre>".print_r($DATA, true)."</pre>
<br /><br />";
}
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$toEmail}<br />\n";
// Check for PHPMailer or debug-mode
- if (!CHECK_PHPMAILER_USAGE()) {
+ if (!checkPhpMailerUsage()) {
// Not in PHPMailer-Mode
if (empty($mailHeader)) {
// Load email header template
</pre>\n");
} elseif (($HTML == 'Y') && (EXT_IS_ACTIVE('html_mail'))) {
// Send mail as HTML away
- SEND_HTML_EMAIL($toEmail, $subject, $message, $mailHeader);
+ sendHtmlEmail($toEmail, $subject, $message, $mailHeader);
} elseif (!empty($toEmail)) {
// Send Mail away
- SEND_RAW_EMAIL($toEmail, $subject, $message, $mailHeader);
+ sendRawEmail($toEmail, $subject, $message, $mailHeader);
} elseif ($HTML == 'N') {
// Problem found!
- SEND_RAW_EMAIL(constant('WEBMASTER'), "[PROBLEM:]".$subject, $message, $mailHeader);
+ sendRawEmail(constant('WEBMASTER'), '[PROBLEM:]' . $subject, $message, $mailHeader);
}
}
// Check if legacy or PHPMailer command
// @TODO Rewrite this to an extension 'smtp'
// @private
-function CHECK_PHPMAILER_USAGE() {
- return ((defined('SMTP_HOSTNAME')) && (defined('SMTP_USER')) && (defined('SMTP_PASSWORD')) && (constant('SMTP_HOSTNAME') != '') && (constant('SMTP_USER') != ''));
+function checkPhpMailerUsage() {
+ return ((getConfig('SMTP_HOSTNAME') != '') && (getConfig('SMTP_USER') != ''));
}
-/*
- * Send out a raw email with PHPMailer class or legacy mail() command
- */
-function SEND_RAW_EMAIL ($toEmail, $subject, $msg, $from) {
+// Send out a raw email with PHPMailer class or legacy mail() command
+function sendRawEmail ($toEmail, $subject, $msg, $from) {
// Shall we use PHPMailer class or legacy mode?
- if (CHECK_PHPMAILER_USAGE()) {
+ if (checkPhpMailerUsage()) {
// Use PHPMailer class with SMTP enabled
- loadIncludeOnce("inc/phpmailer/class.phpmailer.php");
- loadIncludeOnce("inc/phpmailer/class.smtp.php");
+ loadIncludeOnce('inc/phpmailer/class.phpmailer.php');
+ loadIncludeOnce('inc/phpmailer/class.smtp.php');
// get new instance
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
- $mail->Host = constant('SMTP_HOSTNAME');
+ $mail->Host = getConfig('SMTP_HOSTNAME');
$mail->Port = 25;
- $mail->Username = constant('SMTP_USER');
- $mail->Password = constant('SMTP_PASSWORD');
+ $mail->Username = getConfig('SMTP_USER');
+ $mail->Password = getConfig('SMTP_PASSWORD');
if (empty($from)) {
$mail->From = constant('WEBMASTER');
} else {
$mail->Subject = $subject;
if ((EXT_IS_ACTIVE('html_mail')) && (strip_tags($msg) != $msg)) {
$mail->Body = $msg;
- $mail->AltBody = "Your mail program required HTML support to read this mail!";
+ $mail->AltBody = 'Your mail program required HTML support to read this mail!';
$mail->WordWrap = 70;
$mail->IsHTML(true);
} else {
}
$mail->AddAddress($toEmail, '');
$mail->AddReplyTo(constant('WEBMASTER'), constant('MAIN_TITLE'));
- $mail->AddCustomHeader("Errors-To:".constant('WEBMASTER'));
- $mail->AddCustomHeader("X-Loop:".constant('WEBMASTER'));
+ $mail->AddCustomHeader('Errors-To:' . constant('WEBMASTER'));
+ $mail->AddCustomHeader('X-Loop:' . constant('WEBMASTER'));
$mail->Send();
} else {
// Use legacy mail() command
// Translates Y/N to yes/no
function translateYesNo ($yn) {
// Default
- $translated = "??? (".$yn.")";
+ $translated = "??? (".$yn.')';
switch ($yn) {
case 'Y': $translated = getMessage('YES'); break;
case 'N': $translated = getMessage('NO'); break;
return $ret;
}
-// Wrapper for $_POST['sel']
-function countPostSelection () {
- return countSelection(REQUEST_POST('sel'));
-}
-
// Generate XHTML code for the CAPTCHA
function generateCaptchaCode ($code, $type, $DATA, $uid) {
return '<IMG border="0" alt="Code" src="{!URL!}/mailid_top.php?uid=' . $uid . '&' . $type . '=' . $DATA . '&mode=img&code=' . $code . '" />';
// "Getter" for language
function getLanguage () {
// Set default return value to default language from config
- $ret = constant('DEFAULT_LANG');
+ $ret = getConfig('DEFAULT_LANG');
// Init variable
$lang = '';
// Is the variable set
- if (REQUEST_ISSET_GET(('mx_lang'))) {
+ if (REQUEST_ISSET_GET('mx_lang')) {
// Accept only first 2 chars
$lang = substr(REQUEST_GET('mx_lang'), 0, 2);
} elseif (isset($GLOBALS['cache_array']['language'])) {
$ret = $GLOBALS['cache_array']['language'];
} elseif (!empty($lang)) {
// Check if main language file does exist
- if (isFileReadable(constant('PATH').'inc/language/'.$lang.'.php')) {
+ if (isFileReadable(constant('PATH') . 'inc/language/'.$lang.'.php')) {
// Okay found, so let's update cookies
setLanguage($lang);
- }
- } elseif (!isSessionVariableSet('mx_lang')) {
+ } // END - if
+ } elseif (isSessionVariableSet('mx_lang')) {
// Return stored value from cookie
$ret = getSession('mx_lang');
// Fixes a warning before the session has the mx_lang constant
- if (empty($ret)) $ret = constant('DEFAULT_LANG');
+ if (empty($ret)) $ret = getConfig('DEFAULT_LANG');
}
// Cache entry
return COMPILE_CODE($newContent);
}
-// Generates a timestamp (wrapper for mktime())
+// Generates a timestamp (some wrapper for mktime())
function makeTime ($H, $M, $S, $stamp) {
// Extract day, month and year from given timestamp
$day = date('d', $stamp);
}
// Redirects to an URL and if neccessarry extends it with own base URL
-function redirectToUrl ($URL, $addUrlData=true) {
+function redirectToUrl ($URL) {
// Compile out URI codes
$URL = compileUriCode($URL);
} // END - if
// Three different debug ways...
- //* DEBUG: */ debug_report_bug(sprintf("%s[%s:] URL=%s", __FUNCTION__, __LINE__, $URL));
+ /* DEBUG: */ debug_report_bug(sprintf("%s[%s:] URL=%s", __FUNCTION__, __LINE__, $URL));
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, $URL);
//* DEBUG: */ die($URL);
clearOutputBuffer();
} // END - if
- // Add some data to URL if cookies are not accepted
- if ((!isBooleanConstantAndTrue('__COOKIES')) && ($addUrlData === true)) $URL = addUrlData($URL);
-
// Secure the URL against bad things such als HTML insertions and so on...
$URL = htmlentities(strip_tags($URL), ENT_QUOTES);
} elseif (!headers_sent()) {
// Load URL when headers are not sent
//* DEBUG: */ debug_report_bug("URL={$URL}");
- header ('Location: '.str_replace('&', '&', $URL));
+ sendHeader('Location: '.str_replace('&', '&', $URL));
} else {
// Output error message
loadInclude('inc/header.php');
}
// Wrapper for redirectToUrl but URL comes from a configuration entry
-function LOAD_CONFIGURED_URL ($configEntry) {
+function redirectToConfiguredUrl ($configEntry) {
// Get the URL
$URL = getConfig($configEntry);
if (!defined('_MAX')) define('_MAX', 15235);
// Build server string
- $server = $_SERVER['PHP_SELF'].constant('ENCRYPT_SEPERATOR').detectUserAgent().constant('ENCRYPT_SEPERATOR').getenv('SERVER_SOFTWARE').constant('ENCRYPT_SEPERATOR').detectRemoteAddr().":'.':".filemtime(constant('PATH')."inc/databases.php");
+ $server = $_SERVER['PHP_SELF'].getConfig('ENCRYPT_SEPERATOR').detectUserAgent().getConfig('ENCRYPT_SEPERATOR').getenv('SERVER_SOFTWARE').getConfig('ENCRYPT_SEPERATOR').detectRemoteAddr().":'.':".filemtime(constant('PATH').'inc/databases.php');
// Build key string
- $keys = constant('SITE_KEY').constant('ENCRYPT_SEPERATOR').constant('DATE_KEY');
- if (isConfigEntrySet('secret_key')) $keys .= constant('ENCRYPT_SEPERATOR').getConfig('secret_key');
- if (isConfigEntrySet('file_hash')) $keys .= constant('ENCRYPT_SEPERATOR').getConfig('file_hash');
- $keys .= constant('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", getConfig(('patch_ctime')));
- if (isConfigEntrySet('master_salt')) $keys .= constant('ENCRYPT_SEPERATOR').getConfig('master_salt');
+ $keys = getConfig('SITE_KEY').getConfig('ENCRYPT_SEPERATOR').getConfig('DATE_KEY');
+ if (isConfigEntrySet('secret_key')) $keys .= getConfig('ENCRYPT_SEPERATOR').getConfig('secret_key');
+ if (isConfigEntrySet('file_hash')) $keys .= getConfig('ENCRYPT_SEPERATOR').getConfig('file_hash');
+ $keys .= getConfig('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", getConfig(('patch_ctime')));
+ if (isConfigEntrySet('master_salt')) $keys .= getConfig('ENCRYPT_SEPERATOR').getConfig('master_salt');
// Build string from misc data
- $data = $code.constant('ENCRYPT_SEPERATOR').$uid.constant('ENCRYPT_SEPERATOR').$DATA;
+ $data = $code.getConfig('ENCRYPT_SEPERATOR').$uid.getConfig('ENCRYPT_SEPERATOR').$DATA;
// Add more additional data
- if (isSessionVariableSet('u_hash')) $data .= constant('ENCRYPT_SEPERATOR').getSession('u_hash');
- if (isUserIdSet()) $data .= constant('ENCRYPT_SEPERATOR').getUserId();
- if (isSessionVariableSet('mxchange_theme')) $data .= constant('ENCRYPT_SEPERATOR').getSession('mxchange_theme');
- if (isSessionVariableSet('mx_lang')) $data .= constant('ENCRYPT_SEPERATOR').getLanguage();
- if (isset($GLOBALS['refid'])) $data .= constant('ENCRYPT_SEPERATOR').$GLOBALS['refid'];
+ if (isSessionVariableSet('u_hash')) $data .= getConfig('ENCRYPT_SEPERATOR').getSession('u_hash');
+ if (isUserIdSet()) $data .= getConfig('ENCRYPT_SEPERATOR').getUserId();
+ if (isSessionVariableSet('mxchange_theme')) $data .= getConfig('ENCRYPT_SEPERATOR').getSession('mxchange_theme');
+ if (isSessionVariableSet('mx_lang')) $data .= getConfig('ENCRYPT_SEPERATOR').getLanguage();
+ if (isset($GLOBALS['refid'])) $data .= getConfig('ENCRYPT_SEPERATOR').$GLOBALS['refid'];
// Calculate number for generating the code
- $a = $code + constant('_ADD') - 1;
+ $a = $code + getConfig('_ADD') - 1;
if (isConfigEntrySet('master_hash')) {
// Generate hash with master salt from modula of number with the prime number and other data
- $saltedHash = generateHash(($a % constant('_PRIME')).constant('ENCRYPT_SEPERATOR').$server.constant('ENCRYPT_SEPERATOR').$keys.constant('ENCRYPT_SEPERATOR').$data.constant('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", time()).constant('ENCRYPT_SEPERATOR').$a, getConfig('master_salt'));
+ $saltedHash = generateHash(($a % getConfig('_PRIME')).getConfig('ENCRYPT_SEPERATOR').$server.getConfig('ENCRYPT_SEPERATOR').$keys.getConfig('ENCRYPT_SEPERATOR').$data.getConfig('ENCRYPT_SEPERATOR').getConfig('DATE_KEY').getConfig('ENCRYPT_SEPERATOR').$a, getConfig('master_salt'));
// Create number from hash
- $rcode = hexdec(substr($saltedHash, strlen(getConfig('master_salt')), 9)) / abs(constant('_MAX') - $a + sqrt(constant('_ADD'))) / pi();
+ $rcode = hexdec(substr($saltedHash, strlen(getConfig('master_salt')), 9)) / abs(constant('_MAX') - $a + sqrt(getConfig('_ADD'))) / pi();
} else {
// Generate hash with "hash of site key" from modula of number with the prime number and other data
- $saltedHash = generateHash(($a % constant('_PRIME')).constant('ENCRYPT_SEPERATOR').$server.constant('ENCRYPT_SEPERATOR').$keys.constant('ENCRYPT_SEPERATOR').$data.constant('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", time()).constant('ENCRYPT_SEPERATOR').$a, substr(sha1(constant('SITE_KEY')), 0, 8));
+ $saltedHash = generateHash(($a % getConfig('_PRIME')).getConfig('ENCRYPT_SEPERATOR').$server.getConfig('ENCRYPT_SEPERATOR').$keys.getConfig('ENCRYPT_SEPERATOR').$data.getConfig('ENCRYPT_SEPERATOR').getConfig('DATE_KEY').getConfig('ENCRYPT_SEPERATOR').$a, substr(sha1(getConfig('SITE_KEY')), 0, 8));
// Create number from hash
- $rcode = hexdec(substr($saltedHash, 8, 9)) / abs(constant('_MAX') - $a + sqrt(constant('_ADD'))) / pi();
+ $rcode = hexdec(substr($saltedHash, 8, 9)) / abs(constant('_MAX') - $a + sqrt(getConfig('_ADD'))) / pi();
}
// At least 10 numbers shall be secure enought!
// Switch image type
switch (getConfig('img_type'))
{
- case "jpg":
+ case 'jpg':
// Okay, load image and hide all errors
$image = @imagecreatefromjpeg($img);
break;
- case "png":
+ case 'png':
// Okay, load image and hide all errors
$image = @imagecreatefrompng($img);
break;
imagestring($image, 5, 14, 2, $img_code, $text_color);
// Return to browser
- header ("Content-Type: image/".getConfig('img_type'));
+ sendHeader('Content-Type: image/' . getConfig('img_type'));
// Output image with matching image factory
switch (getConfig('img_type')) {
- case "jpg": imagejpeg($image); break;
- case "png": imagepng($image); break;
+ case 'jpg': imagejpeg($image); break;
+ case 'png': imagepng($image); break;
}
// Remove image from memory
imagedestroy($image);
}
// Create selection box or array of splitted timestamp
-function createTimeSelections ($timestamp, $prefix = '', $display = '', $align="center", $return_array=false) {
+function createTimeSelections ($timestamp, $prefix = '', $display = '', $align = 'center', $return_array=false) {
// Calculate 2-seconds timestamp
$stamp = round($timestamp);
//* DEBUG: */ print("*".$stamp.'/'.$timestamp."*<br />");
$result = false;
// "implode" IDs and query string
- $aid = implode(",", $adminIds);
- if ($aid == "-1") {
+ $aid = implode(',', $adminIds);
+ if ($aid == '-1') {
if (EXT_IS_ACTIVE('events')) {
// Add line to user events
EVENTS_ADD_LINE($subj, $msg, $UID);
$NAV = '';
for ($page = 1; $page <= $PAGES; $page++) {
// Is the page currently selected or shall we generate a link to it?
- if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == "1"))) {
+ if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == '1'))) {
// Is currently selected, so only highlight it
$NAV .= "<strong>-";
} else {
$NAV .= "\">";
}
$NAV .= $page;
- if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == "1"))) {
+ if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == '1'))) {
// Is currently selected, so only highlight it
$NAV .= "-</strong>";
} else {
// Use login data to proxy? (username at least!)
if (getConfig('proxy_username') != '') {
// Add it as well
- $encodedAuth = base64_encode(COMPILE_CODE(getConfig('proxy_username')).constant('ENCRYPT_SEPERATOR').COMPILE_CODE(getConfig('proxy_password')));
+ $encodedAuth = base64_encode(COMPILE_CODE(getConfig('proxy_username')).getConfig('ENCRYPT_SEPERATOR').COMPILE_CODE(getConfig('proxy_password')));
$proxyTunnel .= "Proxy-Authorization: Basic ".$encodedAuth."\r\n";
} // END - if
// When the salt is empty build a new one, else use the first x configured characters as the salt
if (empty($salt)) {
// Build server string (inc/databases.php is no longer updated with every commit)
- $server = $_SERVER['PHP_SELF'].constant('ENCRYPT_SEPERATOR').detectUserAgent().constant('ENCRYPT_SEPERATOR').getenv('SERVER_SOFTWARE').constant('ENCRYPT_SEPERATOR').detectRemoteAddr();
+ $server = $_SERVER['PHP_SELF'].getConfig('ENCRYPT_SEPERATOR').detectUserAgent().getConfig('ENCRYPT_SEPERATOR').getenv('SERVER_SOFTWARE').getConfig('ENCRYPT_SEPERATOR').detectRemoteAddr();
// Build key string
- $keys = constant('SITE_KEY').constant('ENCRYPT_SEPERATOR').constant('DATE_KEY').constant('ENCRYPT_SEPERATOR').getConfig('secret_key').constant('ENCRYPT_SEPERATOR').getConfig('file_hash').constant('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", getConfig(('patch_ctime'))).constant('ENCRYPT_SEPERATOR').getConfig('master_salt');
+ $keys = getConfig('SITE_KEY').getConfig('ENCRYPT_SEPERATOR').getConfig('DATE_KEY').getConfig('ENCRYPT_SEPERATOR').getConfig('secret_key').getConfig('ENCRYPT_SEPERATOR').getConfig('file_hash').getConfig('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", getConfig(('patch_ctime'))).getConfig('ENCRYPT_SEPERATOR').getConfig('master_salt');
// Additional data
- $data = $plainText.constant('ENCRYPT_SEPERATOR').uniqid(mt_rand(), true).constant('ENCRYPT_SEPERATOR').time();
+ $data = $plainText.getConfig('ENCRYPT_SEPERATOR').uniqid(mt_rand(), true).getConfig('ENCRYPT_SEPERATOR').time();
// Calculate number for generating the code
- $a = time() + constant('_ADD') - 1;
+ $a = time() + getConfig('_ADD') - 1;
// Generate SHA1 sum from modula of number and the prime number
- $sha1 = sha1(($a % constant('_PRIME')).$server.constant('ENCRYPT_SEPERATOR').$keys.constant('ENCRYPT_SEPERATOR').$data.constant('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", time()).constant('ENCRYPT_SEPERATOR').$a);
+ $sha1 = sha1(($a % getConfig('_PRIME')).$server.getConfig('ENCRYPT_SEPERATOR').$keys.getConfig('ENCRYPT_SEPERATOR').$data.getConfig('ENCRYPT_SEPERATOR').getConfig('DATE_KEY').getConfig('ENCRYPT_SEPERATOR').$a);
//* DEBUG: */ echo "SHA1=".$sha1." (".strlen($sha1).")<br />";
$sha1 = scrambleString($sha1);
//* DEBUG: */ echo "Scrambled=".$sha1." (".strlen($sha1).")<br />";
return $scrambleString;
}
-// Append data like session ID or referal ID to the given URL which would
-// normally be stored in cookies
-function addUrlData ($URL) {
- // Init add
- $add = '';
-
- // Determine URL binder
- $BIND = '?';
- if (strpos($URL, '?') !== false) $BIND = '&';
-
- if ((!defined('__COOKIES')) || ((!constant('__COOKIES')))) {
- // Cookies are not accepted
- if ((REQUEST_ISSET_GET(('refid'))) && (strpos($URL, "refid=") == 0)) {
- // Cookie found in URL
- $add .= $BIND."refid=".bigintval(REQUEST_GET('refid'));
- } elseif ((GET_EXT_VERSION('sql_patches') != '') && (getConfig('def_refid') > 0)) {
- // Not found! So let's set default here
- $add .= $BIND."refid=".getConfig('def_refid');
- }
- } // END - if
-
- // Add all together and return it
- return $URL . $add;
-}
-
// Generate an PGP-like encrypted hash of given hash for e.g. cookies
function generatePassString ($passHash) {
// Return vanilla password hash
$part2 = hexdec(substr(getConfig('secret_key'), $start, 4));
$mod = dechex($idx);
if ($part1 > $part2) {
- $mod = dechex(sqrt(($part1 - $part2) * constant('_PRIME') / pi()));
+ $mod = dechex(sqrt(($part1 - $part2) * getConfig('_PRIME') / pi()));
} elseif ($part2 > $part1) {
- $mod = dechex(sqrt(($part2 - $part1) * constant('_PRIME') / pi()));
+ $mod = dechex(sqrt(($part2 - $part1) * getConfig('_PRIME') / pi()));
}
$mod = substr(round($mod), 0, 4);
$mod = str_repeat('0', 4-strlen($mod)).$mod;
$newHash .= $mod;
} // END - for
- //* DEBUG: */ print($passHash."<br />".$newHash." (".strlen($newHash).")");
+ //* DEBUG: */ print($passHash."<br />".$newHash." (".strlen($newHash).')');
$ret = generateHash($newHash, getConfig('master_salt'));
//* DEBUG: */ print($ret."<br />\n");
} else {
return $id;
}
-// Read a given file
-function readFromFile ($FQFN, $sqlPrepare = false) {
- // Load the file
- if (function_exists('file_get_contents')) {
- // Use new function
- $content = file_get_contents($FQFN);
- } else {
- // Fall-back to implode-file chain
- $content = implode('', file($FQFN));
- }
-
- // Prepare SQL queries?
- if ($sqlPrepare === true) {
- // Remove some unwanted chars
- $content = str_replace("\r", '', $content);
- $content = str_replace("\n\n", "\n", $content);
- } // END - if
-
- // Return the content
- return $content;
-}
-
-// Writes content to a file
-function writeToFile ($FQFN, $content) {
- // Is the file writeable?
- if ((isFileReadable($FQFN)) && (!is_writeable($FQFN)) && (!chmod($FQFN, 0644))) {
- // Not writeable!
- DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("File %s not writeable.", basename($FQFN)));
-
- // Failed! :(
- return false;
- } // END - if
-
- // By default all is failed...
- $return = false;
-
- // Is the function there?
- if (function_exists('file_put_contents')) {
- // Write it directly
- $return = file_put_contents($FQFN, $content);
- } else {
- // Write it with fopen
- $fp = fopen($FQFN, 'w') or app_die(__FUNCTION__, __LINE__, "Cannot write file ".basename($FQFN).'!');
- fwrite($fp, $content);
- fclose($fp);
-
- // Set CHMOD rights
- $return = chmod($FQFN, 0644);
- }
-
- // Return status
- return $return;
-}
-
// Generates an error code from given account status
function generateErrorCodeFromUserStatus ($status) {
// Default error code if unknown account status
return $errorCode;
}
-// Clears the output buffer. This function does *NOT* backup sent content.
-function clearOutputBuffer () {
- // Trigger an error on failure
- if (!ob_end_clean()) {
- // Failed!
- debug_report_bug(__FUNCTION__.': Failed to clean output buffer.');
- } // END - if
-}
-
// Function to search for the last modifified file
function searchDirsRecursive ($dir, &$last_changed) {
// Get dir as array
return $akt_vers;
}
-
-// Loads an include file and logs any missing files for debug purposes
-function loadInclude ($INC) {
- // Add the path. This is why we need a trailing slash in config.php
- $FQFN = constant('PATH') . $INC;
-
- // Is the include file there?
- if (!isIncludeReadable($INC)) {
- // Not there so log it
- debug_report_bug(sprintf("Include file %s not found.", $INC));
- return false;
- } // END - if
-
- // Try to load it
- require($FQFN);
-}
-
-// Loads an include file once
-function loadIncludeOnce ($INC) {
- // Is it not loaded?
- if (!isset($GLOBALS['load_once'][$INC])) {
- // Then try to load it
- loadInclude($INC);
-
- // And mark it as loaded
- $GLOBALS['load_once'][$INC] = "loaded";
- } // END - if
-}
-
// Back-ported from the new ship-simu engine. :-)
function debug_get_printable_backtrace () {
// Init variable
if (!isset($trace['file'])) $trace['file'] = __FUNCTION__;
if (!isset($trace['line'])) $trace['line'] = __LINE__;
if (!isset($trace['args'])) $trace['args'] = array();
- $backtrace .= "<li class=\"debug_list\"><span class=\"backtrace_file\">".basename($trace['file'])."</span>:".$trace['line'].", <span class=\"backtrace_function\">".$trace['function']."(".count($trace['args']).")</span></li>\n";
+ $backtrace .= "<li class=\"debug_list\"><span class=\"backtrace_file\">".basename($trace['file'])."</span>:".$trace['line'].", <span class=\"backtrace_function\">".$trace['function'].'('.count($trace['args']).")</span></li>\n";
} // END - foreach
// Close it
// Add output
$debug .= "Please report this bug at <a href=\"http://bugs.mxchange.org\" rel=\"external\" target=\"_blank\">bugs.mxchange.org</a>:<pre>";
$debug .= debug_get_printable_backtrace();
- $debug .= "</pre>Request-URI: ".$_SERVER['REQUEST_URI']."<br />\n";
+ $debug .= "</pre>\nRequest-URI: ".$_SERVER['REQUEST_URI']."<br />\n";
$debug .= "Thank you for finding bugs.";
// And abort here
break;
case getCode('EXTENSION_PROBLEM'):
- if (REQUEST_ISSET_GET(('ext'))) {
- $msg = sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), REQUEST_GET(('ext')));
+ if (REQUEST_ISSET_GET('ext')) {
+ $msg = sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), REQUEST_GET('ext'));
} else {
$msg = getMessage('EXTENSION_PROBLEM_UNSET_EXT');
}
return $admin;
}
-// Checks wether an include file (non-FQFN better) is readable
-function isIncludeReadable ($INC) {
- // Construct FQFN
- $FQFN = constant('PATH') . $INC;
-
- // Is it readable?
- return isFileReadable($FQFN);
-}
-
-// Encode strings
-// @TODO Implement $compress
-function encodeString ($str, $compress=true) {
- $str = urlencode(base64_encode(compileUriCode($str)));
- return $str;
-}
-
-// Decode strings encoded with encodeString()
-// @TODO Implement $decompress
-function decodeString ($str, $decompress=true) {
- $str = compileUriCode(base64_decode(urldecode(compileUriCode($str))));
- return $str;
-}
-
// Compile characters which are allowed in URLs
function compileUriCode ($code, $simple=true) {
// Compile constants
return $reg;
}
-// Smartly adds slashes
-function smartAddSlashes ($unquoted) {
- $unquoted = str_replace("\\", '', $unquoted);
- return addslashes($unquoted);
-}
-
-// Decode entities in a nicer way
-function decodeEntities ($str) {
- // Decode the entities to UTF-8 now
- $decodedString = html_entity_decode($str, ENT_NOQUOTES, "UTF-8");
-
- // Return decoded string
- return $decodedString;
-}
-
// Wtites data to a config.php-style file
// @TODO Rewrite this function to use readFromFile() and writeToFile()
function changeDataInFile ($FQFN, $comment, $prefix, $suffix, $DATA, $seek=0) {
}
}
-// Merges an array together but only if both are arrays
-function merge_array ($array1, $array2) {
- // Are both an array?
- if ((is_array($array1)) && (is_array($array2))) {
- // Merge all together
- return array_merge($array1, $array2);
- } elseif (is_array($array1)) {
- // Return left array
- DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("array2 is not an array. array != %s", gettype($array2)));
- return $array1;
- } elseif (is_array($array2)) {
- // Return right array
- DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("array1 is not an array. array != %s", gettype($array1)));
- return $array2;
- }
-
- // Both are not arrays
- debug_report_bug(__FUNCTION__.": No arrays provided!");
-}
-
// Debug message logger
function DEBUG_LOG ($funcFile, $line, $message, $force=true) {
// Is debug mode enabled?
SET_INC_POOL(getArrayFromDirectory('inc/reset/', 'reset_'));
// Update database
- if (!defined('DEBUG_RESET')) updateConfiguration('last_update', time());
+ if (getConfig('DEBUG_RESET') != 'Y') updateConfiguration('last_update', time());
// Is the config entry set?
if (GET_EXT_VERSION('sql_patches') >= '0.4.2') {
MERGE_INC_POOL(getArrayFromDirectory('inc/weekly/', 'weekly_'));
// Update config
- if (!defined('DEBUG_WEEKLY')) updateConfiguration('last_week', $currWeek);
+ if (getConfig('DEBUG_WEEKLY') != 'Y') updateConfiguration('last_week', $currWeek);
} // END - if
// Create current month mark
MERGE_INC_POOL(getArrayFromDirectory('inc/monthly/', 'monthly_'));
// Update config
- if (!defined('DEBUG_MONTHLY')) updateConfiguration('last_month', $currMonth);
+ if (getConfig('DEBUG_MONTHLY') != 'Y') updateConfiguration('last_month', $currMonth);
} // END - if
} // END - if
return $ret;
}
-// Check if given FQFN is a readable file
-function isFileReadable ($FQFN) {
- // Check all...
- return ((file_exists($FQFN)) && (is_file($FQFN)) && (is_readable($FQFN)));
-}
-
// Converts timestamp selections into a timestamp
function convertSelectionsToTimestamp (&$POST, &$DATA, &$id, &$skip) {
// Init test variable
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):accessLevel={$accessLevel}<br />\n";
$content = array(
'login_failures' => getSession('mxchange_'.$accessLevel.'_failures'),
- 'last_failure' => generateDateTime(getSession('mxchange_'.$accessLevel.'_last_fail'), "2")
+ 'last_failure' => generateDateTime(getSession('mxchange_'.$accessLevel.'_last_fail'), '2')
);
// Load template
}
// This strips out the real address from proxy output
- if (strstr($address, ",")){
- $addressArray = explode(",", $address);
+ if (strstr($address, ',')){
+ $addressArray = explode(',', $address);
$address = $addressArray[0];
} // END - if
return $address;
}
-// "Getter" for remote IP number
-function detectRemoteAddr () {
- // Get remote ip from environment
- $remoteAddr = determineRealRemoteAddress();
-
- // Is removeip installed?
- if (EXT_IS_ACTIVE('removeip')) {
- // Then anonymize it
- $remoteAddr = GET_ANONYMOUS_REMOTE_ADDR($remoteAddr);
- } // END - if
-
- // Return it
- return $remoteAddr;
-}
-
-// "Getter" for remote hostname
-function detectRemoteHostname () {
- // Get remote ip from environment
- $remoteHost = getenv('REMOTE_HOST');
-
- // Is removeip installed?
- if (EXT_IS_ACTIVE('removeip')) {
- // Then anonymize it
- $remoteHost = GET_ANONYMOUS_REMOTE_HOST($remoteHost);
- } // END - if
-
- // Return it
- return $remoteHost;
-}
-
-// "Getter" for user agent
-function detectUserAgent () {
- // Get remote ip from environment
- $userAgent = getenv('HTTP_USER_AGENT');
-
- // Is removeip installed?
- if (EXT_IS_ACTIVE('removeip')) {
- // Then anonymize it
- $userAgent = GET_ANONYMOUS_USER_AGENT($userAgent);
- } // END - if
-
- // Return it
- return $userAgent;
-}
-
-// "Getter" for referer
-function detectReferer () {
- // Get remote ip from environment
- $referer = getenv('HTTP_REFERER');
-
- // Is removeip installed?
- if (EXT_IS_ACTIVE('removeip')) {
- // Then anonymize it
- $referer = GET_ANONYMOUS_REFERER($referer);
- } // END - if
-
- // Return it
- return $referer;
-}
-
// Adds a bonus mail to the queue
// This is a high-level function!
function addNewBonusMail ($data, $mode = '', $output=true) {
$GLOBALS['refid'] = getConfig(('def_refid'));
} elseif ((GET_EXT_VERSION('user') >= '0.3.4') && (getConfig('select_user_zero_refid')) == 'Y') {
// Select a random user which has confirmed enougth mails
- $GLOBALS['refid'] = SELECT_RANDOM_REFID();
+ $GLOBALS['refid'] = determineRandomReferalId();
} else {
// No default ID when sql_patches is not installed or none set
$GLOBALS['refid'] = 0;
return $GLOBALS['refid'];
}
-// Check wether we are installing
-function isInstalling () {
- $installing = ((isset($GLOBALS['mxchange_installing'])) || (REQUEST_ISSET_GET('installing')));
- //* DEBUG: */ var_dump($installing);
- return $installing;
-}
-
-// Check wether this script is installed
-function isInstalled () {
- return isBooleanConstantAndTrue('mxchange_installed');
-}
-
-// Check wether an admin is registered
-function isAdminRegistered () {
- return isBooleanConstantAndTrue('admin_registered');
-}
-
// Enables the reset mode. Only call this function if you really want the
// reset to be run!
function enableResetMode () {
runFilterChain('reset_enabled');
}
-// Checks wether the reset mode is active
-function isResetModeEnabled () {
- // Now simply check it
- return ((isset($GLOBALS['reset_enabled'])) && ($GLOBALS['reset_enabled'] === true));
-}
-
-// Checks wether the debug mode is enabled
-function isDebugModeEnabled () {
- // Simply check it
- return isBooleanConstantAndTrue('DEBUG_MODE');
-}
-
-// Checks wether the cache instance is valid
-function isCacheInstanceValid () {
- return ((isset($GLOBALS['cache_instance'])) && (is_object($GLOBALS['cache_instance'])));
-}
-
// Our shutdown-function
function shutdown () {
// Call the filter chain 'shutdown'
return (isset($GLOBALS['userid']));
}
-// Checks wether the given FQFN is a directory and not .,.. or .svn
-function isDirectory ($FQFN) {
- // Generate baseName
- $baseName = basename($FQFN);
-
- // Check it
- $isDirectory = ((is_dir($FQFN)) && ($baseName != '.') && ($baseName != '..') && ($baseName != ".svn"));
-
- // Return the result
- return $isDirectory;
-}
-
// Handle message codes from URL
function handleCodeMessage () {
- if (REQUEST_ISSET_GET(('msg'))) {
+ if (REQUEST_ISSET_GET('msg')) {
// Default extension is "unknown"
- $ext = "unknown";
+ $ext = 'unknown';
// Is extension given?
- if (REQUEST_ISSET_GET(('ext'))) $ext = REQUEST_GET(('ext'));
+ if (REQUEST_ISSET_GET('ext')) $ext = REQUEST_GET('ext');
// Convert the 'msg' parameter from URL to a human-readable message
$msg = convertCodeToMessage(REQUEST_GET('msg'));
// Load message template
- LOAD_TEMPLATE("message", false, $msg);
+ LOAD_TEMPLATE('message', false, $msg);
+ } // END - if
+}
+
+// Setter for extra title
+function setExtraTitle ($extraTitle) {
+ $GLOBALS['extra_title'] = $extraTitle;
+}
+
+// Getter for extra title
+function getExtraTitle () {
+ // Is the extra title set?
+ if (!isExtraTitleSet()) {
+ // No, then abort here
+ debug_report_bug('extra_title is not set!');
} // END - if
+
+ // Return it
+ return $GLOBALS['extra_title'];
+}
+
+// Checks if the extra title is set
+function isExtraTitleSet () {
+ return ((isset($GLOBALS['extra_title'])) && (!empty($GLOBALS['extra_title'])));
}
//////////////////////////////////////////////////
}
// Is the header already sent?
-if (($GLOBALS['header_sent'] != "1") && ($GLOBALS['header_sent'] != "2")) {
+if (($GLOBALS['header_sent'] != '1') && ($GLOBALS['header_sent'] != '2')) {
// If not in CSS mode generate the header
- if (($GLOBALS['output_mode'] != "1")) {
+ if (($GLOBALS['output_mode'] != '1')) {
// Generate header
$TITLE = '';
if ((getConfig('enable_title_deco') == 'Y') && (getConfig('title_left') != '')) $TITLE .= trim(getConfig('title_left'))." ";
// Do we have some extra title?
- if (!empty($EXTRA_TITLE)) {
+ if (isExtraTitleSet()) {
// Then prepent it
- $TITLE .= $EXTRA_TITLE." by ";
+ $TITLE .= getExtraTitle() . ' by ';
} // END - if
// Add main title
// Remember title in constant for the template
define('__PAGE_TITLE', $TITLE);
+ } elseif ((isInstalled()) && (!isAdminRegistered())) {
+ // Installed but no admin registered
+ define('__PAGE_TITLE', sprintf(getMessage('SETUP_OF_MXCHANGE'), constant('MAIN_TITLE')));
} elseif ((!isInstalled()) || (!isAdminRegistered())) {
// Installation mode
- define('__PAGE_TITLE', sprintf(getMessage('INSTALLATION_OF_MXCHANGE'), constant('MAIN_TITLE')));
+ define('__PAGE_TITLE', getMessage('INSTALLATION_OF_MXCHANGE'));
} else {
// Configuration not found!
define('__PAGE_TITLE', getMessage('NO_CONFIG_FOUND_TITLE'));
unset($TITLE);
// Output page header code
- LOAD_TEMPLATE("page_header");
+ LOAD_TEMPLATE('page_header');
// Include meta data in 'guest' module
if ($GLOBALS['module'] == 'index') {
// Load meta data template
- LOAD_TEMPLATE("metadata");
+ LOAD_TEMPLATE('metadata');
// Add meta description to header
if ((isInstalled()) && (isAdminRegistered()) && (SQL_IS_LINK_UP())) {
} // END - if
// Include more header data here
- LOAD_TEMPLATE("header");
+ LOAD_TEMPLATE('header');
// Include stylesheet
- loadIncludeOnce("inc/stylesheet.php");
+ loadIncludeOnce('inc/stylesheet.php');
} // END - if
// Closing HEAD tag
- if ($GLOBALS['output_mode'] != "1") OUTPUT_HTML("</head>");
+ if ($GLOBALS['output_mode'] != '1') OUTPUT_HTML('</head>');
$GLOBALS['header_sent'] = 1;
} // END - if
// Load body or not
-if (($GLOBALS['module'] != "frametester") || (($GLOBALS['module'] == "frametester") && (REQUEST_ISSET_GET(('frame')))) || (($GLOBALS['header_sent'] == "1") && (REQUEST_ISSET_GET(('frame')))) && ($GLOBALS['output_mode'] != "1")) {
+if (($GLOBALS['module'] != 'frametester') || (($GLOBALS['module'] == 'frametester') && (REQUEST_ISSET_GET(('frame')))) || (($GLOBALS['header_sent'] == '1') && (REQUEST_ISSET_GET(('frame')))) && ($GLOBALS['output_mode'] != '1')) {
// Is the header sent and the script is not the mail confirmation script and not a CSS?
- if (($GLOBALS['header_sent'] == "1") && (basename($_SERVER['PHP_SELF']) != "mailid.php") && ($GLOBALS['output_mode'] != "1")) {
+ if (($GLOBALS['header_sent'] == '1') && (basename($_SERVER['PHP_SELF']) != 'mailid.php') && ($GLOBALS['output_mode'] != '1')) {
// Add BODY tag
- LOAD_TEMPLATE("page_body");
+ LOAD_TEMPLATE('page_body');
$GLOBALS['header_sent'] = 2;
} // END - if
} // END - if
$INCs = array();
// Open directory
- $dirPointer = opendir(constant('PATH') . $baseDir) or app_die(__FUNCTION__, __LINE__, "Cannot read ".basename($baseDir)." path!");
+ $dirPointer = opendir(constant('PATH') . $baseDir) or app_die(__FUNCTION__, __LINE__, 'Cannot read '.basename($baseDir).' path!');
// Read all entries
while ($baseFile = readdir($dirPointer)) {
// Is this a valid reset file?
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "baseDir={$baseDir},prefix={$prefix},baseFile={$baseFile}");
- if (((isFileReadable($FQFN)) && (substr($baseFile, 0, strlen($prefix)) == $prefix) && (substr($baseFile, -4, 4) == ".php")) || (($includeDirs) && (isDirectory($FQFN)))) {
+ if (((isFileReadable($FQFN)) && (substr($baseFile, 0, strlen($prefix)) == $prefix) && (substr($baseFile, -4, 4) == '.php')) || (($includeDirs) && (isDirectory($FQFN)))) {
// Remove both for extension name
$extName = substr($baseFile, strlen($prefix), -4);
if (!defined('__SECURITY')) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
-}
+} // END - if
// Init variables
$mysql = array();
} // END - if
// Is MXChange installed or no admin registered so far?
-if ((!isInstalled()) || (!isAdminRegistered()))
-{
+if ((!isInstalled()) || (!isAdminRegistered())) {
// Set URL for FORM actions
define('__BURL_ACTION', constant('URL'));
// Output page for entered value
switch (REQUEST_GET('page'))
{
- case "welcome": // Welcome to the installation!
- LOAD_TEMPLATE("install_welcome");
+ case 'welcome': // Welcome to the installation!
+ LOAD_TEMPLATE('install_welcome');
break;
- case "1": // Server path, base URL
+ case '1': // Server path, base URL
// @Profi-Concept: Hab meine Meinung doch geaendert! :-)
// Load template
- LOAD_TEMPLATE("install_page1");
+ LOAD_TEMPLATE('install_page1');
break;
- case "2": // MySQL data (alone!)
- if (empty($mysql['dbase'])) $mysql['dbase'] = "your_database";
- if (empty($mysql['login'])) $mysql['login'] = "your_login";
- if (empty($mysql['host'])) $mysql['host'] = "localhost";
- if (empty($mysql['prefix'])) $mysql['prefix'] = "mxchange";
- if (empty($mysql['type'])) $mysql['type'] = "MyISAM";
+ case '2': // MySQL data (alone!)
+ if (empty($mysql['dbase'])) $mysql['dbase'] = 'your_database';
+ if (empty($mysql['login'])) $mysql['login'] = 'your_login';
+ if (empty($mysql['host'])) $mysql['host'] = 'localhost';
+ if (empty($mysql['prefix'])) $mysql['prefix'] = 'mxchange';
+ if (empty($mysql['type'])) $mysql['type'] = 'MyISAM';
if (getTotalFatalErrors() > 0) {
OUTPUT_HTML("<span class=\"install_fatal\">");
foreach (getFatalArray() as $key => $err) {
define('__EMAIL_VALUE' , REQUEST_POST('email'));
// Load template
- LOAD_TEMPLATE("install_page2");
+ LOAD_TEMPLATE('install_page2');
break;
- case "3":
+ case '3':
// Set more values
define('__SPATH_VALUE' , REQUEST_POST('spath'));
define('__BURL_VALUE' , REQUEST_POST('burl'));
define('__EMAIL_VALUE' , REQUEST_POST('email'));
// Use default SMTP data
- $smtpHost = constant('SMTP_HOSTNAME');
- $smtpUser = constant('SMTP_USER');
- $smtpPass1 = constant('SMTP_PASSWORD');
- $smtpPass2 = constant('SMTP_PASSWORD');
+ $smtpHost = getConfig('SMTP_HOSTNAME');
+ $smtpUser = getConfig('SMTP_USER');
+ $smtpPass1 = getConfig('SMTP_PASSWORD');
+ $smtpPass2 = getConfig('SMTP_PASSWORD');
// Overwrite it with the data from sent (failed) form
if (REQUEST_ISSET_POST(('smtp_host'))) $smtpHost = REQUEST_POST('smtp_host');
if (REQUEST_ISSET_POST(('smtp_user'))) $smtpUser = REQUEST_POST('smtp_user');
+ if (REQUEST_ISSET_POST(('smtp_pass'))) {
+ $smtpPass1 = REQUEST_POST('smtp_pass');
+ $smtpPass2 = REQUEST_POST('smtp_pass');
+ } // END - if
// MySQL settings
define('__MYSQL_HOST' , $mysql['host']);
define('__SMTP_PASS2', $smtpPass2);
// Load template
- LOAD_TEMPLATE("install_page3");
+ LOAD_TEMPLATE('install_page3');
break;
- case "5": // Misc settings
+ case '5': // Misc settings
// General settings
define('__SPATH_VALUE' , REQUEST_POST('spath'));
define('__BURL_VALUE' , REQUEST_POST('burl'));
<td class=\"install\" align=\"right\">{--LANG_OUTPUT_MODE--}: </td>
<td>
<select name=\"omode\" size=\"1\" class=\"install_select\">
- <option value=\"render\"");
- if (constant('OUTPUT_MODE') == 'render') OUTPUT_HTML(' selected="selected"');
- OUTPUT_HTML(">{--MODE_RENDER--}</option>
- <option value=\"direct\"");
- if (constant('OUTPUT_MODE') == 'direct') OUTPUT_HTML(' selected="selected"');
- OUTPUT_HTML(">{--MODE_DIRECT--}</option>
+ <option value=\"render\">{--MODE_RENDER--}</option>
+ <option value=\"direct\">{--MODE_DIRECT--}</option>
</select>
</td>
</tr>
<td class=\"install\" align=\"right\">{--WARN_NO_PASSWORD--}: </td>
<td>
<select name=\"warn_no_pass\" size=\"1\" class=\"install_select\">
- <option value=\"true\"");
- if (isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(' selected="selected"');
- OUTPUT_HTML(">{--YES--}</option>
- <option value=\"false\"");
- if (!isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(' selected="selected"');
- OUTPUT_HTML(">{--NO--}</option>
+ <option value=\"Y\">{--YES--}</option>
+ <option value=\"N\">{--NO--}</option>
</select>
</td>
</tr>
<td class=\"install\" align=\"right\">{--LANG_WRITE_FOOTER--}: </td>
<td>
<select name=\"wfooter\" size=\"1\" class=\"install_select\">
- <option value=\"true\"");
- if (isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(' selected="selected"');
- OUTPUT_HTML(">{--YES--}</option>
- <option value=\"false\"");
- if (!isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(' selected="selected"');
- OUTPUT_HTML(">{--NO--}</option>
+ <option value=\"Y\">{--YES--}</option>
+ <option value=\"N\">{--NO--}</option>
</select>
</td>
</tr>
<td class=\"install\" align=\"right\">{--INSTALL_ENABLE_BACKLINK--}: </td>
<td>
<select name=\"blink\" size=\"1\" class=\"install_select\">
- <option value=\"true\"");
- if (isBooleanConstantAndTrue('ENABLE_BACKLINK')) OUTPUT_HTML(' selected="selected"');
- OUTPUT_HTML(">{--YES--}</option>
- <option value=\"false\"");
- if (!isBooleanConstantAndTrue('ENABLE_BACKLINK')) OUTPUT_HTML(' selected="selected"');
- OUTPUT_HTML(">{--NO--}</option>
+ <option value=\"Y\">{--YES--}</option>
+ <option value=\"N\">{--NO--}</option>
</select>
</td>
</tr>
</form>");
break;
- case "finalize": // Write captured data to files
+ case 'finalize': // Write captured data to files
if ((REQUEST_ISSET_POST(('finalize'))) && (!isInstalled())) {
// You have submitted data then we have to reset the SQLs
INIT_SQLS();
// Seems to work, also right database?
if (SQL_SELECT_DB($mysql['dbase'], __FILE__, __LINE__) === true) {
// Automatically run install.sql
- if ((isFileReadable(REQUEST_POST('spath').'install/tables.sql')) && (isFileReadable(REQUEST_POST('spath').'install/menu-'.getLanguage().'.sql'))) {
+ if ((isFileReadable(REQUEST_POST('spath') . 'install/tables.sql')) && (isFileReadable(REQUEST_POST('spath') . 'install/menu-'.getLanguage().'.sql'))) {
// Both exists so import them
foreach (array('tables', 'menu-'.getLanguage()) as $dump) {
// Should be save here because file_exists() is there but we check it again. :)
} // END - while
} // END - foreach
- // And split it up against ;\n ...
- SET_SQLS(merge_array(GET_SQLS(), explode(";\n", $fileContent)));
+ // Split it up against ";\n" and merge it into existing SQLs
+ MERGE_SQLS(explode(";\n", $fileContent));
} else {
// Not readable!
debug_report_bug(sprintf("SQL dump %s is not readable!", $dump));
// Now run all queries through and try to keep out empty or comment queries
runFilterChain('run_sqls');
+ // Copy the config template and verify it
+ copyFileVerified(REQUEST_POST('spath') . 'inc/config-local.php.dist', REQUEST_POST('spath') . 'inc/cache/config-local.php', 0644);
+
// Ok, all done. So we can write the config data to the php files
- if (REQUEST_POST('spath') != constant('PATH')) changeDataInFile(REQUEST_POST('spath')."inc/config.php", "SERVER-PATH", "define('PATH', \"", "\");", REQUEST_POST('spath'), 0);
- if (REQUEST_POST('burl') != constant('URL')) changeDataInFile(REQUEST_POST('spath')."inc/config.php", "HOST-URL", "define('URL', \"", "\");", REQUEST_POST('burl'), 0);
- changeDataInFile(REQUEST_POST('spath')."inc/config.php", "MAIN_TITLE", "define('MAIN_TITLE', \"", "\");", REQUEST_POST('title'), 0);
- changeDataInFile(REQUEST_POST('spath')."inc/config.php", "SLOGAN", "define('SLOGAN', \"", "\");", REQUEST_POST('slogan'), 0);
- changeDataInFile(REQUEST_POST('spath')."inc/config.php", "WEBMASTER", "define('WEBMASTER', \"", "\");", REQUEST_POST('email'), 0);
- changeDataInFile(REQUEST_POST('spath')."inc/config.php", "NULLPASS-WARNING", "define('warn_no_pass', ", ");", REQUEST_POST('warn_no_pass'), 0);
- changeDataInFile(REQUEST_POST('spath')."inc/config.php", "WRITE-FOOTER", "define('WRITE_FOOTER', ", ");", REQUEST_POST('wfooter'), 0);
- changeDataInFile(REQUEST_POST('spath')."inc/config.php", "BACKLINK", "define('ENABLE_BACKLINK', ", ");", REQUEST_POST('blink'), 0);
- // DEACTIVATED: changeDataInFile(REQUEST_POST('spath')."inc/config.php", "OUTPUT-MODE", "define('OUTPUT_MODE', \"", "\");", REQUEST_POST('omode'), 0);
- changeDataInFile(REQUEST_POST('spath')."inc/config.php", "MYSQL-HOST", " 'host' => \"", "\",", $mysql['host'], 0);
- changeDataInFile(REQUEST_POST('spath')."inc/config.php", "MYSQL-DBASE", " 'dbase' => \"", "\",", $mysql['dbase'], 0);
- changeDataInFile(REQUEST_POST('spath')."inc/config.php", "MYSQL-LOGIN", " 'login' => \"", "\",", $mysql['login'], 0);
- changeDataInFile(REQUEST_POST('spath')."inc/config.php", "MYSQL-PASSWORD", " 'password' => \"", "\",", $mysql['pass1'], 0);
- changeDataInFile(REQUEST_POST('spath')."inc/config.php", "MYSQL-PREFIX", "define('_MYSQL_PREFIX', \"", "\");", $mysql['prefix'], 0);
- changeDataInFile(REQUEST_POST('spath')."inc/config.php", "TABLE-TYPE", "define('_TABLE_TYPE', \"", "\");", $mysql['type'], 0);
- changeDataInFile(REQUEST_POST('spath')."inc/config.php", "SMTP-HOSTNAME", "define('SMTP_HOSTNAME', \"", "\");", REQUEST_POST('smtp_host'), 0);
- changeDataInFile(REQUEST_POST('spath')."inc/config.php", "SMTP-USER", "define('SMTP_USER', \"", "\");", REQUEST_POST('smtp_user'), 0);
- changeDataInFile(REQUEST_POST('spath')."inc/config.php", "SMTP-PASSWORD", "define('SMTP_PASSWORD', \"", "\");", REQUEST_POST('smtp_pass1'), 0);
- changeDataInFile(REQUEST_POST('spath')."inc/config.php", "INSTALLED", "define('mxchange_installed', ", ");", "true", 0);
+ if (REQUEST_POST('spath') != constant('PATH')) changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SERVER-PATH", "define('PATH', \"", "\");", REQUEST_POST('spath'), 0);
+ if (REQUEST_POST('burl') != constant('URL')) changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "HOST-URL", "define('URL', \"", "\");", REQUEST_POST('burl'), 0);
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MAIN-TITLE", "define('MAIN_TITLE', \"", "\");", REQUEST_POST('title'), 0);
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SLOGAN", "define('SLOGAN', \"", "\");", REQUEST_POST('slogan'), 0);
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "WEBMASTER", "define('WEBMASTER', \"", "\");", REQUEST_POST('email'), 0);
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "NULLPASS-WARNING", "setConfigEntry('WARN_NO_PASS', \"", "\");", REQUEST_POST('warn_no_pass'), 0);
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "WRITE-FOOTER", "setConfigEntry('WRITE_FOOTER', \"", "\");", REQUEST_POST('wfooter'), 0);
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "BACKLINK", "setConfigEntry('ENABLE_BACKLINK', \"", "\");", REQUEST_POST('blink'), 0);
+ // DEACTIVATED: changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "OUTPUT-MODE", "define('OUTPUT_MODE', \"", "\");", REQUEST_POST('omode'), 0);
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MYSQL-HOST", " 'host' => \"", "\",", $mysql['host'], 0);
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MYSQL-DBASE", " 'dbase' => \"", "\",", $mysql['dbase'], 0);
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MYSQL-LOGIN", " 'login' => \"", "\",", $mysql['login'], 0);
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MYSQL-PASSWORD", " 'password' => \"", "\",", $mysql['pass1'], 0);
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "MYSQL-PREFIX", "setConfigEntry('_MYSQL_PREFIX', \"", "\");", $mysql['prefix'], 0);
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "TABLE-TYPE", "setConfigEntry('_TABLE_TYPE', \"", "\");", $mysql['type'], 0);
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SMTP-HOSTNAME", "setConfigEntry('SMTP_HOSTNAME', \"", "\");", REQUEST_POST('smtp_host'), 0);
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SMTP-USER", "setConfigEntry('SMTP_USER', \"", "\");", REQUEST_POST('smtp_user'), 0);
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SMTP-PASSWORD", "setConfigEntry('SMTP_PASSWORD', \"", "\");", REQUEST_POST('smtp_pass1'), 0);
+
+ // Generate a long site key
+ $siteKey = generatePassword(50);
+
+ // And write it
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "SITE-KEY", "setConfigEntry('SITE_KEY', \"", "\");", $siteKey, 0);
+
+ // Script is now installed
+ changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "INSTALLED", "setConfigEntry('MXCHANGE_INSTALLED', \"", "\");", 'Y', 0);
} else {
// Installation area not found!
addFatalMessage(__FILE__, __LINE__, getMessage('INSTALL_MISSING_DUMPS'));
$mx_lang = getSession('mx_lang');
// Set default language if it is not (yet) set
-if (is_null($mx_lang)) $mx_lang = constant('DEFAULT_LANG');
+if (is_null($mx_lang)) $mx_lang = getConfig('DEFAULT_LANG');
// Generate filename
$INC = sprintf("inc/language/%s.php", SQL_ESCAPE($mx_lang));
-// Generate FQFN
-$FQFN = constant('PATH') . $INC;
-
// Look for file
-if (!isFileReadable($FQFN)) {
+if (!isIncludeReadable($INC)) {
// Switch to default (DO NOT CHANGE!!!)
- $mx_lang = constant('DEFAULT_LANG');
- setSession('mx_lang', $mx_lang);
- $INC = sprintf("inc/language/%s.php", $mx_lang);
+ setSession('mx_lang', 'de');
+ $INC = 'inc/language/de.php';
+
+ // And set it temporarily
+ setConfigEntry('DEFAULT_LANG', 'de');
} // END - if
// Load language file
// Check for installation mode
if ((isInstalling()) || (!isInstalled()) || (!isAdminRegistered())) {
// Load matching language file
- loadInclude('inc/language/install_' . $mx_lang . '.php');
+ loadInclude('inc/language/install_' . getSession('mx_lang') . '.php');
}
// Remove no more needed variables
define('BONUS_POINTS_TITLE', "Sonderbonus-{!POINTS!}");
define('BONUS_RANK_YOU_ARE_NOT_FOUND', "Sie haben bis jetzt noch keine Aktiv-Vergütung erhalten!");
define('BONUS_RANK', "Platz");
-define('BONUS_SHOW_FOOTER_NOTE_1', "Wir wünschen allen Gewinnern viel Glück bei der monatlichen Aktiv-Rallye!");
-define('BONUS_SHOW_FOOTER_NOTE_2', "Es können nur die ersten {!__BONUS_TOTAL_RANKS!} die Aktiv-Rallye gewinnen. Der Rechtsweg ist ausgeschlossen.");
define('BONUS_SHOW_HEADER_LINE_1', "Hier sehen Sie eine Übersicht, wer alles");
define('BONUS_SHOW_HEADER_LINE_2', "für die Mail");
define('BONUS_SHOW_HEADER_LINE_3', "erhalten hat");
}
// Installation/setup
-define('CONFIG_IS_WRITE_PROTECTED', "Die Konfigurationsdatei <strong>inc/config.php</strong> ist schreibgeschützt. Bitte setzen Sie CHMOD 666 auf die Datei!");
+define('CONFIG_IS_WRITE_PROTECTED', "Die Konfigurationsdatei <strong>inc/cache/config-local.php</strong> ist schreibgeschützt. Bitte setzen Sie CHMOD 666 auf die Datei!");
define('DUMMY_IS_WRITE_PROTECTED', "In dem Verzeichnis <strong>inc/</strong> kann keine Datei erzeugt werden. Bitte setzen Sie CHMOD 777 auf das Verzeichnis!");
define('SECRET_IS_WRITE_PROTECTED', "In dem Verzeichnis <strong>inc/.secret/</strong> kann keine Datei erzeugt werden. Bitte setzen Sie CHMOD 777 auf das Verzeichnis oder probieren Sie auch 770 aus!");
define('LANG_WARNING', "Warnung");
define('DIE_CONFIG_CHANGED_YOU', "Sie haben Ihre Config-Datei editiert! Auf Wiedersehen...");
define('DIE_RUN_INSTALL_MYSQL', "Bitte rufen Sie http://your-domain.com/install.php auf, um Ihre MySQL-Daten einzurichten!");
-define('WARN_NULL_PASSWORD', "Sie haben kein Passwort eingegeben! Bitte lesen Sie in der <strong>inc/config.php</strong> nach, wie Sie diese Warnung abschalten können.");
-define('FATAL_CONFIG_WRITABLE', "Ihre Datei inc/config.php ist beschreibbar! Dies ist ein mögliches Sicherheitsrisiko!");
-define('FATAL_CANNOT_WRITE_CONFIG', "Kann Konfigurationsdaten nicht speichern, da ich keinen Schreibzugriff auf inc/config.php habe!");
+define('WARN_NULL_PASSWORD', "Sie haben kein Passwort eingegeben! Bitte lesen Sie in der <strong>inc/cache/config-local.php</strong> nach, wie Sie diese Warnung abschalten können.");
+define('FATAL_CONFIG_WRITABLE', "Ihre Datei inc/cache/config-local.php ist beschreibbar! Dies ist ein mögliches Sicherheitsrisiko!");
+define('FATAL_CANNOT_WRITE_CONFIG', "Kann Konfigurationsdaten nicht speichern, da ich keinen Schreibzugriff auf inc/cache/config-local.php habe!");
define('FATAL_CANNOT_CREATE_TMP', "Kann eine temporäre Datei nicht erzeugen! Bitte setzen Sie CHMOD 777 auf Verzeichnis inc!");
define('FATAL_ERROR', "Fataler Fehler");
define('LANG_NO_RENDER_DIRECT', "Sie haben weder 'render' noch 'direct' als Ausgabe-Modus eingestellt!");
define('IS_FIRST_MENU', "Ist das erste Hauptmenü");
define('NO_DB_LINK', "Keine Verbindung zur Datenbank.");
define('NO_DB_LINK_SHUTDOWN', "Keine Verbindung zur Datenbank beim Schliessen der Verbindung.");
-define('MYSQL_DATA_MISSING', "Die Konfiguration Ihrer Datenbankverbindung ist unnvollständig. Bitte in inc/config.php mindestens den Hostnamen, Datenbanknamen und Login zur Datenbank eingeben.");
+define('MYSQL_DATA_MISSING', "Die Konfiguration Ihrer Datenbankverbindung ist unnvollständig. Bitte in <strong>inc/cache/config-local.php</strong> mindestens den Hostnamen, Datenbanknamen und Login zur Datenbank eingeben.");
define('REGISTER_PERSONAL_DATA', "Persönliche Daten");
define('REGISTER_CATEGORIES', "Interessengebiete");
define('REGISTER_MISC', "Passwort, maximale Mails pro Tag etc.");
define('LANG_WARNING', "Warning");
define('DIE_CONFIG_CHANGED_YOU', "You have edited your config.php file! I'm out here...");
define('DIE_RUN_INSTALL_MYSQL', "Please run http://your-domain.com/install.php to setup your MySQL data.");
-define('WARN_NULL_PASSWORD', "You have a null-password! If you want to switch off this warning please have a look in <strong>inc/config.php</strong>.");
-define('FATAL_CONFIG_WRITABLE', "Your file inc/config.php is writeable! This is a possible security risk.");
-define('FATAL_CANNOT_WRITE_CONFIG', "Cannot write config data because I have no write permissions to inc/config.php.");
+define('WARN_NULL_PASSWORD', "You have a null-password! If you want to switch off this warning please have a look in <strong>inc/cache/config-local.php</strong>.");
+define('FATAL_CONFIG_WRITABLE', "Your file inc/cache/config-local.php is writeable! This is a possible security risk.");
+define('FATAL_CANNOT_WRITE_CONFIG', "Cannot write config data because I have no write permissions to inc/cache/config-local.php.");
define('FATAL_ERROR', "Fatal error");
define('LANG_NO_RENDER_DIRECT', "You did not setup the output mode weather to 'render' nor to 'direct'.");
define('INSTALLATION', "Script installation");
}
// Language definitions
-define('INSTALLATION_OF_MXCHANGE', "Installation von MXChange-{!MT_WORD!}-Script - %s");
+define('INSTALLATION_OF_MXCHANGE', "Installation von MXChange-{!MT_WORD!}-Script");
+define('SETUP_OF_MXCHANGE', "Installation von MXChange-{!MT_WORD!}-Script - %s");
define('INSTALL_MISSING_DUMPS', "Die SQL-Dumps wurden nicht gefunden! Diese sollten auch mit hochgeladen werden und lesbar sein (CHMOD 644).");
define('INSTALL_ENABLE_BACKLINK', "Backlink (=Rückverlinkung zu mxchange.org setzen?) <em>rel="external"</em> ist gesetzt. Bitte nicht den Backlink einbauen, und <strong>nofollow</strong> verwenden! Das schadet allen.");
define('WRONG_PAGE', "Sie oder dieses Script haben eine falsche Seite ausgewählt!");
// When both passwords match update admin account
if ($POST['pass1'][$id] == $POST['pass2'][$id]) {
// Save only when both passwords are the same (also when they are empty)
- $add = ''; $cache_update = "1";
+ $add = ''; $cache_update = '1';
// Generate hash
$hash = generateHash($POST['pass1'][$id]);
// Shall we allow changing default ACL?
if ($currMode == "allow") {
// Allow chaning it
- $content['mode'] = generateOptionList("/ARRAY/", array("allow", "deny"), array(constant('ADMINS_ALLOW_MODE'), constant('ADMINS_DENY_MODE')), $content['mode']);
+ $content['mode'] = generateOptionList('/ARRAY/', array("allow", "deny"), array(constant('ADMINS_ALLOW_MODE'), constant('ADMINS_DENY_MODE')), $content['mode']);
} else {
// Don't allow it
$content['mode'] = " ";
}
- $content['la_mode'] = generateOptionList("/ARRAY/", array("global", "OLD", "NEW"), array(ADMINS_GLOBAL_LA_SETTING, ADMINS_OLD_LA_SETTING, ADMINS_NEW_LA_SETTING), $content['la_mode']);
+ $content['la_mode'] = generateOptionList('/ARRAY/', array("global", "OLD", "NEW"), array(ADMINS_GLOBAL_LA_SETTING, ADMINS_OLD_LA_SETTING, ADMINS_NEW_LA_SETTING), $content['la_mode']);
// Load row template and switch color
$OUT .= LOAD_TEMPLATE("admin_edit_admins_row", true, $content);
// Purge cache
cachePurgeAdminMenu($id);
- $cache_update = "1";
+ $cache_update = '1';
}
}
// Transfer data to template
define('__YR_LEVEL' , $rank);
define('__YR_POINTS', $points);
- define('__YR_TMARK' , generateDateTime($mark, "1"));
+ define('__YR_TMARK' , generateDateTime($mark, '1'));
// Load template
define('__YOUR_RANKING_LINE', LOAD_TEMPLATE("show_bonus_yr", true));
if (getConfig('bonus_active') != 'Y') return;
// Switch to jackpot-mode when no UID is supplied but userid-mode is selected
- if ((getConfig('bonus_mode') == "UID") && (getConfig('bonus_uid') == '0')) {
+ if ((getConfig('bonus_mode') == 'UID') && (getConfig('bonus_uid') == '0')) {
// Update database & config
updateConfiguration('bonus_mode', 'JACKPOT');
} // END - if
- if ($mode == "login_bonus") {
+ if ($mode == 'login_bonus') {
// Login bonus detected
$points = getConfig('login_bonus');
} else {
case 'JACKPOT': // ... jackpot
if ((SUB_JACKPOT($points) == -1) && (getConfig('bonus_uid') > 0)) {
// Check points amount first...
- $total = GET_TOTAL_DATA(getConfig('bonus_uid'), "user_points", "points") - GET_TOTAL_DATA(getConfig('bonus_uid'), "user_data", "used_points");
+ $total = GET_TOTAL_DATA(getConfig('bonus_uid'), 'user_points', 'points') - GET_TOTAL_DATA(getConfig('bonus_uid'), 'user_data', 'used_points');
if ($total >= $points) {
// Subtract points from userid's account
- SUB_POINTS("bonus_payout_jackpot", getConfig('bonus_uid'), $points);
+ SUB_POINTS('bonus_payout_jackpot', getConfig('bonus_uid'), $points);
} // END - if
} // END - if
break;
- case "UID": // ... userid's account
+ case 'UID': // ... userid's account
// Check his amount first
- $total = GET_TOTAL_DATA(getConfig('bonus_uid'), "user_points", "points") - GET_TOTAL_DATA(getConfig('bonus_uid'), "user_data", "used_points");
+ $total = GET_TOTAL_DATA(getConfig('bonus_uid'), 'user_points', 'points') - GET_TOTAL_DATA(getConfig('bonus_uid'), 'user_data', 'used_points');
if ($total >= $points) {
// Subtract points from userid's account
- SUB_POINTS("bonus_payout_uid", getConfig('bonus_uid'), $points);
+ SUB_POINTS('bonus_payout_uid', getConfig('bonus_uid'), $points);
} else {
// Try to subtract from jackpot
$dummy = SUB_JACKPOT($points);
$result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE timemark < (UNIX_TIMESTAMP() - ".getConfig('bonus_timeout').")", __FUNCTION__, __LINE__);
if (SQL_AFFECTEDROWS() > 0) {
// Send out email to admin
- sendAdminNotification(AUTOPURGE_ADMIN_TURBO_SUBJECT, "admin_autopurge_turbo", SQL_AFFECTEDROWS(), '');
- }
+ sendAdminNotification(AUTOPURGE_ADMIN_TURBO_SUBJECT, 'admin_autopurge_turbo', SQL_AFFECTEDROWS(), '');
+ } // END - if
}
+
//
?>
// This will destory an existing cache file!
if ($this->ret == $this->statusDone) {
// Create file
- if ($this->isCacheReadable()) chmod($this->fqfn, 0666);
+ if ($this->isCacheReadable()) changeMode($this->fqfn, 0666);
$this->pointer = fopen($this->fqfn, 'w') or app_die(__METHOD__, __LINE__, "Cannot write to cache ".$this->fqfn." !");
// Add open PHP tag
fclose($this->pointer);
// Set rights
- if ($this->isCacheReadable()) chmod($this->fqfn, 0666);
+ if ($this->isCacheReadable()) changeMode($this->fqfn, 0666);
// Remove pointer
$this->pointer = false;
if ($uid > 0) {
// Load entries only from a single user
$add = " AND `userid`='".bigintval($uid)."'";
- $mode = 'member'; $COLS = "4"; $DT_MODE = "2";
+ $mode = 'member'; $COLS = "4"; $DT_MODE = '2';
$NOT_FOUND = getMessage('DOUBLER_MEMBER_NO_ENTRIES_FOUND');
} else {
// Guest mode!
- $mode = 'guest'; $COLS = "3"; $DT_MODE = "3";
+ $mode = 'guest'; $COLS = '3'; $DT_MODE = '3';
$NOT_FOUND = getMessage('DOUBLER_GUEST_NO_ENTRIES_FOUND');
}
// Prepare array
$content = array(
- 'holiday_end' => generateDateTime($content['holiday_end'] , "3"),
- 'holiday_start' => generateDateTime($content['holiday_start'], "3"),
+ 'holiday_end' => generateDateTime($content['holiday_end'] , '3'),
+ 'holiday_start' => generateDateTime($content['holiday_start'], '3'),
'holiday_comments' => $content['comments']
);
return COMPILE_CODE(str_replace("\n", "<br />\n", $text));
}
-//
-function SEND_HTML_EMAIL($to, $subject, $message, $FROM) {
+// Sends a HTML mail to the user
+function sendHtmlEmail($to, $subject, $message, $FROM) {
if (EXT_IS_ACTIVE('html_mail')) {
// Send mail away as HTML
- $FROM = "Content-Type: text/html\n".$FROM;
+ $FROM = "Content-Type: text/html\n" . $FROM;
sendEmail($to, $subject, $message, 'N', $FROM);
}
}
// Transfer all neccessary data to the global $DATA array
$DATA['uid_cnt'] = SQL_NUMROWS($result_user);
- $DATA['start'] = generateDateTime($start, "2");
- $DATA['end'] = generateDateTime($end , "2");
- $DATA['now_t'] = generateDateTime(time(), "2");
+ $DATA['start'] = generateDateTime($start, '2');
+ $DATA['end'] = generateDateTime($end , '2');
+ $DATA['now_t'] = generateDateTime(time(), '2');
$DATA['title'] = $title;
$DATA['id'] = $id; // ID for the rallye details link
if ($notify == 'Y') {
// Transfer all neccessary data to the global $DATA array
- $DATA['start'] = generateDateTime($start, "2");
- $DATA['end'] = generateDateTime($end , "2");
- $DATA['now_t'] = generateDateTime(time(), "2");
+ $DATA['start'] = generateDateTime($start, '2');
+ $DATA['end'] = generateDateTime($end , '2');
+ $DATA['now_t'] = generateDateTime(time(), '2');
$DATA['title'] = $title;
$DATA['id'] = $id; // ID for the rallye details link
$DATA['ref'] = 0;
$DATA = array(); $cnt = 0;
$users = array();
$DATA['title'] = $title;
- $DATA['start'] = generateDateTime($start, "1");
- $DATA['end'] = generateDateTime($end , "1");
- $DATA['now_t'] = generateDateTime(time(), "1");
+ $DATA['start'] = generateDateTime($start, '1');
+ $DATA['end'] = generateDateTime($end , '1');
+ $DATA['now_t'] = generateDateTime(time(), '1');
// Just count...
$total = 0;
//
function RALLYE_LOAD_USER_DATA ($uids_array) {
// Implode user ids
- $uid_string = implode(",", $uids_array['uid']);
+ $uid_string = implode(',', $uids_array['uid']);
// Init result string
$ret = '';
while ($content = SQL_FETCHARRAY($result_rallye)) {
// Prepare data for mail template
$DATA['title'] = $content['title'];
- $DATA['start'] = generateDateTime($content['start_time'], "1");
- $DATA['end'] = generateDateTime($content['end_time'] , "1");
- $DATA['now_t'] = generateDateTime(time(), "1");
+ $DATA['start'] = generateDateTime($content['start_time'], '1');
+ $DATA['end'] = generateDateTime($content['end_time'] , '1');
+ $DATA['now_t'] = generateDateTime(time(), '1');
// Send mail to admin
sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_PURGED_SUBJ'), $content['title']), "admin_rallye_purged", '', 0);
);
if ((REQUEST_POST('cat', $content['id']) == 'Y') || ((getConfig('register_default') == 'Y') && (!REQUEST_ISSET_POST('cat', $content['id'])))) {
- $content['def_y'] = ' chkecked="checked"';
+ $content['def_y'] = ' checked="checked"';
} else {
- $content['def_n'] = ' chkecked="checked"';
+ $content['def_n'] = ' checked="checked"';
}
// Load template and switch color
// Generate arrays which holds the relevante chars to replace
$GLOBALS['security_chars'] = array(
// The chars we are looking for...
- 'from' => array("{", "}", '/', '.', "'", "$", "(", ")", '{--', '--}', "%", ';', "[", "]", ':', "--"),
+ 'from' => array("{", "}", '/', '.', "'", "$", '(', ')', '{--', '--}', "%", ';', "[", "]", ':', "--"),
// ... and we will replace to.
'to' => array(
"{OPEN_ANCHOR2}",
if (phpversion() >= '4.0.4pl1' && (strstr(getenv('HTTP_USER_AGENT'),'compatible') || (strstr(getenv('HTTP_USER_AGENT'), "Mozilla")))) {
if ((extension_loaded('zlib')) && (function_exists('ob_start'))) {
// Start caching
- define('_OB_CACHING', "on");
+ define('_OB_CACHING', 'on');
ob_start();
} else {
// Extension not loaded or required function is missing
- define('_OB_CACHING', "404");
+ define('_OB_CACHING', '404');
}
} else {
// Old PHP version
- define('_OB_CACHING', "old");
+ define('_OB_CACHING', 'old');
}
}
$SELF_FILE = basename($_SERVER['PHP_SELF']);
// Check for a .php inside the $SELF_DIR...
-while (ereg(".php", $SELF_DIR)) {
+while (ereg('.php', $SELF_DIR)) {
// Correct the dirname
- $SELF_DIR = substr($SELF_DIR, 0, (strpos($SELF_DIR, ".php") + 4));
+ $SELF_DIR = substr($SELF_DIR, 0, (strpos($SELF_DIR, '.php') + 4));
// Rewrite filename...
$SELF_FILE = basename($SELF_DIR);
// ... and dirname
unset($SELF_FILE);
// Security system loaded...
-define('__SECURITY', "1");
+define('__SECURITY', '1');
//
?>
// Generate message
$message = SPONSOR_GET_MESSAGE(ADMIN_SPONSOR_UPDATED, "updated", $messageArray);
$ret = "updated";
- } elseif ((!$ALREADY) || (($POST['force'] == "1") && (IS_ADMIN()))) {
+ } elseif ((!$ALREADY) || (($POST['force'] == '1') && (IS_ADMIN()))) {
// Add new sponsor, first add more data
$DATA['keys'][] = "sponsor_created"; $DATA['values'][] = time();
$DATA['keys'][] = 'status';
if ($action == 'edit') {
// Default is not limited
$urlData['limited_yes'] = '';
- $urlData['limited_no'] = ' chkecked="checked"';
+ $urlData['limited_no'] = ' checked="checked"';
$urlData['limited'] = 'false';
// Is this URL limited?
if ($urlData['views_max'] > 0) {
// Then rewrite form data
- $urlData['limited_yes'] = ' chkecked="checked"';
+ $urlData['limited_yes'] = ' checked="checked"';
$urlData['limited_no'] = '';
$urlData['limited'] = 'true';
} // END - if
// Translate some data if present
if (isset($content['status'])) $content['status'] = surfbarTranslateUserStatus($content['status']);
- if (isset($content['registered'])) $content['registered'] = generateDateTime($content['registered'], "2");
- if (isset($content['last_locked'])) $content['last_locked'] = generateDateTime($content['last_locked'], "2");
+ if (isset($content['registered'])) $content['registered'] = generateDateTime($content['registered'], '2');
+ if (isset($content['last_locked'])) $content['last_locked'] = generateDateTime($content['last_locked'], '2');
if (isset($content['views_total'])) $content['views_total'] = translateComma($content['views_total']);
if (isset($content['views_allowed'])) $content['views_allowed'] = translateComma($content['views_allowed']);
if (isset($content['views_max'])) $content['views_max'] = translateComma($content['views_max']);
// Translate some data if present
if (isset($content['status'])) $content['status'] = surfbarTranslateUserStatus($content['status']);
- if (isset($content['registered'])) $content['registered'] = generateDateTime($content['registered'], "2");
- if (isset($content['last_locked'])) $content['last_locked'] = generateDateTime($content['last_locked'], "2");
+ if (isset($content['registered'])) $content['registered'] = generateDateTime($content['registered'], '2');
+ if (isset($content['last_locked'])) $content['last_locked'] = generateDateTime($content['last_locked'], '2');
if (isset($content['views_total'])) $content['views_total'] = translateComma($content['views_total']);
if (isset($content['views_allowed'])) $content['views_allowed'] = translateComma($content['views_allowed']);
if (isset($content['views_max'])) $content['views_max'] = translateComma($content['views_max']);
// Get amount from database
$result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt
FROM `{!_MYSQL_PREFIX!}_surfbar_urls`
-WHERE userid NOT IN (".implode(",", $UIDs['uid']).") AND `status`='%s'",
+WHERE userid NOT IN (".implode(',', $UIDs['uid']).") AND `status`='%s'",
array($status), __FUNCTION__, __LINE__
);
SQL_FREERESULT($result);
// Debug message
- //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "UIDs::count=".count($UIDs)." (with own userid=".getUserId().")", false);
+ //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "UIDs::count=".count($UIDs)." (with own userid=".getUserId().')', false);
// Return result
return $UIDs;
ON sbu.id=sbs.url_id
LEFT JOIN `{!_MYSQL_PREFIX!}_surfbar_locks` AS l
ON sbu.id=l.url_id
-WHERE sbu.userid NOT IN (".implode(",", $UIDs).") AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0)) AND sbu.`status`='ACTIVE'".$add."
+WHERE sbu.userid NOT IN (".implode(',', $UIDs).") AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0)) AND sbu.`status`='ACTIVE'".$add."
GROUP BY sbu.id", __FUNCTION__, __LINE__);
// Log last query
// Internal or external?
if ((getConfig('surfbar_pause_mode') == 'INTERNAL') || (getConfig('surfbar_pause_url') == '')) {
// Reload to internal page
- redirectToUrl("surfbar.php?frame=".$page);
+ redirectToUrl('surfbar.php?frame=' . $page);
} else {
// Reload to external page
- LOAD_CONFIGURED_URL('surfbar_pause_url');
+ redirectToConfiguredUrl('surfbar_pause_url');
}
}
$add = " AND sbu.id NOT IN (";
foreach ($USE as $url_id => $lid) {
// Add URL id
- $add .= $url_id.",";
+ $add .= $url_id.',';
} // END - foreach
// Add closing bracket
- $add = substr($add, 0, -1) . ")";
+ $add = substr($add, 0, -1) . ')';
} // END - if
// Determine depleted user account
ON sbu.id=sbs.url_id
LEFT JOIN `{!_MYSQL_PREFIX!}_surfbar_locks` AS l
ON sbu.id=l.url_id
-WHERE sbu.userid NOT IN (".implode(",", $UIDs['uid']).") AND sbu.`status`='ACTIVE' AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0))".$add."
+WHERE sbu.userid NOT IN (".implode(',', $UIDs['uid']).") AND sbu.`status`='ACTIVE' AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0))".$add."
GROUP BY sbu.id
ORDER BY l.last_surfed ASC, sbu.id ASC
LIMIT %s,1",
$OUT = '';
for ($page = 1; $page <= $PAGES; $page++) {
- if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == "1"))) {
+ if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == '1'))) {
$OUT .= "<strong>-";
} else {
if (!REQUEST_ISSET_GET(('letter'))) REQUEST_SET_GET('letter', getMessage('_ALL2'));
$OUT .= $page;
- if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == "1"))) {
+ if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == '1'))) {
$OUT .= "-</strong>";
} else {
$OUT .= "</a>";
}
// Selects a random user id as the new referal id if they have at least X confirmed mails in this run
-function SELECT_RANDOM_REFID () {
+function determineRandomReferalId () {
// Default is zero refid
$refid = 0;
--- /dev/null
+<?php
+/************************************************************************
+ * MXChange v0.2.1 Start: 04/04/2009 *
+ * =============== Last change: 04/04/2009 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : load_config.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Loader for configuration *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Lader fuer Konfiguration *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
+ require($INC);
+} // END - if
+
+// Set some config entries which is required for installation phase
+setConfigEntry('OUTPUT_MODE' , 'render');
+setConfigEntry('WRITE_FOOTER', 'Y');
+setConfigEntry('_DB_TYPE' , 'mysql3');
+
+// Is the local configuration there?
+if (isIncludeReadable('inc/cache/config-local.php')) {
+ // Then load it
+ loadIncludeOnce('inc/cache/config-local.php');
+} elseif (isInstalling()) {
+ // Set some essential constants
+ // @TODO Rewrite them to avoid this else block
+ define('MAIN_TITLE', 'Your mail-exchanger title');
+ define('SLOGAN' , 'Your cool slogan here');
+ define('WEBMASTER' , 'you@some-hoster.tld.invalid');
+} else {
+ // Problem in application detected
+ debug_report_bug('Wether we are not installing nor config-local.php is created!');
+}
+
+//
+?>
switch ($ret)
{
case 'done':
- $done = changeDataInFile(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
+ $done = changeDataInFile(constant('PATH') . 'inc/cache/config-local.php', "ADMIN-SETUP", "setConfigEntry('ADMIN_REGISTERED', \"", "\");", 'Y', 0);
if ($done === true) {
// Registering is done
redirectToUrl('modules.php?module=admin&register=done');
// Admin still not registered?
if (!isAdminRegistered()) {
// Write to config that registration is done
- changeDataInFile(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
+ changeDataInFile(constant('PATH') . 'inc/cache/config-local.php', "ADMIN-SETUP", "setConfigEntry('ADMIN_REGISTERED', \"", "\");", 'Y', 0);
// Load URL for login
redirectToUrl('modules.php?module=admin');
// Only be executed on login procedure!
function CHECK_ADMIN_LOGIN ($admin_login, $password) {
// By default no admin is found
- $ret = "404";
+ $ret = '404';
// Get admin id
$aid = GET_ADMIN_ID($admin_login);
$salt = __SALT;
// Check if password is same
- //* DEBUG: */ echo "*".$ret.",".$data['password'].",".$password.",".$salt."*<br >\n";
+ //* DEBUG: */ echo "*".$ret.','.$data['password'].','.$password.','.$salt."*<br >\n";
if (($ret == 'pass') && ($data['password'] == generateHash($password, $salt)) && ((!empty($salt))) || ($data['password'] == $password)) {
// Re-hash the plain passord with new random salt
$data['password'] = generateHash($password);
// Only be executed on cookie checking
function CHECK_ADMIN_COOKIES ($admin_login, $password) {
// By default no admin cookies are found
- $ret = "404"; $pass = '';
+ $ret = '404'; $pass = '';
// Get hash
$pass = GET_ADMIN_HASH(GET_ADMIN_ID($admin_login));
- if ($pass != "-1") $ret = 'pass';
+ if ($pass != '-1') $ret = 'pass';
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):".generatePassString($pass)."(".strlen($pass).")/".$password."(".strlen($password).")<br />\n";
+ //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")<br />\n";
// Check if password matches
if (($ret == 'pass') && ((generatePassString($pass) == $password) || ($pass == $password) || ((strlen($pass) == 32) && (md5($password) == $pass)))) {
// Walk through all files
foreach ($menuArray as $file) {
// Is this a PHP script?
- if ((!isDirectory($file)) && (strpos($file, "".$type.'-') > -1) && (strpos($file, ".php") > 0)) {
+ if ((!isDirectory($file)) && (strpos($file, "".$type.'-') > -1) && (strpos($file, '.php') > 0)) {
// Then test if the file is readable
$test = sprintf("%sinc/modules/%s/%s", constant('PATH'), $menu, $file);
} // END - if
// Add id number
- $idList .= $id.",";
+ $idList .= $id . ',';
} // END - foreach
// Run the query
$extensionList = getArrayFromDirectory("inc/extensions/", "ext-", false, false);
foreach ($extensionList as $file) {
// Is this file an extension?
- if ((substr($file, 0, 4) == "ext-") && (substr($file, -4) == ".php")) {
+ if ((substr($file, 0, 4) == "ext-") && (substr($file, -4) == '.php')) {
//* DEBUG: */ echo $file."<br />\n";
// Possible newly installed extension found so we extract extension's name
$ext_name = strtolower(substr($file, 4, -4)); // Keep always extension names on lower case!!!
'admin' => $content['assigned_admin'],
'uid' => $content['userid'],
'type' => $content['task_type_msg'],
- 'created' => generateDateTime($content['task_created'], "2")
+ 'created' => generateDateTime($content['task_created'], '2')
));
// Do we have extension task?
}
$OUT = " <select class=\"admin_select\" name=\"sort\" size=\"1\">
<option value=\"0\">".IS_FIRST_MENU."</option>\n";
- foreach ($below as $key => $m)
- {
- if (is_array($m))
- {
- foreach ($m as $key2 => $m2)
- {
+ foreach ($below as $key => $m) {
+ if (is_array($m)) {
+ foreach ($m as $key2 => $m2) {
$OUT .= " <option value=\"".$m2."\">".$titles[$key][$key2];
- foreach ($menus as $k => $v)
- {
- if (($v == $key) && (!is_array($v)))
- {
- $OUT .= " (".$titles[$k].")";
+ foreach ($menus as $k => $v) {
+ if (($v == $key) && (!is_array($v))) {
+ $OUT .= " (" . $titles[$k] . ')';
}
}
$OUT .= "</option>\n";
$aid = bigintval(REQUEST_GET('admin'));
// Set required fields
- REQUEST_SET_POST('edit', "1");
- REQUEST_SET_POST(array('sel', $aid), "1");
+ REQUEST_SET_POST('edit', '1');
+ REQUEST_SET_POST(array('sel', $aid), '1');
} // END - if
if ((REQUEST_ISSET_POST('edit')) && (countPostSelection() > 0)) {
$OUT .=">{--ADMINS_ALL_ADMINS--}</option>\n";
if (EXT_IS_ACTIVE('events')) {
$OUT .= "<option value=\"-1\"";
- if ($content['admin_id'] == "-1") $OUT .= ' selected="selected"';
+ if ($content['admin_id'] == '-1') $OUT .= ' selected="selected"';
$OUT .= ">{--ADMINS_TO_USER_EVENTS--}</option>\n";
}
$OUT .= generateOptionList('admins', "id", "login", $content['admin_id'], 'email');
switch (getConfig('admin_menu'))
{
case "NEW":
- define('__ADMIN_MENU_NEW', ' chkecked="checked"');
+ define('__ADMIN_MENU_NEW', ' checked="checked"');
define('__ADMIN_MENU_OLD' , '');
break;
case "OLD":
define('__ADMIN_MENU_NEW', '');
- define('__ADMIN_MENU_OLD' , ' chkecked="checked"');
+ define('__ADMIN_MENU_OLD' , ' checked="checked"');
break;
}
'action_selection' => ADMIN_MENU_SELECTION("action", $act, $id),
'what_selection' => ADMIN_MENU_SELECTION("what", $wht, $id),
'mode_options' => generateOptionList(
- "/ARRAY/",
+ '/ARRAY/',
array("allow", "deny"),
array(constant('ADMINS_ALLOW_MODE'), constant('ADMINS_DENY_MODE')),
$mode
define('_WHAT_SELECTION' , ADMIN_MENU_SELECTION("what"));
define('_MODE_OPTIONS' ,
generateOptionList(
- "/ARRAY/",
+ '/ARRAY/',
array("allow", "deny"),
array(
getMessage('ADMINS_ALLOW_MODE'),
// Mail confirmation links
define('_CFG_AUTO_PURGE', createTimeSelections(getConfig('auto_purge'), "auto_purge", "MWD"));
if (getConfig('auto_purge_active') != 'Y') {
- define('_CFG_AP_ACTIVE_N', ' chkecked="checked"');
+ define('_CFG_AP_ACTIVE_N', ' checked="checked"');
define('_CFG_AP_ACTIVE_Y', '');
} else {
define('_CFG_AP_ACTIVE_N', '');
- define('_CFG_AP_ACTIVE_Y', ' chkecked="checked"');
+ define('_CFG_AP_ACTIVE_Y', ' checked="checked"');
}
// Output template
setConfigEntry('beg_ral_di_notify', REQUEST_POST('beg_ral_di_notify'));
} else {
// Prepare constants for the template
- define('__BEG_POINTS' , translateComma(getConfig('beg_points') , false));
- define('__BEG_POINTS_MAX' , translateComma(getConfig('beg_points_max') , false));
- define('__BEG_NOTIFY_BONUS' , translateComma(getConfig('beg_notify_bonus'), false));
- define('__BEG_TIMEOUT' , createTimeSelections(getConfig('beg_timeout') , "beg_timeout" , "Dhm"));
- define('__BEG_UID_TIMEOUT' , createTimeSelections(getConfig('beg_uid_timeout'), "beg_uid_timeout", "Dhm"));
- define('__BEG_REMOTE_IP_TIMEOUT', createTimeSelections(getConfig('beg_ip_timeout') , "beg_ip_timeout" , "Dhm"));
- define('__WAIT_SELECTION' , createTimeSelections(getConfig('beg_notify_wait'), "beg_notify_wait", "ms" ));
- define('__BEG_RANKS' , getConfig('beg_ranks'));
+ $content['points'] = translateComma(getConfig('beg_points') , false);
+ $content['points_max'] = translateComma(getConfig('beg_points_max') , false);
+ $content['notify_bonus'] = translateComma(getConfig('beg_notify_bonus'), false);
+ $content['timeout'] = createTimeSelections(getConfig('beg_timeout') , 'beg_timeout' , 'Dhm');
+ $content['uid_timeout'] = createTimeSelections(getConfig('beg_uid_timeout'), 'beg_uid_timeout', 'Dhm');
+ $content['ip_timeout'] = createTimeSelections(getConfig('beg_ip_timeout') , 'beg_ip_timeout' , 'Dhm');
+ $content['wait_selection'] = createTimeSelections(getConfig('beg_notify_wait'), 'beg_notify_wait', 'ms' );
+ $content['ranks'] = getConfig('beg_ranks');
// Activate / Deactivate beg rallye (Y/N)
switch (getConfig('beg_rallye'))
{
case 'Y':
- define('__BEG_RALLYE_Y', ' chkecked="checked"');
- define('__BEG_RALLYE_N', '');
+ $content['rallye_yes'] = ' checked="checked"';
+ $content['rallye_no'] = '';
break;
case 'N':
- define('__BEG_RALLYE_Y', '');
- define('__BEG_RALLYE_N', ' chkecked="checked"');
+ $content['rallye_yes'] = '';
+ $content['rallye_no'] = ' checked="checked"';
break;
}
switch (getConfig('beg_active'))
{
case 'Y':
- define('__BEG_ACTIVE_Y', ' chkecked="checked"');
- define('__BEG_ACTIVE_N', '');
+ $content['active_yes'] = ' checked="checked"';
+ $content['active_no'] = '';
break;
case 'N':
- define('__BEG_ACTIVE_Y', '');
- define('__BEG_ACTIVE_N', ' chkecked="checked"');
+ $content['active_yes'] = '';
+ $content['active_no'] = ' checked="checked"';
break;
}
switch (getConfig('beg_mode'))
{
- case "DIRECT":
- define('__BEG_MODE_DIRECT', ' chkecked="checked"');
- define('__BEG_MODE_REF' , '');
+ case 'DIRECT':
+ $content['mode_direct'] = ' checked="checked"';
+ $content['mode_ref'] = '';
break;
- case "REF":
- define('__BEG_MODE_DIRECT', '');
- define('__BEG_MODE_REF' , ' chkecked="checked"');
+ case 'REF':
+ $content['mode_direct'] = '';
+ $content['mode_ref'] = ' checked="checked"';
break;
}
switch (getConfig('beg_ral_en_notify'))
{
case 'Y':
- define('__BEG_RAL_EN_NOTIFY_Y', ' chkecked="checked"');
- define('__BEG_RAL_EN_NOTIFY_N', '');
+ $content['ral_enable_notify_yes'] = ' checked="checked"';
+ $content['ral_enable_notify_no'] = '';
break;
case 'N':
- define('__BEG_RAL_EN_NOTIFY_Y', '');
- define('__BEG_RAL_EN_NOTIFY_N', ' chkecked="checked"');
+ $content['ral_enable_notify_yes'] = '';
+ $content['ral_enable_notify_no'] = ' checked="checked"';
break;
}
switch (getConfig('beg_ral_di_notify'))
{
case 'Y':
- define('__BEG_RAL_DI_NOTIFY_Y', ' chkecked="checked"');
- define('__BEG_RAL_DI_NOTIFY_N', '');
+ $content['ral_disable_notify_yes'] = ' checked="checked"';
+ $content['ral_disable_notify_no'] = '';
break;
case 'N':
- define('__BEG_RAL_DI_NOTIFY_Y', '');
- define('__BEG_RAL_DI_NOTIFY_N', ' chkecked="checked"');
+ $content['ral_disable_notify_yes'] = '';
+ $content['ral_disable_notify_no'] = ' checked="checked"';
break;
}
switch (getConfig('beg_new_mem_notify'))
{
case 'Y':
- define('__BEG_NEW_MEMBER_NOTIFY_Y', ' chkecked="checked"');
- define('__BEG_NEW_MEMBER_NOTIFY_N', '');
+ $content['new_member_notify_yes'] = ' checked="checked"';
+ $content['new_member_notify_no'] = '';
break;
case 'N':
- define('__BEG_NEW_MEMBER_NOTIFY_Y', '');
- define('__BEG_NEW_MEMBER_NOTIFY_N', ' chkecked="checked"');
+ $content['new_member_notify_yes'] = '';
+ $content['new_member_notify_no'] = ' checked="checked"';
break;
}
switch (getConfig('beg_include_own'))
{
case 'Y':
- define('__BEG_INCLUDE_OWN_Y', ' chkecked="checked"');
- define('__BEG_INCLUDE_OWN_N', '');
+ $content['include_own_yes'] = ' checked="checked"';
+ $content['include_own_no'] = '';
break;
case 'N':
- define('__BEG_INCLUDE_OWN_Y', '');
- define('__BEG_INCLUDE_OWN_N', ' chkecked="checked"');
+ $content['include_own_yes'] = '';
+ $content['include_own_no'] = ' checked="checked"';
break;
}
- switch (getConfig('beg_pay_mode')) {
- case "IMG":
- define('__BEG_PAY_MODE_IMG' , ' selected="selected"');
- define('__BEG_PAY_MODE_JS' , '');
- define('__BEG_PAY_MODE_BOTH', '');
- define('__BEG_PAY_MODE_NONE', '');
- break;
-
- case "JS":
- define('__BEG_PAY_MODE_IMG' , '');
- define('__BEG_PAY_MODE_JS' , ' selected="selected"');
- define('__BEG_PAY_MODE_BOTH', '');
- define('__BEG_PAY_MODE_NONE', '');
- break;
-
- case "BOTH":
- define('__BEG_PAY_MODE_IMG' , '');
- define('__BEG_PAY_MODE_JS' , '');
- define('__BEG_PAY_MODE_BOTH', ' selected="selected"');
- define('__BEG_PAY_MODE_NONE', '');
- break;
-
- case "NONE":
- define('__BEG_PAY_MODE_IMG' , '');
- define('__BEG_PAY_MODE_JS' , '');
- define('__BEG_PAY_MODE_BOTH', '');
- define('__BEG_PAY_MODE_NONE', ' selected="selected"');
- break;
- }
+ // Init elements
+ $content['pay_mode_img'] = '';
+ $content['pay_mode_js'] = '';
+ $content['pay_mode_both'] = '';
+ $content['pay_mode_none'] = '';
+
+ // Set pay mode
+ $content['pay_mode_'.strtolower(getConfig('beg_pay_mode'))] = ' selected="selected"';
- // Add data to constant __MEMBER_SELECTION
- define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('beg_uid'), false, true, true, "beg_uid"));
+ // Member selection box
+ $content['member_selection'] = ADD_MEMBER_SELECTION_BOX(getConfig('beg_uid'), false, true, true, 'beg_uid');
// Load form template
- LOAD_TEMPLATE("admin_config_beg");
+ LOAD_TEMPLATE('admin_config_beg', false, $content);
}
//
switch (getConfig('birthday_active'))
{
case 'Y':
- define('__BIRTHDAY_ACTIVE_Y', ' chkecked="checked"');
- define('__BIRTHDAY_ACTIVE_N', '');
+ $content['active_yes'] = ' checked="checked"';
+ $content['active_no'] = '';
break;
case 'N':
- define('__BIRTHDAY_ACTIVE_Y', '');
- define('__BIRTHDAY_ACTIVE_N', ' chkecked="checked"');
+ $content['active_yes'] = '';
+ $content['active_no'] = ' checked="checked"';
break;
}
switch (getConfig('birthday_mode'))
{
- case "DIRECT":
- define('__BIRTHDAY_MODE_DIRECT', ' chkecked="checked"');
- define('__BIRTHDAY_MODE_REF' , '');
+ case 'DIRECT':
+ $content['mode_direct'] = ' checked="checked"';
+ $content['mode_ref'] = '';
break;
- case "REF":
- define('__BIRTHDAY_MODE_DIRECT', '');
- define('__BIRTHDAY_MODE_REF' , ' chkecked="checked"');
+ case 'REF':
+ $content['mode_direct'] = '';
+ $content['mode_ref'] = ' checked="checked"';
break;
}
$OUT .= "</ol>\n";
define('__TRATES_LIST', $OUT);
- define('__LOGIN_TIMEOUT_SELECTION', createTimeSelections(getConfig('login_timeout') , "login_timeout" , "WDh"));
- define('__BONUS_TIMEOUT_SELECTION', createTimeSelections(getConfig('bonus_timeout') , "bonus_timeout" , "WDh"));
- define('__WAIT_SELECTION' , createTimeSelections(getConfig('bonus_notify_wait'), "bonus_notify_wait", "ms" ));
+ define('__LOGIN_TIMEOUT_SELECTION', createTimeSelections(getConfig('login_timeout') , 'login_timeout' , 'WDh'));
+ define('__BONUS_TIMEOUT_SELECTION', createTimeSelections(getConfig('bonus_timeout') , 'bonus_timeout' , 'WDh'));
+ $content['wait_selection'] = createTimeSelections(getConfig('bonus_notify_wait'), 'bonus_notify_wait', 'ms' );
// Activate / Deactivate bonus active rallye (Y/N)
switch (getConfig('bonus_active'))
{
case 'Y':
- define('__BONUS_ACTIVE_Y', ' chkecked="checked"');
+ define('__BONUS_ACTIVE_Y', ' checked="checked"');
define('__BONUS_ACTIVE_N', '');
break;
case 'N':
define('__BONUS_ACTIVE_Y', '');
- define('__BONUS_ACTIVE_N', ' chkecked="checked"');
+ define('__BONUS_ACTIVE_N', ' checked="checked"');
break;
}
// Other bonus to de-/activate
switch (getConfig('bonus_login_yn'))
{
case 'Y':
- define('__BONUS_LOGIN_Y', ' chkecked="checked"');
+ define('__BONUS_LOGIN_Y', ' checked="checked"');
define('__BONUS_LOGIN_N', '');
break;
case 'N':
define('__BONUS_LOGIN_Y', '');
- define('__BONUS_LOGIN_N', ' chkecked="checked"');
+ define('__BONUS_LOGIN_N', ' checked="checked"');
break;
}
switch (getConfig('bonus_stats_yn'))
{
case 'Y':
- define('__BONUS_STATS_Y', ' chkecked="checked"');
+ define('__BONUS_STATS_Y', ' checked="checked"');
define('__BONUS_STATS_N', '');
break;
case 'N':
define('__BONUS_STATS_Y', '');
- define('__BONUS_STATS_N', ' chkecked="checked"');
+ define('__BONUS_STATS_N', ' checked="checked"');
break;
}
switch (getConfig('bonus_order_yn'))
{
case 'Y':
- define('__BONUS_ORDER_Y', ' chkecked="checked"');
+ define('__BONUS_ORDER_Y', ' checked="checked"');
define('__BONUS_ORDER_N', '');
break;
case 'N':
define('__BONUS_ORDER_Y', '');
- define('__BONUS_ORDER_N', ' chkecked="checked"');
+ define('__BONUS_ORDER_N', ' checked="checked"');
break;
}
switch (getConfig('bonus_ref_yn'))
{
case 'Y':
- define('__BONUS_REF_Y', ' chkecked="checked"');
+ define('__BONUS_REF_Y', ' checked="checked"');
define('__BONUS_REF_N', '');
break;
case 'N':
define('__BONUS_REF_Y', '');
- define('__BONUS_REF_N', ' chkecked="checked"');
+ define('__BONUS_REF_N', ' checked="checked"');
break;
}
switch (getConfig('bonus_click_yn'))
{
case 'Y':
- define('__BONUS_CLICK_Y', ' chkecked="checked"');
+ define('__BONUS_CLICK_Y', ' checked="checked"');
define('__BONUS_CLICK_N', '');
break;
case 'N':
define('__BONUS_CLICK_Y', '');
- define('__BONUS_CLICK_N', ' chkecked="checked"');
+ define('__BONUS_CLICK_N', ' checked="checked"');
break;
}
switch (getConfig('bonus_en_notify'))
{
case 'Y':
- define('__BONUS_EN_NOTIFY_Y', ' chkecked="checked"');
+ define('__BONUS_EN_NOTIFY_Y', ' checked="checked"');
define('__BONUS_EN_NOTIFY_N', '');
break;
case 'N':
define('__BONUS_EN_NOTIFY_Y', '');
- define('__BONUS_EN_NOTIFY_N', ' chkecked="checked"');
+ define('__BONUS_EN_NOTIFY_N', ' checked="checked"');
break;
}
switch (getConfig('bonus_di_notify'))
{
case 'Y':
- define('__BONUS_DI_NOTIFY_Y', ' chkecked="checked"');
+ define('__BONUS_DI_NOTIFY_Y', ' checked="checked"');
define('__BONUS_DI_NOTIFY_N', '');
break;
case 'N':
define('__BONUS_DI_NOTIFY_Y', '');
- define('__BONUS_DI_NOTIFY_N', ' chkecked="checked"');
+ define('__BONUS_DI_NOTIFY_N', ' checked="checked"');
break;
}
switch (getConfig('bonus_new_mem_notify'))
{
case 'Y':
- define('__BONUS_NEW_MEMBER_NOTIFY_Y', ' chkecked="checked"');
+ define('__BONUS_NEW_MEMBER_NOTIFY_Y', ' checked="checked"');
define('__BONUS_NEW_MEMBER_NOTIFY_N', '');
break;
case 'N':
define('__BONUS_NEW_MEMBER_NOTIFY_Y', '');
- define('__BONUS_NEW_MEMBER_NOTIFY_N', ' chkecked="checked"');
+ define('__BONUS_NEW_MEMBER_NOTIFY_N', ' checked="checked"');
break;
}
switch (getConfig('bonus_include_own'))
{
case 'Y':
- define('__BONUS_INCLUDE_OWN_Y', ' chkecked="checked"');
+ define('__BONUS_INCLUDE_OWN_Y', ' checked="checked"');
define('__BONUS_INCLUDE_OWN_N', '');
break;
case 'N':
define('__BONUS_INCLUDE_OWN_Y', '');
- define('__BONUS_INCLUDE_OWN_N', ' chkecked="checked"');
+ define('__BONUS_INCLUDE_OWN_N', ' checked="checked"');
break;
}
// Load final template
- LOAD_TEMPLATE("admin_config_bonus", false);
+ LOAD_TEMPLATE('admin_config_bonus', false, $content);
}
//
?>
// Prepare data
switch (getConfig('cache_admins')) {
case 'Y':
- define('__ADMINS_Y', ' chkecked="checked"');
+ define('__ADMINS_Y', ' checked="checked"');
define('__ADMINS_N', '');
break;
case 'N':
define('__ADMINS_Y', '');
- define('__ADMINS_N', ' chkecked="checked"');
+ define('__ADMINS_N', ' checked="checked"');
break;
}
switch (getConfig('cache_acls')) {
case 'Y':
- define('__ACLS_Y', ' chkecked="checked"');
+ define('__ACLS_Y', ' checked="checked"');
define('__ACLS_N', '');
break;
case 'N':
define('__ACLS_Y', '');
- define('__ACLS_N', ' chkecked="checked"');
+ define('__ACLS_N', ' checked="checked"');
break;
}
switch (getConfig('cache_exts')) {
case 'Y':
- define('__EXTS_Y', ' chkecked="checked"');
+ define('__EXTS_Y', ' checked="checked"');
define('__EXTS_N', '');
break;
case 'N':
define('__EXTS_Y', '');
- define('__EXTS_N', ' chkecked="checked"');
+ define('__EXTS_N', ' checked="checked"');
break;
}
switch (getConfig('cache_config')) {
case 'Y':
- define('__CONFIG_Y', ' chkecked="checked"');
+ define('__CONFIG_Y', ' checked="checked"');
define('__CONFIG_N', '');
break;
case 'N':
define('__CONFIG_Y', '');
- define('__CONFIG_N', ' chkecked="checked"');
+ define('__CONFIG_N', ' checked="checked"');
break;
}
switch (getConfig('cache_modreg')) {
case 'Y':
- define('__MODREG_Y', ' chkecked="checked"');
+ define('__MODREG_Y', ' checked="checked"');
define('__MODREG_N', '');
break;
case 'N':
define('__MODREG_Y', '');
- define('__MODREG_N', ' chkecked="checked"');
+ define('__MODREG_N', ' checked="checked"');
break;
}
switch (getConfig('cache_refdepth')) {
case 'Y':
- define('__REFDEPTH_Y', ' chkecked="checked"');
+ define('__REFDEPTH_Y', ' checked="checked"');
define('__REFDEPTH_N', '');
break;
case 'N':
define('__REFDEPTH_Y', '');
- define('__REFDEPTH_N', ' chkecked="checked"');
+ define('__REFDEPTH_N', ' checked="checked"');
break;
}
switch (getConfig('cache_refsys')) {
case 'Y':
- define('__REFSYS_Y', ' chkecked="checked"');
+ define('__REFSYS_Y', ' checked="checked"');
define('__REFSYS_N', '');
break;
case 'N':
define('__REFSYS_Y', '');
- define('__REFSYS_N', ' chkecked="checked"');
+ define('__REFSYS_N', ' checked="checked"');
break;
}
switch (getConfig('cache_themes')) {
case 'Y':
- define('__THEMES_Y', ' chkecked="checked"');
+ define('__THEMES_Y', ' checked="checked"');
define('__THEMES_N', '');
break;
case 'N':
define('__THEMES_Y', '');
- define('__THEMES_N', ' chkecked="checked"');
+ define('__THEMES_N', ' checked="checked"');
break;
}
switch (getConfig('cache_admin_menu')) {
case 'Y':
- define('__ADMIN_MENU_Y', ' chkecked="checked"');
+ define('__ADMIN_MENU_Y', ' checked="checked"');
define('__ADMIN_MENU_N', '');
break;
case 'N':
define('__ADMIN_MENU_Y', '');
- define('__ADMIN_MENU_N', ' chkecked="checked"');
+ define('__ADMIN_MENU_N', ' checked="checked"');
break;
}
switch (getConfig('doubler_jackpot'))
{
case 'Y':
- define('__DOUBLER_JACKPOT_Y', ' chkecked="checked"');
+ define('__DOUBLER_JACKPOT_Y', ' checked="checked"');
define('__DOUBLER_JACKPOT_N', '');
break;
case 'N':
define('__DOUBLER_JACKPOT_Y', '');
- define('__DOUBLER_JACKPOT_N', ' chkecked="checked"');
+ define('__DOUBLER_JACKPOT_N', ' checked="checked"');
break;
}
switch (getConfig('doubler_own'))
{
case 'Y':
- define('__DOUBLER_OWN_Y', ' chkecked="checked"');
+ define('__DOUBLER_OWN_Y', ' checked="checked"');
define('__DOUBLER_OWN_N', '');
break;
case 'N':
define('__DOUBLER_OWN_Y', '');
- define('__DOUBLER_OWN_N', ' chkecked="checked"');
+ define('__DOUBLER_OWN_N', ' checked="checked"');
break;
}
// Mail send mode
switch (getConfig('doubler_send_mode'))
{
- case "DIRECT":
- define('__DOUBLER_SEND_DIRECT', ' chkecked="checked"');
+ case 'DIRECT':
+ define('__DOUBLER_SEND_DIRECT', ' checked="checked"');
define('__DOUBLER_SEND_RESET' , '');
break;
case "RESET":
define('__DOUBLER_SEND_DIRECT', '');
- define('__DOUBLER_SEND_RESET' , ' chkecked="checked"');
+ define('__DOUBLER_SEND_RESET' , ' checked="checked"');
break;
}
switch (getConfig('doubler_sent_all'))
{
case 'Y':
- define('__DOUBLER_SENT_ALL_Y', ' chkecked="checked"');
+ define('__DOUBLER_SENT_ALL_Y', ' checked="checked"');
define('__DOUBLER_SENT_ALL_N', '');
break;
case 'N':
define('__DOUBLER_SENT_ALL_Y', '');
- define('__DOUBLER_SENT_ALL_N', ' chkecked="checked"');
+ define('__DOUBLER_SENT_ALL_N', ' checked="checked"');
break;
}
// Transfer options (!!!) to __MEMBER_SELECTION
- define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('doubler_uid'), false, true, true, "doubler_uid"));
+ define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('doubler_uid'), false, true, true, 'doubler_uid'));
// Number of rows to display (option lines!!!)
- define('__DOUBLER_DISPLAY_NEW', generateOptionList("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_new')));
- define('__DOUBLER_DISPLAY_PAY', generateOptionList("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_pay')));
- define('__DOUBLER_DISPLAY_OLD', generateOptionList("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_old')));
+ define('__DOUBLER_DISPLAY_NEW', generateOptionList('/ARRAY/', array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_new')));
+ define('__DOUBLER_DISPLAY_PAY', generateOptionList('/ARRAY/', array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_pay')));
+ define('__DOUBLER_DISPLAY_OLD', generateOptionList('/ARRAY/', array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_old')));
// Timeout selection box or input box?
- define('__DOUBLER_TIMEOUT', createTimeSelections(getConfig('doubler_timeout') , "doubler_timeout" , "WDh"));
+ define('__DOUBLER_TIMEOUT', createTimeSelections(getConfig('doubler_timeout') , 'doubler_timeout' , 'WDh'));
// Load template
- LOAD_TEMPLATE("admin_config_doubler");
+ LOAD_TEMPLATE('admin_config_doubler');
}
+
//
?>
// Prepare data
switch (getConfig('verbose_sql')) {
case 'Y':
- define('__VERBOSE_Y', ' chkecked="checked"');
+ define('__VERBOSE_Y', ' checked="checked"');
define('__VERBOSE_N', '');
break;
case 'N':
define('__VERBOSE_Y', '');
- define('__VERBOSE_N', ' chkecked="checked"');
+ define('__VERBOSE_N', ' checked="checked"');
break;
}
switch (getConfig('holiday_mode')) {
case "RESET":
- define('__RESET_DEFAULT' , ' chkecked="checked"');
+ define('__RESET_DEFAULT' , ' checked="checked"');
define('__DIRECT_DEFAULT', '');
break;
- case "DIRECT":
+ case 'DIRECT':
define('__RESET_DEFAULT' , '');
- define('__DIRECT_DEFAULT', ' chkecked="checked"');
+ define('__DIRECT_DEFAULT', ' checked="checked"');
break;
}
// Start of this exchange
if (getConfig('mt_start') > 0) {
// Only show start
- define('__MT_START', "<strong>".generateDateTime(getConfig('mt_start'), "3")."</strong>");
+ define('__MT_START', "<strong>".generateDateTime(getConfig('mt_start'), '3')."</strong>");
} else {
// Make start editable
define('__MT_START',
switch (getConfig('order_max_full'))
{
case 'ORDER':
- define('__ORDER_DEFAULT', ' chkecked="checked"');
+ define('__ORDER_DEFAULT', ' checked="checked"');
define('__MAX_DEFAULT' , '');
break;
case 'MAX':
define('__ORDER_DEFAULT', '');
- define('__MAX_DEFAULT' , ' chkecked="checked"');
+ define('__MAX_DEFAULT' , ' checked="checked"');
break;
}
define('_CFG_MAX_TLENGTH' , getConfig('max_tlength'));
if (getConfig('test_text') != 'Y') {
- define('_CFG_TEST_TEXT_N', ' chkecked="checked"');
+ define('_CFG_TEST_TEXT_N', ' checked="checked"');
define('_CFG_TEST_TEXT_Y', '');
} else {
define('_CFG_TEST_TEXT_N', '');
- define('_CFG_TEST_TEXT_Y', ' chkecked="checked"');
+ define('_CFG_TEST_TEXT_Y', ' checked="checked"');
}
switch (getConfig('repay_deleted_mails')) {
}
if (getConfig('test_subj') != 'Y') {
- define('_CFG_TEST_SUBJ_N', ' chkecked="checked"');
+ define('_CFG_TEST_SUBJ_N', ' checked="checked"');
define('_CFG_TEST_SUBJ_Y', '');
} else {
define('_CFG_TEST_SUBJ_N', '');
- define('_CFG_TEST_SUBJ_Y', ' chkecked="checked"');
+ define('_CFG_TEST_SUBJ_Y', ' checked="checked"');
}
if (getConfig('url_blacklist') != 'Y') {
- define('_CFG_URL_BLIST_N', ' chkecked="checked"');
+ define('_CFG_URL_BLIST_N', ' checked="checked"');
define('_CFG_URL_BLIST_Y', '');
} else {
define('_CFG_URL_BLIST_N', '');
- define('_CFG_URL_BLIST_Y', ' chkecked="checked"');
+ define('_CFG_URL_BLIST_Y', ' checked="checked"');
}
// Selection list
define('_CFG_PROF_REUPDATE' , createTimeSelections(getConfig('resend_profile_update') , 'resend_profile_update', 'MWD'));
if (getConfig('order_multi_page') != 'Y') {
- define('_CFG_ORDER_MULTI_N', ' chkecked="checked"');
+ define('_CFG_ORDER_MULTI_N', ' checked="checked"');
define('_CFG_ORDER_MULTI_Y', '');
} else {
define('_CFG_ORDER_MULTI_N', '');
- define('_CFG_ORDER_MULTI_Y', ' chkecked="checked"');
+ define('_CFG_ORDER_MULTI_Y', ' checked="checked"');
}
if (getConfig('autosend_active') != 'Y') {
- define('_CFG_AUTOSEND_ACTIVE_N', ' chkecked="checked"');
+ define('_CFG_AUTOSEND_ACTIVE_N', ' checked="checked"');
define('_CFG_AUTOSEND_ACTIVE_Y', '');
} else {
define('_CFG_AUTOSEND_ACTIVE_N', '');
- define('_CFG_AUTOSEND_ACTIVE_Y', ' chkecked="checked"');
+ define('_CFG_AUTOSEND_ACTIVE_Y', ' checked="checked"');
}
if (getConfig('send_prof_update') != 'Y') {
- define('_CFG_SEND_UPDATE_N', ' chkecked="checked"');
+ define('_CFG_SEND_UPDATE_N', ' checked="checked"');
define('_CFG_SEND_UPDATE_Y', '');
} else {
define('_CFG_SEND_UPDATE_N', '');
- define('_CFG_SEND_UPDATE_Y', ' chkecked="checked"');
+ define('_CFG_SEND_UPDATE_Y', ' checked="checked"');
}
if (getConfig('admin_notify') != 'Y') {
- define('_CFG_ADMIN_NOTIFY_N', ' chkecked="checked"');
+ define('_CFG_ADMIN_NOTIFY_N', ' checked="checked"');
define('_CFG_ADMIN_NOTIFY_Y', '');
} else {
define('_CFG_ADMIN_NOTIFY_N', '');
- define('_CFG_ADMIN_NOTIFY_Y', ' chkecked="checked"');
+ define('_CFG_ADMIN_NOTIFY_Y', ' checked="checked"');
}
- if (getConfig('css_php') == "DIRECT") {
- define('_CFG_CSS_PHP_DIRECT', ' chkecked="checked"');
+ if (getConfig('css_php') == 'DIRECT') {
+ define('_CFG_CSS_PHP_DIRECT', ' checked="checked"');
define('_CFG_CSS_PHP_FILE', '');
} else {
define('_CFG_CSS_PHP_DIRECT', '');
- define('_CFG_CSS_PHP_FILE', ' chkecked="checked"');
+ define('_CFG_CSS_PHP_FILE', ' checked="checked"');
}
if (getConfig('guest_menu') == 'Y') {
- define('_CFG_GUEST_MENU_ACTIVE', ' chkecked="checked"');
+ define('_CFG_GUEST_MENU_ACTIVE', ' checked="checked"');
define('_CFG_GUEST_MENU_INACTIVE', '');
} else {
define('_CFG_GUEST_MENU_ACTIVE', '');
- define('_CFG_GUEST_MENU_INACTIVE', ' chkecked="checked"');
+ define('_CFG_GUEST_MENU_INACTIVE', ' checked="checked"');
}
if (getConfig('member_menu') == 'Y') {
- define('_CFG_MEMBER_MENU_ACTIVE', ' chkecked="checked"');
+ define('_CFG_MEMBER_MENU_ACTIVE', ' checked="checked"');
define('_CFG_MEMBER_MENU_INACTIVE', '');
} else {
define('_CFG_MEMBER_MENU_ACTIVE', '');
- define('_CFG_MEMBER_MENU_INACTIVE', ' chkecked="checked"');
+ define('_CFG_MEMBER_MENU_INACTIVE', ' checked="checked"');
}
if (getConfig('youre_here') == 'Y') {
- define('_CFG_YOURE_HERE_ACTIVE', ' chkecked="checked"');
+ define('_CFG_YOURE_HERE_ACTIVE', ' checked="checked"');
define('_CFG_YOURE_HERE_INACTIVE', '');
} else {
define('_CFG_YOURE_HERE_ACTIVE', '');
- define('_CFG_YOURE_HERE_INACTIVE', ' chkecked="checked"');
+ define('_CFG_YOURE_HERE_INACTIVE', ' checked="checked"');
}
if (getConfig('show_timings') == 'Y') {
- define('_CFG_SHOW_TIMINGS_Y', ' chkecked="checked"');
+ define('_CFG_SHOW_TIMINGS_Y', ' checked="checked"');
define('_CFG_SHOW_TIMINGS_N', '');
} else {
define('_CFG_SHOW_TIMINGS_Y', '');
- define('_CFG_SHOW_TIMINGS_N', ' chkecked="checked"');
+ define('_CFG_SHOW_TIMINGS_N', ' checked="checked"');
}
if (getConfig('show_points_unconfirmed') == 'Y') {
- define('_CFG_SHOW_POINTS_UNCONFIRMED_Y', ' chkecked="checked"');
+ define('_CFG_SHOW_POINTS_UNCONFIRMED_Y', ' checked="checked"');
define('_CFG_SHOW_POINTS_UNCONFIRMED_N', '');
} else {
define('_CFG_SHOW_POINTS_UNCONFIRMED_Y', '');
- define('_CFG_SHOW_POINTS_UNCONFIRMED_N', ' chkecked="checked"');
+ define('_CFG_SHOW_POINTS_UNCONFIRMED_N', ' checked="checked"');
}
if (getConfig('mailid_error_redirect') == 'INDEX') {
- define('_CFG_MAILID_REDIRECT_INDEX', ' chkecked="checked"');
+ define('_CFG_MAILID_REDIRECT_INDEX', ' checked="checked"');
define('_CFG_MAILID_REDIRECT_REJECT', '');
} else {
define('_CFG_MAILID_REDIRECT_INDEX', '');
- define('_CFG_MAILID_REDIRECT_REJECT', ' chkecked="checked"');
+ define('_CFG_MAILID_REDIRECT_REJECT', ' checked="checked"');
}
for ($i = 0; $i <= 5; $i++) {
// Including new add-mode for one-time referal bonus
switch (getConfig('allow_direct_pay')) {
case 'Y':
- define('__DIRECT_Y', ' chkecked="checked"');
+ define('__DIRECT_Y', ' checked="checked"');
define('__DIRECT_N', '');
break;
case 'N':
define('__DIRECT_Y', '');
- define('__DIRECT_N', ' chkecked="checked"');
+ define('__DIRECT_N', ' checked="checked"');
break;
}
// One-time referal bonus add-mode
switch (getConfig('reg_points_mode')) {
case 'ref' :
- define('__MODE_REF', ' chkecked="checked"');
+ define('__MODE_REF', ' checked="checked"');
define('__MODE_DIRECT', '');
break;
case 'direct':
define('__MODE_REF', '');
- define('__MODE_DIRECT', ' chkecked="checked"');
+ define('__MODE_DIRECT', ' checked="checked"');
break;
}
'aid' => $content['admin_id'],
'email_link' => generateMemberEmailLink($content['admin_id']),
'alogin' => $content['login'],
- 'start' => generateDateTime($content['start_time'], "3"),
- 'end' => generateDateTime($content['end_time'], "3"),
+ 'start' => generateDateTime($content['start_time'], '3'),
+ 'end' => generateDateTime($content['end_time'], '3'),
);
// Load row template and switch color
// Add more content
switch (getConfig('refback_enabled')) {
case 'Y': // Refback enabled
- $content['refback_enabled_y'] = ' chkecked="checked"';
+ $content['refback_enabled_y'] = ' checked="checked"';
$content['refback_enabled_n'] = '';
break;
case 'N': // Refback disabled
$content['refback_enabled_y'] = '';
- $content['refback_enabled_n'] = ' chkecked="checked"';
+ $content['refback_enabled_n'] = ' checked="checked"';
break;
}
// Prepare data
switch (getConfig('removeip_anon_ip')) {
case 'Y':
- define('__CFG_REMOVEIP_ANON_IP_Y', ' chkecked="checked"');
+ define('__CFG_REMOVEIP_ANON_IP_Y', ' checked="checked"');
define('__CFG_REMOVEIP_ANON_IP_N', '');
break;
case 'N':
define('__CFG_REMOVEIP_ANON_IP_Y', '');
- define('__CFG_REMOVEIP_ANON_IP_N', ' chkecked="checked"');
+ define('__CFG_REMOVEIP_ANON_IP_N', ' checked="checked"');
break;
} // END - switch
switch (getConfig('removeip_anon_host')) {
case 'Y':
- define('__CFG_REMOVEIP_ANON_HOST_Y', ' chkecked="checked"');
+ define('__CFG_REMOVEIP_ANON_HOST_Y', ' checked="checked"');
define('__CFG_REMOVEIP_ANON_HOST_N', '');
break;
case 'N':
define('__CFG_REMOVEIP_ANON_HOST_Y', '');
- define('__CFG_REMOVEIP_ANON_HOST_N', ' chkecked="checked"');
+ define('__CFG_REMOVEIP_ANON_HOST_N', ' checked="checked"');
break;
} // END - switch
switch (getConfig('removeip_anon_ua')) {
case 'Y':
- define('__CFG_REMOVEIP_ANON_UA_Y', ' chkecked="checked"');
+ define('__CFG_REMOVEIP_ANON_UA_Y', ' checked="checked"');
define('__CFG_REMOVEIP_ANON_UA_N', '');
break;
case 'N':
define('__CFG_REMOVEIP_ANON_UA_Y', '');
- define('__CFG_REMOVEIP_ANON_UA_N', ' chkecked="checked"');
+ define('__CFG_REMOVEIP_ANON_UA_N', ' checked="checked"');
break;
} // END - switch
switch (getConfig('removeip_anon_ref')) {
case 'Y':
- define('__CFG_REMOVEIP_ANON_REF_Y', ' chkecked="checked"');
+ define('__CFG_REMOVEIP_ANON_REF_Y', ' checked="checked"');
define('__CFG_REMOVEIP_ANON_REF_N', '');
break;
case 'N':
define('__CFG_REMOVEIP_ANON_REF_Y', '');
- define('__CFG_REMOVEIP_ANON_REF_N', ' chkecked="checked"');
+ define('__CFG_REMOVEIP_ANON_REF_N', ' checked="checked"');
break;
} // END - switch
switch (getConfig('removeip_admin_show')) {
case 'Y':
- define('__CFG_REMOVEIP_ADMIN_SHOW_Y', ' chkecked="checked"');
+ define('__CFG_REMOVEIP_ADMIN_SHOW_Y', ' checked="checked"');
define('__CFG_REMOVEIP_ADMIN_SHOW_N', '');
break;
case 'N':
define('__CFG_REMOVEIP_ADMIN_SHOW_Y', '');
- define('__CFG_REMOVEIP_ADMIN_SHOW_N', ' chkecked="checked"');
+ define('__CFG_REMOVEIP_ADMIN_SHOW_N', ' checked="checked"');
break;
} // END - switch
switch (getConfig('removeip_guest_show')) {
case 'Y':
- define('__CFG_REMOVEIP_GUEST_SHOW_Y', ' chkecked="checked"');
+ define('__CFG_REMOVEIP_GUEST_SHOW_Y', ' checked="checked"');
define('__CFG_REMOVEIP_GUEST_SHOW_N', '');
break;
case 'N':
define('__CFG_REMOVEIP_GUEST_SHOW_Y', '');
- define('__CFG_REMOVEIP_GUEST_SHOW_N', ' chkecked="checked"');
+ define('__CFG_REMOVEIP_GUEST_SHOW_N', ' checked="checked"');
break;
} // END - switch
switch (getConfig('removeip_member_show')) {
case 'Y':
- define('__CFG_REMOVEIP_MEMBER_SHOW_Y', ' chkecked="checked"');
+ define('__CFG_REMOVEIP_MEMBER_SHOW_Y', ' checked="checked"');
define('__CFG_REMOVEIP_MEMBER_SHOW_N', '');
break;
case 'N':
define('__CFG_REMOVEIP_MEMBER_SHOW_Y', '');
- define('__CFG_REMOVEIP_MEMBER_SHOW_N', ' chkecked="checked"');
+ define('__CFG_REMOVEIP_MEMBER_SHOW_N', ' checked="checked"');
break;
} // END - switch
switch (getConfig('removeip_sponsor_show')) {
case 'Y':
- define('__CFG_REMOVEIP_SPONSOR_SHOW_Y', ' chkecked="checked"');
+ define('__CFG_REMOVEIP_SPONSOR_SHOW_Y', ' checked="checked"');
define('__CFG_REMOVEIP_SPONSOR_SHOW_N', '');
break;
case 'N':
define('__CFG_REMOVEIP_SPONSOR_SHOW_Y', '');
- define('__CFG_REMOVEIP_SPONSOR_SHOW_N', ' chkecked="checked"');
+ define('__CFG_REMOVEIP_SPONSOR_SHOW_N', ' checked="checked"');
break;
} // END - switch
// Already registered module?
if (ereg($content['module'], getConfig('rewrite_skip'))) {
// Found
- $y = ' chkecked="checked"';
+ $y = ' checked="checked"';
$n = '';
} else {
// Not found
$y = '';
- $n = ' chkecked="checked"';
+ $n = ' checked="checked"';
}
// Remember data in array for the dynamic row template
// Prepare payment model for template
if (getConfig('surfbar_pay_model') == 'STATIC') {
// Static model
- define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , ' chkecked="checked"');
+ define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , ' checked="checked"');
define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', '');
} else {
// Dynamic model
define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , '');
- define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', ' chkecked="checked"');
+ define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', ' checked="checked"');
}
// Prepare auto-sart
if (getConfig('surfbar_autostart') == 'Y') {
// Yes selected
- define('__CONFIG_SURFBAR_AUTOSTART_Y', ' chkecked="checked"');
+ define('__CONFIG_SURFBAR_AUTOSTART_Y', ' checked="checked"');
define('__CONFIG_SURFBAR_AUTOSTART_N', '');
} else {
// No selected
define('__CONFIG_SURFBAR_AUTOSTART_Y', '');
- define('__CONFIG_SURFBAR_AUTOSTART_N', ' chkecked="checked"');
+ define('__CONFIG_SURFBAR_AUTOSTART_N', ' checked="checked"');
}
// Prepare notify limits
if (getConfig('surfbar_notify_limits') == 'Y') {
// Yes selected
- define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', ' chkecked="checked"');
+ define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', ' checked="checked"');
define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', '');
} else {
// No selected
define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', '');
- define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', ' chkecked="checked"');
+ define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', ' checked="checked"');
}
// Prepare notify admin about unlocked emails
if (getConfig('surfbar_notify_admin_unlock') == 'Y') {
// Yes selected
- define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y', ' chkecked="checked"');
+ define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y', ' checked="checked"');
define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', '');
} else {
// No selected
define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y', '');
- define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', ' chkecked="checked"');
+ define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', ' checked="checked"');
}
// Prepare order migration
if (getConfig('surfbar_migrate_order') == 'Y') {
// Yes selected
- define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', ' chkecked="checked"');
+ define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', ' checked="checked"');
define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', '');
} else {
// No selected
define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', '');
- define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', ' chkecked="checked"');
+ define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', ' checked="checked"');
}
// Pause URL mode
if (getConfig('surfbar_pause_mode') == 'INTERNAL') {
// Internal pause page
- define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', ' chkecked="checked"');
+ define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', ' checked="checked"');
define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', '');
} else {
// External pause page (if not empty)
define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', '');
- define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', ' chkecked="checked"');
+ define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', ' checked="checked"');
}
// Notification mode
// Prepare payout Y/N selection
if (getConfig('wernis_payout_active') == 'Y') {
// Payout allowed
- define('__CFG_WERNIS_PAYOUT_ACTIVE_Y', ' chkecked="checked"');
+ define('__CFG_WERNIS_PAYOUT_ACTIVE_Y', ' checked="checked"');
define('__CFG_WERNIS_PAYOUT_ACTIVE_N', '');
} else {
// Payout disabled
define('__CFG_WERNIS_PAYOUT_ACTIVE_Y', '');
- define('__CFG_WERNIS_PAYOUT_ACTIVE_N', ' chkecked="checked"');
+ define('__CFG_WERNIS_PAYOUT_ACTIVE_N', ' checked="checked"');
}
// Prepare withdraw Y/N selection
if (getConfig('wernis_withdraw_active') == 'Y') {
// Payout allowed
- define('__CFG_WERNIS_WITHDRAW_ACTIVE_Y', ' chkecked="checked"');
+ define('__CFG_WERNIS_WITHDRAW_ACTIVE_Y', ' checked="checked"');
define('__CFG_WERNIS_WITHDRAW_ACTIVE_N', '');
} else {
// Payout disabled
define('__CFG_WERNIS_WITHDRAW_ACTIVE_Y', '');
- define('__CFG_WERNIS_WITHDRAW_ACTIVE_N', ' chkecked="checked"');
+ define('__CFG_WERNIS_WITHDRAW_ACTIVE_N', ' checked="checked"');
}
// Load template
// Prepare loaded data for the
$content = array(
- 'start' => generateDateTime($start, "3"),
- 'end' => generateDateTime($end , "3")
+ 'start' => generateDateTime($start, '3'),
+ 'end' => generateDateTime($end , '3')
);
// Send email to user
$content = array(
'sw' => $SW,
'idx' => $content['trans_id'],
- 'stamp' => generateDateTime($content['time_trans'], "3"),
+ 'stamp' => generateDateTime($content['time_trans'], '3'),
'uid_from' => generateUserProfileLink($content['userid']),
'uid_to' => generateUserProfileLink($content['to_uid']),
'reason' => $content['reason'],
$result_normal = SQL_QUERY($sql, __FILE__, __LINE__);
// Set offset an current page to default values
-if (!REQUEST_ISSET_GET('page')) REQUEST_SET_GET('page' , "1");
+if (!REQUEST_ISSET_GET('page')) REQUEST_SET_GET('page' , '1');
if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', getConfig('mails_page'));
// Add limitation to SQL string
// Add navigation table rows
if ($PAGES > 1) {
- define('__TOP_EMAIL_NAV' , ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), true , "3", true));
- define('__BOTTOM_EMAIL_NAV', ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true));
+ define('__TOP_EMAIL_NAV' , ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), true , '3', true));
+ define('__BOTTOM_EMAIL_NAV', ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, '3', true));
} else {
define('__TOP_EMAIL_NAV' , '');
define('__BOTTOM_EMAIL_NAV', '');
$result_normal = SQL_QUERY($sql, __FILE__, __LINE__);
// Set offset an current page to default values
-if (!REQUEST_ISSET_GET('page')) REQUEST_SET_GET('page', "1");
+if (!REQUEST_ISSET_GET('page')) REQUEST_SET_GET('page', '1');
if (!REQUEST_ISSET_GET('offset')) {
if (isConfigEntrySet('mails_page')) {
// Add navigation (with change box and colspan=3)
$content['nav'] = '';
- if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true);
+ if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, '3', true);
// Prepare content
$content['rows'] = $OUT;
// Add navigation (without change box but with colspan=3)
$content['nav'] = '';
- if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true);
+ if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, '3', true);
// Prepare content
$content['rows'] = $OUT;
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_EXT_CHANGED'));
} else {
// Edit selected entries
- $SW = "2"; $OUT = '';
+ $SW = 2; $OUT = '';
foreach (REQUEST_POST('sel') as $ext_id => $sel) {
// Edit this extension?
if (($sel == 'Y') || ($sel == 'N')) {
$OUT = " <select class=\"admin_select\" name=\"sort\" size=\"1\">
<option value=\"0\">".IS_FIRST_MENU."</option>";
- foreach ($below as $key => $m)
- {
- if (is_array($m))
- {
- foreach ($m as $key2 => $m2)
- {
+ foreach ($below as $key => $m) {
+ if (is_array($m)) {
+ foreach ($m as $key2 => $m2) {
$OUT .= " <option value=\"".$m2."\">".$titles[$key][$key2];
- foreach ($menus as $k => $v)
- {
- if (($v == $key) && (!is_array($v)))
- {
- $OUT .= " (".$titles[$k].")";
+ foreach ($menus as $k => $v) {
+ if (($v == $key) && (!is_array($v))) {
+ $OUT .= " (" . $titles[$k] . ')';
}
}
$OUT .= "</option>\n";
'sname' => $content['surname'],
'fname' => $content['family'],
'email' => "<a href=\"".generateMemberEmailLink($content['email'], "user_data")."\">".$content['email']."</a>",
- 'joined' => generateDateTime($content['joined'], "2"),
- 'last' => generateDateTime($content['last_online'], "2"),
- 'notified' => generateDateTime($content['ap_notified'], "2"),
+ 'joined' => generateDateTime($content['joined'], '2'),
+ 'last' => generateDateTime($content['last_online'], '2'),
+ 'notified' => generateDateTime($content['ap_notified'], '2'),
);
// Load row template
'sname' => $content['surname'],
'fname' => $content['family'],
'turbo' => translateComma($content['beg_points']),
- 'last' => generateDateTime($content['last_online'], "2"),
+ 'last' => generateDateTime($content['last_online'], '2'),
'sw' => $SW,
'win1' => $WIN1,
'win2' => $WIN2,
// Prepare constant for timemark
if (EXT_IS_ACTIVE('autopurge')) {
- define('__AUTOPURGE_TIMEOUT', generateDateTime(time() - getConfig('ap_inactive_since'), "2"));
+ define('__AUTOPURGE_TIMEOUT', generateDateTime(time() - getConfig('ap_inactive_since'), '2'));
} else {
define('__AUTOPURGE_TIMEOUT', sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'autopurge'));
}
if (GET_EXT_VERSION('bonus') >= '0.6.9') {
// Add more bonus points here
- $USE = "(0";
- if (getConfig('bonus_click_yn') == 'Y') $USE .= " + turbo_bonus";
- if (getConfig('bonus_login_yn') == 'Y') $USE .= " + login_bonus";
- if (getConfig('bonus_order_yn') == 'Y') $USE .= " + bonus_order";
- if (getConfig('bonus_stats_yn') == 'Y') $USE .= " + bonus_stats";
- if (getConfig('bonus_ref_yn') == 'Y') $USE .= " + bonus_ref";
- $USE .= ")";
+ $USE = '(0';
+ if (getConfig('bonus_click_yn') == 'Y') $USE .= " + `turbo_bonus`";
+ if (getConfig('bonus_login_yn') == 'Y') $USE .= " + `login_bonus`";
+ if (getConfig('bonus_order_yn') == 'Y') $USE .= " + `bonus_order`";
+ if (getConfig('bonus_stats_yn') == 'Y') $USE .= " + `bonus_stats`";
+ if (getConfig('bonus_ref_yn') == 'Y') $USE .= " + `bonus_ref`";
+ $USE .= ')';
} else {
// Old version ???
- $USE = "turbo_bonus";
+ $USE = 'turbo_bonus';
}
// Autopurge installed?
$content['email'] = generateMemberEmailLink($content['email'], "user_data");
$content['gender'] = translateGender($content['gender']);
$content['points'] = translateComma($content['points']);
- $content['last'] = generateDateTime($content['last'], "2");
+ $content['last'] = generateDateTime($content['last'], '2');
$content['sw'] = $SW;
$content['win1'] = $WIN1;
$content['win2'] = $WIN2;
// Prepare constant for timemark
if (EXT_IS_ACTIVE('autopurge')) {
- define('__AUTOPURGE_TIMEOUT', generateDateTime(time() - getConfig('ap_inactive_since'), "2"));
+ define('__AUTOPURGE_TIMEOUT', generateDateTime(time() - getConfig('ap_inactive_since'), '2'));
} else {
define('__AUTOPURGE_TIMEOUT', sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'autopurge'));
}
'sw' => $SW,
'id' => $content['id'],
'uid' => generateUserProfileLink($content['userid']),
- 'start' => generateDateTime($content['holiday_start'], "3"),
- 'end' => generateDateTime($content['holiday_end'], "3"),
+ 'start' => generateDateTime($content['holiday_start'], '3'),
+ 'end' => generateDateTime($content['holiday_end'], '3'),
'comments' => wordwrap($content['comments'], 15),
'status' => translateUserStatus($content['status']),
- 'last' => generateDateTime($content['last_online'], "3"),
+ 'last' => generateDateTime($content['last_online'], '3'),
);
// Load row template and switch color
$SQL2 = '';
// Set offset an current page to default values
-if (!REQUEST_ISSET_GET('page')) REQUEST_SET_GET('page' , "1");
+if (!REQUEST_ISSET_GET('page')) REQUEST_SET_GET('page' , '1');
if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', getConfig('mails_page'));
if ((EXT_IS_ACTIVE('bonus')) && ($WHO == getMessage('_ALL'))) {
// Add navigation (without change box but with colspan=3)
$content['nav'] = '';
- if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true);
+ if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, '3', true);
// Prepare content
$content['rows'] = $OUT;
'ptype' => translateComma($content['payout_total'])." ".COMPILE_CODE($content['type']),
'account' => $content['target_account'],
'bank' => $content['target_bank'],
- 'tstamp' => generateDateTime($content['payout_timestamp'], "2"),
+ 'tstamp' => generateDateTime($content['payout_timestamp'], '2'),
'status' => $content['status'],
);
$content['sw'] = $SW;
$content['link'] = generateUserProfileLink($content['userid']);
$content['primera_amount'] = translateComma($content['primera_amount']);
- $content['primera_timestamp'] = generateDateTime($content['primera_timestamp'], "2");
+ $content['primera_timestamp'] = generateDateTime($content['primera_timestamp'], '2');
$content['raw_type'] = strtolower($content['primera_type']);
$content['primera_type'] = PRIMERA_TRANSFER_STATUS($content['primera_type']);
// Activate / deactivate
switch (REQUEST_GET('activate'))
{
- case "1": // Activate
+ case '1': // Activate
ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET is_active='Y' WHERE `id`=%s AND is_active='N' LIMIT 1");
break;
// Automatic notification
switch (REQUEST_GET('notify'))
{
- case "1": // Activate
+ case '1': // Activate
ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET send_notify='Y' WHERE `id`=%s AND send_notify='N' LIMIT 1");
break;
// Automatic adding of new members
switch (REQUEST_GET('auto'))
{
- case "1": // Activate
+ case '1': // Activate
ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET auto_add_new_user='Y' WHERE `id`=%s AND auto_add_new_user='N' LIMIT 1");
break;
'family' => $data['family'],
'email' => "[<a href=\"".generateMemberEmailLink($data['email'], "user_data")."\">".$data['email']."</a>]",
'status' => translateUserStatus($data['status']),
- 'registered' => generateDateTime($data['joined'], "3"),
+ 'registered' => generateDateTime($data['joined'], '3'),
);
// Check if referal count is larger 0 and update link
'family' => $levels['family'],
'email' => "[<a href=\"".generateMemberEmailLink($levels['email'], "user_data")."\">".$levels['email']."</a>]",
'status' => translateUserStatus($levels['status']),
- 'registered' => generateDateTime($levels['joined'], "3"),
+ 'registered' => generateDateTime($levels['joined'], '3'),
);
// Check if referal count is larger 0 and update link
define('__SPONSOR_EMAIL_VALUE', $DATA['email']);
define('__SPONSOR_URL' , DEREFERER($DATA['url']));
// Timestamps
- define('__SPONSOR_CREATED' , generateDateTime($DATA['sponsor_created'], "2"));
- define('__SPONSOR_LAST_ONLINE', generateDateTime($DATA['last_online'], "2"));
- define('__SPONSOR_LAST_CHANGE', generateDateTime($DATA['last_change'], "2"));
+ define('__SPONSOR_CREATED' , generateDateTime($DATA['sponsor_created'], '2'));
+ define('__SPONSOR_LAST_ONLINE', generateDateTime($DATA['last_online'], '2'));
+ define('__SPONSOR_LAST_CHANGE', generateDateTime($DATA['last_change'], '2'));
// Sponsor points
define('__SPONSOR_AMOUNT' , translateComma($DATA['points_amount']));
define('__SPONSOR_USED' , translateComma($DATA['points_used']));
'fname' => $content['family'],
'email' => "mailto:".$content['email'],
'status' => sponsorTranslateUserStatus($content['status']),
- 'created' => generateDateTime($content['sponsor_created'], "2"),
- 'last' => generateDateTime($content['last_online'], "2"),
+ 'created' => generateDateTime($content['sponsor_created'], '2'),
+ 'last' => generateDateTime($content['last_online'], '2'),
'points' => translateComma($content['points_amount'] - $content['points_used']),
'ip' => $content['remote_addr'],
);
'admin' => $content['assigned_admin'],
'uid' => $content['userid'],
'type' => $content['task_type_msg'],
- 'created' => generateDateTime($content['task_created'], "2")
+ 'created' => generateDateTime($content['task_created'], '2')
));
// Do we have an extension task?
$content = array(
'sw' => $SW,
'idx' => $content['trans_id'],
- 'stamp' => generateDateTime($content['time_trans'], "3"),
+ 'stamp' => generateDateTime($content['time_trans'], '3'),
'from_link' => generateUserProfileLink($content['userid']),
'to_link' => generateUserProfileLink($content['to_uid']),
'reason' => wordwrap($content['reason'], 15),
WHERE p.id='".REQUEST_GET('mid')."' LIMIT 1";
// Column, type and ID for member's mail
- $col = "stats_id"; $type = "NORMAL"; $ID = "-1";
+ $col = "stats_id"; $type = "NORMAL"; $ID = '-1';
// Load admin_list_unconfirmed template
$listed = true; $DATA = REQUEST_GET('mid'); $LINK = 'mailid';
SQL_FREERESULT($result);
// Transfer data to constants for the template
- if (($stats_id > 0) && ($ID == "-1")) $ID = $stats_id;
+ if (($stats_id > 0) && ($ID == '-1')) $ID = $stats_id;
if ($col == 'bonus_id') $sender = 0;
// Load unconfirmed mail links. Hmmm, this select query is pretty cool
'text' => COMPILE_CODE($text),
'url' => FRAMETESTER($url),
'unconfirmed' => $unconfirmed,
- 'stamp' => generateDateTime($stamp, "2"),
+ 'stamp' => generateDateTime($stamp, '2'),
'rows' => $OUT
);
// Init unset data (bad that we change $_GET here!)
if (!REQUEST_ISSET_GET(('letter'))) { REQUEST_SET_GET('letter', getMessage('_ALL2')); }
if (!REQUEST_ISSET_GET(('sortby'))) { REQUEST_SET_GET('sortby', 'userid'); }
-if (!REQUEST_ISSET_GET('page')) { REQUEST_SET_GET('page' , "1"); }
+if (!REQUEST_ISSET_GET('page')) { REQUEST_SET_GET('page' , '1'); }
// Set base URL
$base = "[<a href=\"{!URL!}/modules.php?module=admin";
// Is this above zero?
if ($stamp > 0) {
// Then use it
- define('_BIRTHDAY', generateDateTime($stamp, "3"));
+ define('_BIRTHDAY', generateDateTime($stamp, '3'));
} else {
// Zero or below so set zero!
- define('_BIRTHDAY', generateDateTime(0, "3"));
+ define('_BIRTHDAY', generateDateTime(0, '3'));
}
// Prepare data for template
$DATA['last_profile_sent'] = generateDateTime($DATA['last_profile_sent'], '0');
$DATA['total'] = translateComma(GET_TOTAL_DATA($uid, "user_points", "points"));
$DATA['locked'] = translateComma(GET_TOTAL_DATA($uid, "user_points", "locked_points"));
- $DATA['lock_timestamp'] = generateDateTime($DATA['lock_timestamp'], "2");
+ $DATA['lock_timestamp'] = generateDateTime($DATA['lock_timestamp'], '2');
// Is the lock reason not set?
if (!isset($DATA['lock_reason'])) $DATA['lock_reason'] = '---';
// Activate the extension please!
$PAGES = round(SQL_NUMROWS($result_master) / getConfig('user_limit') + 0.5);
- if (!REQUEST_ISSET_GET('page')) REQUEST_SET_GET('page' , "1");
+ if (!REQUEST_ISSET_GET('page')) REQUEST_SET_GET('page' , '1');
if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', getConfig('user_limit'));
// Add limitation to SQL string and run him again
$content['points'] = translateComma($pointsTotal);
$content['rate'] = translateComma($clickRate);
$content['locked'] = translateComma(GET_TOTAL_DATA($content['userid'], "user_points", "locked_points"));
- $content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], "2");
+ $content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], '2');
$content['status'] = translateUserStatus($content['status']);
// Is the lock reason not set?
$content['sw'] = $SW;
$content['link'] = generateUserProfileLink($content['userid']);
$content['wernis_amount'] = translateComma($content['wernis_amount']);
- $content['wernis_timestamp'] = generateDateTime($content['wernis_timestamp'], "2");
+ $content['wernis_timestamp'] = generateDateTime($content['wernis_timestamp'], '2');
$content['raw_type'] = strtolower($content['wernis_type']);
$content['wernis_type'] = WERNIS_TRANSFER_STATUS($content['wernis_type']);
// Add description as navigation point
ADD_DESCR('admin', __FILE__);
-if (REQUEST_ISSET_GET(('access'))) {
+if (REQUEST_ISSET_GET('access')) {
// Secure input and construct FQFN
$access = SQL_ESCAPE(strip_tags(REQUEST_GET('access')));
$target = sprintf("%slogs/%s", constant('PATH'), $access);
clearOutputBuffer();
// Set header
- if (substr($access, -3, 3) == "log") {
+ if (substr($access, -3, 3) == 'log') {
// Output header
- header("Content-Type: text/plain");
- } elseif (substr($access, -3, 3) == ".gz") {
+ sendHeader('Content-Type: text/plain');
+ } elseif (substr($access, -3, 3) == '.gz') {
// @TODO Fix content-type here
- header("Content-Type: text/plain");
- } elseif (substr($access, -3, 3) == ".bz2") {
+ sendHeader('Content-Type: text/plain');
+ } elseif (substr($access, -3, 3) == '.bz2') {
// @TODO Fix content-type here
- header("Content-Type: text/plain");
+ sendHeader('Content-Type: text/plain');
} else {
// Restore old content
OUTPUT_HTML($OUTPUT);
} else {
// List access logfiles
$dir = constant('PATH') . getConfig('logs_base') . '/';
+
+ // Is the directory there?
if (isDirectory($dir)) {
// logs directory does exist
OUTPUT_HTML("<ol>");
- $handle = opendir($dir) or app_die(__FILE__, __LINE__, "Cannot open directory ".getConfig('logs_base').'!');
+ $handle = opendir($dir) or app_die(__FILE__, __LINE__, 'Cannot open directory '.getConfig('logs_base') . '!');
while ($file = readdir($handle)) {
// We currenly only like files with "access" as prefix, should be more flexible!
- if (substr($file, 0, 6) == "access") {
+ if (substr($file, 0, 6) == 'access') {
// Okay, let us print it out
OUTPUT_HTML("<li><a href=\"{!URL!}/modules.php?module=admin&what=".$GLOBALS['what']."&access=".urlencode($file)."\">".$file."</a></li>");
}
$OUT .= " <option value=\"".$m2."\">".$titles[$key][$key2];
foreach ($menus as $k => $v) {
if (($v == $key) && (!is_array($v))) {
- $OUT .= " (".$titles[$k].")";
+ $OUT .= " (" . $titles[$k] . ')';
}
}
$OUT .= "</option>\n";
LOAD_TEMPLATE('admin_settings_saved', false, $content);
} elseif (($SEL > 0) && (REQUEST_ISSET_POST('edit'))) {
// Edit banner
- $SW = ''; $OUT = '';
+ $SW = 2; $OUT = '';
foreach (REQUEST_POST('sel') as $id => $sel) {
// Load data
$result = SQL_QUERY_ESC("SELECT url, alternate, visible FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE `id`=%s LIMIT 1",
} else {
// Copy data into constants for the template and load it
// @TODO Rewrite this constant
- define('_DATESTAMP', generateDateTime(time(), "3"));
+ define('_DATESTAMP', generateDateTime(time(), '3'));
if (EXT_IS_ACTIVE('html_mail')) {
// Load template with HTML mode
LOAD_TEMPLATE("admin_newsletter");
// "Translate" some data
$content['userid'] = generateUserProfileLink($content['userid']);
$content['total_visits'] = translateComma($content['total_visits']);
- $content['last_online'] = generateDateTime($content['last_online'], "2");
+ $content['last_online'] = generateDateTime($content['last_online'], '2');
$content['sw'] = $SW;
// Load row template
$OUT .= "<tr>
<td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".($idx + 1).".</td>
<td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\"><a href=\"".$LINK."\">".$name."</a></td>
- <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".generateDateTime($THEMES['fctime'][$idx], "2")."</td>
+ <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".generateDateTime($THEMES['fctime'][$idx], '2')."</td>
<td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".translateComma(round($THEMES['fsize'][$idx] / 1.024) / 1000)." ".KBYTES."</td>
<td align=\"center\" class=\"switch_sw".$SW." bottom2\">".$THEMES['ver'][$idx]." (".$THEMES['cver'][$idx].")</td>
</tr>
'cat_link' => $content['category'],
'pay_title' => str_replace("\"", """, getPaymentTitlePrice($content['payment'], true)),
'pay_link' => $content['payment'],
- 'ordered' => generateDateTime($content['timestamp'], "2"),
+ 'ordered' => generateDateTime($content['timestamp'], '2'),
'tsend' => $content['target_send'],
);
$data = array(
'aid' => $content['email'],
'order' => ($content['pay_count'] * $content['pay_rate'])." ".$content['pay_currency'],
- 'stamp' => generateDateTime($content['pay_ordered'], "2"),
+ 'stamp' => generateDateTime($content['pay_ordered'], '2'),
'pname' => $content['pay_name'],
);
'family' => $content['family'],
'email' => "mailto:".$content['email'],
'remote' => $content['remote_addr'],
- 'created' => generateDateTime($content['sponsor_created'], "2"),
+ 'created' => generateDateTime($content['sponsor_created'], '2'),
);
// Load row template and switch colors
} elseif (($ONLINE['version'] != constant('FULL_VERSION')) || ($ONLINE['revision'] != constant('CURR_SVN_REVISION'))) {
// New full-version available (all previous released patches are included in this version!)
define('__ONLINE_VERSION', $ONLINE['version']);
- define('__ONLINE_CHANGE' , generateDateTime($ONLINE['changed'], "2"));
+ define('__ONLINE_CHANGE' , generateDateTime($ONLINE['changed'], '2'));
define('__ONLINE_REVISION', $ONLINE['revision']);
// Load template
ADD_DESCR('admin', __FILE__);
// Base directory (should be moved to database)
-$usage = getConfig('usage_base').'/';
+$usage = getConfig('usage_base') . '/';
if (REQUEST_ISSET_GET(('image'))) {
if (REQUEST_GET('type') == 'usage') {
if (isFileReadable($FQFN)) {
$image = imagecreatefrompng($FQFN);
- header("Content-type: image/png");
+ sendHeader("Content-type: image/png");
imagepng($image);
imagedestroy($image);
}
} // END - if
// Account confirmed!
- if (defined('LEAD_CODE_ENABLED') && defined('LEAD_EXPIRY_TIME')) {
+ if (EXT_IS_ACTIVE('lead')) {
// Set special lead cookie
setSession('lead_uid', bigintval($uid));
define('__UID', bigintval($uid));
LOAD_TEMPLATE("guest_confirm_table");
}
- } elseif (defined('LEAD_CODE_ENABLED') && defined('LEAD_EXPIRY_TIME')) {
+ } elseif (EXT_IS_ACTIVE('lead')) {
// Set special lead cookie
setSession('lead_uid', bigintval($uid));
if (IS_MEMBER()) {
// Login immidiately...
$URL = 'modules.php?module=login';
-} elseif ((IS_FORM_SENT()) && (''.$uid.'' != ''.REQUEST_POST('id').'')) {
+} elseif ((IS_FORM_SENT()) && (''.$uid.'' != ''.REQUEST_POST('id') . '')) {
// Invalid input (no nickname extension installed but nickname entered)
$errorCode = getCode('EXTENSION_PROBLEM');
} elseif (IS_FORM_SENT()) {
}
// Set start and end time
- define('__RALLYE_START', generateDateTime($start, "1"));
- define('__RALLYE_END' , generateDateTime($end , "1"));
+ define('__RALLYE_START', generateDateTime($start, '1'));
+ define('__RALLYE_END' , generateDateTime($end , '1'));
// Determine min_users
define('__RALLYE_MAX_USERS', RALLYE_DETERMINE_MIN_USERS($min_users));
if (!REQUEST_ISSET_POST('zip')) REQUEST_SET_POST('zip' , '');
if (!REQUEST_ISSET_POST(('city'))) REQUEST_SET_POST('city' , '');
if (!REQUEST_ISSET_POST(('cntry'))) REQUEST_SET_POST('cntry' , '');
-if (!REQUEST_ISSET_POST(('country_code'))) REQUEST_SET_POST('country_code', "1");
+if (!REQUEST_ISSET_POST(('country_code'))) REQUEST_SET_POST('country_code', '1');
// Default refid is zero
REQUEST_SET_POST('refid', 0);
$lockedUsers = GET_TOTAL_DATA('LOCKED', 'user_data', 'userid', 'status', true);
// Generate hash which will be inserted into confirmation mail
- $hash = generateHash(sha1($confirmedUsers.constant('ENCRYPT_SEPERATOR').$unconfirmedUsers.constant('ENCRYPT_SEPERATOR').$lockedUsers.constant('ENCRYPT_SEPERATOR').REQUEST_POST('month').'-'.REQUEST_POST('day').'-'.REQUEST_POST('year').constant('ENCRYPT_SEPERATOR').getenv('SERVER_NAME').constant('ENCRYPT_SEPERATOR').detectRemoteAddr().constant('ENCRYPT_SEPERATOR').detectUserAgent().'/'.constant('SITE_KEY').'/'.constant('DATE_KEY').'/'.constant('RAND_NUMBER')));
+ $hash = generateHash(sha1($confirmedUsers.getConfig('ENCRYPT_SEPERATOR').$unconfirmedUsers.getConfig('ENCRYPT_SEPERATOR').$lockedUsers.getConfig('ENCRYPT_SEPERATOR').REQUEST_POST('month') . '-'.REQUEST_POST('day') . '-'.REQUEST_POST('year').getConfig('ENCRYPT_SEPERATOR').getenv('SERVER_NAME').getConfig('ENCRYPT_SEPERATOR').detectRemoteAddr().getConfig('ENCRYPT_SEPERATOR').detectUserAgent().'/'.getConfig('SITE_KEY') . '/'.getConfig('DATE_KEY') . '/'.constant('RAND_NUMBER')));
// Add design when extension sql_patches is v0.2.7 or greater
// @TODO Rewrite these all to a single filter
if (GET_EXT_VERSION('sql_patches') >= '0.2.7') {
// Okay, add design here
$ADD1 = ", `curr_theme`";
- $ADD2 = ", '".getCurrentTheme()."'";
+ $ADD2 = ', ''.getCurrentTheme().''';
} // END - if
// Check if I shall disable sending mail to newly registered members out about active/begging rallye
{
case 'MEMBERS': // Statistics about your members
// Members yesterday / today online
- $ymem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE last_online >= ".constant('START_YDAY')." AND `last_online` < ".constant('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__));
- $tmem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE last_online >= ".constant('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__));
+ $ymem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE last_online >= ".getConfig('START_YDAY')." AND `last_online` < ".getConfig('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__));
+ $tmem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE last_online >= ".getConfig('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__));
// Yesterday / today registered
- $yreg = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE joined >= ".constant('START_YDAY')." AND joined < ".constant('START_TDAY'), __FILE__, __LINE__));
- $treg = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE joined >= ".constant('START_TDAY'), __FILE__, __LINE__));
+ $yreg = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE joined >= ".getConfig('START_YDAY')." AND joined < ".getConfig('START_TDAY'), __FILE__, __LINE__));
+ $treg = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE joined >= ".getConfig('START_TDAY'), __FILE__, __LINE__));
// Only males / females
$male = GET_TOTAL_DATA('M', 'user_data', 'userid', 'gender', true, " AND `status`='CONFIRMED'");
'nick' => $content['nickname'],
'logins' => $content['total_logins'],
'points' => translateComma(GET_TOTAL_DATA($content['userid'], "user_points", "points")),
- 'last' => generateDateTime($content['last_online'], "3"),
+ 'last' => generateDateTime($content['last_online'], '3'),
);
// Load row template
'uid' => $content['userid'],
'nick' => $content['nickname'],
'points' => translateComma($content['points']),
- 'last' => generateDateTime($content['last_online'], "3")
+ 'last' => generateDateTime($content['last_online'], '3')
);
// Load row template
'refs' => $content['refs'],
'nick' => $content['nickname'],
'points' => translateComma(GET_TOTAL_DATA($content['userid'], "user_points", "points")),
- 'last' => generateDateTime($content['last_online'], "3")
+ 'last' => generateDateTime($content['last_online'], '3')
);
// Load row template
$rdf = new fase4_rdf();
$rdf->use_dynamic_display(false);
$rdf->set_CacheDir(constant('PATH')."inc/cache/");
-$rdf->set_salt(md5(constant('SITE_KEY')));
+$rdf->set_salt(md5(getConfig('SITE_KEY')));
$rdf->set_max_item(10);
$rdf->set_Options(
array(
require($INC);
} elseif (!IS_MEMBER()) {
$URL = 'modules.php?module=index';
- if ($check == 'mem_only') $URL .= '&msg='.getCode('MODULE_MEM_ONLY').'&mod='.$GLOBALS['module'];
+ if ($check == 'mem_only') $URL .= '&msg='.getCode('MODULE_MEM_ONLY') . '&mod='.$GLOBALS['module'];
redirectToUrl($URL);
}
'cnt' => $cnt,
'uid' => bigintval($content['userid']),
'points' => translateComma($content['beg']),
- 'last' => generateDateTime($content['last_online'], "2"),
+ 'last' => generateDateTime($content['last_online'], '2'),
);
// Load row template
$content['cnt'] = $cnt;
$content['uid'] = bigintval($content['uid']);
$content['points'] = translateComma($content['points']);
- $content['last'] = generateDateTime($content['last'], "2");
+ $content['last'] = generateDateTime($content['last'], '2');
// Load row template
$OUT .= LOAD_TEMPLATE("member_bonus_row", true, $content);
$OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result)) {
// Default he has not joined
- $content['jn'] = ' chkecked="checked"';
+ $content['jn'] = ' checked="checked"';
$content['jy'] = '';
// When we found an entry don't read it, just change the jx elements
if (REQUEST_ISSET_POST(('cat'))) {
// Form sent?
if (REQUEST_POST('cat', $content['id']) =='Y') {
- $content['jy'] = ' chkecked="checked"';
+ $content['jy'] = ' checked="checked"';
$content['jn'] = '';
}
} else {
// Check if he has an entry
if (GET_TOTAL_DATA($UID, "user_cats", "id", 'userid', true, sprintf(" AND cat_id=%s", bigintval($content['id']))) == 1) {
$content['jn'] = '';
- $content['jy'] = ' chkecked="checked"';
+ $content['jy'] = ' checked="checked"';
}
}
SQL_FREERESULT($result);
// Prepare it for the template
- define('__HOLIDAY_START', generateDateTime($start, "3"));
- define('__HOLIDAY_END' , generateDateTime($end , "3"));
+ define('__HOLIDAY_START', generateDateTime($start, '3'));
+ define('__HOLIDAY_END' , generateDateTime($end , '3'));
// Deactivate it now
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
SQL_FREERESULT($result);
if ($mode == 'Y') {
- define('HTML_Y', ' chkecked="checked"');
+ define('HTML_Y', ' checked="checked"');
define('HTML_N', '');
} else {
- define('HTML_N', ' chkecked="checked"');
+ define('HTML_N', ' checked="checked"');
define('HTML_Y', '');
}
LOAD_TEMPLATE("member_html_mail_settings");
case 'N': // Does not receive the newsletter
define('__STATUS_VALUE', getMessage('NL_MEMBER_OFF'));
- define('__UNTIL_VALUE' , generateDateTime($until, "2"));
+ define('__UNTIL_VALUE' , generateDateTime($until, '2'));
define('NL_SUBMIT' , getMessage('NL_MEMBER_SUBMIT_ON'));
break;
}
// Load timestamp from last order
list($LORDER) = SQL_FETCHROW($result);
- $LORDER = generateDateTime($LORDER, "1");
+ $LORDER = generateDateTime($LORDER, '1');
// Free memory
SQL_FREERESULT($result);
'acc' => $content['target_account'],
'points' => translateComma($content['payout_total'])." ".COMPILE_CODE($content['type']),
'bank' => $content['target_bank'],
- 'stamp' => generateDateTime($content['payout_timestamp'], "2"),
+ 'stamp' => generateDateTime($content['payout_timestamp'], '2'),
'status' => $content['status']
);
while ($data = SQL_FETCHARRAY($result)) {
// Prepare data for output
$rowContent = array(
- 'stamp' => generateDateTime($data['primera_timestamp'], "2"),
+ 'stamp' => generateDateTime($data['primera_timestamp'], '2'),
'points' => translateComma($data['primera_amount']),
'acc' => SQL_ESCAPE($data['primera_account']),
'status' => PRIMERA_TRANSFER_STATUS($data['primera_type']),
define('__RALLYE_MAX_PRICES', RALLYE_DETERMINE_MIN_PRICES($min_prices));
// Set start and end time
- define('__RALLYE_START', generateDateTime($start, "1"));
- define('__RALLYE_END' , generateDateTime($end , "1"));
+ define('__RALLYE_START', generateDateTime($start, '1'));
+ define('__RALLYE_END' , generateDateTime($end , '1'));
if ($expired === true) {
define('__RALLYE_PRICES', RALLYE_LIST_WINNERS($id));
'pay' => getPaymentTitlePrice($data['payment_id']),
'subj' => COMPILE_CODE($data['subject']),
'url' => DEREFERER($data['url']),
- 'stamp' => generateDateTime($data['timestamp'], "2"),
+ 'stamp' => generateDateTime($data['timestamp'], '2'),
'recs' => $data['target_send'],
'type' => translatePoolType($data['data_type']),
'zip' => $data['zip']
'pay' => getPaymentTitlePrice($data[2]),
'subj' => COMPILE_CODE($data[3]),
'url' => DEREFERER($data[4]),
- 'stamp' => generateDateTime($data[5], "2"),
+ 'stamp' => generateDateTime($data[5], '2'),
'recs' => $data[6],
- 'sent' => generateDateTime($data[7], "2"),
+ 'sent' => generateDateTime($data[7], '2'),
'clix' => $data[8],
'perc' => COMPILE_CODE($data[8] / $data[6] * 100)."%",
);
// Drop a message in the admin's area
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (userid, assigned_admin, status, task_type, subject, text, task_created) VALUES ('%s','0','NEW','SUPPORT_MEMBER','%s','%s', UNIX_TIMESTAMP())",
- array(getUserId(), $subj_a, REQUEST_POST('qsummary').':'.array('text' => REQUEST_POST('qdetails'))), __FILE__, __LINE__);
+ array(getUserId(), $subj_a, REQUEST_POST('qsummary') . ':'.array('text' => REQUEST_POST('qdetails'))), __FILE__, __LINE__);
// Form sent
LOAD_TEMPLATE("member_support_contcted");
// Include link to stats
$content['views_total'] = "[<a href=\"{!URL!}/modules.php?module=login&what=surfbar_list\">".translateComma($content['views_total'])."</a>]";
} // END - if
- $content['registered'] = generateDateTime($content['registered'], "2");
- $content['last_locked'] = generateDateTime($content['last_locked'], "2");
+ $content['registered'] = generateDateTime($content['registered'], '2');
+ $content['last_locked'] = generateDateTime($content['last_locked'], '2');
$content['actions'] = SURFBAR_MEMBER_ACTIONS($content['id'], $content['status']);
$content['status'] = surfbarTranslateUserStatus($content['status']);
if (empty($content['lock_reason'])) {
$content = array(
'sw' => $SW,
'tid' => $id,
- 'stamp' => generateDateTime($stamp, "3"),
+ 'stamp' => generateDateTime($stamp, '3'),
'uid' => $uid,
'reason' => $reason,
'points' => translateComma($points)
// Prepare content for template
$content['sw'] = $SW;
- $content['time'] = generateDateTime($content['time_trans'], "3");
+ $content['time'] = generateDateTime($content['time_trans'], '3');
$content['points'] = translateComma($content['points']);
// Load row template
switch ($opt_in)
{
case 'Y':
- define('__TRANSFER_ALLOW_Y', ' chkecked="checked"');
+ define('__TRANSFER_ALLOW_Y', ' checked="checked"');
define('__TRANSFER_ALLOW_N', '');
define('__TRANSFER_NEW_LINK', "<a href=\"{!URL!}/modules.php?module=login&what=transfer&mode=new\">{--TRANSFER_NOW_LINK--}</a>");
break;
case 'N':
define('__TRANSFER_ALLOW_Y', '');
- define('__TRANSFER_ALLOW_N', ' chkecked="checked"');
+ define('__TRANSFER_ALLOW_N', ' checked="checked"');
define('__TRANSFER_NEW_LINK', getMessage('TRANSFER_PLEASE_ALLOW_OPT_IN'));
break;
}
// Load newest transaction
list($newest) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- define('__TRANSFER_SETTINGS_CONTENT', sprintf(getMessage('TRANSFER_LATEST_IS'), generateDateTime($newest, "3")));
+ define('__TRANSFER_SETTINGS_CONTENT', sprintf(getMessage('TRANSFER_LATEST_IS'), generateDateTime($newest, '3')));
}
// Load template
while ($data = SQL_FETCHARRAY($result)) {
// Prepare data for output
$rowContent = array(
- 'stamp' => generateDateTime($data['wernis_timestamp'], "2"),
+ 'stamp' => generateDateTime($data['wernis_timestamp'], '2'),
'points' => translateComma($data['wernis_amount']),
'acc' => bigintval($data['wernis_account']),
'status' => WERNIS_TRANSFER_STATUS($data['wernis_type']),
// Make yes/no selection
switch ($content['receive_warnings']) {
case 'Y':
- define('__YES', ' chkecked="checked"');
+ define('__YES', ' checked="checked"');
define('__NO', '');
break;
case 'N':
define('__YES', '');
- define('__NO', ' chkecked="checked"');
+ define('__NO', ' checked="checked"');
break;
}
// Non-database functions
require('inc/functions.php');
+// Wrapper functions
+require('inc/wrapper-functions.php');
+
// Load more function libraries or includes
foreach (array('request-functions', 'session-functions', 'config-functions', 'code-functions', 'inc-functions', 'filters', 'mysql-manager', 'extensions', 'db/lib', 'handler', 'hooks') as $lib) {
// Load special functions
// Set error handler
set_error_handler('__errorHandler');
+// Load configuration file(s) here
+loadIncludeOnce('inc/load_config.php');
+
+// Set important header_sent
+$GLOBALS['header_sent'] = 0;
+
// Check if the user setups his MySQL stuff...
-if ((empty($MySQL['login'])) && (!isInstalling()) && (!REQUEST_ISSET_GET('installing')) && (isInstalled())) {
+if ((empty($GLOBALS['mysql']['login'])) && (!isInstalling()) && (!REQUEST_ISSET_GET('installing')) && (isInstalled())) {
// No login entered and outside installation mode
- OUTPUT_HTML("<strong>{--LANG_WARNING--}:</strong> ");
+ OUTPUT_HTML('<strong>{--LANG_WARNING--}:</strong> ');
if (isInstalled()) {
// You have changed my configuration file!
- app_die(__FILE__, __LINE__, "{--DIE_CONFIG_CHANGED_YOU--}");
+ app_die(__FILE__, __LINE__, '{--DIE_CONFIG_CHANGED_YOU--}');
} else {
// Please run the installation script (maybe again)
- app_die(__FILE__, __LINE__, "{--DIE_RUN_INSTALL_MYSQL--}");
+ app_die(__FILE__, __LINE__, '{--DIE_RUN_INSTALL_MYSQL--}');
}
-} elseif ((!isInstalling()) && (empty($MySQL['password'])) && (isBooleanConstantAndTrue('warn_no_pass'))) {
+} elseif ((!isInstalling()) && (empty($GLOBALS['mysql']['password'])) && (getConfig('WARN_NO_PASS') == 'Y')) {
// No database password entered!!!
- OUTPUT_HTML("<div>{--LANG_WARNING--}:</div> {--WARN_NULL_PASSWORD--}");
+ OUTPUT_HTML('<div>{--LANG_WARNING--}:</div> {--WARN_NULL_PASSWORD--}');
}
-// Set dummy config array
-initConfig();
-
-// Set important header_sent
-$GLOBALS['header_sent'] = 0;
-
// Init fatal messages
initFatalMessages();
// CSS array
EXT_INIT_CSS_FILES();
- if ((!empty($MySQL['host'])) && (!empty($MySQL['login'])) && (!empty($MySQL['password'])) && (!empty($MySQL['dbase']))) {
+ if ((!empty($GLOBALS['mysql']['host'])) && (!empty($GLOBALS['mysql']['login'])) && (!empty($GLOBALS['mysql']['password'])) && (!empty($GLOBALS['mysql']['dbase']))) {
// Connect to DB
- SQL_CONNECT($MySQL['host'], $MySQL['login'], $MySQL['password'], __FILE__, __LINE__);
+ SQL_CONNECT($GLOBALS['mysql']['host'], $GLOBALS['mysql']['login'], $GLOBALS['mysql']['password'], __FILE__, __LINE__);
// Is the link valid?
if (SQL_IS_LINK_UP()) {
// Is it a valid resource?
- if (SQL_SELECT_DB($MySQL['dbase'], __FILE__, __LINE__) === true) {
+ if (SQL_SELECT_DB($GLOBALS['mysql']['dbase'], __FILE__, __LINE__) === true) {
// This is required for extension 'optimize' to work
- define('__DB_NAME', $MySQL['dbase']);
+ define('__DB_NAME', $GLOBALS['mysql']['dbase']);
// Remove MySQL array from namespace
- unset($MySQL);
+ unset($GLOBALS['mysql']);
// Load configuration stuff
loadConfiguration();
loadIncludeOnce('inc/versions.php');
// Loading patching system is required here...
- loadIncludeOnce('inc/patch-system.php'); // Initialize patch system
+ loadIncludeOnce('inc/patch-system.php');
// Run daily reset
loadIncludeOnce('inc/check-reset.php');
} // END - if
// Default is not found
- $ret = "??? (".$wht.")";
+ $ret = "??? (".$wht.')';
// Look for title
$result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE %s='%s' LIMIT 1",
$ret = checkModulePermissions($mod_chk);
} else {
// Module not found we don't add it to the database
- $ret = "404";
+ $ret = '404';
}
} elseif (!$found) {
// Problem with module detected
$prefix .= " -> ";
// We need to remove .php and the end
- if (substr($search, -4, 4) == ".php") {
+ if (substr($search, -4, 4) == '.php') {
// Remove the .php
$search = substr($search, 0, -4);
} // END - i
}
// Navigation link
- $OUT .= "<a name=\"menu\" class=\"menu_blur\" href=\"{!URL!}/modules.php?module=".$GLOBALS['module']."&what=".$content['sub_what'].addUrlData("")."\" target=\"_self\">";
+ $OUT .= "<a name=\"menu\" class=\"menu_blur\" href=\"{!URL!}/modules.php?module=".$GLOBALS['module']."&what=".$content['sub_what']."\" target=\"_self\">";
} else {
$OUT .= "<em>";
}
$OUT .= " <option value=\"".$content['value']."\"";
if (REQUEST_POST('max_mails') == $content['value']) $OUT .= ' selected="selected"';
$OUT .= ">".$content['value']." {--PER_DAY--}";
- if (!empty($content['comment'])) $OUT .= " (".$content['comment'].")";
+ if (!empty($content['comment'])) $OUT .= " (".$content['comment'].')';
$OUT .= "</option>\n";
}
define('__MAX_RECEIVE_OPTIONS', $OUT);
if (SQL_NUMROWS($result) == 1) {
// Save his points to add them to the jackpot
list($points) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
// Delete points entries as well
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_points` WHERE userid=%s", array(bigintval($uid)), __FUNCTION__, __LINE__);
// Now, when we have all his points adds them do the jackpot!
ADD_JACKPOT($points);
- }
+ } // END - if
+
+ // Free the result
+ SQL_FREERESULT($result);
// Delete category selections as well...
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s",
if (EXT_IS_ACTIVE('rallye')) {
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE userid=%s",
array(bigintval($uid)), __FUNCTION__, __LINE__);
- }
+ } // END - if
// Now a mail to the user and that's all...
- $msg = LOAD_EMAIL_TEMPLATE("del-user", array('text' => $reason), $uid);
+ $msg = LOAD_EMAIL_TEMPLATE('del-user', array('text' => $reason), $uid);
sendEmail($uid, getMessage('ADMIN_DEL_ACCOUNT'), $msg);
// Ok, delete the account!
// Exclude admin and member's area
if (($mod != 'admin') && ($mod != 'login')) {
// Construct dynamic description
- $DESCR = '{!MAIN_TITLE!} '.trim(getConfig('title_middle')).' '.ADD_DESCR('guest', 'what-'.$wht, true);
+ $DESCR = '{!MAIN_TITLE!} '.trim(getConfig('title_middle')) . ' ' . ADD_DESCR('guest', 'what-'.$wht, true);
// Output it directly
OUTPUT_HTML('<meta name="description" content="' . $DESCR . '" />');
}
// Adds points to the jackpot
-function ADD_JACKPOT($points) {
+function ADD_JACKPOT ($points) {
$result = SQL_QUERY("SELECT points FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 0) {
// Create line
}
// Subtracts points from the jackpot
-function SUB_JACKPOT($points) {
+function SUB_JACKPOT ($points) {
// First failed
$ret = '-1';
// Now update all user accounts
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `emails_received`=`emails_received`-1 WHERE `userid` IN (%s) LIMIT %s",
- array(implode(",", $UIDs), count($UIDs)), __FUNCTION__, __LINE__);
+ array(implode(',', $UIDs), count($UIDs)), __FUNCTION__, __LINE__);
} // END - if
// Free result
$GLOBALS['sqls'][$key] = (string) $value;
}
+// Merge SQLs together
+function MERGE_SQLS ($SQLs) {
+ SET_SQLS(merge_array(GET_SQLS(), $SQLs));
+}
+
// Counter for SQLs array
function COUNT_SQLS () {
// Default is false
list($stats_id) = SQL_FETCHROW($result_stats);
// Mark this user as "spammed" ;-) And place a line for him...
- //* DEBUG: */ echo "?L:".__LINE__.'/'.$dummy.'/'.$key.'/'.$uid."(".$DATA[1].")/".$DATA[0].'/'.$stats_id."?<br />";
+ //* DEBUG: */ echo "?L:".__LINE__.'/'.$dummy.'/'.$key.'/'.$uid.'('.$DATA[1].")/".$DATA[0].'/'.$stats_id."?<br />";
switch (removeReceiver($dummy, $key, bigintval($uid), bigintval($DATA[0]), bigintval($stats_id)))
{
case 'done':
$mailText = LOAD_EMAIL_TEMPLATE("back-member", $content, bigintval($uid));
// Send mail out to member
- sendEmail($email, getMessage('MEMBER_BACK_JACKPOT')." (".$uid.")", $mailText);
+ sendEmail($email, getMessage('MEMBER_BACK_JACKPOT')." (".$uid.')', $mailText);
} else {
// Add to jackpot
ADD_JACKPOT($PB);
// Send mail out to admin
- sendAdminNotification(getMessage('ADMIN_BACK_JACKPOT')." (".$uid.")", "back-admin", $content, 'admin');
+ sendAdminNotification(getMessage('ADMIN_BACK_JACKPOT')." (".$uid.')', "back-admin", $content, 'admin');
}
} // END - if
} // END - foreach
// Prepare all data for the template
$content = array(
- 'activated' => generateDateTime($content['holiday_activated'], "1"),
- 'start' => generateDateTime($content['holiday_start'] , "1"),
- 'end' => generateDateTime($content['holiday_end'] , "1")
+ 'activated' => generateDateTime($content['holiday_activated'], '1'),
+ 'start' => generateDateTime($content['holiday_start'] , '1'),
+ 'end' => generateDateTime($content['holiday_end'] , '1')
);
// Send email to user
} // END - if
} // END - if
-// Test session if index.php or modules.php is loaded
-if ((basename($_SERVER['PHP_SELF']) == 'index.php') || (basename($_SERVER['PHP_SELF']) == 'modules.php') || (isInstalling())) {
- if (count($_SESSION) > 0) {
- // Session variables accepted!
- define('__COOKIES', true);
- } else {
- // Cookies rejected!
- define('__COOKIES', false);
- }
-} // END - if
-
//* DEBUG: */ print('<pre>'.print_r($_SESSION, true).'</pre>');
//
array(getConfig('bonus_stats'), bigintval($content['userid'])), __FILE__, __LINE__);
// Translate some data
- $content['timestamp'] generateDateTime($content['timestamp_ordered'], "2");
+ $content['timestamp'] generateDateTime($content['timestamp_ordered'], '2');
// Load email template and send email
$msg = LOAD_EMAIL_TEMPLATE("member_stats_bonus", $content, bigintval($content['userid']));
// Default styles
$STYLES = array(
- "general.css",
+ 'general.css',
);
// Add stylesheet for installation
-if ((isInstalling()) || (!isInstalled())) $STYLES[] = "install.css";
+if ((isInstalling()) || (!isInstalled())) $STYLES[] = 'install.css';
// When no CSS output-mode is set, set it to file-output
-if (!isConfigEntrySet('css_php')) setConfigEntry('css_php', "FILE");
+if (!isConfigEntrySet('css_php')) setConfigEntry('css_php', 'FILE');
// Output CSS files or content or link to css.php ?
-if (($GLOBALS['output_mode'] == "1") || (getConfig('css_php') == "DIRECT")) {
+if (($GLOBALS['output_mode'] == '1') || (getConfig('css_php') == 'DIRECT')) {
// Load CSS files
$STYLES = merge_array($STYLES, EXT_GET_CSS_FILES());
// Do include only existing files and whose are not empty
if ((isFileReadable($FQFN)) && (filesize($FQFN) > 0)) {
switch (getConfig('css_php')) {
- case 'DIRECT':
+ case 'DIRECT': // Just link them (unsupported)
OUTPUT_HTML('<link rel="stylesheet" type="text/css" href="{!URL!}/theme/' . getCurrentTheme() . '/' . $value . '" />');
break;
- case 'FILE':
+ case 'FILE': // Output contents
OUTPUT_HTML(readFromFile($FQFN));
break;
+
+ default: // Invalid mode!
+ debug_report_bug(sprintf("Invalid css_php value %s detected.", getConfig('css_php')));
+ break;
} // END - switch
} // END - if
} // END - foreach
--- /dev/null
+<?php
+/************************************************************************
+ * MXChange v0.2.1 Start: 04/04/2009 *
+ * =============== Last change: 04/04/2009 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : wrapper-functions.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Wrapper functions *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Wrapper-Funktionen *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
+ require($INC);
+} // END - if
+
+// Read a given file
+function readFromFile ($FQFN, $sqlPrepare = false) {
+ // Load the file
+ if (function_exists('file_get_contents')) {
+ // Use new function
+ $content = file_get_contents($FQFN);
+ } else {
+ // Fall-back to implode-file chain
+ $content = implode('', file($FQFN));
+ }
+
+ // Prepare SQL queries?
+ if ($sqlPrepare === true) {
+ // Remove some unwanted chars
+ $content = str_replace("\r", '', $content);
+ $content = str_replace("\n\n", "\n", $content);
+ } // END - if
+
+ // Return the content
+ return $content;
+}
+
+// Writes content to a file
+function writeToFile ($FQFN, $content) {
+ // Is the file writeable?
+ if ((isFileReadable($FQFN)) && (!is_writeable($FQFN)) && (!changeMode($FQFN, 0644))) {
+ // Not writeable!
+ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("File %s not writeable.", basename($FQFN)));
+
+ // Failed! :(
+ return false;
+ } // END - if
+
+ // By default all is failed...
+ $return = false;
+
+ // Is the function there?
+ if (function_exists('file_put_contents')) {
+ // Write it directly
+ $return = file_put_contents($FQFN, $content);
+ } else {
+ // Write it with fopen
+ $fp = fopen($FQFN, 'w') or app_die(__FUNCTION__, __LINE__, "Cannot write file ".basename($FQFN).'!');
+ fwrite($fp, $content);
+ fclose($fp);
+
+ // Set CHMOD rights
+ $return = changeMode($FQFN, 0644);
+ }
+
+ // Return status
+ return $return;
+}
+
+// Clears the output buffer. This function does *NOT* backup sent content.
+function clearOutputBuffer () {
+ // Trigger an error on failure
+ if (!ob_end_clean()) {
+ // Failed!
+ debug_report_bug(__FUNCTION__.': Failed to clean output buffer.');
+ } // END - if
+}
+
+// Loads an include file and logs any missing files for debug purposes
+function loadInclude ($INC) {
+ // Add the path. This is why we need a trailing slash in config.php
+ $FQFN = constant('PATH') . $INC;
+
+ // Is the include file there?
+ if (!isIncludeReadable($INC)) {
+ // Not there so log it
+ debug_report_bug(sprintf("Include file %s not found.", $INC));
+ return false;
+ } // END - if
+
+ // Try to load it
+ require($FQFN);
+}
+
+// Loads an include file once
+function loadIncludeOnce ($INC) {
+ // Is it not loaded?
+ if (!isset($GLOBALS['load_once'][$INC])) {
+ // Then try to load it
+ loadInclude($INC);
+
+ // And mark it as loaded
+ $GLOBALS['load_once'][$INC] = "loaded";
+ } // END - if
+}
+
+// Checks wether an include file (non-FQFN better) is readable
+function isIncludeReadable ($INC) {
+ // Construct FQFN
+ $FQFN = constant('PATH') . $INC;
+
+ // Is it readable?
+ return isFileReadable($FQFN);
+}
+
+// Encode strings
+// @TODO Implement $compress
+function encodeString ($str, $compress = true) {
+ $str = urlencode(base64_encode(compileUriCode($str)));
+ return $str;
+}
+
+// Decode strings encoded with encodeString()
+// @TODO Implement $decompress
+function decodeString ($str, $decompress = true) {
+ $str = compileUriCode(base64_decode(urldecode(compileUriCode($str))));
+ return $str;
+}
+
+// Smartly adds slashes
+function smartAddSlashes ($unquoted) {
+ $unquoted = str_replace("\\", '', $unquoted);
+ return addslashes($unquoted);
+}
+
+// Decode entities in a nicer way
+function decodeEntities ($str) {
+ // Decode the entities to UTF-8 now
+ $decodedString = html_entity_decode($str, ENT_NOQUOTES, 'UTF-8');
+
+ // Return decoded string
+ return $decodedString;
+}
+
+// Merges an array together but only if both are arrays
+function merge_array ($array1, $array2) {
+ // Are both an array?
+ if ((is_array($array1)) && (is_array($array2))) {
+ // Merge all together
+ return array_merge($array1, $array2);
+ } elseif (is_array($array1)) {
+ // Return left array
+ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("array2 is not an array. array != %s", gettype($array2)));
+ return $array1;
+ } elseif (is_array($array2)) {
+ // Return right array
+ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("array1 is not an array. array != %s", gettype($array1)));
+ return $array2;
+ }
+
+ // Both are not arrays
+ debug_report_bug(__FUNCTION__.": No arrays provided!");
+}
+
+// Check if given FQFN is a readable file
+function isFileReadable ($FQFN) {
+ // Check all...
+ return ((file_exists($FQFN)) && (is_file($FQFN)) && (is_readable($FQFN)));
+}
+
+// Checks wether the given FQFN is a directory and not .,.. or .svn
+function isDirectory ($FQFN) {
+ // Generate baseName
+ $baseName = basename($FQFN);
+
+ // Check it
+ $isDirectory = ((is_dir($FQFN)) && ($baseName != '.') && ($baseName != '..') && ($baseName != '.svn'));
+
+ // Return the result
+ return $isDirectory;
+}
+
+// "Getter" for remote IP number
+function detectRemoteAddr () {
+ // Get remote ip from environment
+ $remoteAddr = determineRealRemoteAddress();
+
+ // Is removeip installed?
+ if (EXT_IS_ACTIVE('removeip')) {
+ // Then anonymize it
+ $remoteAddr = GET_ANONYMOUS_REMOTE_ADDR($remoteAddr);
+ } // END - if
+
+ // Return it
+ return $remoteAddr;
+}
+
+// "Getter" for remote hostname
+function detectRemoteHostname () {
+ // Get remote ip from environment
+ $remoteHost = getenv('REMOTE_HOST');
+
+ // Is removeip installed?
+ if (EXT_IS_ACTIVE('removeip')) {
+ // Then anonymize it
+ $remoteHost = GET_ANONYMOUS_REMOTE_HOST($remoteHost);
+ } // END - if
+
+ // Return it
+ return $remoteHost;
+}
+
+// "Getter" for user agent
+function detectUserAgent () {
+ // Get remote ip from environment
+ $userAgent = getenv('HTTP_USER_AGENT');
+
+ // Is removeip installed?
+ if (EXT_IS_ACTIVE('removeip')) {
+ // Then anonymize it
+ $userAgent = GET_ANONYMOUS_USER_AGENT($userAgent);
+ } // END - if
+
+ // Return it
+ return $userAgent;
+}
+
+// "Getter" for referer
+function detectReferer () {
+ // Get remote ip from environment
+ $referer = getenv('HTTP_REFERER');
+
+ // Is removeip installed?
+ if (EXT_IS_ACTIVE('removeip')) {
+ // Then anonymize it
+ $referer = GET_ANONYMOUS_REFERER($referer);
+ } // END - if
+
+ // Return it
+ return $referer;
+}
+
+// Check wether we are installing
+function isInstalling () {
+ $installing = ((isset($GLOBALS['mxchange_installing'])) || (REQUEST_ISSET_GET('installing')));
+ //* DEBUG: */ var_dump($installing);
+ return $installing;
+}
+
+// Check wether this script is installed
+function isInstalled () {
+ return (getConfig('MXCHANGE_INSTALLED') == 'Y');
+}
+
+// Check wether an admin is registered
+function isAdminRegistered () {
+ return (getConfig('ADMIN_REGISTERED') == 'Y');
+}
+
+// Checks wether the reset mode is active
+function isResetModeEnabled () {
+ // Now simply check it
+ return ((isset($GLOBALS['reset_enabled'])) && ($GLOBALS['reset_enabled'] === true));
+}
+
+// Checks wether the debug mode is enabled
+function isDebugModeEnabled () {
+ // Simply check it
+ return (getConfig('DEBUG_MODE') == 'Y');
+}
+
+// Checks wether the cache instance is valid
+function isCacheInstanceValid () {
+ return ((isset($GLOBALS['cache_instance'])) && (is_object($GLOBALS['cache_instance'])));
+}
+
+// Copies a file from source to destination and verifies if that goes fine.
+// This function should wrap the copy() command and make a nicer debug backtrace
+// even if there is no xdebug extension installed.
+function copyFileVerified ($source, $dest, $chmod = '') {
+ // Failed is the default
+ $status = false;
+
+ // Is the source file there?
+ if (!isFileReadable($source)) {
+ // Then abort here
+ debug_report_bug('Cannot read from source file ' . basename($source) . '.');
+ } // END - if
+
+ // Is the target directory there?
+ if (!isDirectory(dirname($dest))) {
+ // Then abort here
+ debug_report_bug('Cannot find directory ' . str_replace(constant('PATH'), '', dirname($dest)) . '.');
+ } // END - if
+
+ // Now try to copy it
+ if (!copy($source, $dest)) {
+ // Something went wrong
+ debug_report_bug('copy() has failed to copy the file.');
+ } // END - if
+
+ // If there are chmod rights set, apply them
+ if (!empty($chmod)) {
+ // Try to apply them
+ $status = changeMode($dest, $chmod);
+ } else {
+ // All fine
+ $status = true;
+ }
+
+ // All fine
+ return $status;
+}
+
+// Wrapper function for header()
+// Send a header but checks before if we can do so
+function sendHeader ($header) {
+ // Is the header already sent?
+ if (headers_sent()) {
+ // Then abort here
+ debug_report_bug('Headers already sent!');
+ } // END - if
+
+ // Send the header
+ header($header);
+}
+
+// Wrapper function for chmod()
+// @TODO Do some more sanity check here
+function changeMode ($FQFN, $mode) {
+ // Is the file/directory there?
+ if ((!isFile($FQFN)) && (!isDirectory($FQFN))) {
+ // Neither, so abort here
+ debug_report_bug('Cannot chmod() on ' . basename($FQFN) . '.');
+ } // END - if
+
+ // Try to set them
+ chmod($FQFN, $mode);
+}
+
+// Wrapper for $_POST['sel']
+function countPostSelection () {
+ return countSelection(REQUEST_POST('sel'));
+}
+
+// [EOF]
+?>
$GLOBALS['output_mode'] = '0';
// Load config.php
-require('inc/config.php');
+require('inc/config-global.php');
// Is the script installed?
if (isInstalled()) {
}
// Template laden
- LOAD_TEMPLATE('index', false, addUrlData(''));
+ LOAD_TEMPLATE('index');
// Shall I insert an automated forward?
if (getConfig('index_delay') > 0) {
// This will be a JavaScript-redirect!
define('__DELAY_VALUE', (getConfig('index_delay') * 1000 + 500));
- define('__MOD_VALUE' , addUrlData('index'));
+ define('__MOD_VALUE' , 'index');
LOAD_TEMPLATE('index_forward');
} // END - if
} else {
$GLOBALS['module'] = 'install';
// Load config file
-require('inc/config.php');
+require('inc/config-global.php');
// Header
loadInclude('inc/header.php');
* MA 02110-1301 USA *
************************************************************************/
-// Deactivate caching system in fake-CSS mode
-define('_OB_CACHING', "old");
-
// Load security stuff here
require('inc/libs/security_functions.php');
$GLOBALS['module'] = 'js';
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
// Is this script installed and a JavaScript tag is provied?
-if ((isInstalled()) && (REQUEST_ISSET_GET(('tag')))) {
+if ((isInstalled()) && (REQUEST_ISSET_GET('tag'))) {
// Set header
- header('Content-type: text/javascript');
+ sendHeader('Content-type: text/javascript');
// Load header
loadIncludeOnce('inc/header.php');
// Prepare include file for looking
$INC = sprintf("inc/js/tag-%s.php",
- REQUEST_GET(('tag'))
+ REQUEST_GET('tag')
);
// Is that file readable?
$GLOBALS['output_mode'] = '0';
// Load config.php
-require('inc/config.php');
+require('inc/config-global.php');
// Is the script installed?
if (isInstalled()) {
$GLOBALS['output_mode'] = '0';
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
// Is the script installed?
if (isInstalled()) {
$GLOBALS['output_mode'] = -1;
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
if (isInstalled()) {
// Is the extension active?
- REDIRECT_ON_UNINSTALLED_EXTENSION('mailid');
+ redirectOnUninstalledExtension('mailid');
// Init
$url_uid = 0; $url_bid = 0; $url_mid = 0;
case 'BONUS':
// Is the bonus extension active?
- REDIRECT_ON_UNINSTALLED_EXTENSION('bonus');
+ redirectOnUninstalledExtension('bonus');
// Bonus-Mails
$result = SQL_QUERY_ESC("SELECT id, url, subject FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s LIMIT 1",
if (SQL_NUMROWS($result) == 1) {
// Load data
- list($pool, $URL, $EXTRA_TITLE) = SQL_FETCHROW($result);
+ list($pool, $URL, $title) = SQL_FETCHROW($result);
// Free result
SQL_FREERESULT($result);
// Compile extra title
- $EXTRA_TITLE = COMPILE_CODE($EXTRA_TITLE);
+ $title = COMPILE_CODE($title);
+
+ // Set it
+ setExtraTitle($title);
// Is the user's ID unlocked?
$result = SQL_QUERY_ESC("SELECT status, gender, surname, family FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
break;
case 'REJECT': // Redirect to rejection page
- LOAD_CONFIGURED_URL('reject_url');
+ redirectToConfiguredUrl('reject_url');
break;
default:
$GLOBALS['output_mode'] = 0;
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
if (isInstalled()) {
// Is the extension active
- REDIRECT_ON_UNINSTALLED_EXTENSION('mailid');
+ redirectOnUninstalledExtension('mailid');
// Secure all data
$url_uid = 0; $url_bid = 0; $url_mid = 0; $code = 0; $mode = '';
$GLOBALS['module'] = '';
// Needed include files
-require('inc/config.php');
+require('inc/config-global.php');
// Fix missing module to 'index'
if (!REQUEST_ISSET_GET('module')) REQUEST_SET_GET('module', 'index');
if (SQL_NUMROWS($result) == 1) {
// Load surname and family's name and build the username
list($s, $f) = SQL_FETCHROW($result);
- $username = $s.' '.$f;
+ $username = $s . ' ' . $f;
// Additionally admin?
if (IS_ADMIN()) {
$GLOBALS['output_mode'] = -1;
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
// Redirect only to registration page when this script is installed
if (isInstalled()) {
$GLOBALS['output_mode'] = 0;
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
// Is the 'bonus' extension active?
-REDIRECT_ON_UNINSTALLED_EXTENSION('bonus');
+redirectOnUninstalledExtension('bonus');
// List only rankings when script is installed
if (isInstalled()) {
$content = SQL_FETCHARRAY($result);
// Prepare constants for the pre-template
- define('__GENDER' , translateGender($content['gender']));
- define('__SNAME' , $content['surname']);
- define('__FNAME' , $content['family']);
- define('__RANK' , BIGINTVAL($content['level']));
- define('__POINTS' , translateComma($content['points']));
- define('__MAILID' , bigintval(REQUEST_GET('d')));
- define('__RANK_ROWS', BONUS_MAKE_RANK_ROWS(bigintval(REQUEST_GET('d')), $t, bigintval(REQUEST_GET('uid'))));
+ $content['gender'] = translateGender($content['gender']);
+ $content['points'] = translateComma($content['points']);
+ $content['mailid'] = bigintval(REQUEST_GET('d'));
+ $content['rows'] = BONUS_MAKE_RANK_ROWS(bigintval(REQUEST_GET('d')), $t, bigintval(REQUEST_GET('uid')));
// Constant created within previous function which contains informations for current user's ranking position:
// __YOUR_RANKING_LINE
// Load pre-template
- define('__BONUS_MSG', LOAD_TEMPLATE('show_bonus_msg', true));
+ $content['msg'] = LOAD_TEMPLATE('show_bonus_msg', true, $content);
} else {
// No data found
- define('__BONUS_MSG', "<span class=\"guest_failed\">{--BONUS_SHOW_NO_DATA--}</span>");
+ $content['msg'] = "<span class=\"guest_failed\">{--BONUS_SHOW_NO_DATA--}</span>";
}
// Free memory
SQL_FREERESULT($result);
} else {
// Wrong type entered
- define('__BONUS_MSG', "<span class=\"guest_failed\">{--BONUS_SHOW_WRONG_TYPE--}</span>");
+ $content['msg'] = "<span class=\"guest_failed\">{--BONUS_SHOW_WRONG_TYPE--}</span>";
}
} else {
// Wrong call!
- define('__BONUS_MSG', "<span class=\"guest_failed\">{--BONUS_SHOW_WRONG_CALL--}</span>");
+ $content['msg'] = "<span class=\"guest_failed\">{--BONUS_SHOW_WRONG_CALL--}</span>";
}
// Load send_bonus header template (for your banners, e.g.?)
- define('__BONUS_HEADER', LOAD_TEMPLATE('show_bonus_header', true));
+ $content['header'] = LOAD_TEMPLATE('show_bonus_header', true);
// Load show_bonus footer template (for your banners, e.g.?)
- define('__BONUS_FOOTER', LOAD_TEMPLATE('show_bonus_footer', true));
+ $content['footer'] = LOAD_TEMPLATE('show_bonus_footer', true);
// Total ranks who can win
- define('__BONUS_TOTAL_RANKS', getConfig('bonus_ranks'));
+ $content['total_ranks'] = getConfig('bonus_ranks');
// Load final template
- LOAD_TEMPLATE('show_bonus');
+ LOAD_TEMPLATE('show_bonus', false, $content);
// Include footer
loadInclude('inc/footer.php');
$GLOBALS['output_mode'] = '0';
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
// Is the script installed?
if (isInstalled()) {
$GLOBALS['output_mode'] = '0';
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
// Redirect only to registration page when this script is installed
if (isInstalled()) {
$msg = null;
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
// Is the script installed?
if (isInstalled()) {
// Only logged in users may use this surfbar!
- REDIRECT_ON_UNINSTALLED_EXTENSION('surfbar');
+ redirectOnUninstalledExtension('surfbar');
// No member?
if (!IS_MEMBER()) {
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed" width="500">
<tr>
<td colspan="3" align="center" class="admin_title bottom2" height="30">
- <strong>{--ADMIN_EDIT_BEG_SETTINGS--}</strong></td>
+ <strong>{--ADMIN_EDIT_BEG_SETTINGS--}</strong>
+ </td>
</tr>
<tr>
<td colspan="3" class="seperator" height="5"> </td>
</tr>
<tr>
<td align="right" width="200" height="20">
- {--ADMIN_BEG_POINTS--}:</td>
+ {--ADMIN_BEG_POINTS--}:
+ </td>
<td class="seperator" width="5"> </td>
- <td width="295" align="center"><input type="text"
- name="beg_points" class="admin_normal" size="7" maxlength="10"
- value="{!__BEG_POINTS!}"></td>
+ <td width="295" align="center">
+ <input type="text" name="beg_points" class="admin_normal" size="7" maxlength="10" value="$content[points]" />
+ </td>
</tr>
<tr>
<td colspan="3" class="seperator" height="5"> </td>
</tr>
<tr>
<td align="right" width="300" height="20">
- {--ADMIN_BEG_POINTS_MAX--}:</td>
+ {--ADMIN_BEG_POINTS_MAX--}:
+ </td>
<td class="seperator" width="5"> </td>
- <td width="195" align="center"><input type="text"
- name="beg_points_max" class="admin_normal" size="7" maxlength="10"
- value="{!__BEG_POINTS_MAX!}"></td>
+ <td width="195" align="center">
+ <input type="text" name="beg_points_max" class="admin_normal" size="7" maxlength="10" value="$content[points_max]" />
+ </td>
</tr>
<tr>
<td colspan="3" class="seperator" height="5"> </td>
<tr>
<td align="right" height="20">{--ADMIN_CONFIG_BEG_TIMEOUT--}:</td>
<td class="seperator" width="5"> </td>
- <td align="center">{!__BEG_TIMEOUT!}</td>
+ <td align="center">$content[timeout]</td>
</tr>
<tr>
<td colspan="3" class="seperator" height="5"> </td>
<td align="right" height="20">
{--ADMIN_CONFIG_BEG_UID_TIMEOUT--}:</td>
<td class="seperator" width="5"> </td>
- <td align="center">{!__BEG_UID_TIMEOUT!}</td>
+ <td align="center">$content[uid_timeout]</td>
</tr>
<tr>
<td colspan="3" class="seperator" height="5"> </td>
</tr>
<tr>
<td align="right" height="20">
- {--ADMIN_CONFIG_BEG_REMOTE_IP_TIMEOUT--}:</td>
+ {--ADMIN_CONFIG_BEG_REMOTE_IP_TIMEOUT--}:
+ </td>
<td class="seperator" width="5"> </td>
- <td align="center">{!__BEG_REMOTE_IP_TIMEOUT!}</td>
+ <td align="center">$content[ip_timeout]</td>
</tr>
<tr>
<td colspan="3" class="seperator" height="5"> </td>
<td align="right" height="20">{--ADMIN_BEG_USERID--}:</td>
<td class="seperator" width="5"> </td>
<td align="center">
- {!__MEMBER_SELECTION!}
+ $content[member_selection]
</td>
</tr>
<tr>
</tr>
<tr>
<td colspan="3" align="center" class="admin_title bottom2" height="30">
- <strong>{--ADMIN_SELECT_BEG_MODE--}:</strong></td>
+ <strong>{--ADMIN_SELECT_BEG_MODE--}:</strong>
+ </td>
</tr>
<tr>
<td colspan="3" class="seperator" height="5"> </td>
</tr>
<tr>
- <td align="right" height="20"><input type="radio" name="beg_mode"
- class="admin_normal" value="DIRECT"{!__BEG_MODE_DIRECT!}> {--BEG_MODE_DIRECT--}<br />
+ <td align="right" height="20">
+ <input type="radio" name="beg_mode" class="admin_normal" value="DIRECT"$content[mode_direct] /> {--BEG_MODE_DIRECT--}
</td>
<td class="seperator" width="5"> </td>
- <td align="center"><input type="radio" name="beg_mode"
- class="admin_normal" value="REF"{!__BEG_MODE_REF!}> {--BEG_MODE_REF--}
+ <td align="center">
+ <input type="radio" name="beg_mode" class="admin_normal" value="REF"$content[mode_ref] /> {--BEG_MODE_REF--}
</td>
</tr>
<tr>
</tr>
<tr>
<td colspan="3" align="center" class="admin_title bottom2" height="30">
- <strong>{--ADMIN_EDIT_BEG_RALLYE_SETTINGS--}</strong></td>
+ <strong>{--ADMIN_EDIT_BEG_RALLYE_SETTINGS--}</strong>
+ </td>
</tr>
<tr>
<td colspan="3" class="seperator" height="5"> </td>
<tr>
<td align="right" height="20">{--ADMIN_BEG_RALLYE_ACTIVE--}</td>
<td class="seperator" width="5"> </td>
- <td align="center"><input type="radio" name="beg_rallye"
- class="admin_normal" value="Y"{!__BEG_RALLYE_Y!} /> {--YES--}<br />
- <input type="radio" name="beg_rallye" class="admin_normal" value="N"{!__BEG_RALLYE_N!} /> {--NO--}
+ <td align="center">
+ <input type="radio" name="beg_rallye" class="admin_normal" value="Y"$content[rallye_yes] /> {--YES--}<br />
+ <input type="radio" name="beg_rallye" class="admin_normal" value="N"$content[rallye_no] /> {--NO--}
</td>
</tr>
<tr>
<tr>
<td align="right" height="20">{--ADMIN_BEG_INCLUDE_OWN--}</td>
<td class="seperator" width="5"> </td>
- <td align="center"><input type="radio" name="beg_include_own"
- class="admin_normal" value="Y"{!__BEG_INCLUDE_OWN_Y!} /> {--YES--}<br />
- <input type="radio" name="beg_include_own" class="admin_normal"
- value="N"{!__BEG_INCLUDE_OWN_N!} /> {--NO--}</td>
+ <td align="center">
+ <input type="radio" name="beg_include_own" class="admin_normal" value="Y"$content[include_own_yes] /> {--YES--}<br />
+ <input type="radio" name="beg_include_own" class="admin_normal" value="N"$content[include_own_no] /> {--NO--}
+ </td>
</tr>
<tr>
<td colspan="3" class="seperator" height="5"> </td>
<tr>
<td align="right" height="20">{--ADMIN_BEG_RANKS--}</td>
<td class="seperator" width="5"> </td>
- <td align="center"><input type="text" name="beg_ranks"
- class="admin_normal" size="3" maxlength="7" value="{!__BEG_RANKS!}" />
+ <td align="center">
+ <input type="text" name="beg_ranks" class="admin_normal" size="3" maxlength="7" value="$content[ranks]" />
</td>
</tr>
<tr>
{--ADMIN_BEG_RALLYE_ONLY_ACTIVE--}
</td>
<td class="seperator" width="5"> </td>
- <td align="center"><input type="radio" name="beg_active"
- class="admin_normal" value="Y"{!__BEG_ACTIVE_Y!} /> {--YES--}<br />
- <input type="radio" name="beg_active" class="admin_normal" value="N"{!__BEG_ACTIVE_N!} /> {--NO--}
+ <td align="center">
+ <input type="radio" name="beg_active" class="admin_normal" value="Y"$content[active_yes] /> {--YES--}<br />
+ <input type="radio" name="beg_active" class="admin_normal" value="N"$content[active_no] /> {--NO--}
</td>
</tr>
<tr>
<td class="seperator" width="5"> </td>
<td align="center">
<select name="beg_pay_mode" size="1">
- <option value="IMG"{!__BEG_PAY_MODE_IMG!}>{--ADMIN_BEG_PAY_MODE_IMG--}</option>
- <option value="JS"{!__BEG_PAY_MODE_JS!}>{--ADMIN_BEG_PAY_MODE_JS--}</option>
- <option value="BOTH"{!__BEG_PAY_MODE_BOTH!}>{--ADMIN_BEG_PAY_MODE_BOTH--}</option>
- <option value="NONE"{!__BEG_PAY_MODE_NONE!}>{--ADMIN_BEG_PAY_MODE_NONE--}</option>
+ <option value="IMG"$content[pay_mode_img]>{--ADMIN_BEG_PAY_MODE_IMG--}</option>
+ <option value="JS"$content[pay_mode_js]>{--ADMIN_BEG_PAY_MODE_JS--}</option>
+ <option value="BOTH"$content[pay_mode_both]>{--ADMIN_BEG_PAY_MODE_BOTH--}</option>
+ <option value="NONE"$content[pay_mode_none]>{--ADMIN_BEG_PAY_MODE_NONE--}</option>
</select>
</td>
</tr>
<tr>
<td align="right" height="20">{--ADMIN_BEG_RAL_EN_NOTIFY--}</td>
<td class="seperator" width="5"> </td>
- <td align="center"><input type="radio" name="beg_ral_en_notify"
- class="admin_normal" value="Y"{!__BEG_RAL_EN_NOTIFY_Y!} /> {--YES--}<br />
- <input type="radio" name="beg_ral_en_notify" class="admin_normal"
- value="N"{!__BEG_RAL_EN_NOTIFY_N!} /> {--NO--}</td>
+ <td align="center">
+ <input type="radio" name="beg_ral_en_notify" class="admin_normal" value="Y"$content[ral_enable_notify_yes] /> {--YES--}<br />
+ <input type="radio" name="beg_ral_en_notify" class="admin_normal" value="N"$content[ral_enable_notify_no] /> {--NO--}
+ </td>
</tr>
<tr>
<td colspan="3" class="seperator" height="5"> </td>
<tr>
<td align="right" height="20">{--ADMIN_BEG_RAL_DI_NOTIFY--}</td>
<td class="seperator" width="5"> </td>
- <td align="center"><input type="radio" name="beg_ral_di_notify"
- class="admin_normal" value="Y"{!__BEG_RAL_DI_NOTIFY_Y!} /> {--YES--}<br />
- <input type="radio" name="beg_ral_di_notify" class="admin_normal"
- value="N"{!__BEG_RAL_DI_NOTIFY_N!} /> {--NO--}</td>
+ <td align="center">
+ <input type="radio" name="beg_ral_di_notify" class="admin_normal" value="Y"$content[ral_disable_notify_yes] /> {--YES--}<br />
+ <input type="radio" name="beg_ral_di_notify" class="admin_normal" value="N"$content[ral_disable_notify_no] /> {--NO--}
+ </td>
</tr>
<tr>
<td colspan="3" class="seperator" height="5"> </td>
<tr>
<td align="right" height="20">{--ADMIN_BEG_NEW_MEMBER_NOTIFY--}</td>
<td class="seperator" width="5"> </td>
- <td align="center"><input type="radio" name="beg_new_mem_notify"
- class="admin_normal" value="Y"{!__BEG_NEW_MEMBER_NOTIFY_Y!} /> {--YES--}<br />
- <input type="radio" name="beg_new_mem_notify" class="admin_normal"
- value="N"{!__BEG_NEW_MEMBER_NOTIFY_N!} /> {--NO--}</td>
+ <td align="center">
+ <input type="radio" name="beg_new_mem_notify" class="admin_normal" value="Y"$content[new_member_notify_yes] /> {--YES--}<br />
+ <input type="radio" name="beg_new_mem_notify" class="admin_normal" value="N"$content[new_member_notify_no] /> {--NO--}
+ </td>
</tr>
<tr>
<td colspan="3" class="seperator" height="5"> </td>
<tr>
<td align="right" height="20">{--ADMIN_BEG_NOTIFY_BONUS--}</td>
<td class="seperator" width="5"> </td>
- <td align="center"><input type="text" name="beg_notify_bonus"
- class="admin_normal" size="3" maxlength="7"
- value="{!__BEG_NOTIFY_BONUS!}"></td>
+ <td align="center">
+ <input type="text" name="beg_notify_bonus" class="admin_normal" size="3" maxlength="7" value="$content[notify_bonus]" />
+ </td>
</tr>
<tr>
<td colspan="3" class="seperator" height="5"> </td>
<tr>
<td align="right" height="20">{--ADMIN_BEG_NOTIFY_WAIT--}</td>
<td class="seperator" width="5"> </td>
- <td align="center">{!__WAIT_SELECTION!}</td>
+ <td align="center">$content[wait_selection]</td>
</tr>
<tr>
<td colspan="3" class="bottom2 seperator" height="5"> </td>
</tr>
<tr>
- <td colspan="3" class="admin_footer"><input
- type="reset" class="admin_reset" value="{--CLEAR_FORM--}" />
- <input type="submit" name="ok" class="admin_submit"
- value="{--SAVE_SETTINGS--}" /></td>
+ <td colspan="3" class="admin_footer">
+ <input type="reset" class="admin_reset" value="{--CLEAR_FORM--}" />
+ <input type="submit" name="ok" class="admin_submit" value="{--SAVE_SETTINGS--}" />
+ </td>
</tr>
</table>
</form>
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<tr>
<td colspan="3" align="center" class="admin_title bottom2" height="30">
- <strong>{--ADMIN_CONFIG_BIRTHDAY_HEADER--}</strong></td>
+ <strong>{--ADMIN_CONFIG_BIRTHDAY_HEADER--}</strong>
+ </td>
</tr>
<tr>
<td colspan="3" class="seperator" height="5"> </td>
<td width="400" align="right">{--ADMIN_BIRTHDAY_POINTS--}:
<span class="admin_note">({--ADMIN_BIRTHDAY_POINTS_NOTE--})</span></td>
<td class="seperator" width="5"> </td>
- <td width="170"><input type="text" name="birthday_points"
- class="admin_normal" value="{!__POINTS_VALUE!}" size="4"
- maxlength="6"> <div class="tiny">({!POINTS!})</div></td>
+ <td width="170">
+ <input type="text" name="birthday_points" class="admin_normal" value="{!__POINTS_VALUE!}" size="4" maxlength="6" />
+ <div class="tiny">({!POINTS!})</div>
+ </td>
</tr>
<tr>
<td colspan="3" class="seperator bottom2" height="5"> </td>
<tr>
<td align="right" height="20">{--ADMIN_BIRTHDAY_ONLY_ACTIVE--}</td>
<td class="seperator" width="5"> </td>
- <td align="center"><input type="radio" name="birthday_active"
- class="admin_normal" value="Y"{!__BIRTHDAY_ACTIVE_Y!} /> {--YES--}<br />
- <input type="radio" name="birthday_active" class="admin_normal"
- value="N"{!__BIRTHDAY_ACTIVE_N!} /> {--NO--}</td>
+ <td align="center">
+ <input type="radio" name="birthday_active" class="admin_normal" value="Y"$content[active_yes] /> {--YES--}<br />
+ <input type="radio" name="birthday_active" class="admin_normal" value="N"$content[active_no] /> {--NO--}
+ </td>
</tr>
<tr>
<td colspan="3" class="bottom2 seperator" height="5"> </td>
</tr>
<tr>
<td colspan="3" align="center" class="admin_title bottom2" height="30">
- <strong>{--ADMIN_SELECT_BIRTHDAY_MODE--}:</strong></td>
+ <strong>{--ADMIN_SELECT_BIRTHDAY_MODE--}:</strong>
+ </td>
</tr>
<tr>
<td colspan="3" class="seperator" height="5"> </td>
</tr>
<tr>
- <td align="right" height="20"><input type="radio"
- name="birthday_mode" class="admin_normal" value="DIRECT"{!__BIRTHDAY_MODE_DIRECT!}> {--BIRTHDAY_MODE_DIRECT--}<br />
+ <td align="right" height="20">
+ <input type="radio" name="birthday_mode" class="admin_normal" value="DIRECT"$content[mode_direct] /> {--BIRTHDAY_MODE_DIRECT--}
</td>
<td class="seperator" width="5"> </td>
- <td align="center"><input type="radio" name="birthday_mode"
- class="admin_normal" value="REF"{!__BIRTHDAY_MODE_REF!}> {--BIRTHDAY_MODE_REF--}
+ <td align="center">
+ <input type="radio" name="birthday_mode" class="admin_normal" value="REF"$content[mode_ref] /> {--BIRTHDAY_MODE_REF--}
</td>
</tr>
<tr>
<td colspan="3" class="bottom2 seperator" height="5"> </td>
</tr>
<tr>
- <td colspan="3" class="admin_footer"><input
- type="reset" class="admin_reset" value="{--CLEAR_FORM--}" /> <input
- type="submit" name="ok" class="admin_submit"
- value="{--SAVE_SETTINGS--}" /></td>
+ <td colspan="3" class="admin_footer">
+ <input type="reset" class="admin_reset" value="{--CLEAR_FORM--}" />
+ <input type="submit" name="ok" class="admin_submit" value="{--SAVE_SETTINGS--}" />
+ </td>
</tr>
</table>
</form>
<td align="right" width="300" height="20">
{--ADMIN_BONUS_RALLYE_NOTIFY_WAIT--}:</td>
<td class="seperator" width="5"> </td>
- <td width="195" align="center">{!__WAIT_SELECTION!}</td>
+ <td width="195" align="center">$content[wait_selection]</td>
</tr>
<tr>
<td colspan="3" class="bottom2 seperator" height="5"> </td>
</tr>
<tr>
<td align="center" height="120" class="beg_msg bottom2">
- {!__BEG_MSG!}</td>
+ $content[msg]
+ </td>
</tr>
<tr>
<td align="center" height="30"><a
<table border="0" cellspacing="0" cellpadding="0" width="100%" style="height: 100%">
<tr>
- <td height="10%" align="center">{!__BIRTHDAY_HEADER!}</td>
+ <td height="10%" align="center">
+ $content[header]
+ </td>
</tr>
<tr>
- <td height="80%" align="center">{!__MSG!}</td>
+ <td height="80%" align="center">
+ $content[msg]
+ </td>
</tr>
<tr>
- <td height="10%" align="center">{!__BIRTHDAY_FOOTER!}</td>
+ <td height="10%" align="center">
+ $content[footer]
+ </td>
</tr>
</table>
-<div class="big">Herzlichen Glückwunsch zum Geburtstag!</div> <br />
+<div class="big">Herzlichen Glückwunsch zum Geburtstag!</div><br />
<br />
-Hallo {!__GENDER!} {!__SNAME!} {!__FNAME!}!<br />
+Hallo $content[gender] $content[surname] $content[family]!<br />
<br />
Wir das Team von <span class="nobr">{!MAIN_TITLE!}</span> wüschen Ihnen
alles Gute und Gesundheit zum Geburtstag. Als kleines Geschenk von uns haben wir
-Ihnen soeben <span class="nobr">{!__GIFT!} {!POINTS!}</span> Ihrem Account
+Ihnen soeben <span class="nobr">$content[points] {!POINTS!}</span> Ihrem Account
gutgeschrieben!
<div align="center">
<div class="footer_box">
-<div class="footer_lines">
- {!TITLE!} v{!FULL_VERSION!} R{!CURR_SVN_REVISION!}<br />
+<div class="footer_lines" style="float:left">
+ {!TITLE!}
+ v{!FULL_VERSION!} R{!CURR_SVN_REVISION!}<br />
{!COPY!}
</div>
-<div class="footer_lines">
+<div class="footer_lines" style="float:right">
This website's engine is free software which is released under the GNU
GPL either version 2 of the License.
</div>
--- /dev/null
+Diese Erweiterung bietet Ihnen die Möglichkeit an, Lead-Code von
+Sponsornetzwerken in die Mitgliederanmeldung einzubinden. Dazu müssen
+Sie derzeit den Lead-Code in das Template <u>lead_code.tpl</u> einbinden
+(mehrere Lead-Codes sind auch möglich!).<br />
+<br />
+Meistens müssen Sie irgentwelche eindeutigen Daten an den Lead-Code
+übergeben. Dies können z.B. doe User-Id und/oder die Email-Adresse
+sein. Beides wird von diesem Script derzeit auch unterstützt.<br />
+<br />
+Wenn Sie die User-Id übertragen möchten, so verwenden Sie die
+Template-Variable <u>lead_uid</u>, möchten Sie die Email-Adresse von der
+Anmeldung übertragen, verwenden Sie <u>lead_email</u>. Dazu ein
+Beispielcode:<br />
+<br />
+<img border="0" alt="Lead" width="1" height="1"
+ src="http://some-sponsor-network/lead-image.php?campaign=xxx&user_data=$content[lead_uid]_$content[lead_email]" />
+<br />
+Sollten Sie dazu noch Fragen haben, so kommen Sie doch einfach <a target="_blank"
+ href="http://forum.mxchange.org" title="Direkt-Link zum Support-Forum">in das
+Forum</a>. Mein Support-Team und ich beantworten Ihnen gerne Ihre Fragen dazu
+und helfen Ihnen bei Schwierigkeiten weiter.
<div align="center">
-<table border="0" cellspacing="0" cellpadding="0"
- class="beg_table dashed" width="500">
+<table border="0" cellspacing="0" cellpadding="0" class="beg_table dashed" width="500">
<tr>
<td width="10" rowspan="10" class="seperator"> </td>
<td height="5" class="seperator"> </td>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="center"><a target="_parent"
- href="{!URL!}/modules.php?module=index&what=welcome$content">
+ href="{!URL!}/modules.php?module=index&what=welcome">
<!-- <img src="{!THEME_URL!}/images/index_logo.jpg" alt="{!MAIN_TITLE!}" title="{!MAIN_TITLE!}" border="0"> //-->
<div class="big">{!MAIN_TITLE!}</div> </a></td>
</tr>
<tr>
<td align="center" height="26%"><div class="big">[ <a
target="_parent"
- href="{!URL!}/modules.php?module=index&what=welcome$content">Weiter...</a> ]</div>
+ href="{!URL!}/modules.php?module=index&what=welcome">Weiter...</a> ]</div>
</td>
</tr>
<tr>
-<table border="0" cellspacing="0" cellpadding="0"
- class="beg_table dashed" width="500">
+<table border="0" cellspacing="0" cellpadding="0" class="beg_table dashed" width="500">
<tr>
<td width="10" rowspan="9" class="seperator"> </td>
<td height="5" class="seperator"> </td>
-<table border="0" cellspacing="0" cellpadding="0" width="100%"
- style="height: 100%">
- <tr>
- <td height="10%" align="center">{!__BONUS_HEADER!}</td>
- </tr>
- <tr>
- <td height="80%" align="center">{!__BONUS_MSG!}</td>
- </tr>
- <tr>
- <td height="10%" align="center">{!__BONUS_FOOTER!}</td>
- </tr>
-</table>
\ No newline at end of file
+<table border="0" cellspacing="0" cellpadding="0" width="100%" style="height: 100%">
+<tr>
+ <td height="10%" align="center">
+ $content[header]
+ </td>
+</tr>
+<tr>
+ <td height="80%" align="center">
+ $content[msg]
+ </td>
+</tr>
+<tr>
+ <td height="10%" align="center">
+ $content[footer]
+ </td>
+</tr>
+</table>
-{--HELLO--} {!__GENDER!} {!__SNAME!} {!__FNAME!}!
+{--HELLO--} $content[gender] $content[surname] $content[family]!
<br />
<br />
{--BONUS_SHOW_HEADER_LINE_1--}
<strong>{!POINTS!}</strong>
{--BONUS_SHOW_HEADER_LINE_2--}
-<strong>{!__MAILID!}</strong>
+<strong>$content[mailid]</strong>
{--BONUS_SHOW_HEADER_LINE_3--}:
<br />
<br />
<td width="120" align="center" class="member_header bottom2"><strong>{!_UID!}:</strong></td>
<td width="100" align="center" class="member_header bottom2"><strong>{!POINTS!}:</strong></td>
</tr>
- {!__RANK_ROWS!}
+ $content[rows]
<tr>
<td colspan="3" class="member_footer" align="center"><div class="tiny member_note"> </div></td>
</tr>
<div>{!__YOUR_RANKING_LINE!}</div>
<div class="member_note">
- {--BONUS_SHOW_FOOTER_NOTE_1--}<br />
- {--BONUS_SHOW_FOOTER_NOTE_2--}
+ Wir wünschen allen Gewinnern viel Glück bei der monatlichen Aktiv-Rallye!<br />
+ Es können nur die ersten <u>$content[total_ranks]</u> die Aktiv-Rallye gewinnen. Der Rechtsweg ist ausgeschlossen.
</div>
$GLOBALS['output_mode'] = -1;
// Load the required file(s)
-require('inc/config.php');
+require('inc/config-global.php');
if (((REQUEST_ISSET_GET(('user'))) || (REQUEST_ISSET_GET(('reseller')))) && (REQUEST_ISSET_GET(('banner')))) {
// for later things... ;-)
array(bigintval(REQUEST_GET('banner'))), __FILE__, __LINE__);
$type = substr($url, -3);
- header ('Content-Type: image/' . $type);
+ sendHeader('Content-Type: image/' . $type);
redirectToUrl($url, false);
} else {
// Free memory