Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Place Avatar in VB and Non-VB Pages Details »
Place Avatar in VB and Non-VB Pages
Mod Version: 1.00, by carmichael1973 (Member) carmichael1973 is offline
Developer Last Online: Apr 2010 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.7.0 Rating: (2 votes - 5.00 average) Installs: 33
Released: 27 Jul 2008 Last Update: Never Downloads: 2
Not Supported Template Edits Re-usable Code Translations Is in Beta Stage  

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

  • Add Auto-Resize for Navbar Only
  • Add AJAX function to expand to original size on mouse over
  • Definable default no avatar images for usergroups
  • AdminCP Options
  • Build as a simple product


You just need to become familiar with the following bit of code:

This will display a users avatar:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and this is what I use in place of the Avatar in Navbar mod:

In navbar template replace:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

with this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

In non-vb pages (i.e. vbp_navbar I use vbPortal) I use this code: You must modify this to match your portal or external pages


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Then just simply assign the noavatar.gif as the default avatar for your usergroups. From then on your users that have not uploaded a custom avatar will be displayed the noavatar.gif

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The user must be logged in to the forums and using cookies to work outside of the forum root. If you are using an integrated portal system you should have no issues!

Enjoy!

07/28/2008 - Added simple screenshot.

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	nav_ava.jpg
Views:	1299
Size:	12.8 KB
ID:	84725  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #16  
Old 05 Aug 2008, 01:47
MobileBros MobileBros is offline
 
Join Date: Jan 2007
Originally Posted by carmichael1973 View Post
My attempts to contact the author of Show User's Avatar in Navbar v1.1, fraghappy have been unsuccessful. I'll try to make this into a product with <if> functions to call a default avatar if no custom avatar exists.

None of the original authors code is needed using this method so there shouldn't be an issue!
http://www.vbulletin.org/forum/showp...19&postcount=8

read that ...... and cant wait for the resize feature either
Reply With Quote
  #17  
Old 09 Aug 2008, 13:50
Captain Tycoon's Avatar
Captain Tycoon Captain Tycoon is offline
 
Join Date: Jan 2008
Works nicely! Will let you know if any bugs or problems appear marked as installed!
Reply With Quote
  #18  
Old 14 Aug 2008, 09:14
Chris11987 Chris11987 is offline
 
Join Date: Jun 2008
I can't get this to work. put the code in for a non-vb page, and edited the two directories to match my forums, but all I get is an image that says "vbulletin" on it. And clicking the image logs me out of the forums, even though I have cookies enabled and am permanently logged in.
Reply With Quote
  #19  
Old 14 Aug 2008, 12:23
carmichael1973's Avatar
carmichael1973 carmichael1973 is offline
 
Join Date: Aug 2006
Originally Posted by Chris11987 View Post
I can't get this to work. put the code in for a non-vb page, and edited the two directories to match my forums, but all I get is an image that says "vbulletin" on it. And clicking the image logs me out of the forums, even though I have cookies enabled and am permanently logged in.
When you say you "edited the two directories to match your forums", what edits did you make? Can you post the code you are trying to use?

Also, with regards to your cookie issue... What is your "Path to save cookies" and "Cookie Domain" set to in your VB Admin options? Based on your issue, I'm assuming you are using the direct method (i.e. http://www.yourdomain.com/..........). If your cookie path and domain settings are not correct, entering a direct link will cause the user to be logged out.

Let me explain... If I visit http://yourforums.com and login, I'm able to click on other links beginning with the http://yourforums.com and stay logged in. If you direct entry a link as http://www.yourforums.com and your cookie path is not setup to recognize the two as being the same, I will be logged out.

Provide some more info and I'll help you sort it out!

Last edited by carmichael1973; 14 Aug 2008 at 21:07.
Reply With Quote
  #20  
Old 16 Aug 2008, 04:25
ForgotenDynasty ForgotenDynasty is offline
 
Join Date: Jul 2008
would this work on a wordpress blog using the wordpress bridge?
Reply With Quote
  #21  
Old 18 Sep 2008, 15:31
odln018's Avatar
odln018 odln018 is offline
 
Join Date: Mar 2006
I can't seem to get this operating.

When i try to find the original navbar code for replacement, I'm not seeing it.
Reply With Quote
  #22  
Old 13 Nov 2008, 18:17
pewa pewa is offline
 
Join Date: Feb 2008
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?
<img src="$vboptions[bbdir]/vbtest/image.php?u=$bbuserinfo[userid]" alt="/images/navbaravatar.gif" border="0" />


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.

Last edited by pewa; 13 Nov 2008 at 22:02.
Reply With Quote
  #23  
Old 23 Nov 2008, 09:37
Chris11987 Chris11987 is offline
 
Join Date: Jun 2008
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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I've also tried using:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I used my website's domain and forums path, of course, and the www's part is not an issue.
Reply With Quote
  #24  
Old 23 Nov 2008, 15:55
Wordplay Wordplay is offline
 
Join Date: Nov 2001
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:

http://www.vbulletin.org/forum/image.php?u=0

__________________
nothing left to say
Reply With Quote
  #25  
Old 25 Nov 2008, 07:26
Chris11987 Chris11987 is offline
 
Join Date: Jun 2008
Originally Posted by Chris11987 View Post
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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I've also tried using:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I used my website's domain and forums path, of course, and the www's part is not an issue.
Anyone?


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.

Last edited by Chris11987; 25 Nov 2008 at 09:33.
Reply With Quote
  #26  
Old 26 Nov 2008, 19:52
pewa pewa is offline
 
Join Date: Feb 2008
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?
Reply With Quote
  #27  
Old 26 Nov 2008, 20:59
Chris11987 Chris11987 is offline
 
Join Date: Jun 2008
Originally Posted by pewa View Post
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?
I should probably point out that this is the same problem I'm having.
Reply With Quote
  #28  
Old 26 Nov 2008, 21:01
pewa pewa is offline
 
Join Date: Feb 2008
Originally Posted by Chris11987 View Post
I should probably point out that this is the same problem I'm having.
Would be great with a fix!
Reply With Quote
  #29  
Old 04 Dec 2008, 11:20
Chris11987 Chris11987 is offline
 
Join Date: Jun 2008
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.
Reply With Quote
  #30  
Old 29 Dec 2008, 14:37
Davey-UK's Avatar
Davey-UK Davey-UK is offline
 
Join Date: Feb 2003
Location: Sheffield-UK
Real name: Dave
Originally Posted by Chris11987 View Post
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.
Just add the following in your template and it works fine

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Obviously change the red bits to your own domain and forums directory.
__________________
==========================================
If it aint broke -------------------- Don't fix it!!
==========================================
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 15:10.

Layout Options | Width: Wide Color: