vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Avatar on homepage (https://vborg.vbsupport.ru/showthread.php?t=32560)

Admin 11-20-2001 10:00 PM

This is what we use on the main page of this forum.
So many people liked it and asked for it, I posted it on at least 5 threads already, but someone wanted a proper release so here it is. :)

Anyway, in index.php add this:
Code:

if ($bbuserinfo[userid]!=0) {
  $avatarurl=getavatarurl($bbuserinfo[userid]);
  if ($avatarurl=='') {
    $avatarurl='{imagesfolder}/noavatar.gif';
  }
  $avatarimage='<img src="'.$avatarurl.'">';
} else {
  $avatarimage='<a href="register.php?s='.$session[sessionhash].'&action=signup"><img src="{imagesfolder}/guestavatar.gif"></a>';
}

right after this:
Code:

$permissions=getpermissions();
if (!$permissions['canview']) {
        show_nopermission();
}

Now in any of your forumhome_xxx templates, you can use this:
Code:

$avatarimage
to display the user's avatar.

It will display the user's avatar if he has selected one, if he hasn't selected one it will show noavatar.gif (you'll need to upload that to your images folder), and if it's a guest, it will show guestavatar.gif, and link the image to register.php.

TheComputerGuy 11-21-2001 12:08 PM

I like it, nice work there Firefly

squawell 11-21-2001 12:36 PM

it's good hack for me thankz FireFly~~

if i want it show up like main page of this forum what template

should i put this code$avatarimage?

forumhome or .....??

SgtSling 11-21-2001 01:46 PM

forumhome template

SgtSling 11-21-2001 01:46 PM

or any of the other's that are listed under forumhome

snyx 11-21-2001 02:47 PM

oh yeah, love'n it firefly!
http://www.form-kaos.com/board/

Sinecure 11-21-2001 03:00 PM

How would I go about using $avatarimage in my header template. Modifying something in functions.php correct?

Admin 11-21-2001 03:08 PM

Add the code to global.php, before:
Code:

$header='';

Sinecure 11-21-2001 03:15 PM

Thank You :D

Mike Gaidin 11-21-2001 08:44 PM

Thanks FireFly!


All times are GMT. The time now is 01:41 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.01020 seconds
  • Memory Usage 1,728KB
  • 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
  • (4)bbcode_code_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