0 Quries Avatar on Navbar

alexD

New Member
With some work I made this template edit.

What does it do? Well its quiresless so no extra load it adds the data from the image.php file that each user has. Warning if your using vboptimize flush catch for this to work.


Add this line right after the <?php but before the /* or else it will be added as a comment nd wont work.

PHP:
define(AVATAR_ON_NAVBAR, 1);

open navbar template and find.

PHP:
			<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong></div>
		</if>
	</td>

add after:

PHP:
<!-- avatar -->
<td style="background-color:#000000">
<if condition="$show['member']">
<if condition="$vbulletin->userinfo[hascustomavatar]">
<img src="image.php?u=$bbuserinfo[userid]&dateline=" height="80" width="80" alt="$bbuserinfo[username]'s avatar" />
<else />
<img src="$stylevar[imgdir_misc]/unknown_sg.png"  height="80" width="80" alt="no avatar" />
</if></if>
<if condition="$show['guest']">
<img src="$stylevar[imgdir_misc]/unknown.gif" height="80" width="80" alt="guest avatar" />
</if>
</td>
<!-- /avatar -->

Make sure images are uploaded to the styles misc directory

You will have to add your own images to the <else /> tag for the $show['member'] part I used this on 3.8.0 but you can use it on your own forum on 3.7.x and 3.8.x havnet tested on 3.6.x yet

now enjoy!
 

viciouscode

New Member
easy link the image to the avatar page

Code:
<!-- avatar -->
<if condition="$show['member']">
<if condition="$vbulletin->userinfo[hascustomavatar]">
<td class="alt2">
<a href="profile.php?do=editavatar"><img src="image.php?u=$bbuserinfo[userid]" height="80" width="80" alt="$bbuserinfo[username]'s avatar" border="0" /></a>
<else />
<a href="profile.php?do=editavatar"><img src="$stylevar[imgdir_misc]/unknown_sg.png"  height="80" width="80" alt="no avatar" border="0" /></a>
</td>
</if></if>
<!-- /avatar -->

edit: I also fixed the code
 

chrismaher2007

New Member
alexD said:
With some work I made this template edit.

Add this line right after the <?php but before the /* or else it will be added as a comment nd wont work.

PHP:
define(AVATAR_ON_NAVBAR, 1);

do you mean actually edit the file image.php and ftp it back to the server??
 

bluescorpion

New Member
THAT is EXACTLY what he means... I think he should have found a better way to set that so that people don't have muck with files to make it work. Its a bad coding decision from my perspective.
 

chrismaher2007

New Member
and what images do you have to upload to misc?

can you not just make it so it displays the members avatar?

ive installed this mod and all i get is a black box rather than an image
 
Top