Login   Register  
PHP Classes

File: breadCrumbs.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Tofeeq ur Rehman  >  Bread crumbs  >  breadCrumbs.php  >  Download  
File: breadCrumbs.php
Role: Class source
Content type: text/plain
Description: generate breadcrumbs for seo sites
Class: Bread crumbs
Generate breadcrumb links from page URI
Author: By
Last change: more flexible to adopt
Date: 6 years ago
Size: 1,673 bytes


Class file image Download
@Taufeeq ur Rehman
@Sat Feb 16 11:52:10 PST 2008 11:52:10
@Class:breadcrumbs to keep track of what user has been visited.
@A facility which will show the customer what steps they have 
    taken to get to their current location
class breadCrumbs{
function breadCrumbs($site_root,$site_name,$css_class){
$this->site_root $site_root;
$this->site_name $site_name;
$this->css_class $css_class;
function _breadCrumbs(){
strpos($_SERVER['REQUEST_URI'],".php"))return false;
$this->site_name != '/')
$uri str_replace("/".$this->site_name."/","",$_SERVER['REQUEST_URI']);
$uri ltrim($_SERVER['REQUEST_URI'],"/");
$uri split("\?",$uri);
$args $uri[1];
$uri $uri[0];    
$pos strpos($uri,".html");
substr($uri,strlen($uri)-1,strlen($uri)) == '/')
$slash '/';
$uri explode("/",rtrim($uri,"/"));
//echo '<p><pre>'; var_export($uri);echo '</pre></p>';
$url '<a class="'.$this->css_class.'" href="'.$this->site_root.'">Home</a> > ';
$href "";
$i=0$i<count($uri); $i++){
$s "";
$i == (count($uri)-1)) $s $slash;
            else if((
strpos($uri[$i+1],".html") === false)) $s '/';
strpos($uri[$i],".html") !== false$href.="/";
$url.= '<a href="'.$this->site_root.$href.'" class="'.$this->css_class.'">'.trim($uri[$i],"/").'</a> > ';
$url substr($url,0,(strlen($url)-3));