السلام عليكم ورحمة الله
لدى معرض للصور يعرض الصور مصغر ثم تضغط على كلمة تحت الصورة ليقوم بعرض الصورة بشكل كبير
المشكلة:
عند الضغط على كلمة تكبير الصورة لا تعمل.
المطلوب :
ايجاد حل لجعل هذه الخاصية تعمل وايضا اريد ان اضغط على الصورة تعمل نفس الخاصية وتعرض لى نفس الصورة مكبرة.
الكود
<?
// Folder Name
$dir = "./pic";
// Number of photos in each page
$pic = 100;
// Number of photos in each row
$Column = 4 ;
// size of photo
$templates= "100";
// Extensions of photos
$exten = array (".bmp",".jpg",".gif",".png",".ani",".BMP",".JPG",".GIF");
// ******** (: ********//
//###########################################################################################
//###########################################################################################
//###########################################################################################
$files = array();
if (!is_dir($dir)){echo " <h1>Be sure from the folder name</h1>";}
$open = @opendir($dir) or die("<h1> $dir Open folder error </h1>");
for ($file=0;$file=readdir($open) ;$file++)
{
if($file !="."&& $file !="..")
{
$exten1 = strrchr($file ,'.');
if (in_array( strrchr($file ,'.') , $exten))
{
$files[] = $file;
//echo"$file<br>";
}
}
}
closedir($open);
//###########################################################################################
// Number of photos in each page
//$pic = 100;
$data = $files;
rsort ($data);
$max = count($files);
// Next table arranges
///////////////////////////////////////////////////////////
// start of table and arranges
echo "<div align='center'> <table border='1' cellpadding='1' cellspacing='1' width='95%' dir='rtl' id='table1' bordercolor='#D3D3D3'>
<tr><td colspan='$Column' style='color: D3D3D3' bgcolor='000000'> <div align='center'><h2>$title</h2></div> </td> <tr>";
$ColumnCounter=1; // number of embty cels
//###########################################################################################
$action == 'shwo';
if ($action == 'shwo'){
echo "<div align='center'><b> <a href='java script:history.go(-1)'>Back</a><br><hr><br>$file_shwo<br><br>
<img src='$dir/$file_shwo' border='0'><br><br>
</b></div>";
exit;
}
//###########################################################################################
///////////////////////////////////////////////////////////
$start = $page * $pic;
$end = $page * $pic + $pic;;
if ($end > $max){$end=$max;}
for ($u=$start; $u<$end; $u++)
{
echo "<td width='25%' align='center' valign='top'><font size='1' face='MS Sans Serif'>
<img src='$dir/$data[$u]' width='$templates' height='$templates' border=0><br style='line-height: 150%'>
<a href='index.php?action=shwo&file_shwo=$data[$u]'> <b>[ Enlarg ]</b></a>
</font></td>";
///////////////////////////////////////////////////////////
// التالي امتدلد للجدول السابق وهذا هو الجزء الذي يتكرر بشروط
if($ColumnCounter=="$Column")// شرط لتكرار الحقول اذا وصل اربعة ينتقل الى صف جديد
{echo "</tr>
<tr>";
$ColumnCounter=0;
}
$ColumnCounter++;// امر التكرار
}
echo "
</tr>
<tr>
<td colspan='$Column' style='color: D3D3D3' bgcolor='000000'>
<div align='center'><h4>Show photos : ($start to $end) - Total photos $max </h4></div>
</td>
<tr> </table> </div><br>";// نهاية جدول عرض الاقسام
?>وشكراً لمساعدتكم
