// Output HTML code directly or 'render' it. You addionally switch the new-line character off
function outputHtml ($htmlCode, $newLine = true) {
// Init output
- if (!isset($GLOBALS['output'])) $GLOBALS['output'] = '';
+ if (!isset($GLOBALS['output'])) {
+ $GLOBALS['output'] = '';
+ } // END - if
// Transfer username
$username = getMessage('USERNAME_UNKNOWN');
if ($type == 'yn') {
// This is a yes/no selection only!
- if ($id > 0) $prefix .= "[" . $id."]";
- $OUT .= " <select name=\"" . $prefix."\" class=\"" . $class . "\" size=\"1\">\n";
+ if ($id > 0) $prefix .= '[' . $id . ']';
+ $OUT .= '<select name="' . $prefix . '" class="' . $class . '" size="1">';
} else {
// Begin with regular selection box here
if (!empty($prefix)) $prefix .= "_";
$type2 = $type;
- if ($id > 0) $type2 .= "[" . $id."]";
- $OUT .= " <select name=\"".strtolower($prefix . $type2)."\" class=\"" . $class . "\" size=\"1\">\n";
+ if ($id > 0) $type2 .= '[' . $id . ']';
+ $OUT .= '<select name="' . strtolower($prefix . $type2) . '" class="' . $class . '" size="1">';
}
switch ($type) {
case 'day': // Day
for ($idx = 1; $idx < 32; $idx++) {
- $OUT .= "<option value=\"" . $idx."\"";
+ $OUT .= '<option value="' . $idx . '"';
if ($default == $idx) $OUT .= ' selected="selected"';
- $OUT .= ">" . $idx."</option>\n";
+ $OUT .= '>' . $idx . '</option>';
} // END - for
break;
case 'month': // Month
- foreach ($GLOBALS['month_descr'] as $month => $descr) {
- $OUT .= "<option value=\"" . $month."\"";
- if ($default == $month) $OUT .= ' selected="selected"';
- $OUT .= ">" . $descr."</option>\n";
+ foreach ($GLOBALS['month_descr'] as $idx => $descr) {
+ $OUT .= '<option value="' . $idx . '"';
+ if ($default == $idx) $OUT .= ' selected="selected"';
+ $OUT .= '>' . $descr . '</option>';
} // END - for
break;
// Check if the default value is larger than minimum and bigger than actual year
if (($default > $minYear) && ($default >= $year)) {
for ($idx = $year; $idx < ($year + 11); $idx++) {
- $OUT .= "<option value=\"" . $idx."\"";
+ $OUT .= '<option value="' . $idx . '"';
if ($default == $idx) $OUT .= ' selected="selected"';
- $OUT .= ">" . $idx."</option>\n";
+ $OUT .= '>' . $idx . '</option>';
} // END - for
} elseif ($default == -1) {
// Current year minus 1
- for ($idx = $startYear; $idx <= ($year + 1); $idx++)
- {
- $OUT .= "<option value=\"" . $idx."\">" . $idx."</option>\n";
- }
+ for ($idx = $startYear; $idx <= ($year + 1); $idx++) {
+ $OUT .= '<option value="' . $idx . '">' . $idx . '</option>';
+ } // END - for
} else {
// Get current year and subtract the configured minimum age
- $OUT .= "<option value=\"".($minYear - 1)."\"><" . $minYear."</option>\n";
+ $OUT .= '<option value="' . ($minYear - 1) . '"><' . $minYear . '</option>';
// Calculate earliest year depending on extension version
if (isExtensionInstalledAndNewer('order', '0.2.1')) {
// Use configured minimum age
// Construct year selection list
for ($idx = $minYear; $idx <= $year; $idx++) {
- $OUT .= "<option value=\"" . $idx."\"";
+ $OUT .= '<option value="' . $idx . '"';
if ($default == $idx) $OUT .= ' selected="selected"';
- $OUT .= ">" . $idx."</option>\n";
+ $OUT .= '>' . $idx . '</option>';
} // END - for
}
break;
case 'sec':
case 'min':
- for ($idx = '0'; $idx < 60; $idx+=5) {
+ for ($idx = 0; $idx < 60; $idx+=5) {
if (strlen($idx) == 1) $idx = '0' . $idx;
- $OUT .= "<option value=\"" . $idx."\"";
+ $OUT .= '<option value="' . $idx . '"';
if ($default == $idx) $OUT .= ' selected="selected"';
- $OUT .= ">" . $idx."</option>\n";
+ $OUT .= '>' . $idx . '</option>';
} // END - for
break;
case 'hour':
- for ($idx = '0'; $idx < 24; $idx++) {
+ for ($idx = 0; $idx < 24; $idx++) {
if (strlen($idx) == 1) $idx = '0' . $idx;
- $OUT .= "<option value=\"" . $idx."\"";
+ $OUT .= '<option value="' . $idx . '"';
if ($default == $idx) $OUT .= ' selected="selected"';
- $OUT .= ">" . $idx."</option>\n";
+ $OUT .= '>' . $idx . '</option>';
} // END - for
break;
case 'yn':
- $OUT .= "<option value=\"Y\"";
+ $OUT .= '<option value="Y"';
if ($default == 'Y') $OUT .= ' selected="selected"';
- $OUT .= ">{--YES--}</option>\n<option value=\"N\"";
+ $OUT .= '>{--YES--}</option><option value="N"';
if ($default != 'Y') $OUT .= ' selected="selected"';
- $OUT .= ">{--NO--}</option>\n";
+ $OUT .= '>{--NO--}</option>';
break;
}
- $OUT .= " </select>\n";
+ $OUT .= '</select>';
return $OUT;
}
debug_report_bug('img_code ' . $img_code .' has invalid length. img_code()=' . strlen($img_code) . ' code_length=' . getConfig('code_length'));
} elseif ($headerSent === false) {
// Return an HTML code here
- return "<img src=\"{%url=img.php?code=" . $img_code."%}\" alt=\"Image\" />\n";
+ return '<img src="{%url=img.php?code=' . $img_code . '%}" alt="Image" />';
}
// Load image
// Is it readable?
if (isFileReadable($img)) {
// Switch image type
- switch (getConfig('img_type'))
- {
+ switch (getConfig('img_type')) {
case 'jpg':
// Okay, load image and hide all errors
$image = imagecreatefromjpeg($img);
// Okay, load image and hide all errors
$image = imagecreatefrompng($img);
break;
- }
+ } // END - switch
} else {
// Exit function here
logDebugMessage(__FUNCTION__, __LINE__, sprintf("File for image type %s not found.", getConfig('img_type')));
switch (getConfig('img_type')) {
case 'jpg': imagejpeg($image); break;
case 'png': imagepng($image); break;
- }
+ } // END - switch
// Remove image from memory
imagedestroy($image);
);
} else {
// Generate table
- $OUT = "<div align=\"" . $align."\">\n";
- $OUT .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"timebox_table dashed\">\n";
- $OUT .= "<tr>\n";
+ $OUT = '<div align="' . $align . '">';
+ $OUT .= '<table border="0" cellspacing="0" cellpadding="0" class="timebox_table dashed">';
+ $OUT .= '<tr>';
if (isInString('Y', $display) || (empty($display))) {
- $OUT .= " <td align=\"center\" class=\"timebox_column bottom\"><div class=\"tiny\">{--_YEARS--}</strong></td>\n";
- }
+ $OUT .= '<td align="center" class="timebox_column bottom"><div class="tiny">{--_YEARS--}</strong></td>';
+ } // END - if
if (isInString('M', $display) || (empty($display))) {
- $OUT .= " <td align=\"center\" class=\"timebox_column bottom\"><div class=\"tiny\">{--_MONTHS--}</strong></td>\n";
- }
+ $OUT .= '<td align="center" class="timebox_column bottom"><div class="tiny">{--_MONTHS--}</strong></td>';
+ } // END - if
if (isInString('W', $display) || (empty($display))) {
- $OUT .= " <td align=\"center\" class=\"timebox_column bottom\"><div class=\"tiny\">{--_WEEKS--}</strong></td>\n";
- }
+ $OUT .= '<td align="center" class="timebox_column bottom"><div class="tiny">{--_WEEKS--}</strong></td>';
+ } // END - if
if (isInString('D', $display) || (empty($display))) {
- $OUT .= " <td align=\"center\" class=\"timebox_column bottom\"><div class=\"tiny\">{--_DAYS--}</strong></td>\n";
- }
+ $OUT .= '<td align="center" class="timebox_column bottom"><div class="tiny">{--_DAYS--}</strong></td>';
+ } // END - if
if (isInString('h', $display) || (empty($display))) {
- $OUT .= " <td align=\"center\" class=\"timebox_column bottom\"><div class=\"tiny\">{--_HOURS--}</strong></td>\n";
- }
+ $OUT .= '<td align="center" class="timebox_column bottom"><div class="tiny">{--_HOURS--}</strong></td>';
+ } // END - if
if (isInString('m', $display) || (empty($display))) {
- $OUT .= " <td align=\"center\" class=\"timebox_column bottom\"><div class=\"tiny\">{--_MINUTES--}</strong></td>\n";
- }
+ $OUT .= '<td align="center" class="timebox_column bottom"><div class="tiny">{--_MINUTES--}</strong></td>';
+ } // END - if
if (isInString('s', $display) || (empty($display))) {
- $OUT .= " <td align=\"center\" class=\"timebox_column bottom\"><div class=\"tiny\">{--_SECONDS--}</strong></td>\n";
- }
+ $OUT .= '<td align="center" class="timebox_column bottom"><div class="tiny">{--_SECONDS--}</strong></td>';
+ } // END - if
- $OUT .= "</tr>\n";
- $OUT .= "<tr>\n";
+ $OUT .= '</tr>';
+ $OUT .= '<tr>';
if (isInString('Y', $display) || (empty($display))) {
// Generate year selection
- $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_ye\" size=\"1\">\n";
- for ($idx = '0'; $idx <= 10; $idx++) {
- $OUT .= " <option class=\"mini_select\" value=\"" . $idx."\"";
+ $OUT .= '<td align="center"><select class="mini_select" name="' . $prefix . '_ye" size="1">';
+ for ($idx = 0; $idx <= 10; $idx++) {
+ $OUT .= '<option class="mini_select" value="' . $idx . '"';
if ($idx == $Y) $OUT .= ' selected="selected"';
- $OUT .= ">" . $idx."</option>\n";
- }
- $OUT .= " </select></td>\n";
+ $OUT .= '>' . $idx . '</option>';
+ } // END - for
+ $OUT .= '</select></td>';
} else {
$OUT .= '<input type="hidden" name="' . $prefix . '_ye" value="0" />';
}
if (isInString('M', $display) || (empty($display))) {
// Generate month selection
- $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_mo\" size=\"1\">\n";
- for ($idx = '0'; $idx <= 11; $idx++)
- {
- $OUT .= " <option class=\"mini_select\" value=\"" . $idx."\"";
+ $OUT .= '<td align="center"><select class="mini_select" name="' . $prefix . '_mo" size="1">';
+ for ($idx = 0; $idx <= 11; $idx++) {
+ $OUT .= ' <option class="mini_select" value="' . $idx . '"';
if ($idx == $M) $OUT .= ' selected="selected"';
- $OUT .= ">" . $idx."</option>\n";
- }
- $OUT .= " </select></td>\n";
+ $OUT .= '>' . $idx . '</option>';
+ } // END - for
+ $OUT .= '</select></td>';
} else {
$OUT .= '<input type="hidden" name="' . $prefix . '_mo" value="0" />';
}
if (isInString('W', $display) || (empty($display))) {
// Generate week selection
- $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_we\" size=\"1\">\n";
- for ($idx = '0'; $idx <= 4; $idx++) {
- $OUT .= " <option class=\"mini_select\" value=\"" . $idx."\"";
+ $OUT .= '<td align="center"><select class="mini_select" name="' . $prefix . '_we" size="1">';
+ for ($idx = 0; $idx <= 4; $idx++) {
+ $OUT .= ' <option class="mini_select" value="' . $idx . '"';
if ($idx == $W) $OUT .= ' selected="selected"';
- $OUT .= ">" . $idx."</option>\n";
- }
- $OUT .= " </select></td>\n";
+ $OUT .= '>' . $idx . '</option>';
+ } // END - for
+ $OUT .= '</select></td>';
} else {
$OUT .= '<input type="hidden" name="' . $prefix . '_we" value="0" />';
}
if (isInString('D', $display) || (empty($display))) {
// Generate day selection
- $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_da\" size=\"1\">\n";
- for ($idx = '0'; $idx <= 31; $idx++) {
- $OUT .= " <option class=\"mini_select\" value=\"" . $idx."\"";
+ $OUT .= '<td align="center"><select class="mini_select" name="' . $prefix . '_da" size="1">';
+ for ($idx = 0; $idx <= 31; $idx++) {
+ $OUT .= ' <option class="mini_select" value="' . $idx . '"';
if ($idx == $D) $OUT .= ' selected="selected"';
- $OUT .= ">" . $idx."</option>\n";
- }
- $OUT .= " </select></td>\n";
+ $OUT .= '>' . $idx . '</option>';
+ } // END - for
+ $OUT .= '</select></td>';
} else {
$OUT .= '<input type="hidden" name="' . $prefix . '_da" value="0" />';
}
if (isInString('h', $display) || (empty($display))) {
// Generate hour selection
- $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_ho\" size=\"1\">\n";
- for ($idx = '0'; $idx <= 23; $idx++) {
- $OUT .= " <option class=\"mini_select\" value=\"" . $idx."\"";
+ $OUT .= '<td align="center"><select class="mini_select" name="' . $prefix . '_ho" size="1">';
+ for ($idx = 0; $idx <= 23; $idx++) {
+ $OUT .= ' <option class="mini_select" value="' . $idx . '"';
if ($idx == $h) $OUT .= ' selected="selected"';
- $OUT .= ">" . $idx."</option>\n";
- }
- $OUT .= " </select></td>\n";
+ $OUT .= '>' . $idx . '</option>';
+ } // END - for
+ $OUT .= '</select></td>';
} else {
$OUT .= '<input type="hidden" name="' . $prefix . '_ho" value="0" />';
}
if (isInString('m', $display) || (empty($display))) {
// Generate minute selection
- $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_mi\" size=\"1\">\n";
- for ($idx = '0'; $idx <= 59; $idx++) {
- $OUT .= " <option class=\"mini_select\" value=\"" . $idx."\"";
+ $OUT .= '<td align="center"><select class="mini_select" name="' . $prefix . '_mi" size="1">';
+ for ($idx = 0; $idx <= 59; $idx++) {
+ $OUT .= ' <option class="mini_select" value="' . $idx . '"';
if ($idx == $m) $OUT .= ' selected="selected"';
- $OUT .= ">" . $idx."</option>\n";
- }
- $OUT .= " </select></td>\n";
+ $OUT .= '>' . $idx . '</option>';
+ } // END - for
+ $OUT .= '</select></td>';
} else {
$OUT .= '<input type="hidden" name="' . $prefix . '_mi" value="0" />';
}
if (isInString('s', $display) || (empty($display))) {
// Generate second selection
- $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_se\" size=\"1\">\n";
- for ($idx = '0'; $idx <= 59; $idx++) {
- $OUT .= " <option class=\"mini_select\" value=\"" . $idx."\"";
+ $OUT .= '<td align="center"><select class="mini_select" name="' . $prefix . '_se" size="1">';
+ for ($idx = 0; $idx <= 59; $idx++) {
+ $OUT .= ' <option class="mini_select" value="' . $idx . '"';
if ($idx == $s) $OUT .= ' selected="selected"';
- $OUT .= ">" . $idx."</option>\n";
- }
- $OUT .= " </select></td>\n";
+ $OUT .= '>' . $idx . '</option>';
+ } // END - for
+ $OUT .= '</select></td>';
} else {
$OUT .= '<input type="hidden" name="' . $prefix . '_se" value="0" />';
}
- $OUT .= "</tr>\n";
- $OUT .= "</table>\n";
- $OUT .= "</div>\n";
- // Return generated HTML code
+ $OUT .= '</tr>';
+ $OUT .= '</table>';
+ $OUT .= '</div>';
}
+
+ // Return generated HTML code
return $OUT;
}
$SWITCH = '0';
$TEST = date('Y', time()) / 4;
$M1 = date('m', time());
+
// If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
if ((floor($TEST) == $TEST) && ($M1 == '02') && ($postData[$prefix . '_mo'] > '02')) $SWITCH = getConfig('ONE_DAY');
+
// First add years...
$ret += $postData[$prefix . '_ye'] * (31536000 + $SWITCH);
+
// Next months...
$ret += $postData[$prefix . '_mo'] * 2628000;
+
// Next weeks
$ret += $postData[$prefix . '_we'] * 604800;
+
// Next days...
$ret += $postData[$prefix . '_da'] * 86400;
+
// Next hours...
$ret += $postData[$prefix . '_ho'] * 3600;
+
// Next minutes..
$ret += $postData[$prefix . '_mi'] * 60;
+
// And at last seconds...
$ret += $postData[$prefix . '_se'];
+
// Return calculated value
return $ret;
}
foreach($data as $k => $v) {
if ($v > 0) {
// Value is greater than 0 "eval" data to return string
- eval("\$ret .= \", \".\$v.\" {--_".strtoupper($k)."--}\";");
+ eval('$ret .= ", ".$v." {--_' . strtoupper($k) . '--}";');
break;
} // END - if
} // END - foreach
$ret = substr($ret, 2);
} else {
// Zero seconds
- $ret = "0 {--_SECONDS--}";
+ $ret = '0 {--_SECONDS--}';
}
// Return fancy time string
function addEmailNavigation ($PAGES, $offset, $show_form, $colspan, $return=false) {
$TOP = '';
if ($show_form === false) {
- $TOP = " top";
- }
+ $TOP = ' top';
+ } // END - if
$NAV = '';
for ($page = 1; $page <= $PAGES; $page++) {
if (isInString('/', $host)) $host = substr($host, 0, strpos($host, '/'));
// Generate relative URL
- //* DEBUG: */ print("SCRIPT=" . $script.'<br />');
+ //* DEBUG: */ print('SCRIPT=' . $script.'<br />');
if (substr(strtolower($script), 0, 7) == 'http://') {
// But only if http:// is in front!
$script = substr($script, (strlen($url) + 7));
$script = substr($script, (strlen($url) + 8));
}
- //* DEBUG: */ print("SCRIPT=" . $script.'<br />');
+ //* DEBUG: */ print('SCRIPT=' . $script.'<br />');
if (substr($script, 0, 1) == '/') $script = substr($script, 1);
// Return host name
$resolver = new HostnameResolver();
// Open connection
- //* DEBUG: */ die("SCRIPT=" . $script.'<br />');
+ //* DEBUG: */ die('SCRIPT=' . $script.'<br />');
if ($useProxy === true) {
// Resolve hostname into IP address
$ip = $resolver->resolveHostname(compileRawCode(getConfig('proxy_host')));
// Scramble string here
//* DEBUG: */ outputHtml('***Original=' . $str.'***<br />');
- for ($idx = '0'; $idx < strlen($str); $idx++) {
+ for ($idx = 0; $idx < strlen($str); $idx++) {
// Get char on scrambled position
$char = substr($str, $scrambleNums[$idx], 1);
// Begin descrambling
$orig = str_repeat(' ', 40);
//* DEBUG: */ outputHtml('+++Scrambled=' . $str.'+++<br />');
- for ($idx = '0'; $idx < 40; $idx++) {
+ for ($idx = 0; $idx < 40; $idx++) {
$char = substr($str, $idx, 1);
$orig = substr_replace($orig, $char, $scrambleNums[$idx], 1);
} // END - for
$scrambleNumbers = array();
// First we need to setup randomized numbers from 0 to 31
- for ($idx = '0'; $idx < $len; $idx++) {
+ for ($idx = 0; $idx < $len; $idx++) {
// Generate number
$rand = mt_rand(0, ($len -1));
// Handle a (maybe) sent form here
function doNetworkHandleForm () {
// Was the form sent?
- if ((isFormSent()) || (isPostRequestParameterSet('edit')) || (isPostRequestParameterSet('del')) || (isPostRequestParameterSet('change')) || (isPostRequestParameterSet('remove'))) {
+ if ((isFormSent()) || (isFormSent('edit')) || (isFormSent('del')) || (isFormSent('change')) || (isFormSent('remove'))) {
// Do we have a 'do'?
if (isGetRequestParameterSet('do')) {
// Process the request
// Processes an admin form
function doAdminNetworkProcessForm () {
// Form really sent?
- if ((!isFormSent()) && (!isPostRequestParameterSet('edit')) && (!isPostRequestParameterSet('del')) && (!isPostRequestParameterSet('change')) && (!isPostRequestParameterSet('remove'))) {
+ if ((!isFormSent()) && (!isFormSent('edit')) && (!isFormSent('del')) && (!isFormSent('change')) && (!isFormSent('remove'))) {
// Abort here
loadTemplate('admin_settings_unsaved', false, getMessage('ADMIN_NETWORK_FORM_NOT_SENT'));
return;
// Add color
$networkData['sw'] = $SW;
- if (isPostRequestParameterSet('edit')) {
+ if (isFormSent('edit')) {
// Make selection box for network_request_type
$networkData['network_request_type'] = generateOptionList(
'/ARRAY/',
// Add row template for editing
$OUT .= loadTemplate('admin_edit_networks_row', true, $networkData);
- } elseif (isPostRequestParameterSet('del')) {
+ } elseif (isFormSent('del')) {
// Translate the request type
$networkData['network_request_type'] = getMessage('ADMIN_NETWORK_REQUEST_TYPE_' . $networkData['network_request_type']);
// If we have no rows, we don't need to display the edit form
if (!empty($OUT)) {
// Output main template
- if (isPostRequestParameterSet('edit')) {
+ if (isFormSent('edit')) {
loadTemplate('admin_edit_networks', false, $OUT);
- } elseif (isPostRequestParameterSet('del')) {
+ } elseif (isFormSent('del')) {
loadTemplate('admin_del_networks', false, $OUT);
} else {
// Problem!
// Add color
$networkTypeData['sw'] = $SW;
- if (isPostRequestParameterSet('edit')) {
+ if (isFormSent('edit')) {
// Add row template for deleting
$OUT .= loadTemplate('admin_edit_network_types_row', true, $networkTypeData);
- } elseif (isPostRequestParameterSet('del')) {
+ } elseif (isFormSent('del')) {
// Fix empty banner URL
if (trim($networkTypeData['network_type_banner_url']) == '') $networkTypeData['network_type_banner_url'] = '---';
);
// Output main template
- if (isPostRequestParameterSet('edit')) {
+ if (isFormSent('edit')) {
loadTemplate('admin_edit_network_types', false, $content);
- } elseif (isPostRequestParameterSet('del')) {
+ } elseif (isFormSent('del')) {
loadTemplate('admin_del_network_types', false, $content);
} else {
// Problem!
// Add color
$networkRequestData['sw'] = $SW;
- if (isPostRequestParameterSet('edit')) {
+ if (isFormSent('edit')) {
// Add options list for network type
$networkRequestData['type_options'] = generateNetworkTypeOptions($networkRequestData['network_type_id']);
// Add row template for deleting
$OUT .= loadTemplate('admin_edit_network_params_row', true, $networkRequestData);
- } elseif (isPostRequestParameterSet('del')) {
+ } elseif (isFormSent('del')) {
// Fix empty banner URL
if (trim($networkRequestData['request_param_default']) == '') $networkRequestData['request_param_default'] = '---';
);
// Output main template
- if (isPostRequestParameterSet('edit')) {
+ if (isFormSent('edit')) {
loadTemplate('admin_edit_network_params', false, $content);
- } elseif (isPostRequestParameterSet('del')) {
+ } elseif (isFormSent('del')) {
loadTemplate('admin_del_network_params', false, $content);
} else {
// Problem!
addMenuDescription('admin', __FILE__);
// Was an URL added?
-if ((isPostRequestParameterSet('add')) && (isPostRequestParameterSet('url'))) {
+if ((isFormSent('add')) && (isPostRequestParameterSet('url'))) {
// Initialize variables
$DATA = array();
$id = 'reload_ye';
// Some security stuff...
if ((!defined('__SECURITY')) || (!isAdmin())) {
die();
-}
+} // END - if
// Add description as navigation point
addMenuDescription('admin', __FILE__);
// Check if the admin has entered title and what-php file name...
-if (((!isPostRequestParameterSet('title')) || (!isPostRequestParameterSet('menu')) || (!isPostRequestParameterSet(('descr')))) && (isFormSent())) {
+if ((isFormSent()) && ((!isPostRequestParameterSet('title')) || (!isPostRequestParameterSet('menu')) || (!isPostRequestParameterSet('descr')))) {
unsetPostRequestParameter('ok');
} // END - if
}
$OUT .= "</option>\n";
}
- }
- else
- {
+ } else {
$OUT .= " <option value=\"".$m."\">".$titles[$key]."</option>\n";
}
}
} // END - if
// List all menu points and make them editable
-if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+if ((isFormSent('edit')l) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Edit menu entries
// @TODO Kill all constants in this file
$content['sub'] = $SUB;
// Load template
loadTemplate('admin_amenu_edit_form', false, $content);
-} elseif ((isPostRequestParameterSet('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Prepare misc content
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
// Display form is default
$FORM = true;
-if ((isPostRequestParameterSet('add')) && (isPostRequestParameterSet('login')) && (isPostRequestParameterSet('email')) && (isPostRequestParameterSet('pass1')) && (isPostRequestParameterSet('pass2')) && (postRequestParameter('pass1') == postRequestParameter('pass2'))) {
- // Add admin when not added already
- if (addAdminAccount(postRequestParameter('login'), generateHash(postRequestParameter('pass1')), postRequestParameter('email')) == 'done') {
- // Do not ouput any form!
- $FORM = false;
+// Is the form sent?
+if (isFormSent('add')) {
+ // Check all
+ if ((isPostRequestParameterSet('login')) && (isPostRequestParameterSet('email')) && (isPostRequestParameterSet('pass1')) && (isPostRequestParameterSet('pass2')) && (postRequestParameter('pass1') == postRequestParameter('pass2'))) {
+ // Add admin when not added already
+ if (addAdminAccount(postRequestParameter('login'), generateHash(postRequestParameter('pass1')), postRequestParameter('email')) == 'done') {
+ // Do not ouput any form!
+ $FORM = false;
- // Admin login saved
- loadTemplate('admin_settings_saved', false, getMessage('ADMIN_ADMINS_ADD_DONE'));
+ // Admin login saved
+ loadTemplate('admin_settings_saved', false, getMessage('ADMIN_ADMINS_ADD_DONE'));
- // Run filter chain
- runFilterChain('post_admin_added', postRequestArray());
+ // Run filter chain
+ runFilterChain('post_admin_added', postRequestArray());
+ } // END - if
} // END - if
} // END - if
setPostRequestParameter('sel', array($adminId => 1));
} // END - if
-if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0)) {
+if ((isFormSent('edit')) && (countPostSelection() > 0)) {
// Edit account(s)
adminsEditAdminAccount(postRequestArray());
-} elseif ((isPostRequestParameterSet('change')) && (count(postRequestParameter('login')) > 0)) {
+} elseif ((isFormSent('change')) && (count(postRequestParameter('login')) > 0)) {
// Change admin accounts
adminsChangeAdminAccount(postRequestArray());
-} elseif ((isPostRequestParameterSet('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
// Show admin accounts for deletetion
adminsDeleteAdminAccount(postRequestArray());
} else {
- if ((isPostRequestParameterSet('remove')) && (countPostSelection() > 0)) {
+ if ((isFormSent('remove')) && (countPostSelection() > 0)) {
// Remove accounts now
adminsRemoveAdminAccount(postRequestArray());
} // END - if
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-if (isPostRequestParameterSet('edit')) {
+if (isFormSent('edit')) {
// Check if entires are checked
if (countPostSelection() > 0) {
// Add option for events
if (SQL_NUMROWS($result) > 0) {
// Shall I change entries?
- if (isPostRequestParameterSet('change')) {
+ if (isFormSent('change')) {
// Init SQLs
initSqls();
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0)) {
+if ((isFormSent('edit')) && (countPostSelection() > 0)) {
// Edit ACLs
$OUT = ''; $SW = 2;
foreach (postRequestParameter('sel') as $id => $selected) {
// Load main template
loadTemplate('admin_config_admins_edit', false, $OUT);
-} elseif ((isPostRequestParameterSet('change')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('change')) && (countPostSelection() > 0)) {
// Change entries
foreach (postRequestParameter('sel') as $id => $selected) {
// Secure id
// Entries changed
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_ADMINS_ENTRIES_CHANGED'));
-} elseif ((isPostRequestParameterSet('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
// Delete ACLs
$OUT = ''; $SW = 2;
foreach (postRequestParameter('sel') as $id => $selected) {
// Load main template
loadTemplate('admin_config_admins_del', false, $OUT);
-} elseif ((isPostRequestParameterSet('remove')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('remove')) && (countPostSelection() > 0)) {
// Remove entries
// @TODO Rewrite this to filter 'run_sqls'
foreach (postRequestParameter('sel') as $id => $selected) {
// Entries deleted
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_ADMINS_ENTRIES_DELETED'));
-} elseif (isPostRequestParameterSet('add')) {
+} elseif (isFormSent('add')) {
// Check if everything is fine...
$mode = getAdminDefaultAcl(bigintval(postRequestParameter('admin_id')));
// Init variable to avoid a notice
$CATS = '';
-if (isPostRequestParameterSet('add')) {
+if (isFormSent('add')) {
// Add a new category
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `cat`='%s' LIMIT 1",
array(postRequestParameter('catname')), __FILE__, __LINE__);
// Display message
loadTemplate('admin_settings_saved', false, $TEXT);
} // END - if
-} elseif ((isPostRequestParameterSet('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
// Delete categories
$OUT = ''; $SW = 2;
foreach (postRequestParameter('sel') as $id => $value) {
// Load main template
loadTemplate('admin_del_cats', false, $OUT);
-} elseif ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('edit')) && (countPostSelection() > 0)) {
// Edit categories
$OUT = ''; $SW = 2;
foreach (postRequestParameter('sel') as $id => $value) {
// Display message
loadTemplate('admin_settings_saved', false, $TEXT);
} // END - if
-} elseif ((isPostRequestParameterSet('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
// Delete entries
$OUT = ''; $SW = 2;
foreach (postRequestParameter('sel') as $id => $value) {
// Load main template
loadTemplate('admin_config_email_del', false, $content);
-} elseif ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('edit')) && (countPostSelection() > 0)) {
// Edit entries
$OUT = ''; $SW = 2;
foreach (postRequestParameter('sel') as $id => $value) {
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-if (isPostRequestParameterSet('edit')) {
+if (isFormSent('edit')) {
// Check if at least one module is selected
if (countPostSelection() > 0) {
// Output header
unsetPostRequestParameter('edit');
unsetPostRequestParameter('change');
}
-} elseif (isPostRequestParameterSet('change')) {
+} elseif (isFormSent('change')) {
// Init SQLs
initSqls();
if (isPostRequestParameterSet('rate')) setPostRequestParameter('rate', convertCommaToDot(postRequestParameter('rate')));
-if ((isPostRequestParameterSet('add')) && (isPostRequestParameterSet('title')) && (postRequestParameter('rate') > 0)) {
+if ((isFormSent('add')) && (isPostRequestParameterSet('title')) && (postRequestParameter('rate') > 0)) {
// Add new payout type
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE type='%s' LIMIT 1",
array(postRequestParameter('title')), __FILE__, __LINE__);
$result_mem = SQL_QUERY("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `status`='NEW' ORDER BY payout_timestamp DESC", __FILE__, __LINE__);
$display = true;
-if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0)) {
+if ((isFormSent('edit')) && (countPostSelection() > 0)) {
// Edit payout types
if ((isGetRequestParameterSet('ok')) && (getRequestParameter('ok') == 'ok')) {
// Init SQLs
// Load main template
loadTemplate('admin_config_payouts_edit', false, $OUT);
}
-} elseif ((isPostRequestParameterSet('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
// Delete payout types
if ((isGetRequestParameterSet('ok')) && (getRequestParameter('ok') == 'ok')) {
// Init SQLs
loadTemplate('admin_config_point_settings', false, $content);
} elseif (getRequestParameter('sub') == 'ref') {
// 12 3 32 2 3 32 2 3 4 43 21
- if ((isPostRequestParameterSet('del')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
+ if ((isFormSent('del')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
// Delete entries
$OUT = ''; $SW = 2;
foreach (postRequestParameter('sel') as $id => $value) {
// Load main template
loadTemplate('admin_points_del', false, $OUT);
- } elseif ((isPostRequestParameterSet('edit')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
+ } elseif ((isFormSent('edit')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
// Edit entries
$OUT = ''; $SW = 2;
foreach (postRequestParameter('sel') as $id => $value) {
if (isGetRequestParameterSet('rallye')) {
// Price submitted?
- if (isPostRequestParameterSet('add')) {
+ if (isFormSent('add')) {
if ((isPostRequestParameterSet(('level'))) && ((isPostRequestParameterSet('points')) || (isPostRequestParameterSet(('info'))))) {
// Submitted data is valid, but maybe we already have this price level?
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s AND `price_level`='%s' LIMIT 1",
loadTemplate('admin_settings_saved', false, getMessage('RALLYE_PRICE_ALREADY_FOUND'));
}
}
- } elseif (isPostRequestParameterSet('remove')) {
+ } elseif (isFormSent('remove')) {
// Check if at last one line is selected
if (countPostSelection() > 0) {
// Delete selected entries
} else {
loadTemplate('admin_settings_saved', false, getMessage('RALLYE_ENTRIES_NOT_DELETED'));
}
- } elseif (isPostRequestParameterSet('change')) {
+ } elseif (isFormSent('change')) {
// Change entries
foreach (postRequestParameter('level') as $id => $level) {
// Secure id
loadTemplate('admin_settings_saved', false, getMessage('RALLYE_ENTRIES_CHANGED'));
}
- if (isPostRequestParameterSet('edit')) {
+ if (isFormSent('edit')) {
// Check if at last one line is selected
if (countPostSelection() > 0) {
// Make selected editable
$content = '{--RALLYE_NO_PRICES_SELECTED_1--}<a href="{%url=modules.php?module=admin&what=config_rallye_prices&rallye=' . getRequestParameter('rallye') . '%}">{--RALLYE_NO_PRICES_SELECTED_2--}</a>{--RALLYE_NO_PRICES_SELECTED_3--}';
loadTemplate('admin_settings_saved', false, $content);
}
- } elseif (isPostRequestParameterSet('del')) {
+ } elseif (isFormSent('del')) {
// Check if at last one line is selected
if (countPostSelection() > 0) {
// List all prices
}
// Add form for adding new price level
- if (!isPostRequestParameterSet('edit')) {
+ if (!isFormSent('edit')) {
loadTemplate('admin_add_rallye_prices', false, getRequestParameter('rallye'));
} // END - if
} else {
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-if (isPostRequestParameterSet('del')) {
+if (isFormSent('del')) {
// Delete entries from tables
if (countPostSelection() > 0) {
// Init SQLs
addMenuDescription('admin', __FILE__);
// User exists..
-if ((isFormSent()) || ((isPostRequestParameterSet('del')) && (isPostRequestParameterSet(('reason'))))) {
+if ((isFormSent()) || ((isFormSent('del')) && (isPostRequestParameterSet(('reason'))))) {
// Is the account there?
if (fetchUserData(getRequestParameter('userid'))) {
// Delete user account
if ((isFormSent()) && (!isPostRequestParameterSet('id'))) {
unsetPostRequestParameter('ok');
-}
+} // END - if
$result = SQL_QUERY("SELECT id, sender, subject, payment_id, cat_id FROM `{?_MYSQL_PREFIX?}_pool` ORDER BY timestamp", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
initSqls();
// Sponsor was found
- if ((isFormSent()) || (isPostRequestParameterSet('edit'))) {
+ if ((isFormSent()) || (isFormSent('edit'))) {
// Perform action on mode
switch (getRequestParameter('mode')) {
case 'add_points': // Add points
if (!isGetRequestParameterSet('userid')) {
// Output selection form with all confirmed user accounts listed
addMemberSelectionBox();
- } elseif (isPostRequestParameterSet('edit')) {
+ } elseif (isFormSent('edit')) {
// Ok, change the account...
$updateUser = false; $add = '';
if ((!isPostRequestParameterSet('pass1')) && (!isPostRequestParameterSet('pass2'))) {
// We are about to register a new extension
$do = 'register'; $ext_id = bigintval(getRequestParameter('reg_ext'));
// The id comes from task management and it is - of course - *not* the extension's name!
-} elseif ((isPostRequestParameterSet('change')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('change')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// De-/activate extensions
foreach (postRequestParameter('sel') as $ext_id => $active) {
// Shall we keep the extension always active?
doExtensionSqls($ext_id, getExtensionMode());
}
}
-} elseif (((isPostRequestParameterSet('edit')) || (isPostRequestParameterSet('modify'))) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif (((isFormSent('edit')) || (isPostRequestParameterSet('modify'))) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Change settings like CSS file load
if (isPostRequestParameterSet('modify')) {
// Change entries
// Load template
loadTemplate('admin_extensions_delete', false, $OUT);
$do = 'delete';
-} elseif ((isPostRequestParameterSet('remove')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('remove')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Remove extensions from DB (you have to delete all files manually!)
$cache_update = '0';
foreach (postRequestParameter('sel') as $ext_id => $active) {
} // END - if
// List all menu points and make them editable
-if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Edit menu entries
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
// Load template
loadTemplate('admin_gmenu_edit_form', false, $content);
-} elseif ((isPostRequestParameterSet('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Del menu entries with or without confirmation
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
$show = true;
if ((isPostRequestParameterSet('id')) && (is_array(postRequestParameter('id'))) && (count(postRequestParameter('id')) > 0)) {
// Okay, which button was pressed?
- if (isPostRequestParameterSet('change')) {
+ if (isFormSent('change')) {
// Change permissions
adminChangeActivationStatus(postRequestParameter('id'), 'bank_packages', 'package_active');
- } elseif (isPostRequestParameterSet('edit')) {
+ } elseif (isFormSent('edit')) {
// Delete entries (with confirmation)
adminEditEntriesConfirm(
postRequestParameter('id'),
// Delete entries (with confirmation)
adminDeleteEntriesConfirm(postRequestParameter('id'), 'bank_packages', array('id', 'title', 'description', 'account_fee'), array('bigintval', '', '', 'translateComma'), array('', '', '', ''));
$show = false;
- } elseif (isPostRequestParameterSet('remove')) {
+ } elseif (isFormSent('remove')) {
// Delete entries (with confirmation)
adminDeleteEntriesConfirm(postRequestParameter('id'), 'bank_packages', array(), array(), array(), true);
}
addMenuDescription('admin', __FILE__);
// Add new code?
-if ((isPostRequestParameterSet('add')) && (isPostRequestParameterSet(('code'))) && (isPostRequestParameterSet(('descr')))) {
+if ((isFormSent('add')) && (isPostRequestParameterSet('code')) && (isPostRequestParameterSet('descr'))) {
// Check if country code does already exist
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_countries` WHERE code='%s' LIMIT 1",
array(strtoupper(postRequestParameter('code'))), __FILE__, __LINE__);
// Display message
loadTemplate('admin_settings_saved', false, $message);
-} elseif ((isPostRequestParameterSet('change')) && (isPostRequestParameterSet('id'))) {
+} elseif ((isFormSent('change')) && (isPostRequestParameterSet('id'))) {
// Change all status
adminChangeActivationStatus(postRequestParameter('id'), 'countries', 'is_active');
'url' => 'modules.php?module=admin&what=list_country',
'title' => getMessage('ADMIN_COUNTRY_ACTIVATION_NEXT_LINK')
));
-} elseif (((isPostRequestParameterSet('edit')) || (isPostRequestParameterSet('delete'))) && (isPostRequestParameterSet('id'))) {
+} elseif (((isFormSent('edit')) || (isPostRequestParameterSet('delete'))) && (isPostRequestParameterSet('id'))) {
if (count(postRequestParameter('id')) > 0) {
- if (isPostRequestParameterSet('edit')) {
+ if (isFormSent('edit')) {
// Edit template
$row = 'admin_list_country_edit_row';
$post = 'modify';
// Create message
$message = getMessage('ADMIN_COUNTRIES_MODIFIED');
- } elseif ((isPostRequestParameterSet('remove')) && (isPostRequestParameterSet('id'))) {
+ } elseif ((isFormSent('remove')) && (isPostRequestParameterSet('id'))) {
// Remove
$IDs = implode(',', array_keys(postRequestParameter('id')));
addSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_countries` WHERE `id` IN (".$IDs.") LIMIT ".count(postRequestParameter('id'))."");
// Run SQL command
runFilterChain('run_sqls');
-} elseif (isPostRequestParameterSet('remove')) {
+} elseif (isFormSent('remove')) {
// Delete rallyes
if (countPostSelection() > 0) {
// Init SQLs
// No rallye selected to delete!
$message = getMessage('RALLYE_DELETE_NOTHING_SELECTED');
}
-} elseif (isPostRequestParameterSet('change')) {
+} elseif (isFormSent('change')) {
// Change rallye
if (countSelection(postRequestParameter('title')) > 0) {
// Init SQLs
}
}
-if (isPostRequestParameterSet('edit')) {
+if (isFormSent('edit')) {
// Check for selections
if (countPostSelection() > 0) {
// Make all selected and deactivated rallyes editable
$message = '';
-if (isPostRequestParameterSet('add')) {
+if (isFormSent('add')) {
// Check input variables
if (!isPostRequestParameterSet('pay_name')) unsetPostRequestParameter('add');
if ((round(postRequestParameter('pay_rate')) == 0) || (!isPostRequestParameterSet('pay_rate'))) unsetPostRequestParameter('add');
if ((postRequestParameter('pay_min_count') == '0') || (!isPostRequestParameterSet('pay_min_count'))) unsetPostRequestParameter('add');
if (!isPostRequestParameterSet('pay_currency')) unsetPostRequestParameter('add');
-} elseif ((isPostRequestParameterSet('edit')) || (isPostRequestParameterSet('del')) || (isPostRequestParameterSet('change')) || (isPostRequestParameterSet('remove'))) {
+} elseif ((isFormSent('edit')) || (isFormSent('del')) || (isFormSent('change')) || (isFormSent('remove'))) {
// Check if at least one entry was selected
if (!isPostRequestParameterSet('id')) {
// Nothing selected for editing / deleting???
unsetPostRequestParameter('del');
unsetPostRequestParameter('change');
unsetPostRequestParameter('remove');
- } elseif (isPostRequestParameterSet('change')) {
+ } elseif (isFormSent('change')) {
// Change entries here...
foreach (postRequestParameter('id') as $id => $sel) {
// Secure id
// Generate message
$message = getMessage('SPONSOR_PAY_ENTRIES_CHANGED');
- } elseif (isPostRequestParameterSet('remove')) {
+ } elseif (isFormSent('remove')) {
// Remove entries here...
foreach (postRequestParameter('id') as $id => $sel) {
// Remove entry
} // END - if
}
-if (isPostRequestParameterSet('add')) {
+if (isFormSent('add')) {
// Check if entry with same name does exists
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `pay_name`='%s' LIMIT 1",
array(postRequestParameter('pay_name')), __FILE__, __LINE__);
// Output message
loadTemplate('admin_settings_saved', false, $message);
-} elseif ((isPostRequestParameterSet('edit')) || (isPostRequestParameterSet('del'))) {
+} elseif ((isFormSent('edit')) || (isFormSent('del'))) {
// Load all data
$OUT = ''; $SW = 2;
foreach (postRequestParameter('id') as $id => $sel) {
'curr' => htmlspecialchars($curr)
);
- if (isPostRequestParameterSet('edit')) {
+ if (isFormSent('edit')) {
// Edit entry
$OUT .= loadTemplate('admin_list_sponsor_pay_edit_row', true, $content);
} else {
} // END - foreach
// Load main template depending on mode (edit/delete)
- if (isPostRequestParameterSet('edit')) {
+ if (isFormSent('edit')) {
// Load main edit template
loadTemplate('admin_list_sponsor_pay_edit', false, $OUT);
} else {
} // END - if
// Edit or delete button hit?
-if (isPostRequestParameterSet('edit')) {
+if (isFormSent('edit')) {
// Show entries for editing
adminEditEntriesConfirm(
postRequestParameter('id'),
} elseif (isPostRequestParameterSet('do_delete')) {
// Remove entries from database
adminDeleteEntriesConfirm(postRequestParameter('id'), 'surfbar_urls', array(), array(), array(), true);
-} elseif (isPostRequestParameterSet('lock')) {
+} elseif (isFormSent('lock')) {
// Un-/lock selected URLs. This does not work for pending URLs
adminLockEntriesConfirm(
postRequestParameter('id'),
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=0 WHERE `id`=%s AND `assigned_admin`=%s LIMIT 1",
array(bigintval($id), getCurrentAdminId()), __FILE__, __LINE__);
} // END - foreach
- } elseif (isPostRequestParameterSet('del')) {
+ } elseif (isFormSent('del')) {
// Delete tasks
foreach (postRequestParameter('sel') as $id => $sel) {
if (getRequestParameter('type') == 'deleted') {
} elseif (isPostRequestParameterSet('sent')) {
// Sent mail
YOOMEDIA_SEND_BONUS_MAIL(postRequestArray(), 'normal');
-} elseif (isPostRequestParameterSet('remove')) {
+} elseif (isFormSent('remove')) {
// Add mail to exclude list
YOOMEDIA_EXCLUDE_MAIL(postRequestArray(), 'normal');
} elseif (isPostRequestParameterSet('unlist')) {
// Load user's data
if (fetchUserData(getRequestParameter('userid'))) {
// Is a lock reason set?
- if ((isPostRequestParameterSet('lock')) && (getUserData('status') != 'LOCKED')) {
+ if ((isFormSent('lock')) && (getUserData('status') != 'LOCKED')) {
// Ok, lock the account!
if (isExtensionInstalledAndNewer('user', '0.3.5')) {
// Lock with reason
// Prepare message
$message = getMaskedMessage('USER_ACCOUNT_UNLOCKED', getRequestParameter('userid'));
$ACT = true;
- } elseif (isPostRequestParameterSet('del')) {
+ } elseif (isFormSent('del')) {
// Delete the account
$ACT = true;
loadIncludeOnce('inc/modules/admin/what-del_user.php');
} // END - if
// List all menu points and make them editable
-if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Edit menu entries
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
// Load template
loadTemplate('admin_mmenu_edit', false, $content);
-} elseif ((isPostRequestParameterSet('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Del menu entries with or without confirmation
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
// Output template
loadTemplate('admin_settings_saved', false, $content);
-} elseif ((isPostRequestParameterSet('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
// Delete entries here
$OUT = ''; $SW = 2;
foreach (postRequestParameter('sel') as $id => $value) {
// Load main template
loadTemplate('admin_del_payments', false, $OUT);
-} elseif ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('edit')) && (countPostSelection() > 0)) {
// Edit entries
$OUT = ''; $SW = 2;
foreach (postRequestParameter('sel') as $id => $value) {
// Display message
loadTemplate('admin_settings_saved', false, $content);
-} elseif ((countPostSelection() > 0) && (isPostRequestParameterSet('edit'))) {
+} elseif ((countPostSelection() > 0) && (isFormSent('edit'))) {
// Edit banner
$SW = 2; $OUT = '';
foreach (postRequestParameter('sel') as $id => $sel) {
// Load main template
loadTemplate('admin_refbanner_edit', false, $OUT);
} else {
- if ((countPostSelection() > 0) && (isPostRequestParameterSet('del'))) {
+ if ((countPostSelection() > 0) && (isFormSent('del'))) {
// Delete banner
foreach (postRequestParameter('sel') as $id => $sel) {
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `id`=%s LIMIT 1",
$sql = "UPDATE `{?_MYSQL_PREFIX?}_themes` SET theme_active='Y' WHERE `id`='".$id."' LIMIT 1";
}
$OUT = getMessage('ADMIN_THEMES_UPDATED');
- } elseif (isPostRequestParameterSet('del')) {
+ } elseif (isFormSent('del')) {
// Delete themes
$sql = "DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_themes` WHERE `id`='".$id."' LIMIT 1";
$OUT = getMessage('ADMIN_THEMES_DELETED');
ORDER BY
`timestamp` ASC", __FILE__, __LINE__);
-if ((SQL_NUMROWS($result_main) > 0) || (isPostRequestParameterSet('lock'))) {
- if (isPostRequestParameterSet('accept')) {
+if ((SQL_NUMROWS($result_main) > 0) || (isFormSent('lock'))) {
+ if (isFormSent('accept')) {
if (countPostSelection() > 0) {
// Accept mail orders
foreach (postRequestParameter('sel') as $id => $value) {
// Nothing selected
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_MAILS_NOTHING_CHECKED'));
}
- } elseif ((isPostRequestParameterSet('lock')) && (countPostSelection() > 0) && (getConfig('url_blacklist') == 'Y')) {
+ } elseif ((isFormSent('lock')) && (countPostSelection() > 0) && (getConfig('url_blacklist') == 'Y')) {
// Lock URLs
foreach (postRequestParameter('sel') as $id => $url) {
// Secure id number
// Output message
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_URLS_BLOCKED'));
- } elseif ((!isPostRequestParameterSet('lock')) && (!isPostRequestParameterSet('accept')) && (!isPostRequestParameterSet('reject'))) {
+ } elseif ((!isFormSent('lock')) && (!isFormSent('accept')) && (!isFormSent('reject'))) {
// Mail orders are in pool so we can display them
$OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result_main)) {
// Load main template
loadTemplate('admin_unlock_emails', false, $content);
- } elseif ((isPostRequestParameterSet('lock')) && (getConfig('url_blacklist') != 'Y')) {
+ } elseif ((isFormSent('lock')) && (getConfig('url_blacklist') != 'Y')) {
// URL blacklist not activated
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_URL_BLACKLIST_DISABLED'));
} else {
// Detect what the member wants to do
$mode = 'show'; // Show his data
if (isPostRequestParameterSet('save')) $mode = 'save'; // Save entered data
-if (isPostRequestParameterSet('edit')) $mode = 'edit'; // Edit data
+if (isFormSent('edit')) $mode = 'edit'; // Edit data
if (isPostRequestParameterSet('notify')) $mode = 'notify'; // Switch off notification
switch ($mode) {
} // END - if
// Was the form submitted?
-if ((isPostRequestParameterSet('edit')) && (isPostRequestParameterSet('id'))) {
+if ((isFormSent('edit')) && (isPostRequestParameterSet('id'))) {
// Okay, has the user entered some values?
if (isPostRequestParameterSet('percents')) {
// Revert german commta for testing
}
// Checks wether a form was sent. If so, the $_POST['ok'] element must be set
-function isFormSent () {
+function isFormSent ($requestParameter = 'ok') {
// Simply wrap it!
- return isPostRequestParameterSet('ok');
+ return isPostRequestParameterSet($requestParameter);
}
// Checks if 'content_type' is set
</tr>
<tr>
<td class="bottom" align="right">
- {--ADMIN_EXPERT_SETTINGS_MAKE_PERMANENT--}
+ <input type="checkbox" class="admin_normal" name="expert_settings" value="Y" />
</td>
<td class="bottom" align="center">
- <input type="checkbox" class="admin_normal" name="expert_settings" value="Y" />
+ {--ADMIN_EXPERT_SETTINGS_MAKE_PERMANENT--}
</td>
</tr>
<tr>