<?php
function extract_nom($files) {
	 $reslut['original'] = $files;
	 $rub=$url='';
	 ## detection
	 if ( (empty($_PX_config)) OR (!is_array($_PX_config)) ) {
		if (is_dir("config/")) { @require ("config/sys_config.php"); $admin=true; $reslut['admin']="../";}
		elseif ( (is_dir("include/")) AND (file_exists("include/sys_config.php")) ) { @require ("include/sys_config.php"); $admin=false;}
		else return false;
	 }
	 if (!empty($files)) $f=$files;
	 else $f=$_SERVER['REQUEST_URI'];
	 if ($admin)$data= eregi_replace(CHEMIN_ADMIN, "", $f);
	 else $data= eregi_replace(CHEMIN_DU_SITE, "", $f);
	 ## gestion argument get
	 if (eregi("\\?","$data")) { $reslut['arg']=strchr($data,"?");  $data= str_replace($reslut['arg'], "", "$data"); }
	 if (eregi("/",$data)){
		$r=explode("/",$data);
		$max=count($r); $lf=$max-1;
		for ($p=0;$p>$lf;$p++)
			if (!eregi("^\\.\\.",$r[$p])){ $rub .=$r[$p]."_"; $url .=$r[$p]."/";}
	 } else {
		$r=array("$data");
		$lf=0;
	 }
	 $reslut['ext']=eregi_replace(".*[.]",".", $r[$lf] );
	 $reslut['file']=eregi_replace("([.][a-z]{3})","", $r[$lf] );
	 $reslut['rub']=$rub;
	 $reslut['url']=$url;
	return $reslut;
}
?>