sendHeader('Content-language: ' . getLanguage());
// Extension 'rewrite' installed?
- if ((isExtensionActive('rewrite')) && (getOutputMode() != '1')) {
+ if ((isExtensionActive('rewrite')) && (getOutputMode() != 1)) {
$GLOBALS['output'] = rewriteLinksInCode($GLOBALS['output']);
} // END - if
outputRawCode($GLOBALS['output']);
} elseif ((getConfig('OUTPUT_MODE') == 'render') && (!empty($GLOBALS['output']))) {
// Rewrite links when rewrite extension is active
- if ((isExtensionActive('rewrite')) && (getOutputMode() != '1')) {
+ if ((isExtensionActive('rewrite')) && (getOutputMode() != 1)) {
$GLOBALS['output'] = rewriteLinksInCode($GLOBALS['output']);
} // END - if
if (empty($GLOBALS['refid'])) $GLOBALS['refid'] = 0;
// Generate date/time string
- $date_time = generateDateTime(time(), '1');
+ $date_time = generateDateTime(time(), 1);
// Is content an array
if (is_array($content)) $content['date_time'] = $date_time;
}
// Loads an email template and compiles it
-function loadEmailTemplate ($template, $content = array(), $UID = '0') {
+function loadEmailTemplate ($template, $content = array(), $UID = 0) {
global $DATA;
// Our configuration is kept non-global here
// Free result
SQL_FREERESULT($result_email);
}
- } elseif ($toEmail == '0') {
+ } elseif ($toEmail == 0) {
// Is the webmaster!
$toEmail = getConfig('WEBMASTER');
}
}
// Generates a human-readable timestamp from the Uni* stamp
-function generateDateTime ($time, $mode = '0') {
+function generateDateTime ($time, $mode = 0) {
// Filter out numbers
$time = bigintval($time);
switch (getLanguage()) {
case 'de': // German date / time format
switch ($mode) {
- case '0': $ret = date("d.m.Y \u\m H:i \U\h\\r", $time); break;
- case '1': $ret = strtolower(date('d.m.Y - H:i', $time)); break;
- case '2': $ret = date('d.m.Y|H:i', $time); break;
- case '3': $ret = date('d.m.Y', $time); break;
+ case 0: $ret = date("d.m.Y \u\m H:i \U\h\\r", $time); break;
+ case 1: $ret = strtolower(date('d.m.Y - H:i', $time)); break;
+ case 2: $ret = date('d.m.Y|H:i', $time); break;
+ case 3: $ret = date('d.m.Y', $time); break;
default:
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
break;
default: // Default is the US date / time format!
switch ($mode) {
- case '0': $ret = date('r', $time); break;
- case '1': $ret = date('Y-m-d - g:i A', $time); break;
- case '2': $ret = date('y-m-d|H:i', $time); break;
- case '3': $ret = date('y-m-d', $time); break;
+ case 0: $ret = date('r', $time); break;
+ case 1: $ret = date('Y-m-d - g:i A', $time); break;
+ case 2: $ret = date('y-m-d|H:i', $time); break;
+ case 3: $ret = date('y-m-d', $time); break;
default:
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
break;
// Translates the american decimal dot into a german comma
function translateComma ($dotted, $cut = true, $max = 0) {
// Default is 3 you can change this in admin area "Misc -> Misc Options"
- if (!isConfigEntrySet('max_comma')) setConfigEntry('max_comma', '3');
+ if (!isConfigEntrySet('max_comma')) setConfigEntry('max_comma', 3);
// Use from config is default
$maxComma = getConfig('max_comma');
}
//
-function addSelectionBox ($type, $default, $prefix = '', $id = '0') {
+function addSelectionBox ($type, $default, $prefix = '', $id = 0) {
$OUT = '';
if ($type == 'yn') {
case 'sec':
case 'min':
for ($idx = 0; $idx < 60; $idx+=5) {
- if (strlen($idx) == 1) $idx = '0' . $idx;
+ if (strlen($idx) == 1) $idx = 0 . $idx;
$OUT .= "<option value=\"" . $idx."\"";
if ($default == $idx) $OUT .= ' selected="selected"';
$OUT .= ">" . $idx."</option>\n";
case 'hour':
for ($idx = 0; $idx < 24; $idx++) {
- if (strlen($idx) == 1) $idx = '0' . $idx;
+ if (strlen($idx) == 1) $idx = 0 . $idx;
$OUT .= "<option value=\"" . $idx."\"";
if ($default == $idx) $OUT .= ' selected="selected"';
$OUT .= ">" . $idx."</option>\n";
$NAV = '';
for ($page = 1; $page <= $PAGES; $page++) {
// Is the page currently selected or shall we generate a link to it?
- if (($page == getRequestElement('page')) || ((!isGetRequestElementSet('page')) && ($page == '1'))) {
+ if (($page == getRequestElement('page')) || ((!isGetRequestElementSet('page')) && ($page == 1))) {
// Is currently selected, so only highlight it
$NAV .= '<strong>-';
} else {
$NAV .= '">';
}
$NAV .= $page;
- if (($page == getRequestElement('page')) || ((!isGetRequestElementSet('page')) && ($page == '1'))) {
+ if (($page == getRequestElement('page')) || ((!isGetRequestElementSet('page')) && ($page == 1))) {
// Is currently selected, so only highlight it
$NAV .= '-</strong>';
} else {
$mod = dechex(sqrt(($part2 - $part1) * getConfig('_PRIME') / pi()));
}
$mod = substr(round($mod), 0, 4);
- $mod = str_repeat('0', 4-strlen($mod)) . $mod;
+ $mod = str_repeat(0, 4-strlen($mod)) . $mod;
//* DEBUG: */ outputHtml("*" . $start.'=' . $mod."*<br />");
$start += 4;
$newHash .= $mod;
case getCode('OVERLENGTH') : $message = getMessage('MEMBER_TEXT_OVERLENGTH'); break;
case getCode('URL_FOUND') : $message = getMessage('MEMBER_TEXT_CONTAINS_URL'); break;
case getCode('SUBJ_URL') : $message = getMessage('MEMBER_SUBJ_CONTAINS_URL'); break;
- case getCode('BLIST_URL') : $message = "{--MEMBER_URL_BLACK_LISTED--}<br />\n{--MEMBER_BLIST_TIME--}: ".generateDateTime(getRequestElement('blist'), '0'); break;
+ case getCode('BLIST_URL') : $message = "{--MEMBER_URL_BLACK_LISTED--}<br />\n{--MEMBER_BLIST_TIME--}: ".generateDateTime(getRequestElement('blist'), 0); break;
case getCode('NO_RECS_LEFT') : $message = getMessage('MEMBER_SELECTED_MORE_RECS'); break;
case getCode('INVALID_TAGS') : $message = getMessage('MEMBER_HTML_INVALID_TAGS'); break;
case getCode('MORE_POINTS') : $message = getMessage('MEMBER_MORE_POINTS_NEEDED'); break;
// Load timestamp from last order
list($timestamp) = SQL_FETCHROW($result);
- $timestamp = generateDateTime($timestamp, '1');
+ $timestamp = generateDateTime($timestamp, 1);
// Free memory
SQL_FREERESULT($result);
return false;
}
// Send notification to admin
-function sendAdminNotification ($subject, $templateName, $content=array(), $userid = '0') {
+function sendAdminNotification ($subject, $templateName, $content=array(), $userid = 0) {
if (getExtensionVersion('admins') >= '0.4.1') {
// Send new way
sendAdminsEmails($subject, $templateName, $content, $userid);
//* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):accessLevel={$accessLevel}<br />");
$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
// Determines referal id and sets it
function determineReferalId () {
// Skip this in non-html-mode
- if (getOutputMode() != '0') return false;
+ if (getOutputMode() != 0) return false;
// Check if refid is set
if ((isset($GLOBALS['refid'])) && ($GLOBALS['refid'] > 0)) {
}
// Set cookie when default refid > 0
- if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((getSession('refid') == '0') && (getConfig('def_refid') > 0))) {
+ if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((getSession('refid') == 0) && (getConfig('def_refid') > 0))) {
// Set cookie
setSession('refid', $GLOBALS['refid']);
} // END - if
if (!is_array($code)) $codeE = explode("\n", $code); else $codeE = $code;
$count_lines = count($codeE);
- $r = "Line | Code:<br />";
+ $r = 'Line | Code:<br />';
foreach($codeE as $line => $c) {
- $r .= "<div class=\"line\"><span class=\"linenum\">";
+ $r .= '<div class="line"><span class="linenum">';
if ($count_lines == 1) {
- $r .= '1';
+ $r .= 1;
} else {
$r .= ($line == ($count_lines - 1)) ? '' : ($line+1);
}
- $r .= "</span>|";
+ $r .= '</span>|';
// Add code
- $r .= "<span class=\"linetext\">" . htmlentities($c) . "</span></div>";
+ $r .= '<span class="linetext">' . htmlentities($c) . '</span></div>';
}
- return "<div class=\"code\">" . $r . "</div>\n";
+ return '<div class="code">' . $r . '</div>';
+}
+
+// Convert ';' to ', ' for e.g. receiver list
+function convertReceivers ($old) {
+ return str_replace(';', ', ', $old);
}
//////////////////////////////////////////////////