webForumDet fria alternativet

Opendir

1 svar · 283 visningar · startad av maxj

maxjMedlem sedan juli 20032 inlägg
#1

<?php

	function Cache() 

{
header("Pragma: no-cache");
header("Cache-control: no-cache");
}
$filedir2 = "arbet/graf";
$filedir = "arbet/graf/sma";
$dh = opendir($filedir);
while(gettype($file = readdir($dh)) != boolean)
{
if (is_dir("$filedir/$file")) {
} else {
$size = getimagesize("$filedir2/$file");
$info = pathinfo("$file");
$ext = $info["extension"];
echo "<tr onMouseOver=\"this.style.backgroundColor='#eeeeee';\" onMouseOut=\"this.style.backgroundColor='';\">";
echo "<a href=\"$filedir2/$file\" onclick=\"javascript:return iPop(this.href,$size[0],$size[1],'$file')\"><img src=\"$filedir/$file\"></a>";

}
}
closedir($dh);
?>

hur ska jag få den här koden att bara visa bilder?

MatteMedlem sedan aug. 20002 970 inlägg
#2

Testa det här:

if ($size = @getimagesize("$filedir2/$file")) { 
    $info = pathinfo("$file"); 
    $ext = $info["extension"]; 
    echo "<tr onMouseOver=\"this.style.backgroundColor='#eeeeee';\" onMouseOut=\"this.style.backgroundColor='';\">"; 
    echo "<a href=\"$filedir2/$file\" onclick=\"java script:return iPop(this.href,$size[0],$size[1],'$file')\"><img src=\"$filedir/$file\"></a>"; 
}
127 ms totalt · 3 externa anrop · cache AV · v20260731051352-full.56cc9887
0 ms — hämta statistik (cache)
0 ms — hämta forumlista (cache)
124 ms — hämta tråd, inlägg och bilagor (db)