define('__SUB_VALUE', $SUB);
define('__CHK_VALUE', $chk);
- $cnt = 0; $SW = 2; $OUT = "";
+ $cnt = 0; $OUT = ""; $SW = 2;
foreach (REQUEST_POST('sel') as $sel => $confirm)
{
if ($confirm == 1)
} else {
// List sub menus
$result = 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__);
+ array($SUB), __FILE__, __LINE__);
}
// Get number of menu entries
$max = SQL_NUMROWS($result);
if ($max > 0) {
// Set sub value
+ // @TODO Rewrite this constant
define('__SUB_VALUE', $SUB);
// Init variables
$cnt = 0;
$OUT = "";
- while (list($id, $act, $wht, $title, $sort) = SQL_FETCHROW($result)) {
+ // Process all menu entries
+ while ($content = SQL_FETCHARRAY($result)) {
$cnt++;
- if (($sort == 0) || (($sort == 1) && (!empty($SUB)))) {
+ if (($content['sort'] == 0) || (($content['sort'] == 1) && (!empty($SUB)))) {
// Is highest position
- $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=guestedit&sub={!__SUB_VALUE!}&act=".$act."&w=".$wht."&tid=".($sort+1)."&fid=".$sort."\">{--LOWER--}</a>";
+ $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=guestedit&sub={!__SUB_VALUE!}&act=".$content['action']."&w=".$content['what']."&tid=".($content['sort']+1)."&fid=".$content['sort']."\">{--LOWER--}</a>";
} elseif ($cnt == $max) {
// Is lowest position
- $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=guestedit&sub={!__SUB_VALUE!}&act=".$act."&w=".$wht."&tid=".($sort-1)."&fid=".$sort."\">{--HIGHER--}</a>";
- } elseif ($sort > 0) {
+ $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=guestedit&sub={!__SUB_VALUE!}&act=".$content['action']."&w=".$content['what']."&tid=".($content['sort']-1)."&fid=".$content['sort']."\">{--HIGHER--}</a>";
+ } elseif ($content['sort'] > 0) {
// Anything else between highest and lowest
- $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=guestedit&sub={!__SUB_VALUE!}&act=".$act."&w=".$wht."&tid=".($sort-1)."&fid=".$sort."\">{--HIGHER--}</a>/<a href=\"{!URL!}/modules.php?module=admin&what=guestedit&sub={!__SUB_VALUE!}&act=".$act."&w=".$wht."&tid=".($sort+1)."&fid=".$sort."\">{--LOWER--}</a>";
+ $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=guestedit&sub={!__SUB_VALUE!}&act=".$content['action']."&w=".$content['what']."&tid=".($content['sort']-1)."&fid=".$content['sort']."\">{--HIGHER--}</a>/<a href=\"{!URL!}/modules.php?module=admin&what=guestedit&sub={!__SUB_VALUE!}&act=".$content['action']."&w=".$content['what']."&tid=".($content['sort']+1)."&fid=".$content['sort']."\">{--LOWER--}</a>";
}
- if (empty($act)) $act = " ";
- if (empty($wht)) $wht = " ";
- if (empty($title)) $title = " ";
+ if (empty($content['action'])) $content['action'] = " ";
+ if (empty($content['what'])) $content['what'] = " ";
+ if (empty($content['title'])) $content['title'] = " ";
+
$content = array(
'sw' => $SW,
- 'id' => $id,
- 'action' => $act,
- 'what' => $wht,
- 'title' => $title,
+ 'id' => $content['id'],
+ 'action' => $content['action'],
+ 'what' => $content['what'],
+ 'title' => $content['title'],
'navi' => $NAVI,
'mode' => "guest"
);