yes it here, check it
PHP Code:
// begin variables
// the path to the PNG file that you want to overlay with
// must be on the local machine, not an http:// URL
$WATERMARK_PNG_FILE = '/home/wshh/public_html/watermark.png';
// how you want to position the watermark enter either center or bottom_left
$WATERMARK_POSITION = 'bottom_left';
// user you want to see watermarking on - this is just for testing
// set to 0 to work for all users
$VB_USER_ID = 0;
// end variables - you shouldn't need to edit below here
// if there's no filepath to work with there's nothing we can do
// we also need the watermark file to exist
// if $VB_USER_ID is specified (for testing) show it just them
if(! empty($attachpath) && file_exists($WATERMARK_PNG_FILE) && ( $VB_USER_ID == 0 || $GLOBALS['vbulletin']->userinfo['userid'] == $VB_USER_ID )) {
// derive output name
$fo = preg_replace('/\.attach$/', '.marked', $attachpath);
// image doesn't exist or thumbnail is newer than the cached file - create a watermarked version
if( (! file_exists($fo) || filemtime($WATERMARK_PNG_FILE) > filemtime($fo) || true) && $fo != $attachpath ) {
// decide what image type it is
if( preg_match('/\.png$/i', $attachmentinfo['filename']) ) {
$im = @imagecreatefrompng($attachpath);
} elseif( preg_match('/\.jpg$/i', $attachmentinfo['filename']) ) {
$im = @imagecreatefromjpeg($attachpath);
// create an empty truecolor container
$tempimage = @imagecreatetruecolor(@imagesx($im), @imagesy($im));
// copy the 8-bit gif into the truecolor image
@imagecopy($tempimage, $im,
0, 0, 0, 0,
@imagesx($im), @imagesy($im)
);
// copy the source_id int
$im = $tempimage;
}
// open the watermark image
$wm = @imagecreatefrompng($WATERMARK_PNG_FILE);
@imagealphablending($wm, false);
@imagesavealpha($wm, true);
// catch opening problems
if($im && $wm) {
if($WATERMARK_POSITION == 'center') {
$pos_x = (imagesx($im) / 2) - (imagesx($wm) / 2);
$pos_y = (imagesy($im) / 2) - (imagesy($wm) / 2);
} else {
$pos_x = imagesx($im) - imagesx($wm) - 10;
$pos_y = imagesy($im) - imagesy($wm) - 10;
}
// merge the files together
$copy_worked = @imagecopy($im,$wm,
$pos_x, $pos_y,
0, 0, imagesx($wm), imagesy($wm)
);
}
// write out the new image
if($copy_worked) {
// decide what image type it is
if( preg_match('/\.png$/i', $attachmentinfo['filename']) ) {
@imagepng($im,$fo);
} elseif( preg_match('/\.jpg$/i', $attachmentinfo['filename']) ) {
@imagejpeg($im,$fo);
} elseif( preg_match('/\.gif$/i', $attachmentinfo['filename']) ) {
@imagegif($im,$fo);
}
}
}
// check that the new file is there - if so open the file pointer to it
if( @filesize($fo) > 0 && $fp2 = fopen($fo,'rb') ) {
// re-send image size header
header('Content-Length: '. filesize($fo));
@fclose($fp);
$fp = $fp2;
}
}
so please tell me now why nothing happens?