Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Display Avatar In Any Template Details »»
Display Avatar In Any Template
Version: 1.00, by M1th M1th is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.5.0 Beta 1 Rating:
Released: 06-14-2005 Last Update: Never Installs: 22
Template Edits
Code Changes  
No support by the author.

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.

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 06-17-2005, 04:45 AM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As I posted in Frag's hack release thread, you can use my "No Avatar" image if you don't like the one provided. See attached image.
Reply With Quote
  #13  
Old 06-28-2005, 06:01 AM
jesse jesse is offline
 
Join Date: Mar 2004
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what do you mean post the html code in any template?
need to define a template
Reply With Quote
  #14  
Old 06-28-2005, 06:59 AM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any template means any template you want the avatar to appear in

Satan
Reply With Quote
  #15  
Old 09-10-2005, 01:39 AM
Wordplay Wordplay is offline
 
Join Date: Nov 2001
Location: Dengoku
Posts: 864
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can this help me displaying avatars in current users online list:

https://vborg.vbsupport.ru/showthrea...100#post771100
Reply With Quote
  #16  
Old 09-14-2005, 07:35 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any chance of making this a Plugin?

fetch_userinfo_query
PHP Code:
$option += (($option 2) ? 2); 
Reply With Quote
  #17  
Old 11-01-2005, 07:31 PM
The Chief's Avatar
The Chief The Chief is offline
 
Join Date: Aug 2005
Location: Montreal
Posts: 1,037
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed nice work
Reply With Quote
  #18  
Old 11-05-2005, 07:02 PM
M1th's Avatar
M1th M1th is offline
 
Join Date: Jul 2002
Location: UK
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Andreas
Any chance of making this a Plugin?

fetch_userinfo_query
PHP Code:
$option += (($option 2) ? 2); 
Ah cool I'll look into it.


I havent touched vB in a while so might take some time.
Reply With Quote
  #19  
Old 11-06-2005, 09:37 PM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A file edit in exchange for a saved query.. Fair trade in my opinion!

A plugin version would rock though..
Reply With Quote
  #20  
Old 01-03-2006, 06:32 AM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm.. I've just noticed that the dateline doesn't appear to be working when placing the avatar on my navbar.

The image URL is:
image.php?u=1&dateline=

This can cause an out-of-date avatar to be displayed, and it seems that only a hard refresh (Ctrl+F5) can fix this.. This there any additional code that can be changed for a more "solid" fix?
Reply With Quote
  #21  
Old 09-10-2006, 06:36 AM
Jarllax Jarllax is offline
 
Join Date: Jun 2006
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great stuff, works well. Was unable to use the other version that IS a plugin as it broke a different mod for some reason.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:20 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05696 seconds
  • Memory Usage 2,320KB
  • Queries Executed 28 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_html
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete