--- inc/conn.inc 2001/03/03 12:56:37 1.5 +++ inc/conn.inc 2001/09/18 10:38:55 1.9 @@ -9,12 +9,31 @@ exit; } - $url=basename($PHP_SELF)."?$QUERY_STRING"; - $sth = $dbh->prepare("select item from menu where url = '$url'"); + $sql_section=""; + + $url=basename($PHP_SELF); + if ($QUERY_STRING) $url.="?$QUERY_STRING"; + + if ($section) $sql_section=" and section='$section'"; + + $sth = $dbh->prepare("select item from menu where url = '$url' $sql_section limit 1"); $sth->execute(); global $menu_item; if ($row=$sth->fetchrow_hash()) { $menu_item=$row[0]; } + // parse /preview URL + + global $is_preview,$visible_is_true; + + $preview_url="/preview"; + if (substr($GLOBALS[REQUEST_URI],0,strlen($preview_url)) == $preview_url) { + $is_preview=1; + $visible_is_true = "true"; // visible can be true or false + } else { + $visible_is_true = "visible is true"; // limit output just to visible + } + + ?>