şunu farkettim
100067.swf - 100100.jpg eklendi.. bu şekilde yazıyor yani oyuna karşılık gelmesi gereken resim yerine tüm oyunlarda 100100.jpg adlı resim yazıyor sanırım nedeni bu fakat bunu bir türlü çözemedim. yardımcı olabilcek arkadaş varmı acaba. bendeki indirdiğim dosyanın içeriği bu.
<?php
function uzantiBul($isim) {
$dizi = explode('.',$isim);
$eleman = count($dizi) -1;
$uzanti = $dizi["$eleman"];
//echo $uzanti;
return $uzanti;
}
include('../includes/config.php');
/* echo "<form method=\"POST\">";
echo "<input type=\"text\" name=\"diz\" />";
echo "<input type=\"submit\"></form>"; */
$dizin = '../files/file/'; # $_POST['diz'];
$dir = '../files/image/';
if(!is_dir($dizin)){ echo "Dizin bulunamadı."; return; }
if(!is_dir($dir)){ echo "Dizin bulunamadı."; return; }
if($ac=opendir($dizin)) {
while (($dosya=readdir($ac)) !== false) {
// if (is_file("../files/file/$dosya.swf")) {
$uzan = uzantiBul($dosya);
if($uzan == "swf") {
$dosya=substr($dosya,0,-4);
$sonuc = mysql_query("Select file from files where file = '$dosya.swf' Limit 1");
$satir = mysql_num_rows($sonuc);
if($satir == 0){
$tarih = date("Y-m-d");
$res = "";
$sss = substr($dosya,0,strlen($dosya)-3);
if($as=opendir($dir)) {
while( ($aman = readdir($as)) !== false){
if( ($aman != '.') and ($aman!='..') ){
if(eregi("^$sss(.*).jpg",$aman) ){
$res = $aman;
}
}
}
closedir($as);
}
mysql_query("INSERT INTO files VALUES('','$dosya', 'Türkiye\'nin en kral oyun sitesinde yüzlerce birbirinden farkli güzel oyunlar ve $dosya oyunu , mükemmel $dosya flash oyunları , En kral $dosya oyunları','$dosya oyunu mükemmel bir oyun',1,500,400,1,1,'$res',1,1,$tarih,0,0,0,0,'',' $dosya.swf')");
echo("$dosya.swf - $res eklendi..<br>");
} //if(satir
} //if uzanti
// } //if(is_file
} //while
closedir($ac);
echo("<b><font size=\"+5\">İşlem bitti..</font></b><br>");
} //if ac
?>