Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Attached Image Watermark Details »»
Attached Image Watermark
Version: 1.00, by Ntfu2 Ntfu2 is offline
Developer Last Online: Jan 2010 Show Printable Version Email this Page

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.

Comments
  #112  
Old 05-31-2006, 04:33 PM
hypnoticpimp hypnoticpimp is offline
 
Join Date: Dec 2004
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 == || $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,
    
0000
    @
imagesx($im), @imagesy($im)
   );
       
   
// copy the source_id int
   
$im $tempimage;
  }
  
// open the watermark image
  
$wm = @imagecreatefrompng($WATERMARK_PNG_FILE);
  @
imagealphablending($wmfalse);
  @
imagesavealpha($wmtrue);
  
// 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,
    
00imagesx($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) > && $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?
Reply With Quote
  #113  
Old 06-01-2006, 11:02 PM
Ntfu2 Ntfu2 is offline
 
Join Date: Feb 2006
Posts: 1,247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

link to your site please

Do you have GD2+ installed on server?
Reply With Quote
  #114  
Old 07-23-2006, 01:28 PM
chipdien chipdien is offline
 
Join Date: Apr 2005
Location: Germany
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i use vbb 3.5.3. And nothing happens like hypnoticpimp

http://diendan.svvn-dresden.org/show...8304#post28304

Quote:
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
Reply With Quote
  #115  
Old 07-23-2006, 08:26 PM
Ntfu2 Ntfu2 is offline
 
Join Date: Feb 2006
Posts: 1,247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try uploading a fresh image,

make sure your attachments are in the filesystem and not the database.

if viewing old attachments press CTRL+F5 to maybe try to recache it
Reply With Quote
  #116  
Old 07-24-2006, 02:53 AM
shadyninja shadyninja is offline
 
Join Date: Apr 2006
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
?
Reply With Quote
  #117  
Old 07-24-2006, 03:43 AM
Ntfu2 Ntfu2 is offline
 
Join Date: Feb 2006
Posts: 1,247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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/
Reply With Quote
  #118  
Old 07-24-2006, 03:47 AM
shadyninja shadyninja is offline
 
Join Date: Apr 2006
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Ntfu2
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.
Reply With Quote
  #119  
Old 07-24-2006, 03:56 AM
Ntfu2 Ntfu2 is offline
 
Join Date: Feb 2006
Posts: 1,247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by shadyninja
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
Reply With Quote
  #120  
Old 07-24-2006, 10:06 AM
shadyninja shadyninja is offline
 
Join Date: Apr 2006
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok thanks
I now feel 6 years old!
Reply With Quote
  #121  
Old 07-24-2006, 03:24 PM
shadyninja shadyninja is offline
 
Join Date: Apr 2006
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:11 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04992 seconds
  • Memory Usage 2,345KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete