Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Watermark Attached Images Details »»
Watermark Attached Images
Version: 1.00, by filburt1 filburt1 is offline
Developer Last Online: May 2007 Show Printable Version Email this Page

Version: 2.3.x Rating:
Released: 05-31-2003 Last Update: Never Installs: 27
 
No support by the author.

This hack adds a watermark to attached images. The watermark, as specified by your own .png image, is added on image download, not when the image is attached. Requires GD2. Do not even try installing if you don't have GD2.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 06-03-2003, 12:34 AM
matthepepe matthepepe is offline
 
Join Date: Jan 2002
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did delete those 2 lines, and it still did not do me any good,

first i deleted

PHP Code:
header("Content-disposition:$attachment filename=$attachmentinfo[filename]");
header("Content-Length: ".strlen($attachmentinfo[filedata])); 
then i replaced,

PHP Code:
if ($extension=="gif") {
  
header("Content-type: image/gif");
} elseif (
$extension=="jpg" or $extension=="jpeg") {
  
header("Content-type: image/pjpeg");
} elseif (
$extension=="png") {
  
header("Content-type: image/png");
} elseif (
$extension=="pdf") {
    
header("Content-type: application/pdf");
} else {
  
header("Content-type: unknown/unknown");
}
echo 
$attachmentinfo[filedata]; 
with

PHP Code:
$isimage true;
switch (
$extension)
{
    case 
"gif":
        
$header "image/gif";
        break;
    case 
"jpg":
    case 
"jpeg":
        
$header "image/jpeg";
        break;
    case 
"png":
        
$header "image/png";
        break;
    case 
"pdf":
        
$header "application/pdf";
        
$isimage false;
        break;
    default:
        
$isimage false;
        
$header "unknown/unknown";
}
header("Content-disposition: inline; filename=" $attachmentinfo['filename']);
header("Content-type: $header");

if (
$isimage)
{
    
// watermark options:
    
$filename "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['filename']; 
and i still get the red x's for images.
Reply With Quote
  #43  
Old 06-03-2003, 01:07 AM
007's Avatar
007 007 is offline
 
Join Date: Jan 2003
Location: United States
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep, exactly. I'm going to try upgrading to 2.3.0 and see how it works then...
Reply With Quote
  #44  
Old 06-03-2003, 01:10 AM
S.Shady's Avatar
S.Shady S.Shady is offline
 
Join Date: Apr 2003
Location: Cleveland, Ohio
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works fine but none of my attachments of images fully gets uploaded it seams
Reply With Quote
  #45  
Old 06-03-2003, 07:25 PM
007's Avatar
007 007 is offline
 
Join Date: Jan 2003
Location: United States
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok I just upgraded to 2.3.0 and still nothing.

(Yes I do have GD2 and I have it selected in the options..)
Reply With Quote
  #46  
Old 06-03-2003, 07:27 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What exactly happens when you go to an attachment directly?
Reply With Quote
  #47  
Old 06-03-2003, 07:34 PM
matthepepe matthepepe is offline
 
Join Date: Jan 2002
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you get a red x.
Reply With Quote
  #48  
Old 06-03-2003, 08:49 PM
Courage Courage is offline
 
Join Date: Feb 2002
Location: Romania
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have attachments as files hack installed

Instead of

PHP Code:
header("Content-disposition: inline; filename=$attachmentinfo[filename]");
header("Content-Length: ".strlen($attachmentinfo[filedata])); 
I have:

PHP Code:
header("Content-disposition: inline; filename=$attachmentinfo[filename]");
header("Content-Length: $filesize"); // attachments as files hack 
I deleted header("Content-Length: $filesize"); , but I think that now i can add files without size limit checking ...

Ideeas ?
Reply With Quote
  #49  
Old 06-03-2003, 10:09 PM
007's Avatar
007 007 is offline
 
Join Date: Jan 2003
Location: United States
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah I now have 2.3.0 and I still have a red X. I contacted my host again to see if I really do have GD2.0+ and they said I do...

Reply With Quote
  #50  
Old 06-04-2003, 07:08 AM
Skyline_GT Skyline_GT is offline
 
Join Date: May 2003
Location: Vancouver, BC
Posts: 482
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How come I have this line
Code:
header("Content-disposition: inline; filename=$attachmentinfo[filename]");
instead of
Code:
header("Content-disposition:$attachment filename=$attachmentinfo[filename]");
Reply With Quote
  #51  
Old 06-04-2003, 03:10 PM
bitbender's Avatar
bitbender bitbender is offline
 
Join Date: Jan 2002
Location: Sorta near Dallas, Texas
Posts: 166
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where the heck does a fella FIND a good copy of gd2 for Red Splat ?? I want to use this hack, as well as watermark the pix outa the gallery (photopost), but I can't seem to locate a decent RPM for red splat 7.1 and 7.3.

Any Ideas any one ? All I can find wants tons of pre 6.2 rpm's installed as dependencies..
Reply With Quote
Reply

Thread Tools

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 10:55 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.06516 seconds
  • Memory Usage 2,323KB
  • 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
  • (2)bbcode_code
  • (5)bbcode_php
  • (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
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • 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