1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
   | <?php
function filAriane()
{
  $path = $_SERVER['PHP_SELF'];
  $file = basename ($path);
 
	function titre($page) //fonction pour récupérer le titre de la page
	{
		$title = '';
		$file = file_get_contents($page);
		if (eregi("<title>(.*)</title>", $file, $sortie)) $title = $sortie[1];
 
		return $title;
	}
 
	$mytitle = titre($file);
 
	$path = $_SERVER['PHP_SELF'];
	$file = basename ($path);
 
	$titre=$file;
 
	$nbr = 4;
	$name = substr($titre, 0, -$nbr);
 
	$var=explode('/',$_SERVER['REQUEST_URI']);
	$i=0;
	$i2=0;
	foreach($var AS $contenu)
	{
		if($var[$i]!=$var[count($var)-1] and !empty($var[$i]) AND $i!=0)
		{
			$contenu2.=((!empty($contenu))?($contenu.'/'):(''));
			$var[$i]='<a href="http://'.$_SERVER['HTTP_HOST'].'/'.$contenu2.'">'.ucfirst($contenu).'</a>';
			$i2++;
		}
		$i++;
	}
	if (empty($_GET['p']))
		$var[$i-1]=$mytitle.'.php';
	else
		$var[$i-1]=$_GET['p'].'.php';
 
	if(!empty($var[count($var)-1]))
	{
		$var[count($var)-1]=ucfirst(substr($var[count($var)-1],0,strrpos($var[count($var)-1],'.')));
		$i2++;
	}
	$var=ltrim(urldecode(implode(' > ',$var)),' > ');
	if(preg_match('# > $#isU',$var))
	{
		$var=preg_replace('# > $#isU','',$var);
	}
        $var = str_replace('-', ' ', $var);
		$var = str_replace("Apprendre Informatique", " ", $var);
 
	return '<a href="http://www.apprendreinformatique.fr/plan.php" style="color: #808080;font-style: underline;">[Plan du site]</a>  <a href="http://'.$_SERVER['HTTP_HOST'].'">Apprendre informatique</a> > '.$var;
 
 
}
?> | 
Partager