مرحبا اخواني اسف جدا لعدم دخولي في المنتدى شوي الوضع خلاني ابتعد عن الأنترنيت اسف جدا .
اخواني اليوم عندي مشكلة في سكربت لوضع شعار على الصور المتواجدة في مجلد معين .
شوفو السكربت .
مشكلتي مع السكربت هي انا في ملف Uploads عندي اكثر من 900 صورة لكن في المتصفح لا يضهر سوى صورة واحدة المتواجدة في المجلد Uploads الذي يحتوى على 900 صورة فما هو الحل لجلب كل الصور ؟
<?php
$files = glob("uploads/*.*");
for ($i=1; $i<count($files); $i++)
{
header('Content-type: image/jpeg');
$img = $files[$i];
$p = $_GET['p']; if(!$p) $p = 'tl';
if(!$q || $q<0 || $q>100) $q = '200';
$filetype = substr($img,strlen($img)-4,4);
$filetype = strtolower($filetype);
if($filetype == ".gif") $image = @imagecreatefromgif($img);
if($filetype == ".jpg") $image = @imagecreatefromjpeg($img);
if($filetype == ".png") $image = @imagecreatefrompng($img);
$watermark = @imagecreatefrompng('watermark.png');
$w_w = imagesx($watermark);
$w_h = imagesy($watermark);
if($p == "tl") {
$dest_x = 0;
$dest_y = 0;
} elseif ($p == "tc") {
$dest_x = ($img_w - $w_w)/2;
$dest_y = 0;
} elseif ($p == "tr") {
$dest_x = $img_w - $w_w;
$dest_y = 20;
} elseif ($p == "cl") {
$dest_x = 0;
$dest_y = ($img_h - $w_h)/2;
} elseif ($p == "c") {
$dest_x = ($img_w - $w_w)/2;
$dest_y = ($img_h - $w_h)/2;
} elseif ($p == "cr") {
$dest_x = $img_w - $w_w;
$dest_y = ($img_h - $w_h)/2;
} elseif ($p == "bl") {
$dest_x = 0;
$dest_y = $img_h - $w_h;
} elseif ($p == "bc") {
$dest_x = ($img_w - $w_w)/2;
$dest_y = $img_h - $w_h;
} elseif ($p == "br") {
$dest_x = $img_w - $w_w;
$dest_y = $img_h - $w_h;
}
imagecopy($image, $watermark, $dest_x, $dest_y, 0, 0, $w_w, $w_h);
imagejpeg($image, null, $q);
imagedestroy($image);
imagedestroy($watermark);
}
?>وعندما استخدم كود خاص لجلب الصور كلها فقط بدون مشكلة .
<?php
$files = glob("uploads/*.*");
for ($i=1; $i<count($files); $i++)
{
$img = $files[$i];
echo "<img src='".$img."'/>";
}
?>؟؟؟ اتمنى الحل اخواني بأقرب وقت انا محتاج لهذا العمل و شكرا.