קובץ ראשי index.php : <?php function DisplayRandomImage($album) { $DIRNAME=$album; $msg = ""; $y = 0; $images = array(); $file_handle = "";if (is_dir($DIRNAME)) { $file_handle=opendir($DIRNAME); $y = 0; foreach (glob("$DIRNAME/thumbs/*.jpg") as $images[$y]) { $y++; } if (count($images) > 0) { srand((double)microtime()*1000000); $y = rand(0,(count($images) - 1)); $msg ="<img src='$images[$y]' class='im'>"; } else { $msg = "No random images located in \"" . $DIRNAME . "\"\n"; } foreach (glob("$DIRNAME/thumbs/*.JPG") as $images[$y]) { $y++; } if (count($images) > 0) { srand((double)microtime()*1000000); $y = rand(0,(count($images) - 1)); $msg ="<img src='$images[$y]' class='im'>"; } else { $msg = "No random images located in \"" . $DIRNAME . "\"\n"; } } else { $msg = "\"" . $DIRNAME . "\" does not appear to be a valid directory!\n"; } return $msg; } foreach (glob("$album/*.jpg") as $filename) { $co++; list($width[], $height[]) = getimagesize("$filename"); $pics[]=$filename; $picsn[]=str_replace("$album/",'',$filename); } foreach (glob("$album/*.JPG") as $filename) { $co++; list($width[], $height[]) = getimagesize("$filename"); $pics[]=$filename; $picsn[]=str_replace("$album/",'',$filename); } ## $no=0; if (isset ($album)) { if (!(file_exists("$album/thumbs")) ) { mkdir("$album/thumbs",0777); chmod ("$album/thumbs",0777); } } if (isset ($album)) { foreach ($pics as $filename) { if ($height[$no] > $width [$no]) { $ratio[$no] = ($height[$no]/$width[$no]); $nheight1[$no]="400"; $nwidth1[$no]=($nheight1[$no]/$ratio[$no]); } else { $ratio[$no] = ($width[$no]/$height[$no]); $nwidth1[$no]="400"; $nheight1[$no]=($nwidth1[$no]/$ratio[$no]); } $newf="$album/thumbs/$picsn[$no]"; if (!(file_exists($newf))) { $thumb[$no] =imagecreatetruecolor($nwidth1[$no],$nheight1[$no]); $source[$no] = ImageCreateFromJpeg("$pics[$no]"); imagecopyresampled($thumb[$no], $source[$no], 0, 0, 0, 0, $nwidth1[$no], $nheight1[$no],$width[$no], $height[$no]); imagejpeg($thumb[$no],$newf); } $no++; } } # $ne=$_GET['pic']; $a=$_GET['a']; $file=$_GET['download']; $image=$_GET['image']; $page=$_GET['page']; $album=$_GET['album']; $action=$_GET['action'];
include "sql.php"; $result = mysql_query("SELECT fn FROM album WHERE album='$album'") or die(mysql_error()); $desc = mysql_fetch_array($result); ?> <html> <head> <META content="text/html; charset=windows-1255" http-equiv=Content-Type> <link rel="stylesheet" type="text/css" href="css1.css" > </head> <body style="margin:0px ;color:white;BACKGROUND-ATTACHMENT: fixed;BACKGROUND-IMAGE: url('newback.gif'); " > <center> <div style="height:100% ; width:85% ; margin-top:0px ; background:#0F2931"> <?php include "../menu.php"; switch ($action) { case "": echo "<table align='center' valign='top' cellspacing='5' dir=rtl><tr>"; include "sql.php"; $result = mysql_query("SELECT * FROM album") or die(mysql_error()); while($row = mysql_fetch_array($result)) {$bbb++; $int=$bbb/3; $pos = strpos($int, '.'); $dd1=substr($int, $pos+1); $about=$row['fn']; $name=$row['album']; echo "<td valign='MIDDLE'> <div dir=rtl><cneter> <table border=1 valign='top' dir=rtl> <center><a href='?action=view&album=$name'><tr style='cursor:pointer'> <td>".DisplayRandomImage($name)."</center></td> <td width=200 style=\"BACKGROUND-ATTACHMENT: fixed;BACKGROUND-IMAGE: url('bg3.gif');\"><center>$about</center></td> </tr></a> </table></center> </div> </td>"; if ($dd1==0) echo "</tr><tr>"; } echo "</th></table><br>"; break; case "view": foreach ($pics as $aaa) { echo "<img src=$aaa style='display:none'>"; } echo " <center> <table style='margin:5px'> <tr><td style=\"font:bold italic 25px ;BACKGROUND-IMAGE:url('bg3.gif') ;BACKGROUND-ATTACHMENT:fixed ; text-align:center ; width=250 ; color:#FFFFFF ;\"> גלריית תמונות</td></tr> <tr><td> </td></tr> <tr><td><center>$album</center></td></tr> <tr><td><center>".$desc['0']."</td></tr> </table> <br> <table style='margins:10px ;' cellspacing='50'> <tr> <td valign='top' align='left'><iframe src='center.php?album=$album' width='450' height='480' frameborder='0' align='middle' name='center' scrolling='no' style='border:1px ridge black' ></iframe> </td> <td valign='top'><iframe src='men.php?album=$album' height='550' frameborder='0' align='middle' scrolling='no' style='border:1px ridge black' ></iframe> </td> </tr> </table> <br> <table> <tr><td><a href='?'><center>HOME</center></a></td></tr> </table>"; break; } include "../footer.php"; ?> </div> </center> </body> </html>
|
הנה הדף של התמונות הממוזערות :
<html> <head></head> <body style="margin:0px; BACKGROUND-ATTACHMENT: fixed;BACKGROUND-IMAGE: url('bg3.gif')" > <?php $album=$_GET;include "sql.php"; $co='0'; foreach (glob("$album/*.jpg") as $filename) { $co++; list($width, $height) = getimagesize("$filename"); $pics=$filename; $picsn=str_replace("$album/",'',$filename); } foreach (glob("$album/*.JPG") as $filename) { $co++; list($width, $height) = getimagesize("$filename"); $pics=$filename; $picsn=str_replace("$album/",'',$filename); } $no='0'; foreach ($pics as $filename1) { if ($height > $width ) { $ratio = ($height/$width); $nheight1="400"; $nwidth1=($nheight1/$ratio); } else { $ratio = ($width/$height); $nwidth1="400"; $nheight1=($nwidth1/$ratio); } $no++; } $aaa=0; $limit="18";
$ne=$_GET; $a=$_GET; $file=$_GET; $image=$_GET; $page=$_GET; if (!isset($page)) $page=1; $mpage=ceil($co/$limit); $max=($limit*$page); $min=($limit*($page-1)); $npage=($page+1); $ppage=($page-1); include "sql.php"; $result = mysql_query("SELECT fn FROM album WHERE album='$album'") or die(mysql_error()); $desc = mysql_fetch_array($result); ?> <div style="BACKGROUND-ATTACHMENT: fixed;BACKGROUND-IMAGE: url('bg3.gif')" > <center> <table width=250 > <?php for ($a=$min;$a>=$min AND $a<$max;$a++) {$aaa++; $picn=str_replace("$album/",'',$pics); $int=$aaa/3; $pos = strpos($int, '.'); $dd=substr($int, $pos+1); if (isset($pics)) {echo "<center><td valign='middle'> <div><cneter> <table> <tr><td><center><a href='center.php?image=true&pic=$a&album=$album' target='center'><img src=$album/thumbs/$picsn style='width:60px;height:60px; border:1px ridge black;'> </a></center></td></tr> </table></center> </div>"; } if ($dd==0) echo "</tr><tr>"; } ?> </tr></table> <br> <?php if ($mpage>1) echo "<center> <table dir=rtl > <tr><td colspan=2><center> עמוד $page מתוך $mpage </center></td></tr> <tr>"; echo "<td>"; if ($page>0 AND $page<$mpage) echo "<a href='?action=view&album=$album&page=$npage'><center>$ne<img src='right.gif' border=0></center></a>"; echo "</td> <td>"; if ($page<=$mpage AND $page>=2) echo "<a href='?action=view&album=$album&page=$ppage'><center>$ne<img src='left.gif' border=0></center></a>"; echo "</td>"; if ($mpage>1) echo "</tr></table></center> "; ?> </td> </tr></table> </center> </div> </body> </html>
|
ואחרון חביב
הפריים של התמונה התחלפת :
<?php $album=$_GET; $ne=$_GET; $a=$_GET; $file=$_GET; $image=$_GET; $page=$_GET; $limit="18";if (!isset($ne)) { $image=true; if (!(isset($page))) $page='1'; $ne=($limit*($page-1)); } $co='0'; foreach (glob("$album/*.jpg") as $filename) { $co++; list($width, $height) = getimagesize("$filename"); $pics=$filename; $picsn=str_replace("$album/",'',$filename); } foreach (glob("$album/*.JPG") as $filename) { $co++; list($width, $height) = getimagesize("$filename"); $pics=$filename; $picsn=str_replace("$album/",'',$filename); } $no='0'; foreach ($pics as $filename1) { if ($height > $width ) { $ratio = ($height/$width); $nheight1="400"; $nwidth1=($nheight1/$ratio); } else { $ratio = ($width/$height); $nwidth1="400"; $nheight1=($nwidth1/$ratio); } $no++; } $nextp=($ne+1); $prevp=($ne-1);
if ($ne<=$co AND $ne>=1) $nnn="<a href='?image=true&album=$album&pic=$prevp'><img src='left.gif' border=0></a>"; else $nnn=" "; if ($ne>=0 AND $ne<($co-1)) $nnn1="<a href='?image=true&pic=$nextp&album=$album'><img src='right.gif' border=0></a>"; else $nnn1=" "; ?> <html> <head> <style> a:link {color:white ; text-decoration:none ; } a:visited {color:white ; text-decoration:none} a:hover {color:white ; text-decoration:none ; } </style> </head> <body style="margin:0px" > <table style="width:450px; height:480px ;BACKGROUND-ATTACHMENT: fixed;BACKGROUND-IMAGE: url('bg3.gif')" valign=middle> <tr><td colspan=3><center><img src='http://photos.muler.co.il/<?php echo $album;?>/thumbs/<?php echo $picsn;?> ' width=<?php echo $nwidth1;?>px height=<?php echo $nheight1;?>px > </center></td></tr> <tr><td style='text-align:left'><?php echo $nnn;?></td><td style='text-align:center ;'><?php echo "$nextp / $co";?></td><td style='text-align:right ;'><?php echo $nnn1;?></td></tr> <tr><td colspan=3 ><a href='down.php?action=download&download=<?php echo "$picsn&album=$album'"?>><center>DOWNLOAD</center></a></td></tr> </table> </td> </body> </html>
|