Get XOOPS XOOPS FAQ Forums News Themes Modules
News World of XOOPS Developers Hacks Modules Themes Archive Submit News

XOOPS vs. Herko Coomans

Make a donation

Please select an amount to donate


Do you want your username revealed with your donation?
Yes - List me as a Generous Donor
No - List my donation as from an Anonymous Donor


Search

Local Support Sites

Cumulus Tag Cloud

admin Arabic banner block Christmas comments cumulus DayDawn dhsoft e-Commerce E-Learning Google GUI hacks instant-zero jQuery module news Nordic Olédrion oxygen PageRank security SEO simple-XOOPS sport tag Theme wiki xoops

New Users

Registering user

# 96568

dvsshoescom

Welcome to XOOPS!

Archives

XOOPS Code hosted on SourceForge

Watermark Hack for Xoops Core Imagemanager

Posted by optikool on 2009/10/8 3:40:00 (1379 reads) | Posted on Hacks
This is a hack to xoops 2.3.3 which gives you the ability to add a watermark to images that you upload through the image manager.

The name of your watermark should be watermark.png and it should be located under uploads… /uploads/watermark.png. Replace the files located in the zip file with the files in your Xoops installation.

Thanks to Mowaffaq Ali at www.arabxoops.com for making a donation to this project. Please post your suggestions and feedback Xoops Forums or at my website

Download it from here

Open in new window


Printer Friendly Page Send this Story to a Friend Create a PDF from the article


Bookmark this article at these sites

                   

The comments are owned by the poster. We aren't responsible for their content.

kool

xoops core imagemanager should be modularized and combine all the works that has been done before this

and also this work above..
Posted: 2009/10/8 6:37 • Updated: 2009/10/8 6:37
Quote:
xoops core imagemanager should be modularized and combine all the works that has been done before this

Absolutely!

We are looking for volunteers who could do it for XOOPS. Anybody?

BTW - thanks to Mowaffaq Ali at www.arabxoops.com for making a donation to create this hack, and allowing to make it public! Very much appreciated!

Optikool - I like your Website. Very nice design. It seems like we are finally showing that XOOPS can have some very creative and sophisticated Web designs - your Website or our new theme done by Eduardo for XOOPS Website are real examples of that.
Posted: 2009/10/8 7:05 • Updated: 2009/10/8 8:24
Open in new window

Demo
Posted: 2009/10/8 8:47 • Updated: 2009/10/8 8:47
Thanks for sharing this

Only one question:

is there a way to change the position of the watermark in the image?

eg. uper left-right
footer right-left
etc.

thanks
Posted: 2009/10/8 9:33 • Updated: 2009/10/8 9:33
very nice, thanks guys.
Posted: 2009/10/8 9:55 • Updated: 2009/10/8 9:55
good work thank you all
Posted: 2009/10/8 11:51 • Updated: 2009/10/8 11:51
@wcrwcr - The watermark.png file can be any size so in theory depending on the size of the watermark you can place your logo anywhere in the png image. In my watermark I centered the text in the middle of the png image. Just be sure to add transparency to your image. I have another version of this hack that puts an option in system -> general pref to change the path and name of the watermark.png which would let you have multiple watermarks however because of the way the system preferences get added to the database, it would take more testing to see if I could add modify the database and add the new fields on an update or if this could only be part of a new install.

@mambo - Thanks for the feedback on my theme. You might like the theme I did for my wife's website too. :)
Posted: 2009/10/8 12:20 • Updated: 2009/10/8 12:20
Extgallery use watermark position, may be this code useful:

    function _makeWatermark(&$imageTransform) {

        if(!
function_exists('imagettfbbox'))
            return;

        global 
$xoopsModuleConfig;

        
/*    Text position param
        /
        /    0 : orig
        /    -1 : opposit
        /    1 : center
        /
        */
        
if($xoopsModuleConfig['watermark_position'] == "tl") {
            
$x 0;
            
$y 0;
        } elseif(
$xoopsModuleConfig['watermark_position'] == "tr") {
            
$x = -1;
            
$y 0;
        } elseif(
$xoopsModuleConfig['watermark_position'] == "bl") {
            
$x 0;
            
$y = -1;
        } elseif(
$xoopsModuleConfig['watermark_position'] == "br") {
            
$x = -1;
            
$y = -1;
        } elseif(
$xoopsModuleConfig['watermark_position'] == "tc") {
            
$x 1;
            
$y 0;
        } elseif(
$xoopsModuleConfig['watermark_position'] == "bc") {
            
$x 1;
            
$y = -1;
        } elseif(
$xoopsModuleConfig['watermark_position'] == "lc") {
            
$x 0;
            
$y 1;
        } elseif(
$xoopsModuleConfig['watermark_position'] == "rc") {
            
$x = -1;
            
$y 1;
        } elseif(
$xoopsModuleConfig['watermark_position'] == "cc") {
            
$x 1;
            
$y 1;
        }

        
$text = ($xoopsModuleConfig['watermark_type'] == 0) ? $GLOBALS['xoopsUser']->getVar('uname') : $xoopsModuleConfig['watermark_text'];

        
$watermarkParams = array(
            
'text'=>$text,
            
'x'=>$x,
            
'y'=>$y,
            
'color'=>$xoopsModuleConfig['watermark_color'],
            
'font'=>XOOPS_ROOT_PATH."/modules/extgallery/fonts/".$xoopsModuleConfig['watermark_font'],
            
'size'=>$xoopsModuleConfig['watermark_fontsize'],
            
'resize_first'=>false,
            
'padding'=>$xoopsModuleConfig['watermark_padding']
        );
        
$imageTransform->addText($watermarkParams);
    }

Posted: 2009/10/8 13:18 • Updated: 2009/10/8 13:18