Yo, naja, kann man nix machen *schnief*
Grüsse Manfred
Grüsse Manfred
/* ************************************************************************************* */
function GetSubPageFromId ($PageId, $admin) {
if ($admin != "1") { $admin_where = " AND HTMLContent IS NOT NULL"; }
$result = mysql_query( "SELECT * FROM AllPages WHERE UpperId = '$PageId' $admin_where ORDER BY Sort,UpperId" );
if ( mysql_num_rows($result) > 0 ) {
while ($zeile=mysql_fetch_array($result)) {
$PageArray[$zeile["Id"]] = array (
"Id" => $zeile["Id"],
"UpperId" => $zeile["UpperId"],
"Sort" => $zeile["Sort"],
"Name" => $zeile["Name"] );
}
}
else {
$PageArray = -1;
}
return $PageArray;
}
/* ************************************************************************************* */
function GetTopFoldersFromId ($PageId) {
$result = mysql_query( "SELECT Name,UpperId,Id FROM AllPages WHERE Id = '$PageId'" );
if ( mysql_num_rows($result) > 0 ) {
$zeile = mysql_fetch_array($result);
$Folders = $zeile["Id"];
if ($zeile["UpperId"] != 0) {
$Folders = GetTopFoldersFromId ($zeile["UpperId"]) . "|" . $Folders;
}
}
return $Folders;
}
/* ************************************************************************************* */
function GetNavigationFromId ($StartPageId, $SpaceWidth, $ActivePage, $Recursiv, $admin) {
global $PHP_SELF;
$SpaceIMG = "<img src=\"/images/dot-x.gif\" width=\"".$SpaceWidth."\" height=\"1\" border=\"0\" align=\"middle\" alt=\"\">";
if ($SpaceWidth==0) {
$SpaceIMG = "";
$SpaceWidth = -3;
}
$array_temp = GetSubPageFromId($StartPageId, $admin);
$folder = "|" . GetTopFoldersFromId($ActivePage) . "|";
if ($array_temp!=-1) {
while(list($key,$value) = each($array_temp)) {
if (strstr($folder,"|$key|")) { $active_zusatz = "class=\"active\""; } else { $active_zusatz = ""; }
$NavigationString.= " ".$SpaceIMG."<a $active_zusatz href=\"".$PHP_SELF."?id=".$key."\" target=\"_top\">".$array_temp[$key][Name]."</a><br>\n";
if ( ($Recursiv > 0) && strstr($folder, "|".$array_temp[$key][Id]."|") ) {
$NavigationString.= GetNavigationFromId ($array_temp[$key][Id], $SpaceWidth+3, $ActivePage, $Recursiv-1, $admin);
}
}
$Recursiv--;
}
return $NavigationString;
}
Kommentar