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.

Kirk Y 06-17-2005 04:45 AM

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.

jesse 06-28-2005 06:01 AM

what do you mean post the html code in any template?
need to define a template

Chris M 06-28-2005 06:59 AM

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

Satan

Wordplay 09-10-2005 01:39 AM

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

https://vborg.vbsupport.ru/showthrea...100#post771100

Andreas 09-14-2005 07:35 PM

Any chance of making this a Plugin? :)

fetch_userinfo_query
PHP Code:

$option += (($option 2) ? 2); 


The Chief 11-01-2005 07:31 PM

Installed nice work ;)

M1th 11-05-2005 07:02 PM

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. :)

Oblivion Knight 11-06-2005 09:37 PM

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

A plugin version would rock though.. ;)

Oblivion Knight 01-03-2006 06:32 AM

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?

Jarllax 09-10-2006 06:36 AM

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

PayBas 01-16-2007 04:39 PM

Any chance of this still becoming a plugin?

Ben Wilkins 05-20-2007 11:35 AM

Quote:

Originally Posted by Oblivion Knight (Post 863212)
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?



bump. I need this fixed.


All times are GMT. The time now is 01:03 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.01248 seconds
  • Memory Usage 1,769KB
  • 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
  • (4)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (22)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