************************************************************************/
// 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);
}
+
// Add description as navigation point
ADD_DESCR("admin", basename(__FILE__));
-OUTPUT_HTML("</FONT><br />");
-
-OPEN_TABLE("100%", "admin_content admin_content_align", "");
// Check if the admin has entered title and what-php file name...
if (((empty($_POST['title'])) || (empty($_POST['menu']))) && (isset($_POST['ok'])))
// Remove double eintries
$prev = ""; $dmy = $menus; $dmy2 = $titles; $dmy3 = $below;
- foreach ($menus as $key=>$value)
+ foreach ($menus as $key => $value)
{
if ($value == $prev)
{
}
$menus = $dmy; $titles = $dmy2; $below = $dmy3;
// Load sub menus :)
- foreach ($menus as $key_main=>$value_main)
+ foreach ($menus as $key_main => $value_main)
{
$result = SQL_QUERY_ESC("SELECT what, title, sort
FROM "._MYSQL_PREFIX."_guest_menu
-WHERE action='%s' AND what != '' ORDER BY sort",
+WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort",
array(bigintval($value_main)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0)
{
// Remove double eintries
$prev = ""; $dmy = $menus[$value_main]; $dmy2 = $titles[$value_main]; $dmy3 = $below[$value_main];
- foreach ($menus[$value_main] as $key=>$value)
+ foreach ($menus[$value_main] as $key => $value)
{
if ($value == $prev)
{
$OUT = " <SELECT class=\"admin_select\" name=\"sort\" size=\"1\">
<OPTION value=\"0\">".IS_FIRST_MENU."</OPTION>";
- foreach ($below as $key=>$m)
+ foreach ($below as $key => $m)
{
if (is_array($m))
{
- foreach ($m as $key2=>$m2)
+ foreach ($m as $key2 => $m2)
{
$OUT .= " <OPTION value=\"".$m2."\">".$titles[$key][$key2];
- foreach ($menus as $k=>$v)
+ foreach ($menus as $k => $v)
{
if (($v == $key) && (!is_array($v)))
{
if (!empty($_POST['menu']))
{
$result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_guest_menu
-(action, what, title, sort, visible, locked)
-VALUES('%s', '%s', '%s', '%s', '%s', '%s')",
+(`action`,`what`,`title`,`sort`,`visible`,`locked`)
+VALUES('%s','%s','%s','%s','%s','%s')",
array(
$_POST['menu'],
$_POST['name'],
{
$result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_guest_menu
(action, title, sort, visible, locked)
-VALUES('%s', '%s', '%s', '%s', '%s')",
+VALUES('%s','%s','%s','%s','%s')",
array(
$_POST['name'],
$_POST['title'],
LOAD_TEMPLATE("admin_settings_saved", false, SETTINGS_NOT_SAVED);
}
-CLOSE_TABLE();
//
?>