Charger | Nouveau
source non définie
"; else if ($fgrep == "") echo "grep non défini
"; else if ($f == "") echo "filename non défini
"; else { if (!file_exists("$confdir/$f")) createfile("$confdir/$f"); $fp = fopen("$confdir/$f","w"); fwrite($fp,"source\t\t= \"$fsource\"\n"); fwrite($fp,"titlesite\t= \"$fsource\"\n"); fwrite($fp,"linksite\t= \"$flinksite\"\n"); fwrite($fp,"descriptionsite\t= \"$fdescriptionsite\"\n"); fwrite($fp,"languagesite\t= \"$flanguagesite\"\n"); fwrite($fp,"baseurl\t\t= \"$fbaseurl\"\n"); fwrite($fp,"grep\t\t= \"$fgrep\""); fclose($fp); } } // télécharge le fichier source $data = implode("",file($source)); // le nettoie $data = strtr($data,"\n\t\0\r"," "); $data = trim($data); echo "les champs marqués d'un * sont obligatoires."; echo "
source*:
titlesite:
filename:$filename
linksite:
descriptionsite:
languagesite:
baseurl:
grep*:
offset:



"; if (isset($source)) { preg_match_all("'$grep'",$data,$res,PREG_SET_ORDER); if ($offset == "") $offset = 0; $index = $offset; while($res[$index][0] != "") { if ($res[$index][1] != "" && $res[$index][2] != "") { echo $res[$index][2]." ("; if (isset($baseurl) && !strchr($res[$index][1],"http://")) echo $baseurl; echo htmlspecialchars(trim(strtr($res[$index++][1],"\""," "))).")
\n"; } } } } else if (isset($add) && $add == "new") { echo "les champs marqués d'un * sont obligatoires."; echo "
source*:
titlesite:
filename*:
linksite:
descriptionsite:
languagesite:
baseurl:
grep*:
offset:



"; } else { $d = opendir("$confdir/"); while (false!==($file = readdir($d))) if ($file[0] != ".") echo "
  • ".$file."\n"; closedir($d); } ?>