Ok, thanks for your replys. I needed the id for the dynamic SSL encryption, wich I've mailed to you.
With the {NAV_TABLE_COLUMN:5} problem is maybe a workaround, to build the structure recursive. So let the script search for the lowest level and and then one higer and so on until you reaches the root. So you don't have to count with i++ for it. See the example below, thats how I build it together with a friend at my interrims CMS for the firm:
Code: Select all
// Laden der Verfügaren Seiten
$query = "SELECT * FROM pages WHERE vis='1' ORDER BY sort ASC";
$result = mysql_query($query);
// In diesen Array kommen statische Seiten
$_static = array();
// In diesen dynamische
$_dynamic = array();
// Hier kommen sie alle einmal rein
$_all = array();
// DIese beiden Arrays brauche ich für den Pagetree
$tree = array();
$tree_r = array();
$rootpage = "";
// SQL Abfrage auswerten....
while ($tmp = mysql_fetch_array($result)) {
$_all[] = $tmp["site"];
// Typ feststellen und entspr. Speichern.
if ($tmp["type"] == "static") $_static[] = $tmp["site"];
else $_dynamic[] = $tmp["site"];
// Die beiden Tree Arrays speichern.
/*
Mit diesen beiden Arrays kann man nun den ganzen
pagetree rekonstruieren. In $tree wird die aktuelle
page immer als subarray des "parent" gespeichert.
Bei tree_r wird für jede Seite ein array angelegt.
*/
$tree[$tmp["parent"]][] = $tmp;
$tree_r[$tmp["site"]] = $tmp;
if ($tmp["root"] == "Y") $rootpage = $tmp["site"];
}
// Wenn keine Seite als rootpage markiert wurde, aufhören
if ($rootpage == "") die("Sorry, we have no startpage");
<-- SNIPP / SNAPP -->
// Rekursive Funktion zum finden der root Page des aktuellen Astes
function find_root($site) {
global $tree_r;
$search = 0;
if ($tree_r[$site]["parent"] == "0")
$search = $site;
else
$search = find_root($tree_r[$site]["parent"]);
return $search;
}
$search = find_root($site);
if (is_array($tree[$search]))
foreach ($tree[$search] as $page) {
if ($page["auth"] == "Y") continue;
$t->set_local(array(
"page_title" => $page["title"],
"hash_link" => $_decode[$page["site"]]
));
$t_name = "sub_menuitem";
if (in_array($page["site"], $path)) {
$t_name = "sub_menuitem_act";
}
$t->load($t_name, "submenu");
if (in_array($page["site"], $path))
third_menu($page["site"]);
}
else
$t->set_global("submenu", "");
Maybe it's helpfully to you, maybe not...
Cheers,
Florian