Location: PHPKode > projects > chillyCMS > chillyCMS/modules/breadcrumbs/breadcrumbs.php
<?php
defined('DOIT') or die('Restricted access');

$this->query('select * from site_content order by startpage desc');
$result = $this->db->getdata_array();

$nextid = $this->id;
$depth = false;
$breadcrumbs = array();

$breadcrumbs[0] = array('id'=>0,'name'=>escape_html($thismod->data['settings']),'startpage'=>1);

/*foreach ($result as $row) {
	if ($row['startpage']==1) {
		$breadcrumbs[0] = array('id'=>0,'name'=>$row['name'],'startpage'=>1);
		break;
	}
}*/

do {
	foreach ($result as $row) {
		if ($row['id']==$nextid) {
			$depth = $row['depth'];
			$breadcrumbs[$depth] = array('id'=>$row['id'],'name'=>$row['name'],'startpage'=>$row['startpage']);
			$nextid = $row['parentid'];
			break;
		}
	}
} while ($depth>1);

ksort($breadcrumbs);

foreach ($breadcrumbs as $depth=>$bc) {
	if ($bc['startpage']==0 or $bc['id']==0) {
		if ($depth>0) { echo  ' &raquo;'; }
		echo ' <a href="'.URL.'/index.php';

		if ($depth>0) {
			echo '?id='.$bc['id'];
		}
	
		echo '">'.$bc['name'].'</a>';
	}
}

?>
Return current item: chillyCMS