vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   gd troubles as usual (https://vborg.vbsupport.ru/showthread.php?t=70974)

AN-net 10-25-2004 04:34 PM

gd troubles as usual
 
ok well im trying to modify the fetch_avatar_url function so it will place text over a user's avatar but of course it isnt workin

here is the code:
PHP Code:

            if ($vboptions['usefileavatar'])
            {
                
$preavaurl"http://www.animationation.net/community/$vboptions[avatarurl]/avatar{$userid}_{$avatarinfo[avatarrevision]}.gif";
                
$preavaImageCreateFromGif($preavaurl);
                
$colortextimagecolorallocate($preava000);
                
ImageTTFText($preava6011$colortext"./arial.ttf""BANNED!");
                return 
"$vboptions[avatarurl]/avatar{$userid}_{$avatarinfo[avatarrevision]}.gif";
            }
            else
            {
                return 
"image.php?u=$userid&dateline=$avatarinfo[dateline]";
            } 

see the problem is its still showing the original avatar unedited, how can i achieve this?

Natch 10-25-2004 04:36 PM

I don't see a line of code which output's the image to the server...

AN-net 10-25-2004 06:00 PM

how would i do that? im still new at this>_<

AN-net 10-26-2004 05:17 PM

bump

Natch 10-26-2004 10:13 PM

If you wanted to look it up in the php.net manual, you would have found the following information (the following is my paraphrase):

Basically, you need to output the image either directly to the page (leave out the path statement) or to a file... or it is being created by ImageCreateFromGIF(), modified with ImageTTF(), then it vanishes after you create it when the page finishes loading...

Unless you know what the transparent colour using in the image is (and you can't detect that on the fly) your output image will not be transparent...

The following code would work for your "stored as a file" avatars, but for the database stored avatars you would require a database INSERT query to put the modified GIF image into the DB...
PHP Code:

imagegif($preava,"./$vboptions[avatarurl]/avatar{$userid}_{$avatarinfo[avatarrevision]}.gif"); 

Make sense?

Another way to do it would be to create a separat PHP script to create the image itself, then you can call a banned_img.php script if you are viewing a banned users avatar... that might suit better.

Ref: php.net - imagegif()


All times are GMT. The time now is 06:24 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.01002 seconds
  • Memory Usage 1,731KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete