<?php
include("./datas/config.php");
		
$dir_links = realpath("./");
	
if ($handle = opendir($dir_links)) {

   while (false !== ($file = readdir($handle))) {  	 
   	
   	   if($file == "error_log" 
   	   || $file == "." 
   	   || $file == ".." 
   	   || $file == "index.php" 
	   || $file == "_private"
           || $file == "_vti_bin"
           || $file == "_vti_cnf"
           || $file == "_vti_log"
           || $file == "_vti_pvt"
           || $file == "_vti_txt"
           || $file == "links"
           || $file == "datas"
   	   || $file == "$templatefoldername" 
   	   || $file == ".htaccess" 
   	   || $file == "Cgi Bin" 
   	   || $file == "cgi-bin" 
   	   || $file == "error" 
   	   || $file == "stats" 
   	   || $file == "phpinfo.php" 
	   || $file == "partners.php"
	   || $file == "privacy.php"  
   	   || $file == "sitemap.php" 
   	   || $file == "sitemap.xml" 
   	   || $file == "robots.txt"
   	   || $file == "text-links.txt"
   	   || $file == "cache"
   	   || $file == "permalink.php"
|| $file == "feed.xml"
	   || $file == "tos.php"
	   || $file == "partners_instr.php"
	   || $file == "submitarticle.php"
	   || $file == "tellafriend.php"
	   || $file == "article_list.php"
   	   ){
   		
   		echo "";
   	}
   	else{
   		
   		$file_name_1 = str_replace("-", " ", $file);
   		$file_name_2 = str_replace(".php", " ", $file_name_1);
   		$file_name_3 = ucwords($file_name_2); 
   		$file_name = rtrim($file_name_3); 
   		$file = str_replace("", "/", $file);
   	
          $hreflist[] = "<a class=\"nav\" href=\"".$file."\">$file_name</a><span class=\"hide\"> | </span><br/>";
          
   	}
   }

   closedir($handle);
   
$nr1 = count($hreflist);

if($nr1 < $nr_links){
	
	$nr_links = $nr1;
}
   
for ($x = 0; $x < $nr_links; $x++) {    
	mt_srand((double)microtime()*1000000);
    $RandomNumber = rand (1, count($hreflist)-1);
    print($hreflist[$RandomNumber]);
}
   
}

?>
