$date_time = MAKE_DATETIME(time(), "1");
// Base directory
- $BASE = sprintf("%stemplates/%s/html/", constant('PATH'), GET_LANGUAGE());
- $MODE = '';
+ $basePath = sprintf("%stemplates/%s/html/", constant('PATH'), GET_LANGUAGE());
+ $mode = '';
// Check for admin/guest/member templates
if (strpos($template, "admin_") > -1) {
// Admin template found
- $MODE = "admin/";
+ $mode = "admin/";
} elseif (strpos($template, "guest_") > -1) {
// Guest template found
- $MODE = "guest/";
+ $mode = "guest/";
} elseif (strpos($template, "member_") > -1) {
// Member template found
- $MODE = "member/";
+ $mode = "member/";
} elseif (strpos($template, "install_") > -1) {
// Installation template found
- $MODE = "install/";
+ $mode = "install/";
} elseif (strpos($template, "ext_") > -1) {
// Extension template found
- $MODE = "ext/";
+ $mode = "ext/";
} elseif (strpos($template, "la_") > -1) {
// "Logical-area" template found
- $MODE = "la/";
+ $mode = "la/";
} else {
// Test for extension
$test = substr($template, 0, strpos($template, "_"));
if (EXT_IS_ACTIVE($test)) {
// Set extra path to extension's name
- $MODE = $test."/";
+ $mode = $test."/";
}
}
////////////////////////
// Generate file name //
////////////////////////
- $FQFN = $BASE.$MODE.$template.".tpl";
+ $FQFN = $basePath.$mode.$template.".tpl";
- if ((!empty($GLOBALS['what'])) && ((strpos($template, "_header") > 0) || (strpos($template, "_footer") > 0)) && (($MODE == "guest/") || ($MODE == "member/") || ($MODE == "admin/"))) {
+ if ((!empty($GLOBALS['what'])) && ((strpos($template, "_header") > 0) || (strpos($template, "_footer") > 0)) && (($mode == "guest/") || ($mode == "member/") || ($mode == "admin/"))) {
// Select what depended header/footer template file for admin/guest/member area
$file2 = sprintf("%s%s%s_%s.tpl",
- $BASE,
- $MODE,
+ $basePath,
+ $mode,
$template,
SQL_ESCAPE($GLOBALS['what'])
);
// Does the special template exists?
if (!FILE_READABLE($FQFN)) {
// Reset to default template
- $FQFN = $BASE.$template.".tpl";
+ $FQFN = $basePath.$template.".tpl";
} // END - if
// Now does the final template exists?
$DATA['email'] = $email;
// Base directory
- $BASE = sprintf("%stemplates/%s/emails/", constant('PATH'), GET_LANGUAGE());
+ $basePath = sprintf("%stemplates/%s/emails/", constant('PATH'), GET_LANGUAGE());
// Check for admin/guest/member templates
if (strpos($template, "admin_") > -1) {
// Admin template found
- $FQFN = $BASE."admin/".$template.".tpl";
+ $FQFN = $basePath."admin/".$template.".tpl";
} elseif (strpos($template, "guest_") > -1) {
// Guest template found
- $FQFN = $BASE."guest/".$template.".tpl";
+ $FQFN = $basePath."guest/".$template.".tpl";
} elseif (strpos($template, "member_") > -1) {
// Member template found
- $FQFN = $BASE."member/".$template.".tpl";
+ $FQFN = $basePath."member/".$template.".tpl";
} else {
// Test for extension
$test = substr($template, 0, strpos($template, "_"));
if (EXT_IS_ACTIVE($test)) {
// Set extra path to extension's name
- $FQFN = $BASE.$test."/".$template.".tpl";
+ $FQFN = $basePath.$test."/".$template.".tpl";
} else {
// No special filename
- $FQFN = $BASE.$template.".tpl";
+ $FQFN = $basePath.$template.".tpl";
}
}
// Does the special template exists?
if (!FILE_READABLE($FQFN)) {
// Reset to default template
- $FQFN = $BASE.$template.".tpl";
+ $FQFN = $basePath.$template.".tpl";
} // END - if
// Now does the final template exists?
if ((getConfig('enable_mod_title') == 'Y') || ((empty($GLOBALS['what'])) && (empty($GLOBALS['action']))) || ($GLOBALS['module'] == 'admin')) $TITLE .= " ".trim(getConfig('title_middle'))." ".ADD_MODULE_TITLE($GLOBALS['module']);
// Add title from what file
- $MODE = '';
- if ($GLOBALS['module'] == "login") $MODE = 'member';
- elseif ($GLOBALS['module'] == 'index') $MODE = 'guest';
- if ((!empty($MODE)) && (getConfig('enable_what_title') == 'Y')) $TITLE .= " ".trim(getConfig('title_middle'))." ".GET_MOD_DESCR($MODE, $GLOBALS['what']);
+ $mode = '';
+ if ($GLOBALS['module'] == "login") $mode = 'member';
+ elseif ($GLOBALS['module'] == 'index') $mode = 'guest';
+ if ((!empty($mode)) && (getConfig('enable_what_title') == 'Y')) $TITLE .= " ".trim(getConfig('title_middle'))." ".GET_MOD_DESCR($mode, $GLOBALS['what']);
// Add title decorations? (right)
if ((getConfig('enable_title_deco') == 'Y') && (getConfig('title_right') != "")) $TITLE .= " ".trim(getConfig('title_right'));
array($type, $data, $rank), __FUNCTION__, __LINE__);
// Nothing found by default
- $userid = "---"; $points = "---";
+ $userid = '---'; $points = '---';
// Are you one of them?
if (SQL_NUMROWS($result_users) == 1) {
return $OUT;
}
//
-function BONUS_POINTS_HANDLER ($MODE) {
+function BONUS_POINTS_HANDLER ($mode) {
// Shall we add bonus points?
if (getConfig('bonus_active') != 'Y') return;
UPDATE_CONFIG('bonus_mode', "JACKPOT");
} // END - if
- if ($MODE == "login_bonus") {
+ if ($mode == "login_bonus") {
// Login bonus detected
$points = getConfig('login_bonus');
} else {
// Direct points supplied
- $points = $MODE;
+ $points = $mode;
}
// Subtract points from...
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');
}
// Rewrite userid/refid only if admin is in
if (IS_ADMIN()) {
// Set links to admin area
- if ($content['userid'] > 0) { $content['userid'] = ADMIN_USER_PROFILE_LINK($content['userid']); } else { $content['userid'] = "---"; }
- if ($content['refid'] > 0) { $content['refid'] = ADMIN_USER_PROFILE_LINK($content['refid']); } else { $content['refid'] = "---"; }
+ if ($content['userid'] > 0) { $content['userid'] = ADMIN_USER_PROFILE_LINK($content['userid']); } else { $content['userid'] = '---'; }
+ if ($content['refid'] > 0) { $content['refid'] = ADMIN_USER_PROFILE_LINK($content['refid']); } else { $content['refid'] = '---'; }
} // END - if
// Prepare data for the row template
);
// Load template and switch color
- $OUT .= LOAD_TEMPLATE($MODE."_doubler_list_rows", true, $content);
+ $OUT .= LOAD_TEMPLATE($mode."_doubler_list_rows", true, $content);
$SW = 3 - $SW;
}
}
// Return template
- return LOAD_TEMPLATE($MODE."_doubler_list", true, $OUT);
+ return LOAD_TEMPLATE($mode."_doubler_list", true, $OUT);
}
//
}
//
-function SEND_NEWSLETTER ($to, $subject, $message, $MODE) {
+function SEND_NEWSLETTER ($to, $subject, $message, $mode) {
// Send mail away as HTML
if (REQUEST_POST('auto_urls') == 'Y') {
// Automatically insert URLs into newsletter
- if ((EXT_IS_ACTIVE('html_mail')) && ($MODE == 'html')) {
+ if ((EXT_IS_ACTIVE('html_mail')) && ($mode == 'html')) {
// Send HTML mail
SEND_EMAIL($to, $subject, HTML_INSERT_URLS($message), "Y");
} else {
}
} else {
// Regular send-out
- if ((EXT_IS_ACTIVE('html_mail')) && ($MODE == 'html')) {
+ if ((EXT_IS_ACTIVE('html_mail')) && ($mode == 'html')) {
SEND_EMAIL($to, $subject, $message, "Y");
} else {
SEND_EMAIL($to, $subject, $message, "N");
switch($mode) {
case 'email': $mode = "\n"; break;
case 'html' : $mode = "<br />\n"; break;
- }
+ } // END - switch
// Load prices
$result_prices = SQL_QUERY("SELECT price_level, points, info FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id='".$rallye."' ORDER BY price_level", __FUNCTION__, __LINE__);
if (empty($refpoints)) $refpoints = 0;
// Init userid for list
- $_uid = "---";
+ $_uid = '---';
// List only users with at least one ref!
//* DEBUG: */ echo "*".$cnt."/".$content['userid']."/".$content['curr_points']."/".$refpoints."*<br />\n";
if (($cnt > 0) && ($refpoints > $content['curr_points'])) { $_uid = $content['userid']; } else { $cnt = ''; }
$DATA['uid'][] = $_uid;
$DATA['ref'][] = $cnt;
$DATA['cpoints'][] = $content['curr_points'];
- }
+ } // END - while
// Free memory
SQL_FREERESULT($result);
// Sort whole array
- array_pk_sort($DATA, array("ref", "cpoints"), 0, 1, true);
+ array_pk_sort($DATA, array('ref', 'cpoints'), 0, 1, true);
// Generate table
$OUT = LOAD_TEMPLATE("guest_rallye_header", true);
$SW = 2;
- for ($idx = 0; $idx < $prices; $idx++)
- {
- if (empty($DATA['uid'][$idx])) $DATA['uid'][$idx] = "---";
- if (empty($DATA['ref'][$idx])) $DATA['ref'][$idx] = "---";
+ for ($idx = 0; $idx < $prices; $idx++) {
+ if (empty($DATA['uid'][$idx])) $DATA['uid'][$idx] = '---';
+ if (empty($DATA['ref'][$idx])) $DATA['ref'][$idx] = '---';
// Add row
$OUT .= "<tr>
<td class=\"switch_sw".$SW." bottom2\"> ".($idx+1).".</td>
$OUT .= "</td>
</tr>\n";
$SW = 3 - $SW;
- }
+ } // END - for
+
// Add footer
$OUT .= LOAD_TEMPLATE("guest_rallye_footer", true);
// Add userid and his ref count to table
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_rallye_users` (rallye_id, userid, refs)
VALUES ('%s','%s','0')",
- array(bigintval($id), bigintval($uid)), __FUNCTION__, __LINE__);
- } else {
- // Free memory
- SQL_FREERESULT($result);
- }
+ array(bigintval($id), bigintval($uid)), __FUNCTION__, __LINE__);
+ } // END - if
+
+ // Free memory
+ SQL_FREERESULT($result);
if ($notify == 'Y') {
// Transfer all neccessary data to the global $DATA array
$users['uid'][] = $content['userid'];
$users['ref'][] = abs($cnt - $content['refs']);
$users['cpoints'][] = $refpoints - $content['curr_points'];
- }
+ } // END - while
// Free memory
SQL_FREERESULT($result_user);
// We only need to check one element in $users, see above while() block
if (isset($users['uid'][$k])) {
$prices['uid'][$k] = $users['uid'][$k];
- if (empty($prices['uid'][$k])) $prices['uid'][$k] = "---";
+ if (empty($prices['uid'][$k])) $prices['uid'][$k] = '---';
$prices['ref'][$k] = $users['ref'][$k];
- if (empty($prices['ref'][$k])) $prices['ref'][$k] = "---";
+ if (empty($prices['ref'][$k])) $prices['ref'][$k] = '---';
$prices['cpoints'][$k] = $users['cpoints'][$k];
} // END - if
} // END - foreach
function RALLYE_LIST_WINNERS ($rallye, $default=0) {
// First check how many prices are set
$result_prices = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level",
- array(bigintval($rallye)), __FUNCTION__, __LINE__);
+ array(bigintval($rallye)), __FUNCTION__, __LINE__);
$prices = SQL_NUMROWS($result_prices);
SQL_FREERESULT($result_prices);
// active = 1: account is still confirmed
// active = 0: account is deleted or locked
$result_active = SQL_QUERY_ESC("SELECT COUNT(userid) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND `status`='CONFIRMED' LIMIT 1",
- array(bigintval($DATA['uid'][$idx])), __FUNCTION__, __LINE__);
+ array(bigintval($DATA['uid'][$idx])), __FUNCTION__, __LINE__);
list($active) = SQL_FETCHROW($result_active);
SQL_FREERESULT($result_active);
- if (empty($DATA['uid'][$idx])) $DATA['uid'][$idx] = "---";
+ if (empty($DATA['uid'][$idx])) $DATA['uid'][$idx] = '---';
if ((empty($DATA['ref'][$idx])) || ($DATA['ref'][$idx] == 0) || ($active == 0) || ("".round($DATA['cpoints'][$idx])."" == "0") || (empty($DATA['cpoints'][$idx]))) {
// Allow valid and active users with at least one ref to get points
- $DATA['ref'][$idx] = "---";
- $DATA['uid'][$idx] = "---";
- }
+ $DATA['ref'][$idx] = '---';
+ $DATA['uid'][$idx] = '---';
+ } // END - if
if (!empty($DATA['info'][$idx])) {
// Take direct infos
$OUT .= "</td>
</tr>\n";
$SW = 3 - $SW;
- }
+ } // END - for
// Add footer
$OUT .= LOAD_TEMPLATE("guest_rallye_expired_footer", true);
function RALLYE_TEMPLATE_SELECTION ($name="template", $default="") {
// Check templates directory
$OUT = ''; $ral = array();
- $BASE = sprintf("%stemplates/%s/html/rallye/", constant('PATH'), GET_LANGUAGE());
- $dir = opendir($BASE);
+ $basePath = sprintf("%stemplates/%s/html/rallye/", constant('PATH'), GET_LANGUAGE());
+ $dir = opendir($basePath) or mxchange_die(sprintf("Cannot open dir %s.", $basePath));
while ($read = readdir($dir)) {
// If it is no dir (so a file)
- if (!isDirectory($BASE.$read)) {
+ if (!isDirectory($basePath.$read)) {
// Accept only templates matching with rallye_????.tpl.xx
- if (eregi("^rallye_.*\.tpl", $read))
- {
+ if (eregi("^rallye_.*\.tpl", $read)) {
$read = substr($read, 7, strpos($read, ".") - 7);
// Accept only template names between 1 and 255 chars length
if ((strlen($read) < 256) && (!empty($read))) $ral[] = $read;
- }
- }
- }
+ } // END - if
+ } // END - if
+ } // END - while
closedir($dir);
// Do we have found templates which we can link with the new rallye?
$OUT = "<select name=\"".$name."\" size=\"1\" class=\"admin_select\">
<option value=\"\">{--SELECT_NONE--}</option>\n";
foreach ($ral as $rallye) {
- $OUT .= " <option value=\"".$rallye."\"";
+ $OUT .= " <option value=\"".$rallye."\"";
if ($default == $rallye) $OUT .= ' selected="selected"';
$OUT .= ">".$rallye."</option>\n";
- }
+ } // END - foreach
$OUT .= "</select>\n";
} else {
// No rallye templates found
// Not interesting here...
break;
}
- }
+ } // END - foreach
// Abort also here!
if ($cnt > 0) break;
- }
- }
+ } // END - if
+ } // END - foreach
+
//* DEBUG: */ echo "<pre>";
//* DEBUG: */ print_r($GLOBALS['cache_array']['refsystem']);
//* DEBUG: */ echo "</pre>";
}
//
-function REGISTER_ADD_CATEGORY_TABLE ($MODE, $return=false) {
+function REGISTER_ADD_CATEGORY_TABLE ($mode, $return=false) {
$OUT = '';
// Guests are mostly not interested in how many members has
// Is the lock reason empty?
if (empty($urlData['lock_reason'])) {
// Fix it to three dashes
- $urlData['lock_reason'] = "---";
+ $urlData['lock_reason'] = '---';
} // END - if
// Include fields only for action 'edit'
$code = SURFBAR_GENERATE_VALIDATION_CODE($urlId, $salt);
// Return result of checking hashes and salts
- //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "---".$code."|".$check."---", false);
+ //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, '---'.$code."|".$check.'---', false);
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "+++".$salt."|".SURFBAR_GET_DATA('last_salt')."+++", false);
return (($code == $check) && ($salt == SURFBAR_GET_DATA('last_salt')));
}
// Create timemark from saved month
$mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', time()));
-$sql = ''; $MODE = '';
+$sql = ''; $mode = '';
// Shall I sent activation or deactivation mail?
$sql = "SELECT userid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE (beg_ral_notify ";
{
// Okay, let's check for member accounts
$sql .= "= 0 OR (beg_ral_notify > 0 AND beg_ral_en_notify < beg_ral_di_notify)";
- $MODE = "en";
+ $mode = "en";
}
else
{
{
// Okay, let's check for member accounts
$sql .= " > 0 AND beg_ral_di_notify < beg_ral_en_notify";
- $MODE = "di";
+ $mode = "di";
}
else
{
$result_main = SQL_QUERY($sql, __FILE__, __LINE__);
if (SQL_NUMROWS($result_main) > 0) {
// Normal notification mails or bonus mails?
- $sentBonusMails = ((getConfig('beg_notify_bonus') > 0) && ($MODE == "en") && (EXT_IS_ACTIVE('bonus')));
+ $sentBonusMails = ((getConfig('beg_notify_bonus') > 0) && ($mode == "en") && (EXT_IS_ACTIVE('bonus')));
// Generate subject line
- $subject = constant('BEG_RALLYE_'.strtoupper($MODE).'_NOTIFY');
+ $subject = constant('BEG_RALLYE_'.strtoupper($mode).'_NOTIFY');
// Load message body for bonus mails
$message = LOAD_EMAIL_TEMPLATE("beg_en_notify_body", '', "{PER}uid{PER}");
SET beg_ral_notify='%s', beg_ral_%s_notify='%s'
WHERE userid=%s
LIMIT 1",
- array(time(), $MODE, time(), $content['userid']), __FILE__, __LINE__);
+ array(time(), $mode, time(), $content['userid']), __FILE__, __LINE__);
// Load email template and send it to the user!
if ($sentBonusMails === true) {
$UIDs[] = $content['userid'];
} else {
// Send normal notification mail to the members
- $message = LOAD_EMAIL_TEMPLATE('beg_' . $MODE . '_notify', array(), $content['userid']);
+ $message = LOAD_EMAIL_TEMPLATE('beg_' . $mode . '_notify', array(), $content['userid']);
SEND_EMAIL($content['email'], $subject, $message);
}
} // END - while
// Create timemark from saved month
$mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', time()));
-$sql = ''; $MODE = '';
+$sql = ''; $mode = '';
// Shall I sent activation or deactivation mail?
$sql = "SELECT userid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE (bonus_ral_notify ";
if (getConfig('bonus_en_notify') == 'Y') {
// Okay, let's check for member accounts
$sql .= "= 0 OR (bonus_ral_notify > 0 AND bonus_ral_en_notify < bonus_ral_di_notify)";
- $MODE = "en";
+ $mode = "en";
} else {
// Do not notify!
$sql = '';
if (getConfig('bonus_di_notify') == 'Y') {
// Okay, let's check for member accounts
$sql .= " > 0 AND bonus_ral_di_notify < bonus_ral_en_notify";
- $MODE = "di";
+ $mode = "di";
} else {
// Do not notify!
$sql = '';
$sql .= ") AND `status`='CONFIRMED' ORDER BY last_online ASC";
// Normal notification mails or bonus mails?
- $sentBonusMails = ((getConfig('bonus_notify_points') > 0) && ($MODE == "en") && (EXT_IS_ACTIVE('bonus')));
+ $sentBonusMails = ((getConfig('bonus_notify_points') > 0) && ($mode == "en") && (EXT_IS_ACTIVE('bonus')));
// Generate subject line
- $subject = constant('BONUS_RALLYE_'.strtoupper($MODE).'_NOTIFY');
+ $subject = constant('BONUS_RALLYE_'.strtoupper($mode).'_NOTIFY');
// Load message body for bonus mails
$message = LOAD_EMAIL_TEMPLATE('bonus_en_notify_body', '', '{PER}uid{PER}');
SET bonus_ral_notify='%s', bonus_ral_%s_notify='%s'
WHERE userid=%s
LIMIT 1",
- array(time(), $MODE, time(), $content['userid']), __FILE__, __LINE__);
+ array(time(), $mode, time(), $content['userid']), __FILE__, __LINE__);
// Load email template and send it to the user!
if ($sentBonusMails === true) {
$UIDs[] = $content['userid'];
} else {
// Send normal notification mail to the members
- $message = LOAD_EMAIL_TEMPLATE('bonus_' . $MODE . '_notify', array(), $content['userid']);
+ $message = LOAD_EMAIL_TEMPLATE('bonus_' . $mode . '_notify', array(), $content['userid']);
SEND_EMAIL($content['email'], $subject, $message);
}
} // END - while
}
// Create a menu selection box for given menu system
-function ADMIN_MENU_SELECTION ($MODE, $default="", $defid="") {
+function ADMIN_MENU_SELECTION ($mode, $default="", $defid="") {
$wht = "`what` != ''";
- if ($MODE == "action") $wht = "(`what`='' OR `what` IS NULL) AND action !='login'";
+ if ($mode == "action") $wht = "(`what`='' OR `what` IS NULL) AND action !='login'";
$result = SQL_QUERY_ESC("SELECT %s, title FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE ".$wht." ORDER BY `sort`",
- array($MODE), __FUNCTION__, __LINE__);
+ array($mode), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Load menu as selection
- $OUT = "<select name=\"".$MODE."_menu";
+ $OUT = "<select name=\"".$mode."_menu";
if ((!empty($defid)) || ($defid == "0")) $OUT .= "[".$defid."]";
$OUT .= "\" size=\"1\" class=\"admin_select\">
<option value=\"\">{--SELECT_NONE--}</option>\n";
// Check "logical-area-mode"
function ADMIN_CHECK_MENU_MODE () {
// Set the global mode as the mode for all admins
- $MODE = getConfig('admin_menu');
- $ADMIN = $MODE;
+ $mode = getConfig('admin_menu');
+ $ADMIN = $mode;
// Get admin id
$aid = GET_CURRENT_ADMIN_ID();
}
// Check what the admin wants and set it when it's not the global mode
- if ($ADMIN != "global") $MODE = $ADMIN;
+ if ($ADMIN != "global") $mode = $ADMIN;
// Return admin-menu's mode
- return $MODE;
+ return $mode;
}
// Change activation status
$OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result_tasks)) {
// Init infos
- $content['infos'] = "---";
+ $content['infos'] = '---';
// Generate assign link
$content['assigned_admin'] = GENERATE_AID_LINK($content['assigned_admin']);
SQL_FREERESULT($result);
// Prepare variables
- if (empty($act)) $act = "---";
- if (empty($wht)) $wht = "---";
+ if (empty($act)) $act = '---';
+ if (empty($wht)) $wht = '---';
// Get admin mode
$mode = constant('ADMINS_'.strtoupper($mode).'_MODE');
$OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result_acls)) {
// Prepare variables
- if (empty($content['action_menu'])) $content['action_menu'] = "---";
- if (empty($content['what_menu'])) $content['what_menu'] = "---";
+ if (empty($content['action_menu'])) $content['action_menu'] = '---';
+ if (empty($content['what_menu'])) $content['what_menu'] = '---';
// Get mode
$content['access_mode'] = constant('ADMINS_'.strtoupper($content['access_mode']).'_MODE');
list($rallye, $level, $points, $infos) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- if (empty($infos)) $infos = "---";
+ if (empty($infos)) $infos = '---';
// Prepare data for the row template
$content = array(
$OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result)) {
// Fix empty info
- if (empty($content['info'])) $content['info'] = "---";
+ if (empty($content['info'])) $content['info'] = '---';
// Prepare data for the row template
// @TODO Rewritings: level->price_level, infos->info in template
$OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result)) {
// Set title to three dashes when no title is supplied
- if (empty($content['title'])) $content['title'] = "---";
+ if (empty($content['title'])) $content['title'] = '---';
// Already registered module?
if (ereg($content['module'], getConfig('rewrite_skip'))) {
}
// Output row
- $cssSelection = "---";
+ $cssSelection = '---';
if (GET_EXT_VERSION('sql_patches') >= '0.0.6') $cssSelection = ADD_SELECTION('yn', $css, "css", $ext_id);
// Prepare data for the row template
$OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result)) {
// Prepare CSS selection output
- $cssSelection = "---";
+ $cssSelection = '---';
if (GET_EXT_VERSION('sql_patches') >= '0.0.6') $cssSelection = TRANSLATE_YESNO($content['ext_css']);
// Prepare data for the row template
$OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result)) {
// Add three dashes to comment when it is empty
- if (empty($content['comments'])) $content['comments'] = "---";
+ if (empty($content['comments'])) $content['comments'] = '---';
// Prepare data for the row template
$content = array(
$content['target_bank'] = "<a href=\"".FRAMETESTER($content['url'])."\" target=\"_blank\">{--CLICK_HERE--}</a>";
} else {
// e-currency payout request
- if (empty($content['target_account'])) $content['target_account'] = "---";
- if (empty($content['target_bank'])) $content['target_bank'] = "---";
+ if (empty($content['target_account'])) $content['target_account'] = '---';
+ if (empty($content['target_bank'])) $content['target_bank'] = '---';
}
// Remember data in array for the template
$content['primera_type'] = PRIMERA_TRANSFER_STATUS($content['primera_type']);
// Fix empty message and status
- if (empty($content['primera_api_message'])) $content['primera_api_message'] = "---";
+ if (empty($content['primera_api_message'])) $content['primera_api_message'] = '---';
if (empty($content['primera_api_status'])) $content['primera_api_status'] = "OK";
// Append it and switch colors
// Alter some variables
if (empty($content['alogin'])) $content['alogin'] = "???";
- if (empty($content['template'])) $content['template'] = "---";
- if (empty($content['descr'])) $content['descr'] = "---";
+ if (empty($content['template'])) $content['template'] = '---';
+ if (empty($content['descr'])) $content['descr'] = '---';
// Transfer data into array for the template
// @TODO Rewritings: aid->admin_id in template
// Check if an entry is empty
foreach ($DATA as $k => $v) {
- if (empty($v)) $DATA[$k] = "---";
+ if (empty($v)) $DATA[$k] = '---';
}
// Check for sponsor's orders (only count)
$content['status'] = SURFBAR_TRANSLATE_STATUS($content['status']);
$content['registered'] = MAKE_DATETIME($content['registered'], 2);
$content['last_locked'] = MAKE_DATETIME($content['last_locked'], 2);
- if (empty($content['lock_reason'])) $content['lock_reason'] = "---";
+ if (empty($content['lock_reason'])) $content['lock_reason'] = '---';
// Load row template
$OUT .= LOAD_TEMPLATE("admin_list_surfbar_urls_row", true, $content);
$OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result_tasks)) {
// Init infos
- $content['infos'] = "---";
+ $content['infos'] = '---';
// Generate link
$content['assigned_admin'] = GENERATE_AID_LINK($content['assigned_admin']);
if (!REQUEST_ISSET_GET('page')) { REQUEST_SET_GET('page' , "1"); }
// Set base URL
-$BASE = "[<a href=\"{!URL!}/modules.php?module=admin";
+$base = "[<a href=\"{!URL!}/modules.php?module=admin";
if (REQUEST_ISSET_GET('uid')) {
// Secure the user ID
$LINKS = GET_TOTAL_DATA($uid, "user_links", "id", 'userid', true);
// Add links to the numbers
- if ($LINKS > 0) $LINKS = $BASE."&what=list_links&uid=".$uid."\">".$LINKS."</a>]";
- if ($DATA['refid'] > 0) $DATA['refid'] = $BASE."&what=list_user&uid=".$DATA['refid']."\">".$DATA['refid']."</a>]";
- if (empty($DATA['last_module'])) $DATA['last_module'] = "---";
- if ($REFS > 0) $REFS = $BASE."&what=list_refs&uid=".$uid."\">".$REFS."</a>]";
- if ($CATS > 0) $CATS = $BASE."&what=list_cats&uid=".$uid."\">".$CATS."</a>]";
+ if ($LINKS > 0) $LINKS = $base."&what=list_links&uid=".$uid."\">".$LINKS."</a>]";
+ if ($DATA['refid'] > 0) $DATA['refid'] = $base."&what=list_user&uid=".$DATA['refid']."\">".$DATA['refid']."</a>]";
+ if (empty($DATA['last_module'])) $DATA['last_module'] = '---';
+ if ($REFS > 0) $REFS = $base."&what=list_refs&uid=".$uid."\">".$REFS."</a>]";
+ if ($CATS > 0) $CATS = $base."&what=list_cats&uid=".$uid."\">".$CATS."</a>]";
// Calculate timestamp for birthday
$stamp = mktime(0, 0, 0, $DATA['birth_month'], $DATA['birth_day'], $DATA['birth_year']);
$DATA['status'] = TRANSLATE_STATUS($DATA['status']);
$DATA['last_online'] = MAKE_DATETIME($DATA['last_online'], "0");
$DATA['used_points'] = TRANSLATE_COMMA($DATA['used_points']);
- if ($DATA['emails_sent'] > 0) $DATA['emails_sent'] = $BASE."&what=email_details&uid=".$uid."\">".TRANSLATE_COMMA($DATA['emails_sent'])."</a>]";
+ if ($DATA['emails_sent'] > 0) $DATA['emails_sent'] = $base."&what=email_details&uid=".$uid."\">".TRANSLATE_COMMA($DATA['emails_sent'])."</a>]";
$DATA['joined'] = MAKE_DATETIME($DATA['joined'], "0");
$DATA['last_update'] = MAKE_DATETIME($DATA['last_update'], "0");
$DATA['last_profile_sent'] = MAKE_DATETIME($DATA['last_profile_sent'], "0");
$DATA['lock_timestamp'] = MAKE_DATETIME($DATA['lock_timestamp'], "2");
// Is the lock reason not set?
- if (!isset($DATA['lock_reason'])) $DATA['lock_reason'] = "---";
+ if (!isset($DATA['lock_reason'])) $DATA['lock_reason'] = '---';
// Nickname inclusion?
// @TODO Rewrite these to filters
if (EXT_IS_ACTIVE('nickname')) {
// Nickname not set or invalid? Then
- if ((empty($DATA['nickname'])) || ($DATA['nickname'] == $uid)) $DATA['nickname'] = "---";
+ if ((empty($DATA['nickname'])) || ($DATA['nickname'] == $uid)) $DATA['nickname'] = '---';
} else {
// Extension not found
$DATA['nickname'] = getMessage('EXT_NICKNAME_404');
// Get number of unconfirmed mails
$LINKS = GET_TOTAL_DATA($content['userid'], "user_links", "id", 'userid', true);
- if ($LINKS > 0) $LINKS = $BASE."&what=list_links&uid=".$content['userid']."\">".TRANSLATE_COMMA($LINKS)."</a>]";
+ if ($LINKS > 0) $LINKS = $base."&what=list_links&uid=".$content['userid']."\">".TRANSLATE_COMMA($LINKS)."</a>]";
// Set link to sent mails if present
- if ($content['emails_sent'] > 0) $content['emails_sent'] = $BASE."&what=email_details&uid=".$content['userid']."\">".TRANSLATE_COMMA($content['emails_sent'])."</a>]";
+ if ($content['emails_sent'] > 0) $content['emails_sent'] = $base."&what=email_details&uid=".$content['userid']."\">".TRANSLATE_COMMA($content['emails_sent'])."</a>]";
// Add nickname
- if (empty($content['nickname']) || $content['nickname'] == $content['userid']) $content['nickname'] = "---";
+ if (empty($content['nickname']) || $content['nickname'] == $content['userid']) $content['nickname'] = '---';
// Calculate total points
$pointsTotal = GET_TOTAL_DATA($content['userid'], "user_points", "points") - GET_TOTAL_DATA($content['userid'], "user_data", "used_points");
$content['status'] = TRANSLATE_STATUS($content['status']);
// Is the lock reason not set?
- if (!isset($content['lock_reason'])) $content['lock_reason'] = "---";
+ if (!isset($content['lock_reason'])) $content['lock_reason'] = '---';
// Is the extension 'country' installed?
// @TODO Rewrite this into a filter
$content['wernis_type'] = WERNIS_TRANSFER_STATUS($content['wernis_type']);
// Fix empty message and status
- if (empty($content['wernis_api_message'])) $content['wernis_api_message'] = "---";
+ if (empty($content['wernis_api_message'])) $content['wernis_api_message'] = '---';
if (empty($content['wernis_api_status'])) $content['wernis_api_status'] = "OK";
// Append it and switch colors
// Trim every data line
foreach ($LANG_DUMMY as $k => $v) {
$v = trim($v);
- if (substr($v, 3) == "") $v = "---";
+ if (substr($v, 3) == "") $v = '---';
$LANG_DUMMY[$k] = $v;
if ($v == "xx:xx") break;
$LANG[] = $v;
$SW = 2;
while ($content = SQL_FETCHARRAY($result)) {
// Fix empty action/what
- if (empty($content['action'])) $content['action'] = "---";
- if (empty($content['what'])) $content['what'] = "---";
+ if (empty($content['action'])) $content['action'] = '---';
+ if (empty($content['what'])) $content['what'] = '---';
if ($content['is_admin'] == 'Y') {
// Is an administrator
require($INC);
}
-$MODE = 'guest';
+$mode = 'guest';
if (REQUEST_ISSET_GET(('order'))) {
// Order number placed, is he also logged in?
REQUEST_SET_POST('url', $url);
// Mode is member
- $MODE = 'member';
+ $mode = 'member';
} else {
// Matching line not found!
LOAD_URL('modules.php?module=index&what=login');
switch ($frame)
{
case '':
- switch ($MODE)
+ switch ($mode)
{
case 'member':
// Build frameset
// At least one member was online so let's load them all
$OUT = ''; $SW = 2;
while (list($uid, $nick, $last) = SQL_FETCHROW($result)) {
- $nick2 = "---";
+ $nick2 = '---';
if (($nick != $uid) && (!empty($nick))) $nick2 = $nick;
// Transfer data to array
'sw' => $SW,
'uid' => $uid,
'nick' => $nick2,
- 'points' => TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "points") - GET_TOTAL_DATA($uid, "user_data", "used_points")),
- 'last' => MAKE_DATETIME($last, "2"),
+ 'points' => TRANSLATE_COMMA(GET_TOTAL_DATA($uid, 'user_points', 'points') - GET_TOTAL_DATA($uid, 'user_data', 'used_points')),
+ 'last' => MAKE_DATETIME($last, '2'),
);
// Load template
- $OUT .= LOAD_TEMPLATE("guest_active_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('guest_active_row', true, $content);
// Switch colors
$SW = 3 - $SW;
}
} else {
// No member was online today! :-(
- $OUT = LOAD_TEMPLATE("guest_active_none_row", true);
+ $OUT = LOAD_TEMPLATE('guest_active_none_row', true);
}
// Remember output in constant
define('__ACTIVE_ROWS', $OUT);
// Load template
-LOAD_TEMPLATE("guest_active_table");
+LOAD_TEMPLATE('guest_active_table');
//
?>
// Add description as navigation point
ADD_DESCR('guest', __FILE__);
-$MODE = '';
+$mode = '';
if (REQUEST_ISSET_GET(('mode'))) {
// A "special" mode of the login system was requested
switch (REQUEST_GET('mode'))
{
- case 'activate' : $MODE = 'activate'; break; // Activation link requested
- case 'lost_pass': $MODE = 'lost_pass'; break; // Request new password
+ case 'activate' : $mode = 'activate'; break; // Activation link requested
+ case 'lost_pass': $mode = 'lost_pass'; break; // Request new password
}
} // END - if
// Free memory
SQL_FREERESULT($result);
-} elseif ($MODE == 'activate') {
+} elseif ($mode == 'activate') {
// Send activation link again
if (IS_FORM_SENT()) {
// Check submitted data
// Load form
LOAD_TEMPLATE('guest_sponsor_activate');
}
-} elseif ($MODE == 'lost_pass') {
+} elseif ($mode == 'lost_pass') {
// Send new password
if (IS_FORM_SENT()) {
// Check submitted data
$OUT = ''; $SW = 2; $cnt = 1;
while ($content = SQL_FETCHARRAY($result)) {
// Init nickname
- $content['nickname'] = "---";
+ $content['nickname'] = '---';
// Get nickname
if (EXT_IS_ACTIVE('nickname')) $content['nickname'] = NICKNAME_GET_NICK($content['userid']);
$OUT = ''; $SW = 2; $cnt = 1;
while ($content = SQL_FETCHARRAY($result)) {
// Init nickname
- $content['nickname'] = "---";
+ $content['nickname'] = '---';
// Get nickname
if (EXT_IS_ACTIVE('nickname')) $content['nickname'] = NICKNAME_GET_NICK($content['userid']);
$OUT = ''; $SW = 2; $cnt = 1;
while ($content = SQL_FETCHARRAY($result)) {
// Init nickname
- $content['nickname'] = "---";
+ $content['nickname'] = '---';
// Get nickname
if (EXT_IS_ACTIVE('nickname')) $content['nickname'] = NICKNAME_GET_NICK($content['userid']);
define('UID_VALUE', getUserId()); $URL = '';
// Detect what the member wants to do
-$MODE = "show"; // Show his data
-if (REQUEST_ISSET_POST(('save'))) $MODE = "save"; // Save entered data
-if (REQUEST_ISSET_POST('edit')) $MODE = "edit"; // Edit data
-if (REQUEST_ISSET_POST(('notify'))) $MODE = "notify"; // Switch off notification
+$mode = "show"; // Show his data
+if (REQUEST_ISSET_POST(('save'))) $mode = "save"; // Save entered data
+if (REQUEST_ISSET_POST('edit')) $mode = "edit"; // Edit data
+if (REQUEST_ISSET_POST(('notify'))) $mode = "notify"; // Switch off notification
-switch ($MODE)
+switch ($mode)
{
case "show": // Show his data
if (EXT_IS_ACTIVE('country', true)) {
$hash = generateHash(REQUEST_POST('pass1'), substr($DATA[1], 0, -40));
if ((($hash == $DATA[1]) || (REQUEST_POST('pass1') == REQUEST_POST('pass2'))) && (REQUEST_ISSET_POST(('pass1')))) {
// Only on simple changes normal mode is active = no email or password changed
- $MODE = 'normal'; $AND = '';
+ $mode = 'normal'; $AND = '';
// Did the user changed the password?
- if ($hash != $DATA[1]) { $AND = ", password='".$hash."'"; $MODE = 'pass'; }
+ if ($hash != $DATA[1]) { $AND = ", password='".$hash."'"; $mode = 'pass'; }
// Or did he changed his password?
if (REQUEST_POST('addy') != $DATA[0]) {
// Jupp
- if ($MODE == 'normal') { $MODE = 'email'; } else { $MODE .= ";email"; }
+ if ($mode == 'normal') { $mode = 'email'; } else { $mode .= ";email"; }
REQUEST_SET_POST('old_addy', $DATA[0]);
}
}
// Get all modes ...
- $modes = explode(';', $MODE);
+ $modes = explode(';', $mode);
// ... and run them through
SEND_MODE_MAILS ('mydata', $modes);
$content['target_bank'] = "<a href=\"".DEREFERER($content['url'])."\" target=\"_blank\">{--CLICK_HERE--}</a>";
} else {
// e-currency payout request
- if (empty($content['target_account'])) $content['target_account'] = "---";
- if (empty($content['target_bank'])) $content['target_bank'] = "---";
+ if (empty($content['target_account'])) $content['target_account'] = '---';
+ if (empty($content['target_bank'])) $content['target_bank'] = '---';
}
// Prepare data for the template
SQL_FREERESULT($result);
// Initialize variables
-$CONFIRMED = "---"; $SENT = "---"; $RECEIVED = "---";
+$CONFIRMED = '---'; $SENT = '---'; $RECEIVED = '---';
// Only user >= v0.1.2: Fetch confirmed mails counter
if (GET_EXT_VERSION('user') >= '0.1.2') {
SQL_FREERESULT($result);
// Please update the user extension if you see 3 dashes
- if (empty($SENT)) $SENT = "---";
- if (empty($RECEIVED)) $RECEIVED = "---";
+ if (empty($SENT)) $SENT = '---';
+ if (empty($RECEIVED)) $RECEIVED = '---';
} else {
// Please update!
- $CONFIRMED = "---";
+ $CONFIRMED = '---';
}
// If TLOCK is 0 add 3 zeros for floating
$refRow['points'] = TRANSLATE_COMMA($refRow['points']);
$refRow['refback'] = TRANSLATE_COMMA($refRow['refback']);
$refRow['status'] = TRANSLATE_STATUS($refRow['status']);
- if (empty($refRow['nickname'])) $refRow['nickname'] = "---";
+ if (empty($refRow['nickname'])) $refRow['nickname'] = '---';
// Load row template
if ($deleted) {
$refRow['status'] = TRANSLATE_STATUS($refRow['status']);
$refRow['unconfirmed'] = TRANSLATE_COMMA($refRow['unconfirmed']);
$refRow['clickrate'] = TRANSLATE_COMMA($refRow['clickrate'], true, 1);
- if (empty($refRow['nickname'])) $refRow['nickname'] = "---";
+ if (empty($refRow['nickname'])) $refRow['nickname'] = '---';
// Load row template
$rows .= LOAD_TEMPLATE("member_ref_list_row", true, $refRow);
$OUT = ''; $SW = 2;
while ($data = SQL_FETCHARRAY($result)) {
// Is the ZIP code set? If not, set dashes
- if (empty($data['zip'])) $data['zip'] = "---";
+ if (empty($data['zip'])) $data['zip'] = '---';
// Prepare content for output
$content = array(
$content['status'] = SURFBAR_TRANSLATE_STATUS($content['status']);
if (empty($content['lock_reason'])) {
// Fixes some HTML problems with empty cells
- $content['lock_reason'] = "---";
+ $content['lock_reason'] = '---';
} // END - if
// Load row template
// Free memory
SQL_FREERESULT($result);
-$MODE = '';
-if (REQUEST_ISSET_GET(('mode'))) $MODE = REQUEST_GET('mode');
+$mode = '';
+if (REQUEST_ISSET_GET(('mode'))) $mode = REQUEST_GET('mode');
// Check for "faker"
-if (($opt_in == 'N') && ($MODE == "new")) $MODE = '';
+if (($opt_in == 'N') && ($mode == "new")) $mode = '';
-switch ($MODE)
+switch ($mode)
{
case "new": // Start new transfer
// Get total points and subtract the balance amount from it = maximum transferable points
case "list_in": // List only incoming transactions
case "list_out": // List only outgoing transactions
// As you can see I put list_in and list_out together. I now do a switch() again on it for the right SQL command
- switch ($MODE)
+ switch ($mode)
{
case "list_in":
$sql = "SELECT trans_id, from_uid, points, reason, time_trans FROM `{!_MYSQL_PREFIX!}_user_transfers_in` WHERE userid=%s ORDER BY time_trans DESC LIMIT ".getConfig('transfer_max');
}
//
-function ADD_MENU ($MODE, $act, $wht) {
+function ADD_MENU ($mode, $act, $wht) {
// Init some variables
$main_cnt = 0;
$AND = '';
$sub_what = '';
// is the menu action valid?
- if (!VALIDATE_MENU_ACTION($MODE, $act, $wht, true)) {
+ if (!VALIDATE_MENU_ACTION($mode, $act, $wht, true)) {
return getCode('MENU_NOT_VALID');
} // END - if
// Load SQL data and add the menu to the output stream...
$result_main = SQL_QUERY_ESC("SELECT title, action FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE (`what`='' OR `what` IS NULL)".$AND." ORDER BY `sort`",
- array($MODE), __FUNCTION__, __LINE__);
+ array($mode), __FUNCTION__, __LINE__);
//* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
if (SQL_NUMROWS($result_main) > 0) {
- OUTPUT_HTML("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"".$MODE."_menu\">");
+ OUTPUT_HTML("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"".$mode."_menu\">");
// There are menus available, so we simply display them... :)
while ($content = SQL_FETCHARRAY($result_main)) {
//* DEBUG: */ echo __LINE__."/".$main_cnt."/".$content['action']."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
$act = $content['action'];
// Load menu header template
- LOAD_TEMPLATE($MODE."_menu_title", false, $content);
+ LOAD_TEMPLATE($mode."_menu_title", false, $content);
// Sub menu
$result_sub = SQL_QUERY_ESC("SELECT title AS sub_title, what AS sub_what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ".$AND." ORDER BY `sort`",
- array($MODE, $content['action']), __FUNCTION__, __LINE__);
+ array($mode, $content['action']), __FUNCTION__, __LINE__);
// Get number of rows
$ctl = SQL_NUMROWS($result_sub);
// Full file name for checking menu
//* DEBUG: */ echo __LINE__.":!!!!".$content['sub_what']."!!!<br />\n";
- $INC = sprintf("inc/modules/%s/what-%s.php", $MODE, $content['sub_what']);
+ $INC = sprintf("inc/modules/%s/what-%s.php", $mode, $content['sub_what']);
if (INCLUDE_READABLE($INC)) {
if ((!empty($wht)) && (($wht == $content['sub_what']))) {
$OUT = "<strong>";
// Add regular menu row or bottom row?
if ($cnt < $ctl) {
- LOAD_TEMPLATE($MODE."_menu_row", false, $content);
+ LOAD_TEMPLATE($mode."_menu_row", false, $content);
} else {
- LOAD_TEMPLATE($MODE."_menu_bottom", false, $content);
+ LOAD_TEMPLATE($mode."_menu_bottom", false, $content);
}
}
} else {
// This is a menu block... ;-)
$GLOBALS['block_mode'] = true;
- $INC_BLOCK = sprintf("inc/modules/%s/action-%s.php", $MODE, $content['action']);
+ $INC_BLOCK = sprintf("inc/modules/%s/action-%s.php", $mode, $content['action']);
if (FILE_READABLE($INC_BLOCK)) {
// Load include file
if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == 'online')) OUTPUT_HTML("<tr>
- <td class=\"".$MODE."_menu_whats\">");
+ <td class=\"".$mode."_menu_whats\">");
//* DEBUG: */ echo __LINE__."/".$main_cnt."/".$content['action']."/".$content['sub_what'].":".$GLOBALS['what']."*<br />\n";
LOAD_INC($INC_BLOCK);
//* DEBUG: */ echo __LINE__."/".$main_cnt."/".$content['action']."/".$content['sub_what'].":".$GLOBALS['what']."*<br />\n";
$main_cnt++;
//* DEBUG: */ echo __LINE__."/".$main_cnt."/".$content['action']."/".$content['sub_what'].":".$GLOBALS['what']."*<br />\n";
if (SQL_NUMROWS($result_main) > $main_cnt) {
- OUTPUT_HTML("<tr><td class=\"".$MODE."_menu_seperator\"></td></tr>");
+ OUTPUT_HTML("<tr><td class=\"".$mode."_menu_seperator\"></td></tr>");
} // END - if
}
}
// Generates a list of "max receiveable emails per day"
-function ADD_MAX_RECEIVE_LIST ($MODE, $default = "", $return = false) {
+function ADD_MAX_RECEIVE_LIST ($mode, $default = "", $return = false) {
$OUT = '';
$result = false;
- switch ($MODE) {
+ switch ($mode) {
case 'guest':
// Guests (in the registration form) are not allowed to select 0 mails per day.
$result = SQL_QUERY("SELECT value, comment FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE value > 0 ORDER BY value",
break;
default: // Invalid!
- DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Invalid mode %s detected.", $MODE));
+ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Invalid mode %s detected.", $mode));
break;
}
define('__MAX_RECEIVE_OPTIONS', $OUT);
// Load template
- $OUT = LOAD_TEMPLATE($MODE."_receive_table", true);
+ $OUT = LOAD_TEMPLATE($mode."_receive_table", true);
} else {
// Maybe the admin has to setup some maximum values?
debug_report_bug("Nothing is being done here?");
}
// Validate the given menu action
-function VALIDATE_MENU_ACTION ($MODE, $act, $wht, $UPDATE=false) {
+function VALIDATE_MENU_ACTION ($mode, $act, $wht, $UPDATE=false) {
// Is the cache entry there and we shall not update?
- if ((isset($GLOBALS['cache_array']['action_valid'][$MODE][$act][$wht])) && ($UPDATE === false)) {
+ if ((isset($GLOBALS['cache_array']['action_valid'][$mode][$act][$wht])) && ($UPDATE === false)) {
// Count cache hit
incrementConfigEntry('cache_hits');
// Then use this cache
- return $GLOBALS['cache_array']['action_valid'][$MODE][$act][$wht];
+ return $GLOBALS['cache_array']['action_valid'][$mode][$act][$wht];
} // END - if
// By default nothing is valid
// Look in all menus or only unlocked
$add = '';
- if ((!IS_ADMIN()) && ($MODE != 'admin')) $add = " AND `locked`='N'";
+ if ((!IS_ADMIN()) && ($mode != 'admin')) $add = " AND `locked`='N'";
- //* DEBUG: */ echo __LINE__.":".$MODE."/".$act."/".$wht."*<br />\n";
- if (($MODE != 'admin') && ($UPDATE === true)) {
+ //* DEBUG: */ echo __LINE__.":".$mode."/".$act."/".$wht."*<br />\n";
+ if (($mode != 'admin') && ($UPDATE === true)) {
// Update guest or member menu
$sql = SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_%s_menu` SET counter=counter+1 WHERE `action`='%s' AND `what`='%s'".$add." LIMIT 1",
- array($MODE, $act, $wht), __FUNCTION__, __LINE__, false);
+ array($mode, $act, $wht), __FUNCTION__, __LINE__, false);
} elseif (($wht != "overview") && (!empty($wht))) {
// Other actions
$sql = SQL_QUERY_ESC("SELECT id, what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `action`='%s' AND `what`='%s'".$add." ORDER BY action DESC LIMIT 1",
- array($MODE, $act, $wht), __FUNCTION__, __LINE__, false);
+ array($mode, $act, $wht), __FUNCTION__, __LINE__, false);
} else {
// Admin login overview
$sql = SQL_QUERY_ESC("SELECT id, what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `action`='%s' AND (`what`='' OR `what` IS NULL)".$add." ORDER BY action DESC LIMIT 1",
- array($MODE, $act), __FUNCTION__, __LINE__, false);
+ array($mode, $act), __FUNCTION__, __LINE__, false);
}
// Run SQL command
SQL_FREERESULT($result);
// Set cache entry
- $GLOBALS['cache_array']['action_valid'][$MODE][$act][$wht] = $ret;
+ $GLOBALS['cache_array']['action_valid'][$mode][$act][$wht] = $ret;
// Return result
return $ret;
}
//
-function GET_MOD_DESCR($MODE, $wht, $column="what") {
+function GET_MOD_DESCR($mode, $wht, $column="what") {
// Fix empty "what"
if (empty($wht)) {
$wht = "welcome";
// Look for title
$result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE %s='%s' LIMIT 1",
- array($MODE, $column, $wht), __FUNCTION__, __LINE__);
+ array($mode, $column, $wht), __FUNCTION__, __LINE__);
// Is there an entry?
if (SQL_NUMROWS($result) == 1) {
}
// Get action value from mode (admin/guest/member) and what-value
-function GET_ACTION ($MODE, &$wht) {
+function GET_ACTION ($mode, &$wht) {
// Init status
$ret = '';
- //* DEBUG: */ echo __LINE__."=".$MODE."/".$wht."/".$GLOBALS['action']."=<br />";
- if ((empty($wht)) && ($MODE != 'admin')) {
+ //* DEBUG: */ echo __LINE__."=".$mode."/".$wht."/".$GLOBALS['action']."=<br />";
+ if ((empty($wht)) && ($mode != 'admin')) {
$wht = "welcome";
if (getConfig('index_home') != "") $wht = getConfig('index_home');
} // END - if
- if ($MODE == 'admin') {
+ if ($mode == 'admin') {
// Action value for admin area
if (REQUEST_ISSET_GET('action')) {
// Use from request!
//* DEBUG: */ echo __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ret=".$ret."<br />\n";
// Does the module have a menu?
- if (MODULE_HAS_MENU($MODE)) {
+ if (MODULE_HAS_MENU($mode)) {
// Rewriting modules to menu
- switch ($MODE) {
- case 'index': $MODE = 'guest'; break;
- case "login": $MODE = 'member'; break;
+ switch ($mode) {
+ case 'index': $mode = 'guest'; break;
+ case "login": $mode = 'member'; break;
} // END - switch
// Guest and member menu is "main" as the default
// Load from database
$result = SQL_QUERY_ESC("SELECT action FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `what`='%s' LIMIT 1",
- array($MODE, $wht), __FUNCTION__, __LINE__);
+ array($mode, $wht), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load action value and pray that this one is the right you want... ;-)
list($ret) = SQL_FETCHROW($result);
// Free memory
SQL_FREERESULT($result);
- } elseif ((GET_EXT_VERSION('sql_patches') == "") && ($MODE != 'admin')) {
+ } elseif ((GET_EXT_VERSION('sql_patches') == "") && ($mode != 'admin')) {
// No sql_patches installed, but maybe we need to register an admin?
if (isAdminRegistered()) {
// Redirect
// Output inclusion lines
foreach ($STYLES as $value) {
// Only include found CSS files (to reduce 404 requests)
- $BASE = sprintf("%stheme/%s/css/", constant('PATH'), GET_CURR_THEME());
- $FQFN = $BASE.$value;
+ $basePath = sprintf("%stheme/%s/css/", constant('PATH'), GET_CURR_THEME());
+ $FQFN = $basePath . $value;
// Do include only existing files and whose are not empty
if ((FILE_READABLE($FQFN)) && (filesize($FQFN) > 0)) {
switch (getConfig('css_php')) {
- case "DIRECT":
+ case 'DIRECT':
OUTPUT_HTML("<link rel=\"stylesheet\" type=\"text/css\" href=\"{!URL!}/theme/".GET_CURR_THEME()."/".$value."\" />");
break;
- case "FILE":
+ case 'FILE':
OUTPUT_HTML(READ_FILE($FQFN));
break;
} // END - switch