vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Navbar avatar only in forumhome (https://vborg.vbsupport.ru/showthread.php?t=174780)

Medina 04-01-2008 08:58 AM

Navbar avatar only in forumhome
 
PHP Code:

// Avatar In NavBar
if ($vbulletin->userinfo['avatarid']) 

 
// using a predefined avatar 
 
$avatar $db->query_first("SELECT avatarpath FROM " TABLE_PREFIX "avatar WHERE avatarid = " $vbulletin->userinfo[avatarid] . ""); 
 
$avatarid $avatar['avatarid']; 
 
$navbaravatar "<img src=\"" $vbulletin->options[bburl] . "/$avatar[avatarpath]\" alt=\"Your Avatar\" border=\"0\" />"

else 

 
// not using a predefined avatar, check for custom 
 
if ($avatar $db->query_first("SELECT dateline, userid FROM " TABLE_PREFIX "customavatar WHERE userid = " $vbulletin->userinfo[userid] . "")) 
 { 
  
// using a custom avatar 
  
$navbaravatarurl = ($vbulletin->options['usefileavatar']) ? "" $vbulletin->options[avatarurl] . "/avatar$avatar[userid]_" $vbulletin->userinfo[avatarrevision] . ".gif" "" $vbulletin->options[bburl] . "/image.php?u=" $vbulletin->userinfo['userid'] . "&amp;dateline=" $avatar['dateline'] . "";
  
$navbaravatar "<img src=\"$navbaravatarurl\" alt=\"Your Avatar\" border=\"0\" />";
 } 
 else
 { 
  
// no avatar specified 
  
$nouseavatarchecked HTML_CHECKED
  
$avatarchecked[0] = ''
  
$navbaravatar "<img src=\"" $vbulletin->options[bburl] . "/$stylevar[imgdir_misc]/noavatar.gif\" alt=\"Your Avatar\" border=\"0\" />"// "<span class=\"smallfont\">No Avatar</span>";
 


// Avatar In NavBar 





This is the code what I using for navbar avatar. But I don`t wan`t show up on all templates. Only in forumhome. Who can help me out.


Thanks.

Dismounted 04-01-2008 01:23 PM

PHP Code:

// Avatar In NavBar
if (THIS_SCRIPT == 'index')
{
if (
$vbulletin->userinfo['avatarid']) 

 
// using a predefined avatar 
 
$avatar $db->query_first("SELECT avatarpath FROM " TABLE_PREFIX "avatar WHERE avatarid = " $vbulletin->userinfo[avatarid] . ""); 
 
$avatarid $avatar['avatarid']; 
 
$navbaravatar "<img src=\"" $vbulletin->options[bburl] . "/$avatar[avatarpath]\" alt=\"Your Avatar\" border=\"0\" />"

else 

 
// not using a predefined avatar, check for custom 
 
if ($avatar $db->query_first("SELECT dateline, userid FROM " TABLE_PREFIX "customavatar WHERE userid = " $vbulletin->userinfo[userid] . "")) 
 { 
  
// using a custom avatar 
  
$navbaravatarurl = ($vbulletin->options['usefileavatar']) ? "" $vbulletin->options[avatarurl] . "/avatar$avatar[userid]_" $vbulletin->userinfo[avatarrevision] . ".gif" "" $vbulletin->options[bburl] . "/image.php?u=" $vbulletin->userinfo['userid'] . "&amp;dateline=" $avatar['dateline'] . "";
  
$navbaravatar "<img src=\"$navbaravatarurl\" alt=\"Your Avatar\" border=\"0\" />";
 } 
 else
 { 
  
// no avatar specified 
  
$nouseavatarchecked HTML_CHECKED
  
$avatarchecked[0] = ''
  
$navbaravatar "<img src=\"" $vbulletin->options[bburl] . "/$stylevar[imgdir_misc]/noavatar.gif\" alt=\"Your Avatar\" border=\"0\" />"// "<span class=\"smallfont\">No Avatar</span>";
 


}
// Avatar In NavBar 


Medina 04-01-2008 01:52 PM

Dammn, your good. Thank you verry much.! :D


All times are GMT. The time now is 04:10 PM.

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.00997 seconds
  • Memory Usage 1,746KB
  • 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
  • (3)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