<?
function check_confd()
{
global $conf_dir, $photos_path;


if (!file_exists($conf_dir)){
if(!@mkdir($conf_dir, 0755)){
echo "
<font class='fntmsg2'>
Script can not create the directory '$conf_dir' for configuration files. <br>
</font>
<font class='fnt2p'>
Set up permission 777 for your classifieds directory and permission 
755 for the script admconf.php <br> by chmod command via ftp client,   and run this script again 
or create the directory  '$conf_dir' <br> with permission 777 manually  
inside classifieds directory.
</font><p>
";
}
else {
chmod ($conf_dir, 0777);
$flinf="<html><body></body></html>";
$cf_file=$conf_dir."index.html"; 
if (!($flnm=fopen("$cf_file","w"))){flsverr($cf_file);}
fwrite($flnm, $flinf);
fclose($flnm);

echo "
<font class='fntmsg1'>
The directory '$conf_dir' for configuration files has been created successfully !
<p>
</font>
";
}
}


if (!file_exists($photos_path)){
if(!@mkdir($photos_path, 0755)){
echo "
<font class='fntmsg2'>
Script can not create the directory '$photos_path' for ads photos. <br>
</font>
<font class='fnt2p'>
Set up permission 777 for your classifieds directory and permission 
755 for the script admconf.php <br> by chmod command via ftp client, and run this script again 
or create the directory  '$photos_path' <br> with permission 777 manually  
inside classifieds directory.
</font><p>
";
}
else {
chmod ($photos_path, 0777);
$flinf="<html><body></body></html>";
$cf_file=$photos_path."index.html"; 
if (!($flnm=fopen("$cf_file","w"))){flsverr($cf_file);}
fwrite($flnm, $flinf);
fclose($flnm);


echo "
<font class='fntmsg1'>
The directory '$photos_path' for ads photos has been created successfully !
<p>
</font>
";
}
}

}

?>