vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Social Group and Album Enhancements - PB Watermark Album images (https://vborg.vbsupport.ru/showthread.php?t=182884)

RLShare 06-17-2008 10:00 PM

PB Watermark Album images
 
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

Fırtına 06-18-2008 08:14 PM

Thanks :)

xxalexkimxx 06-18-2008 08:28 PM

Yay thank u so much for this hack.
I will install it now

xxalexkimxx 06-18-2008 08:36 PM

Where do i go to set:
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

RLShare 06-18-2008 08:41 PM

Quote:

Originally Posted by xxalexkimxx (Post 1552933)
Where do i go to set:
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

I haven't implemented that yet, Thats why its listed under planned changes. I will be implementing it soon. I put that up there so people know the changes that I already plan to make and so they do not suggest changes that are in the works.


Right now you will have to create a 'watermark.png' and upload it to the forum root directory. And it will always show up on the bottom right.

xxalexkimxx 06-18-2008 08:43 PM

oh ok let me do that now
thanks

xxalexkimxx 06-18-2008 08:50 PM

i got this message came up when upload image
Quote:

This PNG image has the incorrect file extension.

Fırtına 06-18-2008 08:59 PM

Quote:

Originally Posted by xxalexkimxx (Post 1552943)
i got this message came up when upload image

+1 And me...

*********


Is location in forum_root/includes/functions_album.php ?

http://img337.imageshack.us/img337/3...nctionssf6.png

7lanet 06-18-2008 10:00 PM

Quote:

2. Edit the file forum_root/includes/functions_album.php and add this function. I added it right below the Vbulletin Copyright notice.
where exactly add

7lanet 06-18-2008 10:13 PM

I Upload img type gif , JPEG

It show msg
Quote:

This PNG image has the incorrect file extension.

RLShare 06-18-2008 10:44 PM

Ive updated the original post to reflect the changes that should fix your problems, thank you for letting me know. You will need to add one more function to the file and re-upload the new plug-in I just attached.



Quote:

Originally Posted by Fırtına (Post 1552945)
Is location in forum_root/includes/functions_album.php ?

http://img337.imageshack.us/img337/3...nctionssf6.png

^^Thats exactly it, let me know if the update still does not fix it.

7lanet 06-18-2008 10:59 PM

Fatal error: Call to undefined function imagesavetofile() in /home/joker/public_html/vb/album.php(794) : eval()'d code on line 9

RLShare 06-18-2008 11:07 PM

Did you add the function 'imagesavetofile' I posted below the other function to the functions_album.php file?

I just noticed that its easy to look over, the section of my post that contains the code to be pasted to the other file now has 2 functions in it so you will need to delete what you pasted into the file before and copy whats up there now into its place.

bxbigt 06-19-2008 02:02 AM

can we get this for all images uploaded to the site

Zeb Zoober 06-19-2008 02:38 AM

Quote:

Originally Posted by bxbigt (Post 1553182)
can we get this for all images uploaded to the site

+1

Would love to see this work for attachment pictures too.

GaiLoan 06-19-2008 02:41 AM

this nice, i belive everyone waiting for this :) thanks

RvG2 06-19-2008 03:00 AM

holy cow... I've been waiting for this long time ago.

RvG2 06-19-2008 03:11 AM

how to create my own watermark .png?

RLShare 06-19-2008 03:22 AM

Quote:

Originally Posted by RvG2 (Post 1553222)
how to create my own watermark .png?

Gimp is a powerful free image editing program.
http://gimp.org/downloads/

TimberFloorAu 06-19-2008 05:03 AM

Tried. Doesnt Work.

Perhaps, rather than use this as a beta area for developing a mod, you should get everything working ok, get it tested, do some instructions.
Looks promising. :)

lazytown 06-19-2008 05:11 AM

Looking forward to this when it's completed. It would be nice if it could watermark existing album images.

-vissa

waza 06-19-2008 07:36 AM

It's nice, but have a look at class_image.php and class_upload.php in the includes folder. You could probably integrate it better into the vbulletin system with modifying these classes.

RLShare 06-19-2008 11:58 AM

Quote:

Originally Posted by TimberFloorAu (Post 1553267)
Tried. Doesnt Work.

Perhaps, rather than use this as a beta area for developing a mod, you should get everything working ok, get it tested, do some instructions.
Looks promising. :)

'Tried doesn't work' DOESN'T help me. A more detailed explanation of what happened would. I doubt you even tried with a reply like that. And what exactly do you think it means to be a Beta? That means I want it tested. Maybe you should learn a thing about the terminology of this before you start telling me what to do.

RLShare 06-19-2008 12:02 PM

Quote:

Originally Posted by waza (Post 1553354)
It's nice, but have a look at class_image.php and class_upload.php in the includes folder. You could probably integrate it better into the vbulletin system with modifying these classes.

Will do, thanks for the direction.

ShiZoPhreN 06-19-2008 02:06 PM

Thanks RLShare

*clicks installed*

Tboy_forum 06-19-2008 07:54 PM

+1 for all images uploaded please

Clicks 'installed'

Mr.samy 06-19-2008 09:01 PM

thanks dear ,

but can i add text on picture without photos ( .png ) such that doamin .

balance12 06-19-2008 10:36 PM

If i want that the watermark.. be placed from side to side from the picture... like a large bar.... i have to midifed something++

ALSALAFE 06-19-2008 10:49 PM

Thanks :up:

balance12 06-20-2008 01:07 PM

Done everythinh....
Place watermark png on forumrrot
Edite funciton_album
Import Plugin

Parse error: syntax error, unexpected T_STRING in /home/reinodra/public_html/includes/functions_album.php on line 17

balance12 06-20-2008 01:19 PM

Work Greattttttttt

balance12 06-20-2008 11:31 PM

It only adss me the watermark, in the first picture of the uploaded pohoton in an album.. imean.. in the album you can upload 3 simultaneous pictures.. and only the first one gets tthe watermak...

Jdm Ej1 Coupe 06-21-2008 12:25 AM

interesting will wait to see if it gets better before installing

RLShare 06-21-2008 12:41 AM

Quote:

Originally Posted by balance12 (Post 1555003)
It only adss me the watermark, in the first picture of the uploaded pohoton in an album.. imean.. in the album you can upload 3 simultaneous pictures.. and only the first one gets tthe watermak...

lol. See a simple thing like this and I overlooked it. Thats why I posted it, thanks for pointing it out. Will fix later tonite or tommorow.

Catmag 06-22-2008 01:58 AM

Works well. Haven't tried to upload multiple images yet.

Any way to increase the size of the watermark?

RLShare 06-22-2008 12:25 PM

Updated so that it now works when uploading multiple images....Delete the old plugin and import the new one.


Quote:

Originally Posted by Catmag (Post 1555774)
Works well. Haven't tried to upload multiple images yet.

Any way to increase the size of the watermark?

You can use a larger watermark.png image. It places the watermark image in the bottom right corner based on the dimensions of the watermark.png so it will work with any size image.

Alfa1 06-22-2008 06:05 PM

The problem with watermarks is that they normally are a fixed size. This means that a large pic will get a relatively tiny watermark and a small pic may get butchered by a watermark.

Please make the size of the watermark relative to the size of the picture.

RaMMz 06-22-2008 09:12 PM

Thanks, it works perfect.

You should upload watermark.png to the forum root directory, edit that simple .php and it works fine & upload the plugin.

RaMMz @ BlackTouch NETWORK.-

TimberFloorAu 06-22-2008 09:26 PM

Is this backwards compatible.

In essence, does it watermark all existing uploaded images, or only new ones?

RaMMz 06-22-2008 09:34 PM

Quote:

Originally Posted by TimberFloorAu (Post 1556345)
Is this backwards compatible.

In essence, does it watermark all existing uploaded images, or only new ones?

Only new ones.


All times are GMT. The time now is 07:28 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
  • Page Generation 0.01487 seconds
  • Memory Usage 1,856KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete