************************************************************************/
// Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) {
+if ((!defined('__SECURITY')) || (!is_admin())) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
require($INC);
}
unset($_POST['remove']);
} elseif (isset($_POST['change'])) {
// Change entries here...
- foreach ($_POST['id'] as $id=>$sel) {
+ foreach ($_POST['id'] as $id => $sel) {
// Secure ID
$id = bigintval($id);
$MSG = SPONSOR_PAY_ENTRIES_CHANGED;
} elseif (isset($_POST['remove'])) {
// Remove entries here...
- foreach ($_POST['id'] as $id=>$sel) {
+ foreach ($_POST['id'] as $id => $sel) {
// Remove entry
$result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_sponsor_paytypes WHERE id='%s' LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
if (!empty($MSG)) {
// Output message
LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
- OUTPUT_HTML("<BR>");
+ OUTPUT_HTML("<br />");
}
}
if (SQL_NUMROWS($result) == 0) {
// No entry found so add this line
$result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_rate, pay_min_count, pay_currency)
- VALUES ('%s', '%s', '%s', '%s')",
+ VALUES ('%s','%s','%s','%s')",
array(htmlspecialchars($_POST['pay_name']), str_replace(",", ".", $_POST['pay_rate']), bigintval($_POST['pay_min_count']), htmlspecialchars($_POST['pay_currency'])),
__FILE__, __LINE__);
// Output message
LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
- OUTPUT_HTML("<BR>");
+ OUTPUT_HTML("<br />");
} elseif ((isset($_POST['edit'])) || (isset($_POST['del']))) {
// Load all data
$OUT = ""; $SW = 2;
- foreach ($_POST['id'] as $id=>$sel) {
+ foreach ($_POST['id'] as $id => $sel) {
// Load entry
$result = SQL_QUERY_ESC("SELECT pay_name, pay_rate, pay_min_count, pay_currency FROM "._MYSQL_PREFIX."_sponsor_paytypes WHERE id='%s' LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);