I tested on my site and it seems nothing has happen. I replaced
PHP Code:
echo $attachmentinfo['filedata'];
With
PHP Code:
if (strpos($attachmentinfo['mimetype'],"image/jp")) { $isjpg = 1; }
if ($isjpg && !$_GET['thumb']) {
$filename = "/home/vbhacks/public_html/forum/watermark.png"; // use a PNG-24 to preserve transparency!
$im = imagecreatefromstring($attachmentinfo['filedata']);
imagealphablending($im, true);
$watermark = imagecreatefrompng($filename);
$y = imagesy($im) - imagesy($watermark);
$w = imagesx($watermark);
$h = imagesy($watermark);
imagecopy($im, $watermark, 0, $y, 0, 0, $w, $h);
imagejpeg($im, "", 80);
} else {
echo $attachmentinfo['filedata'];
}
And uploaded this in my forums directory. But nothing shows when i click on an attachment. Something im doing wrong?