function addReferalRallyePrices ($rallye, $mode = 'email') {
// Output mode
switch($mode) {
- case 'email': $mode = "\n"; break;
- case 'html' : $mode = "<br />\n"; break;
+ case 'email': $mode = "\n"; break;
+ case 'html' : $mode = '<br />'; break;
} // END - switch
// Load prices
$sql = "UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET";
foreach ($postData as $key => $value) {
// Mmmmm, too less security here???
- $sql .= " `".secureString($key)."`='%s',";
+ $sql .= " `" . secureString($key) . "`='%s',";
// We will secure this later inside the SQL_QUERY_ESC() function
$DATA[] = secureString($value);
$sql = substr($sql, 0, -1);
// Add SQL tail data
- $sql .= " WHERE `id`=%s AND password='%s' LIMIT 1";
+ $sql .= " WHERE `id`=%s AND `password`='%s' LIMIT 1";
$DATA[] = bigintval(getSession('sponsorid'));
$DATA[] = getSession('sponsorpass');
$actionArray = SURFBAR_GET_ARRAY_FROM_STATUS($status);
// Init HTML code
- $OUT = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"100%\">
-<tr>\n";
+ $OUT = '<table border="0" cellspacing="0" cellpadding="1" width="100%">
+<tr>';
// Calculate width
$width = round(100 / count($actionArray));
} // END - foreach
// Close table
- $OUT .= "</tr>
-</table>\n";
+ $OUT .= '</tr>
+</table>';
// Return code
return $OUT;
// Some security stuff...
if ((!defined('__SECURITY')) || (!isAdmin())) {
die();
-}
+} // END - if
// Add description as navigation point
addMenuDescription('admin', __FILE__);
$menus = array(); $titles = array(); $below = array();
// Get all available main menus
- $result = SQL_QUERY("SELECT
+ $result_menu = SQL_QUERY("SELECT
`action`, `title`, `sort`
FROM
`{?_MYSQL_PREFIX?}_guest_menu`
(`what`='' OR `what` IS NULL)
ORDER BY
`sort` ASC", __FILE__, __LINE__);
- if (!SQL_HASZERONUMS($result)) {
+ if (!SQL_HASZERONUMS($result_menu)) {
// Read menu structure
// @TODO Cant this be rewritten?
- while ($content = SQL_FETCHARRAY($result)) {
+ while ($content = SQL_FETCHARRAY($result_menu)) {
// Menu actions
$menus[] = $content['action'];
$below[] = $content['sort'] + 1;
} // END - while
- // Free memory
- SQL_FREERESULT($result);
-
// Remove double eintries
// @TODO This can be somehow rewritten to a function
$prev = ''; $dmy = $menus; $dmy2 = $titles; $dmy3 = $below;
// Below this menu point should the new be added so we simply increase the sort value by 1 :-)
$below[$value_main][] = $content['sort'] + 1;
- }
-
- // Free memory
- SQL_FREERESULT($result);
+ } // END - while
// Remove double eintries
// @TODO This can be somehow rewritten to a function
} else {
$prev = $value;
}
- }
+ } // END - foreach
// Transfer dummy array
$menus[$value_main] = $dmy;
$titles[$value_main] = $dmy2;
$below[$value_main] = $dmy3;
- }
- }
- }
+ } // END - if
+
+ // Free memory
+ SQL_FREERESULT($result);
+ } // END - foreach
+ } // END - if
+
+ // Free memory
+ SQL_FREERESULT($result_menu);
- $OUT = " <select class=\"admin_select\" name=\"sort\" size=\"1\">
- <option value=\"0\">{--IS_FIRST_MENU--}</option>";
+ $OUT = '<select class="admin_select" name="sort" size="1">
+ <option value="0">{--IS_FIRST_MENU--}</option>';
foreach ($below as $key => $m) {
if (is_array($m)) {
foreach ($m as $key2 => $m2) {
- $OUT .= " <option value=\"".$m2."\">".$titles[$key][$key2];
+ $OUT .= '<option value="' . $m2 . '">' . $titles[$key][$key2];
foreach ($menus as $k => $v) {
if (($v == $key) && (!is_array($v))) {
- $OUT .= " (" . $titles[$k] . ')';
+ $OUT .= ' (' . $titles[$k] . ')';
}
}
- $OUT .= "</option>\n";
+ $OUT .= '</option>';
}
} else {
- $OUT .= " <option value=\"".$m."\">".$titles[$key]."</option>\n";
+ $OUT .= '<option value="' . $m . '">' . $titles[$key] . '</option>';
}
}
- $OUT .= "</select>";
+ $OUT .= '</select>';
// Prepare selections for template
$content['below_selection'] = $OUT;
} // END - foreach
} // END - if
- $OUT = "<select class=\"admin_select\" name=\"sort\" size=\"1\">
- <option value=\"\">{--IS_FIRST_MENU--}</option>\n";
+ $OUT = '<select class="admin_select" name="sort" size="1">
+ <option value="">{--IS_FIRST_MENU--}</option>';
foreach ($below as $key => $m) {
if (is_array($m)) {
foreach ($m as $key2 => $m2) {
- $OUT .= " <option value=\"" . $m2 . "\">" . $titles[$key][$key2];
+ $OUT .= '<option value="' . $m2 . '">' . $titles[$key][$key2];
foreach ($menus as $k => $v) {
if (($v == $key) && (!is_array($v))) {
- $OUT .= " (" . $titles[$k] . ')';
+ $OUT .= ' (' . $titles[$k] . ')';
} // END - if
} // END - foreach
- $OUT .= "</option>\n";
+ $OUT .= '</option>';
} // END - foreach
} else {
- $OUT .= " <option value=\"" . $m . "\">" . $titles[$key] . "</option>\n";
+ $OUT .= '<option value="' . $m . '">' . $titles[$key] . '</option>';
}
}
- $OUT .= "</select>";
+ $OUT .= '</select>';
// Prepare selection boxes for template
$content['below_selection'] = $OUT;
// Generate monthly stats
$SW = 2; $r2 = ' right'; $l = 'll'; $r = 'lr'; $OUT = '';
foreach ($months as $month => $cnt) {
- if ($SW == 2) $OUT .= "<tr>\n";
+ if ($SW == 2) $OUT .= '<tr>';
// Prepare data for template
$data = array(
$r2 = '';
$l = 'rl'; $r = 'rr';
} else {
- $OUT .= "</tr>\n";
+ $OUT .= '</tr>';
$r2 = ' right';
$l = 'll'; $r = 'lr';
}
if (isExtensionActive('country')) {
// Generate selection box
- $OUT = "<select name=\"country_code\" class=\"member_select\" size=\"1\">\n";
+ $OUT = '<select name="country_code" class="member_select" size="1">';
$whereStatement = "WHERE `is_active`='Y'";
if (isAdmin()) $whereStatement = '';
$OUT .= generateOptionList('countries', 'id', 'descr', $content['country_code'], 'code', $whereStatement);
- $OUT .= "</select>";
+ $OUT .= '</select>';
$content['country'] = $OUT;
} else {
// Ouput default input box
// Add row
// @TODO Move this code into a template
- $OUT .= "<tr>
- <td class=\"{%template,ColorSwitch%} bottom right\" align=\"center\" height=\"30\">
- <input type=\"radio\" name=\"member_theme\" class=\"member_normal\" value=\"".$unix."\"".$default." />
+ $OUT .= '<tr>
+ <td class="{%template,ColorSwitch%} bottom right" align="center" height="30">
+ <input type="radio" name="member_theme" class="member_normal" value="' . $unix . '"' . $default . ' />
</td>
- <td class=\"{%template,ColorSwitch%} bottom right\" align=\"center\">".$THEMES['theme_name'][$key]."</td>
- <td class=\"{%template,ColorSwitch%} bottom right\" align=\"center\">
- <a href=\"mailto:".$THEMES['theme_email'][$key]."?Subject=[Theme:] ".$THEMES['theme_name'][$key]." (".$unix.")'.'\">".$THEMES['theme_author'][$key]."</a>
+ <td class="{%template,ColorSwitch%} bottom right" align="center">' . $THEMES['theme_name'][$key] . '</td>
+ <td class="{%template,ColorSwitch%} bottom right" align="center">
+ <a href="mailto:' . $THEMES['theme_email'][$key] . '?Subject=[Theme:] ' . $THEMES['theme_name'][$key] . ' (' . $unix . ')'.'">' . $THEMES['theme_author'][$key] . '</a>
</td>
- <td class=\"{%template,ColorSwitch%} bottom right\" align=\"center\">
- <a href=\"".generateDerefererUrl($THEMES['theme_url'][$key])."\" target=\"_blank\">".$THEMES['theme_url'][$key]."</a>
+ <td class="{%template,ColorSwitch%} bottom right" align="center">
+ <a href="' . generateDerefererUrl($THEMES['theme_url'][$key]) . '" target="_blank">' . $THEMES['theme_url'][$key] . '</a>
</td>
- <td class=\"{%template,ColorSwitch%} bottom\" align=\"center\">v".$THEMES['theme_version'][$key]."</td>
-</tr>\n";
+ <td class="{%template,ColorSwitch%} bottom" align="center">v' . $THEMES['theme_version'][$key] . '</td>
+</tr>';
} // END - foreach
if (empty($OUT)) {
if (!SQL_HASZERONUMS($result)) {
// Load list
- $OUT = "<select name=\"to_userid\" size=\"1\" class=\"member_select\">
- <option value=\"0\">{--SELECT_NONE--}</option>\n";
+ $OUT = '<select name="to_userid" size="1" class="member_select">
+ <option value="0">{--SELECT_NONE--}</option>';
// @TODO Try to rewrite his to $content = SQL_FETCHARRAY(), see some lines above for two different queries
while (list($userid, $nick) = SQL_FETCHROW($result)) {
- $OUT .= " <option value=\"".$userid."\"";
+ $OUT .= ' <option value="' . $userid . '"';
if ((isPostRequestParameterSet('to_userid')) && (postRequestParameter('to_userid') == $userid)) $OUT .= ' selected="selected"';
$OUT .= '>';
if (($nick != $userid) && (!empty($nick))) {
SQL_FREERESULT($result);
} else {
// Nothing for in or out
- $OUT = "<tr>
- <td colspan=\"5\" align=\"center\" class=\"bottom\">
- ".loadTemplate('admin_settings_saved', true, $nothingMessage)."
+ $OUT = '<tr>
+ <td colspan="5" align="center" class="bottom">
+ ' . loadTemplate('admin_settings_saved', true, $nothingMessage) . '
</td>
-</tr>";
+</tr>';
}
// ... and add them to a constant for the template
if (isAdmin()) $ADD = '';
$dummy = substr($search, 0, -4);
- $ADD .= " AND `action`='".getActionFromModuleWhat($accessLevel, $dummy)."'";
+ $ADD .= sprintf(" AND `action`='%s'", getActionFromModuleWhat($accessLevel, $dummy));
} elseif (($accessLevel == 'sponsor') || ($accessLevel == 'engine')) {
// Sponsor / engine menu
$type = 'what';