vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Watermark images (on the fly) (https://vborg.vbsupport.ru/showthread.php?t=68112)

Robbban 08-07-2004 10:00 PM

Watermark images (on the fly)
 
This is something i made because I couldn't find any hack working for 3.0.7. Just took a couple of minutes. ;)


Works with 3.0.7!

Liquid1ce 08-08-2004 12:43 PM

very nice hack thanks

Logikos 08-08-2004 12:46 PM

Nice work, i will test this now.

Robbban 08-08-2004 01:02 PM

Quote:

Originally Posted by Live Wire
Nice work, i will test this now.

Good! :) Please tell me how you think it works! If there is any errors (witch there shouldn't be since I tested it and it works) please don't hesitate to contact me!

Benj 08-08-2004 01:03 PM

thanks man this is just what i need :)

Logikos 08-08-2004 01:07 PM

I tested on my site and it seems nothing has happen. I replaced

PHP Code:

echo $attachmentinfo['filedata']; 

With

PHP Code:

    if (strpos($attachmentinfo['mimetype'],"image/jp")) { $isjpg 1; }
    if (
$isjpg && !$_GET['thumb']) {
        
$filename "/home/vbhacks/public_html/forum/watermark.png"// use a PNG-24 to preserve transparency!

        
$im imagecreatefromstring($attachmentinfo['filedata']);
        
imagealphablending($imtrue);

        
$watermark imagecreatefrompng($filename);

        
$y imagesy($im) - imagesy($watermark);

        
$w imagesx($watermark);
        
$h imagesy($watermark);
    
        
imagecopy($im$watermark0$y00$w$h);

        
imagejpeg($im""80);
    } else {
        echo 
$attachmentinfo['filedata'];
    } 

And uploaded this in my forums directory. But nothing shows when i click on an attachment. Something im doing wrong?

Robbban 08-08-2004 01:08 PM

Hmmm... Have you tried to reload the page with CTRL+F5? Internet Explorer caches all images :)

Edit:

watermark.png is one thing and watermark.PNG is another. Change the filename. :)

HuangA 08-08-2004 01:12 PM

nice work, I'll try it out now ^^

Logikos 08-08-2004 01:54 PM

I tried what you said and still seems like nothing has happen. Will this only work on vb 3.0.3? cause im using 3.0.0 but the code seems there is no diffrence.

The Coldwood 08-08-2004 02:30 PM

Great hack - really enjoyed it!


All times are GMT. The time now is 10:59 AM.

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.01174 seconds
  • Memory Usage 1,738KB
  • 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
  • (2)bbcode_php_printable
  • (1)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
  • (10)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