///ini_set('display_errors',1);
include('inc/functions.php');
$content='';
if(isset($_GET['dir'])){
$dir='/'.$_GET['dir'];
}
else if(isset($_GET['txt'])){
$txt=$_GET['txt'];
$text=1;
}
else {
$dir='';
$root=1;
}
if(!isset($text)){
$dirname='data'.$dir;
$linkdir=str_replace('data','',$dirname);
}
/* Title */
$content_ttl='';
if(isset($text)){
if(substr_count($txt,'webalizer'))die(file_get_contents($txt.'.html'));
$content_ttl=txt_ttl($txt);
$pos=strrpos($txt,'/')+1;
$branch=substr($txt,0,$pos);
include('inc/rating.php');
$src=str_replace('_',' ','data/'.$txt.'.txt');
$rating=str_replace(' ','-',retrieve_rating($src));
$swf_var='';
if(isset($_COOKIE['rated_clips'])){
$cdt=$_COOKIE['rated_clips'];
if(substr_count($cdt,$txt))$swf_var='&rated_clip=1';
}
$content.='
';
else $content.='
';
$content.='
';
foreach($dirs as $dir){
if(!substr_count($dir,'.txt')){
$content.='| • '.dir_ttl($dir).' | ';
$j++;
if($j==3){
$content.='
';
$j=0;
}
}
}
$content.='
';
$content.='
';
}
}
/* Listings */
if(!isset($text)){
$files=read_dir(str_replace('_',' ',$dirname));
if(count($files)>0){
$content.='
';
if(!isset($root)){
foreach($files as $ftxt){
$content.='
';
}
if(count($files))$content.='
';
}
$content.='
';
}
}
/* Content */
if(isset($text)){
$file='data/'.str_replace(array('_'),array(' '),$txt).'.txt';
if(file_exists($file)){
$rtcl=get_article($file);
$ad_img='
';
$rtcl_txt=$ad_img.$rtcl[1];
$content.='
'.$rtcl_txt.'
';
}
else $content.='File not found.';
}
/* Ad unit 2 + Link unit */
if( (!isset($root)) && (isset($text)) )$content.='
'.$ad;
$content.='
';
/* Header */
if(isset($text)){
$ttl=$rtcl[0];
$ttlc=strtoupper($ttl);
if($ttl===$ttlc)$ttl=ucwords(strtolower($ttl));
if($ttl=='')$ttl=$content_ttl;
$desc=strip_tags($rtcl[1]);
if(strlen($desc) > 160){
$desc=substr($desc,0,160);
$pos=strrpos($desc,'.');
if($pos!=0)$desc=substr($desc,0,$pos);
else $desc=substr($desc,0,160);
}
$description=trim($desc);
$keywords=related_tags($title.' '.$description.' '.$branch.' article');
}
else if(!isset($root)){
$ttl='Articles on '.$catg_ttl;
$bdt=explode('/',$branch);
$bdtc=count($bdt);
$branch_txt='';
if($bdtc>2)$branch_txt=' in the Category '.str_replace('_',' ',$bdt[($bdtc-2)]);
$description='Articles on '.$catg_ttl.$branch_txt;
$keywords=related_tags($title.' '.$description.' '.$branch.' '.join($dirs,' '));
}
else{
$ttl='Rticlez - General Article Directory';
$description='General article directory featuring articles with information on various subjects';
$keywords='articles, directory, information, media, career, Finance, business, internet, education, health, computers, culture, knowledge, holiday, family, Arts, society, Lifestyle, recreation, life planning, automotive';
}
/* Output */
include('template.php');
echo "";
?>