vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   avatar check (https://vborg.vbsupport.ru/showthread.php?t=50063)

bharvey42 03-13-2003 01:50 AM

avatar check
 
I have a customized avatar system that stores custom avatars as the users username.gif

Now In the postbit template I would like to be able to display that avatar

$userinfo[username].gif when I use this i get a broken link if the user hasn't uploaded there avatar yet. I made it so it would load a transparent gif and stuck the gif into a table as a background but it repeats if it isn't 66x64.

So what would be the best way to check if the file exists and display it and if not just display the transparent image and fill where the avatar would be?

Thanks

mr e 03-13-2003 02:24 AM

try this, in admin/functions.php find

// do posts from ignored users

and above it do
PHP Code:

if(getavatarurl($bbuserinfo['userid'] != "") {
      
$useravatar "<img src=\"$bbuserinfo[username].gif\">";
    } else {
       
$useravatar "<img src=\"transparent.gif\" width=\"66\" height=\"64\">";
    } 

then put $useravatar in your postbit, not sure if it'll work though :)

bharvey42 03-13-2003 09:26 PM

the avatarurl in vB is always going to be null so i don't think that is going to work?

I need to see if the file exsists and if not display the clear.gif

mr e 03-13-2003 10:51 PM

it won't be null if they've uploaded an avatar, that's what you want right? if they've uploaded one, then display it, otherwise display clear.gif?

bharvey42 03-14-2003 12:48 AM

yeah that is what i want but like i said the avatar is saved as the users name.

It's not uploaded via vB so it won't be stored in the vB db

mr e 03-14-2003 02:25 AM

so it's stored in a folder on your server as their username?

bharvey42 03-14-2003 08:59 PM

yeah the file would be stored as

like

main/images/avatars/username.gif

bharvey42 03-16-2003 11:23 PM

bumppity bump

bharvey42 03-25-2003 06:24 PM

anybody?


All times are GMT. The time now is 10:09 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.00995 seconds
  • Memory Usage 1,722KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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