PDA

View Full Version : Display Avatar In Any Template


M1th
06-14-2005, 10:00 PM
Very similar to fraghappy's Show Avatar In Navbar (http://%5Burl=https://vborg.vbsupport.ru/showthread.php?t=83053%5D) 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:
define('AVATAR_ON_NAVBAR', 1);

at the end, right after:
$config['Mysqli']['ini_file'] = '';


Place this HTML code in any template you like.



<if condition="$vbulletin->userinfo['avatarid']">
<img src="$bbuserinfo[avatarpath]" alt="$bbuserinfo'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_$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. :)

[u][u]Credits fraghappy 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
Who moved this to the plugin forum? :pPlugin forum? What plugin forum? :D :D

M1th
06-16-2005, 10:08 AM
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
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/showthread.php?p=771100#post771100

Andreas
09-14-2005, 07:35 PM
Any chance of making this a Plugin? :)

fetch_userinfo_query

$option += (($option & 2) ? 0 : 2);

The Chief
11-01-2005, 07:31 PM
Installed nice work ;)

M1th
11-05-2005, 07:02 PM
Any chance of making this a Plugin? :)

fetch_userinfo_query

$option += (($option & 2) ? 0 : 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
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.