************************************************************************/
// 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__));
// Do we edit/delete/change main menus or sub menus?
$AND = "what = ''"; $SUB = "";
-if (!empty($_GET['sub']))
-{
+if (!empty($_GET['sub'])) {
$AND = sprintf("action='%s'", SQL_ESCAPE($_GET['sub']));
$SUB = SQL_ESCAPE($_GET['sub']);
}
else
{
// List sub menus
- $query = SQL_QUERY_ESC("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_guest_menu WHERE action='%s' AND what != '' ORDER BY sort ASC",
+ $query = SQL_QUERY_ESC("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_guest_menu WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort ASC",
array($SUB), __FILE__, __LINE__);
}