![]() |
Attached Image Watermarking PLUS Guest Viewing of Thumbnails
I had been looking for these two options for quite a while, and was finally able to hire Brian (of vBadvanced) to write them for me. Since a lot of people have been looking for this, I have decided (with Brian's permission) to release this as a free, unsupported, modification.
This modification will allow you to specify a watermark image that will be overlayed over any attached JPG or PNG file on your site in real time, as the image is displayed. NO PERMANENT CHANGES ARE MADE TO ANY OF YOUR ATTACHMENTS. You can also exclude specific forums and usergroups from seeing the watermark. As an added bonus, he included the ability to allow guests to see attached image thumbnails, while still requiring them to register to see the full size attachments. (Make sure you have your Unregistered / Not Logged In usergroup set to NOT have access to download attachments.) PLEASE CLICK INSTALL so that maybe Jelsoft will include these as built-in features in a future version. Notes/Troubleshooting:
Well, on to the modification: ============================================= STEP 1: Since the resulting file contains too much vBulletin code, I am unable to include it with this modification. So, the first step is to copy vBulletin's attachment.php to a file named attachment_watermark.php. Then, edit attachment_watermark.php, making the following changes. ============================================= STEP 2: You need to delete a LOT of lines from the top of the file. Find this line... Code:
$idname = $vbphrase['attachment']; Your attachment_watermark.php file should begin with this code when you've completed this step: Code:
<?php ============================================= STEP 3: Find this line of code: Code:
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['cangetattachment']) OR (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND ($attachmentinfo['postuserid'] != $vbulletin->userinfo['userid'] OR $vbulletin->userinfo['userid'] == 0))) Code:
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) OR (!($forumperms & $vbulletin->bf_ugp_forumpermissions['cangetattachment']) AND !$vbulletin->GPC['thumb']) OR (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND ($attachmentinfo['postuserid'] != $vbulletin->userinfo['userid'] OR $vbulletin->userinfo['userid'] == 0))) ============================================= STEP 4: Find these lines of code: Code:
else Code:
// ######################################### ============================================= STEP 5: Find this line of code: Code:
header('Content-Length: ' . (($lastbyte + 1) - $startbyte)); Code:
// ######################################### ============================================= STEP 6: Find this line of code: Code:
($hook = vBulletinHook::fetch_hook('attachment_display')) ? eval($hook) : false; Code:
// ######################################### STEP 7: Find this line of code: Code:
($hook = vBulletinHook::fetch_hook('attachment_complete')) ? eval($hook) : false; Code:
exit; ============================================= STEP 8: Save and upload attachment_watermark.php to your forum root directory. ============================================= STEP 9: Install the product-attach_watermark.xml Product via the vBulletin AdminCP Product Manager. ============================================= STEP 10: Configure the options at AdminCP -> vBulletin Options -> Attachment Watermarks. All fields should be self-explanatory. |
kinda cool, i think i will tweak on it.. ;)
|
Sound interesting, thank you ConqSoft.
|
A fantastic tool to drive registration on 2 fronts. Very kind of you to release it, thanks.
|
I installed it, but it's not showing up. Does the watermark itself have to be a .jpg or .png file? I used a .gif file.
*edit* I tried it with a .png file, and still no luck. |
A transparent .PNG is the best thing to use for the watermark.
|
jpg or png for watermark. However, I can't get it to work either.
|
Your server needs GD2 installed also. (Edited above.)
It's possible that I made a mistake with the modification instructions. Since I just have the fully modified file, I had to build the change instructions from that. I'll look over it and see if I missed anything. It would be much easier to just include the file, but it may violate site policy since it contains a lot of original vBulletin code. |
Ok, I found two errors. Please re-do steps 5 and 6.
|
Conq if this works, and you ever want to have kids, i'll have them for you :D
|
Quote:
|
Still haven't been able to get it working, have edited completely twice.
GD 2.0.28 Step 5 contains an extra brace at the end of the find string, not that it matters much. |
Are you using the full PHYSICAL path to the watermark file, and do you have the width/height setting set to something low enough to affect your images, and are your attachments stored in the file system?
Also, if you have viewed the attachment previously, it may be cached. Make sure you clear your browser cache. |
Ah, I didn't realize they had to be stored as files. I thought I had seen a specification on the request to use the database.
I am sure all is correct, I have written my own watermarking previously, however it is a project outside of vBulletin and uses ImageMagick. |
Quote:
|
Quote:
|
If anyone gets this working, please reply so that I know the instructions are correct. Thanks.
|
Wow, thanks!
|
I redid the necessary steps, and double checked everything, and it's all done as required, and still no luck, however my attachments are not stored as files. I'm guessing that must be the problem I'm having.
|
I just downloaded and am praying that it works with database attachments. Anyway, that was very nice of you to share this much needed feature.
|
Unfortunately, it did not work for me with attachments in database.
|
Quote:
|
thanks for this it looks good :)
|
many thanks for this mod! been looking for it a long time!
before i start implementing it, does this work with the highslide attachment mod? |
thanks very much, although some users seem to have trouble with getting this to work I had no problems at all.
(i'm using filesystem attachments, which is better anyway..) |
Should the original attachment.php stay or can we delete it?
|
It needs to stay also. This is just a new file that uses a lot of code from attachment.php because they're weren't enough hooks to do everything he needed to do.
|
So far it's seems to be only 2 of us with problems. Has someone managed to use with attachments in database?
|
Quote:
|
Is this plugin works with .gif extension ?
Thanks |
Quote:
|
Quote:
I'm already add .gif extension,and works fine on my test boards.I'll hard test on my test forum 2-3 days then apply production forum. Thanks |
Thanks ConqSoft
I've wanted this for a whlle now! |
Thanks for sharing this. I'll give it a go as soon as I get a chance.
|
sorry its ok...
Thanks for the nice hack! |
Right on! I have been following your request for this. Thanks for sharing!
|
Thanks Keith,
Instructions were perfect and everyting is working great on all my forums. |
Thanks for your Plugin.
I want that a guest can view the thumbnails but not the full full size oft it. But it does not work. My stettings: Guests to View Thumbnails yes Unregistered / Not Logged In usergroup set to NOT have access to download attachments |
Did you follow all the steps? The attachment_watermark.php file is still required for the Guest Thumbnail feature also. Though, you can just leave the watermark fields empty if you don't want to use that part.
|
yes I did
here is my attachment_watermark.php |
All times are GMT. The time now is 06:02 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|