Commit e545064e authored by Ryan Wade's avatar Ryan Wade

Fixed bug where "Home" was not shown in breadcrumb.php

Due to use of != vs !==
Improved Breadcrumb generation algorithm
parent ad6b6861
......@@ -47,7 +47,7 @@
}
public function GET_PAGE($id)
{
if(($id!=null)&&($id>=0) && ($id<count($this->pages)))
if(($id !== null) && ($id > -1) && ($id < count($this->pages)))
return $this->pages[$id];
return new SQL_ROW(null);
}
......
......@@ -27,18 +27,14 @@
}*/
$t_id = $this->id;
$t_title = $this->title;
$link = "";
//if($t_id == -1)
//$link = "<a class='breadcrumbLink' href='viewpage.php?id=".$t_id."'>".$t_title."</a>";
while(true)
$link = "<a class='breadcrumbLink' href='viewpage.php?id=".$t_id."'>".$t_title."</a>";
$t_id = $this->SQL->GET_PAGE($t_id)->GET_ATTRIBUTE(1);
while(($t_id !== -1)&&($t_id!==null))
{
$link = " > <a class='breadcrumbLink' href='viewpage.php?id=".$t_id."'>".$t_title."</a>".$link;
$t_title = $this->SQL->GET_PAGE($t_id)->GET_ATTRIBUTE(2);
$link = "<a class='breadcrumbLink' href='viewpage.php?id=".$t_id."'>".$t_title."</a> > ".$link;
$t_id = $this->SQL->GET_PAGE($t_id)->GET_ATTRIBUTE(1);
if($t_id == -1||$t_id==null)
break;
$t_title = $this->SQL->GET_PAGE($t_id)->GET_ATTRIBUTE(2);//SQL get Title
}
$link = substr($link,3);
?>
<div id="breadcrumb">
<div id="breadcrumbBox">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment