The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Place Avatar in VB and Non-VB Pages Details »» | |||||||||||||||||||||||||||
Place Avatar in VB and Non-VB Pages
Developer Last Online: Apr 2010
The following is a bit of code I came up with to continue to use the Avatar in Navbar mod by fraghappy. After searching for many hours I decided just to figure it out myself.
On the bright side, none of the plugins and db queries from the old mod are used. I'll try to support this as much as possible, but I don't foresee anyone having any real issues. It's pretty straight forward. Don't forget to click the INSTALL Features in progress
You just need to become familiar with the following bit of code: This will display a users avatar: Code:
<img src="$vboptions[bbdir]/image.php?u=$bbuserinfo[userid]" alt="Your avatar" border="0" /> In navbar template replace: Code:
<table cellpadding="0" cellspacing="0" align="left" style="margin-top:5px;"> <tr> <td><a href="profile.php?$session[sessionurl]do=editavatar"><img src="$navbar_ava[0]" alt="Your avatar" border="0" /></a> </td> Code:
<table cellpadding="0" cellspacing="0" align="left" style="margin-top:5px;"> <tr> <td><a href="$vboptions[bbdir]/profile.php?$session[sessionurl]do=editavatar"><img src="$vboptions[bbdir]/image.php?u=$bbuserinfo[userid]" alt="Your avatar" border="0" /></a> </td> Code:
<table cellpadding="0" cellspacing="0" align="left" style="margin-top:5px;"> <tr> <td><a href="$vbpoptions[bbdir]/profile.php?$session[sessionurl]do=editavatar"><img src="$vbpoptions[bbdir]/image.php?u=$bbuserinfo[userid]" alt="Your avatar" border="0" /></a> </td> Personally I don't use the no avatar image as the default. I created a custom default avatar for each usergroup. As for the plugin for the original Avatar on Navbar mod, I don't even use it. With this bit of code it's simple and not needed. or if you want to call it directly using an http: use this method: Code:
<table cellpadding="0" cellspacing="0" align="left" style="margin-top:5px;"> <tr> <td><a href="http://www.yourwebsite/pathtoforums/profile.php?$session[sessionurl]do=editavatar"><img src="http://www.yourwebsite/pathtoforums/image.php?u=$bbuserinfo[userid]" alt="Your avatar" border="0" /></a> </td> Enjoy! 07/28/2008 - Added simple screenshot. Show Your Support
|
Comments |
#22
|
||||
|
||||
I can't seem to get this operating.
When i try to find the original navbar code for replacement, I'm not seeing it. |
#23
|
|||
|
|||
I don't want to add a default avatar to all users but I would like to display a default avatar in the navbar when the user is missing one.
could that be done with something like? Quote:
Another question: The avatars display just fine but when a person without avatar logs in the text "Your avatar" is missing and all there is is a blank space. |
#24
|
|||
|
|||
I'm trying to place the avatar right next to my "Welcome _____, you have X PMs and notifications" part of the navbar.
Here's my code I'm using, with the avatar part highlighted red: Code:
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="alt1" width="300">
<if condition="$show['member']">
<td class="alt2" nowrap="nowrap">
<div class="smallfont">
<td><a href="$vboptions[bbdir]/profile.php?$session[sessionurl]do=editavatar"><img src="$vboptions[bbdir]/image.php?u=$bbuserinfo[userid]" alt="Your avatar" border="0" /></a>
</td>
<strong><phrase 1="$bbuserinfo[username]" 2="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[welcome_x_link_y]</phrase></strong><br />
<if condition="$show['notifications']">
<div><span id="notifications"><a href="usercp.php$session[sessionurl_q]">$vbphrase[your_notifications]:</a> <strong>$notifications_total</strong></span></div>
<script type="text/javascript"> vBmenu.register("notifications"); </script>
<else /><if condition="$show['pmstats']">
<div><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl_q]">$vbphrase[private_messages_nav]</phrase></div>
</if></if>
<if condition="$show['pmwarning']"><div><strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong></div></if>
</div>
</td>
<else />
<td class="alt2" nowrap="nowrap" style="padding:0px">
<!-- login form -->
<form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">
<script type="text/javascript" src="clientscript/vbulletin_md5.js?v=$vboptions[simpleversion]"></script>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
<tr>
<td class="smallfont" style="white-space: nowrap;"><label for="navbar_username">$vbphrase[username]</label></td>
<td><input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td>
<td class="smallfont" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />$vbphrase[remember_me]</label></td>
</tr>
<tr>
<td class="smallfont"><label for="navbar_password">$vbphrase[password]</label></td>
<td><input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="10" tabindex="102" /></td>
<td><input type="submit" class="button" value="$vbphrase[log_in]" tabindex="104" title="$vbphrase[enter_username_to_login_or_register]" accesskey="s" /></td>
</tr>
</table>
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
<input type="hidden" name="do" value="login" />
<input type="hidden" name="vb_login_md5password" />
<input type="hidden" name="vb_login_md5password_utf" />
</form>
<!-- / login form -->
</td>
</if>
</tr>
</table>
Code:
<td><a href="http://www.yourwebsite/pathtoforums/profile.php?$session[sessionurl]do=editavatar"><img src="http://www.yourwebsite/pathtoforums/image.php?u=$bbuserinfo[userid]" alt="Your avatar" border="0" /></a>
</td>
|
#25
|
|||
|
|||
if a user doesn't have an avatar though it doesn't show the noavatar pic... matter of fact in the code i also can't see anything saying it should pick out a noavatar pic.
and if a user isn't logged in it shows this image: https://vborg.vbsupport.ru/image.php?u=0 |
#26
|
|||
|
|||
Quote:
edit: After taking a look, it seems that the codes given in this thread are calling whatever the url of the current page is as the image. Since a webpage is obviously not an image, that is why the avatar won't show up. My question is, how did everyone else get theirs to work. I've tried using "$avatarurl" and "$user[avatarurl]" as the image source and still haven't had any luck. |
#27
|
|||
|
|||
It works on my test site which have vBadvanced and vbulletin files in the same folder(root), but It won't work on my live site where I have vBa inte the root and the forum in /forum
Any idea why? |
#28
|
|||
|
|||
I should probably point out that this is the same problem I'm having.
|
#29
|
|||
|
|||
Would be great with a fix!
|
#30
|
|||
|
|||
I'd like to update by saying that even after moving my compss to inside my forum's directory, I still have no avatar showing up.
|
#31
|
||||
|
||||
Quote:
Code:
<a href="http://www.yourdomain/forumsdir/profile.php?$session[sessionurl]do=editavatar"><img src="http://www.yourdomain/forumsdir/image.php?u=$bbuserinfo[userid]" alt="Your avatar" border="0" /></a>
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|