vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Display Avatar In Any Template (https://vborg.vbsupport.ru/showthread.php?t=83150)

M1th 06-14-2005 10:00 PM

Display Avatar In Any Template
 
Very similar to fraghappy's Show Avatar In Navbar Plugin with the difference being that you will now be able to get rid of the extra query executed on every page

Simply open up your config.php file and place:
PHP Code:

define('AVATAR_ON_NAVBAR'1); 

at the end, right after:
PHP Code:

$config['Mysqli']['ini_file'] = ''


Place this HTML code in any template you like.


HTML Code:

<if condition="$vbulletin->userinfo['avatarid']">
        <img src="$bbuserinfo[avatarpath]" alt="$bbuserinfo[username]'s Avatar" border="0" />
<else />
          <if condition="$vbulletin->userinfo['hascustomavatar']">
                  <if condition="$vbulletin->options['usefileavatar']">
                        <a href="profile.php?do=editavatar"><img src="$vboptions[avatarurl]/avatar$bbuserinfo[userid]_$bbuserinfo[avatarrevision].gif" title="$bbuserinfo[username]'s Avatar" alt="Avatar" border="0" /></a>
                  <else />
                        <a href="profile.php?do=editavatar"><img src="image.php?u=$bbuserinfo[userid]&amp;dateline=$avatar[dateline]" title="$bbuserinfo[username]'s Avatar" alt="Avatar" border="0" /></a>
                  </if>
          <else />
                <a href="profile.php?do=editavatar"><img src="$stylevar[imgdir_misc]/noavatar.gif" alt="guestavatar.gif" title="No Avatar Specified" border="0" /></a>
          </if> 
</if>

Upload the noavatar.gif to your /images/misc directory

Done. :)

Creditsfraghappy for the idea and letting me release this mod. :)

Dan 06-15-2005 03:39 PM

Nice one M1th :D

M1th 06-16-2005 09:49 AM

Who moved this to the plugin forum? :p

Marco van Herwaarden 06-16-2005 10:07 AM

Quote:

Originally Posted by M1th
Who moved this to the plugin forum? :p

Plugin forum? What plugin forum? :D :D

M1th 06-16-2005 10:08 AM

Quote:

Originally Posted by MarcoH64
Plugin forum? What plugin forum? :D :D

Sneaky Mods. ;)

dsboyce8624 06-16-2005 07:07 PM

Will this work on 3.0.x?

Chris M 06-16-2005 07:10 PM

You will have to adapt it to function with vB3.0.x, but it should do ;)

Satan

dsboyce8624 06-16-2005 07:24 PM

Problem is I have no idea how.

I know the first find/add won't work, but how do I replace it?

M1th 06-16-2005 07:31 PM

Yep, this works with vB3.0.x too.

Just replace all the instances of $vbulletin->userinfo with $bbuserinfo and $vbulletin->options with $vboptions in the HTML code. :)


And you wont see $config['Mysqli']['ini_file'] = ''; in the config.php file. Instead place the code right after $cookieprefix = 'bb';

dsboyce8624 06-16-2005 08:11 PM

Quote:

Originally Posted by M1th
Yep, this works with vB3.0.x too.

Just replace all the instances of $vbulletin->userinfo with $bbuserinfo and $vbulletin->options with $vboptions in the HTML code. :)


And you wont see $config['Mysqli']['ini_file'] = ''; in the config.php file. Instead place the code right after $cookieprefix = 'bb';

Already did something else.

Thanks though.


All times are GMT. The time now is 11:18 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.01044 seconds
  • Memory Usage 1,748KB
  • 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_html_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_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