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

Reply
 
Thread Tools
PB Watermark Album images Details »»
PB Watermark Album images
Version: 0.1, by RLShare RLShare is offline
Developer Last Online: Aug 2011 Show Printable Version Email this Page

Category: Social Group and Album Enhancements - Version: 3.7.1 Rating:
Released: 06-17-2008 Last Update: 06-21-2008 Installs: 134
Uses Plugins
Code Changes Is in Beta Stage  
No support by the author.

There is a new version of this modification available Here that has been confirmed to work in version 3.7.x

------------------------------------------------------------------------------------

This mod is in beta, it was inspired by this thread yesterday.
https://vborg.vbsupport.ru/showthread.php?t=178296

I'm hoping that posting this beta version in here will help me gather useful feedback on what kind of features might be useful in such a hack.

What does it do:
-Adds a watermark to the bottom right of all images uploaded to users albums.

Planned changes:
1. Allow the url of the watermark image to be changed via admincp
2. Allow location of where the watermark image is placed to be changed via admincp

Installation Instructions:
1. Create or Use the watermark.png I attached, and upload it to your forum root before anything.

2. Edit the file forum_root/includes/functions_album.php and add these functions. I added them right below the Vbulletin Copyright notice.
PHP Code:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////// -ALBUM WATERMARK MOD - image createfrom/saveto file functions-////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
function imagecreatefromfile($path)
                        {
                            
$info = @getimagesize($path);
                           
                            if(!
$info)
                            {
                                return 
false;
                            }                           
                            
$functions = array(
                                
IMAGETYPE_GIF => 'imagecreatefromgif',
                                
IMAGETYPE_JPEG => 'imagecreatefromjpeg',
                                
IMAGETYPE_PNG => 'imagecreatefrompng',
                                
IMAGETYPE_WBMP => 'imagecreatefromwbmp',
                                
IMAGETYPE_XBM => 'imagecreatefromwxbm',
                                );
                            if(!
$functions[$info[2]])
                            {
                                return 
false;
                            }
                           
                            if(!
function_exists($functions[$info[2]]))
                            {
                                return 
false;
                            }
                           
                            return 
$functions[$info[2]]($path);
                        }


function 
imagesavetofile($image,$path)
                        {
                            
$info = @getimagesize($path);
                           
                            if(!
$info)
                            {
                                return 
false;
                            }                           
                            
$functions = array(
                                
IMAGETYPE_GIF => 'imagegif',
                                
IMAGETYPE_JPEG => 'imagejpeg',
                                
IMAGETYPE_PNG => 'imagepng',
                                
IMAGETYPE_WBMP => 'imagewbmp',
                                
IMAGETYPE_XBM => 'imagewxbm',
                                );
                            if(!
$functions[$info[2]])
                            {
                                return 
false;
                            }
                           
                            if(!
function_exists($functions[$info[2]]))
                            {
                                return 
false;
                            }
                           
                            return 
$functions[$info[2]]($image,$path);
                        }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////// -ALBUM WATERMARK MOD - image createfrom/saveto file functions-////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////// 
3. Import the plug-in attached

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
caoducanh9x

Comments
  #42  
Old 06-22-2008, 10:50 PM
Mr.samy's Avatar
Mr.samy Mr.samy is offline
 
Join Date: Feb 2008
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After i install it .... and try to upload animated photo ... i see the plugins put the watermark on it but the photo become not animated and stop from work
Reply With Quote
  #43  
Old 06-23-2008, 09:29 PM
balance12 balance12 is offline
 
Join Date: Sep 2007
Posts: 106
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I upgrade it, and work grate with massive uploads, but it shows me different Size of watermark.. you upload an albun it shows you great, the other shows it shorter.. then good.....

One good one smaller....

What could it be?
Reply With Quote
  #44  
Old 06-23-2008, 10:04 PM
xxalexkimxx xxalexkimxx is offline
 
Join Date: Nov 2006
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by 7lanet View Post
I Upload img type gif , JPEG

It show msg
change the all image type to LOWER CASE
Reply With Quote
  #45  
Old 06-23-2008, 10:41 PM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mr.samy View Post
After i install it .... and try to upload animated photo ... i see the plugins put the watermark on it but the photo become not animated and stop from work
Im working with the GD imaging library for PHP and it does not support animated GIFS. I might look into adding support for animated GIFs myself in the future but that will not be until after I work on getting the other features I want done.


Quote:
Originally Posted by balance12 View Post
I upgrade it, and work grate with massive uploads, but it shows me different Size of watermark.. you upload an albun it shows you great, the other shows it shorter.. then good.....

One good one smaller....

What could it be?
The only reason I could think of is that Your uploading images that are larger then the max size, VB will automatically resize images that are larger then the Max size and my code applies watermarks to the images that get uploaded before VB processes them. So Im guessing that my code is adding the watermark, then VB is shrinking the image after making it look like the watermark is of a different size.
Reply With Quote
  #46  
Old 06-25-2008, 06:03 AM
7lanet's Avatar
7lanet 7lanet is offline
 
Join Date: Aug 2007
Location: YeMeN
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

in 3.7.2

Fatal error: Out of memory (allocated 22806528) (tried to allocate 8192 bytes) in /home/joker/public_html/vb/includes/functions_album.php on line 40
Reply With Quote
  #47  
Old 06-25-2008, 07:24 AM
ErnieTheMilk ErnieTheMilk is offline
 
Join Date: Mar 2007
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I keep getting some error messages on upload

Warning: imagecreatefrompng(watermark.png) [function.imagecreatefrompng]: failed to open stream: No such file or directory in [path]/album.php(795) : eval()'d code on line 1

Fatal error: Call to undefined function: imagecreatefromfile() in ....... on line 6

I've uploaded everything as suggested...... Its a great mod, hope it can get sorted as I'd love to use it!
Reply With Quote
  #48  
Old 06-25-2008, 02:25 PM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ErnieTheMilk View Post
I keep getting some error messages on upload

Warning: imagecreatefrompng(watermark.png) [function.imagecreatefrompng]: failed to open stream: No such file or directory in [path]/album.php(795) : eval()'d code on line 1

Fatal error: Call to undefined function: imagecreatefromfile() in ....... on line 6

I've uploaded everything as suggested...... Its a great mod, hope it can get sorted as I'd love to use it!
You either messed up putting the functions in the functions_album.php file or you did not put the functions in that file.


Quote:
Originally Posted by 7lanet View Post
in 3.7.2

Fatal error: Out of memory (allocated 22806528) (tried to allocate 8192 bytes) in /home/joker/public_html/vb/includes/functions_album.php on line 40
I have not upgraded to 3.7.2 yet, when I do I will look into this.
Reply With Quote
  #49  
Old 06-25-2008, 02:34 PM
ErnieTheMilk ErnieTheMilk is offline
 
Join Date: Mar 2007
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RLShare View Post
You either messed up putting the functions in the functions_album.php file or you did not put the functions in that file.
Thats a great help, thanks. I know I'm stupid, but I do know how to copy & paste into a file that you actually name!

The only problem I had was where to put it as you said right after the vBulletin copyright notice. Well, I found one, right at the top of the file - I assume that's where you meant it to go
Reply With Quote
  #50  
Old 06-25-2008, 11:03 PM
RLShare RLShare is offline
 
Join Date: Jun 2008
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ErnieTheMilk View Post
Thats a great help, thanks. I know I'm stupid, but I do know how to copy & paste into a file that you actually name!

The only problem I had was where to put it as you said right after the vBulletin copyright notice. Well, I found one, right at the top of the file - I assume that's where you meant it to go
This is an image someone posted earlier in this thread.. It shows how the top of the file functions_album.php should look after you paste the functions in.



The top part is the copyright notice I mentioned pasting the code in after.
Reply With Quote
  #51  
Old 06-26-2008, 05:49 AM
ErnieTheMilk ErnieTheMilk is offline
 
Join Date: Mar 2007
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's where I originally posted it... and it didn't work

However, I have to say after perserverance, and popping it in different places, I managed to get it to work! The code did go further down the page tho!

Now if you could just sort out the watermark scale issue on differing sized photos
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 01:05 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.07613 seconds
  • Memory Usage 2,355KB
  • 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
  • (1)bbcode_php
  • (7)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
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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