View Single Post
  #112  
Old 05-31-2006, 03:33 PM
hypnoticpimp hypnoticpimp is offline
 
Join Date: Dec 2004
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes it here, check it

PHP Code:
// begin variables
// the path to the PNG file that you want to overlay with
// must be on the local machine, not an http:// URL
$WATERMARK_PNG_FILE '/home/wshh/public_html/watermark.png';
// how you want to position the watermark enter either center or bottom_left
$WATERMARK_POSITION 'bottom_left';
// user you want to see watermarking on - this is just for testing
// set to 0 to work for all users
$VB_USER_ID 0;
// end variables - you shouldn't need to edit below here
 

// if there's no filepath to work with there's nothing we can do
// we also need the watermark file to exist
// if $VB_USER_ID is specified (for testing) show it just them
if(! empty($attachpath) && file_exists($WATERMARK_PNG_FILE) && ( $VB_USER_ID == || $GLOBALS['vbulletin']->userinfo['userid'] == $VB_USER_ID )) {

 
// derive output name
 
$fo preg_replace('/\.attach$/''.marked'$attachpath);
 
// image doesn't exist or thumbnail is newer than the cached file - create a watermarked version
 
if( (! file_exists($fo) || filemtime($WATERMARK_PNG_FILE) > filemtime($fo) || true) && $fo != $attachpath ) {
  
// decide what image type it is
  
if( preg_match('/\.png$/i'$attachmentinfo['filename']) ) {
   
$im = @imagecreatefrompng($attachpath);
  } elseif( 
preg_match('/\.jpg$/i'$attachmentinfo['filename']) ) {
   
$im = @imagecreatefromjpeg($attachpath);
  
   
// create an empty truecolor container
   
$tempimage = @imagecreatetruecolor(@imagesx($im), @imagesy($im));
       
   
// copy the 8-bit gif into the truecolor image
   
@imagecopy($tempimage$im,
    
0000
    @
imagesx($im), @imagesy($im)
   );
       
   
// copy the source_id int
   
$im $tempimage;
  }
  
// open the watermark image
  
$wm = @imagecreatefrompng($WATERMARK_PNG_FILE);
  @
imagealphablending($wmfalse);
  @
imagesavealpha($wmtrue);
  
// catch opening problems
  
if($im && $wm) {
   if(
$WATERMARK_POSITION == 'center') {
    
$pos_x = (imagesx($im) / 2) - (imagesx($wm) / 2);
    
$pos_y = (imagesy($im) / 2) - (imagesy($wm) / 2);
   } else {
    
$pos_x imagesx($im) - imagesx($wm) - 10;
    
$pos_y imagesy($im) - imagesy($wm) - 10;
   }

   
// merge the files together
   
$copy_worked = @imagecopy($im,$wm,
         
$pos_x$pos_y,
    
00imagesx($wm), imagesy($wm)
   );
  }
  
// write out the new image
  
if($copy_worked) {
   
// decide what image type it is
   
if( preg_match('/\.png$/i'$attachmentinfo['filename']) ) {
    @
imagepng($im,$fo);
   } elseif( 
preg_match('/\.jpg$/i'$attachmentinfo['filename']) ) {
    @
imagejpeg($im,$fo);
   } elseif( 
preg_match('/\.gif$/i'$attachmentinfo['filename']) ) {
    @
imagegif($im,$fo);
   }
  }
 }
 
// check that the new file is there - if so open the file pointer to it
 
if( @filesize($fo) > && $fp2 fopen($fo,'rb') ) {
  
// re-send image size header
  
header('Content-Length: 'filesize($fo));
  @
fclose($fp);
  
$fp $fp2;
 }

so please tell me now why nothing happens?
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02090 seconds
  • Memory Usage 1,820KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete