include_once("wc/_common.php");
include_once("_template_renderer.php");
$content_title = $content_keywords = $content_description = "Карта сайта";
include("_header.php");
function place_map_level($parent_id = 0, $level_nr = 0){
global $db, $content_table_name, $this_http_path, $site_http_path, $current_menu;
$res = "";
$r = $db->getrst("select * from ".$content_table_name."_menu where `view`='".addslashes($current_menu)."' and parent_id=$parent_id order by sort_nr");
if ($r->eof()) {}
else {
$nr = 0;
$res.="
";
while(!$r->eof()) {
$nr++;
$mc = $r->fields["title"];
$mu = $r->fields["link"];
$res.="- ";
if (!$mu) $res.="".he($mc)."";
else {
if (strpos($mu, "content.php?id=") === 0) $mu = $site_http_path."?".substr($mu, strlen("content.php?id=")."&from=menu&mid=".$r->id);
if (strpos($mu,"?")===0) {
if (strlen($mu)>1) {
$n = substr($mu, 1);
if (trim(num($n))==$n) $mu = $site_http_path."?id=".$n."&from=sitemap";
else $mu = $site_http_path.$mu;
} else $mu="javascript:void null;";
}
if (strpos($mu, "?") === false && !(strpos(strtolower($mu), "http://")===0)) $mu = $site_http_path.$mu;
$res.="".he($mc)."";
}
$res.=place_map_level($r->id, $level_nr+1);
$res.="
";
$r->movenext();
}
$res.="
";
}
$r->close(); unset($r);
return $res;
}
$map = place_map_level();
?>Карта сайта
echo($map);
include("_footer.php");
?>