Version: 1.00, by Ntfu2
Developer Last Online: Jan 2010
Version: 3.5.4
Rating:
Released: 04-11-2006
Last Update: Never
Installs: 146
No support by the author.
This plugin will watermark attached images on your forums. works on 3.5.3 for sure, probably works on others as well.
Simply upload new Plugin, Then Edit the Three Following lines, then Activate plugin.
Edit this line to match your watermark file:
$WATERMARK_PNG_FILE = '/home/ntfu2/public_html/watermark.png';
Edit this line for bottom or centered
$WATERMARK_POSITION = 'bottom_left';
You can test with your userid only first, Edit this line
$VB_USER_ID = 0;
ATTACHMENTS MUST BE IN FILESYSTEM
does not support .gif since it will stop any animated gif from playing. watermarks, .jpg and .jpeg You can probably add code to watermark others.
If you use it click install, i'll try to give support, but only to those who install
Edit: UkJimbo made this modification for me, i paid for it, so therefore i am releasing it to the public
Enjoy!
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
// 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) );
// 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; } }
GD Support enabled
GD Version bundled (2.0.28 compatible)
FreeType Support enabled
FreeType Linkage with freetype
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
what does this need to be changed to....
to be able to move them to the file system
We attempted to write a test file to /path/to/your/attachment/directory, but we were unsuccessful. Please verify that the web server has write/delete permissions for this path.
?
You'll need to chmod the directory to 0777 that you set in the adminCP, you can do it either FTP usually with a right click -> permissions or via SSH command
You'll need to chmod the directory to 0777 that you set in the adminCP, you can do it either FTP usually with a right click -> permissions or via SSH command
Code:
chmod -R 0777 /path/to/your/attachment/directory/
Im kind of a noob when it comes to this stuff , want to explain this to me as if I were 5 years old.
Im kind of a noob when it comes to this stuff , want to explain this to me as if I were 5 years old.
*I'll assume a 5 year old got far enough to import the plugin*
1. Login to your site using your FTP program (the way you uploaded your vbulletin files)
2. Create a new directory outside of the public_html (or www) folder called 'attachments'
3. Right click on that new folder you just created and look for a way to change its permissions, enter 0777 for its new permissions
4. Go to your site
5. Find the AdminCP link
6. Login using your administrator details.
7. On the left hand side look for ATtachments
8. Hit the Blue arrow to make a drop down, and reveals Attachment Storage Type
9. either move them from the Database into the filesystem, Hit the go button
10. set the folder to your attachment folder you created in step 2, should look something like /home/site/attachments
That should move your attachments from database into the file system
hmmm
"Right click on that new folder you just created and look for a way to change its permissions, enter 0777 for its new permissions"
I thought I knew what you were talking about, but when I got to the folder, there wasnt a way to change permissions