Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Place Avatar in VB and Non-VB Pages Details »»
Place Avatar in VB and Non-VB Pages
Version: 1.00, by carmichael1973 carmichael1973 is offline
Developer Last Online: Apr 2010 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.7.0 Rating:
Released: 07-26-2008 Last Update: Never Installs: 33
Template Edits
Re-useable Code Translations Is in Beta Stage  
No support by the author.

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:
Code:
<img src="$vboptions[bbdir]/image.php?u=$bbuserinfo[userid]" alt="Your avatar" border="0" />
and this is what I use in place of the Avatar in Navbar mod:

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>
with this:

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>
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

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

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 07-29-2008, 03:32 AM
carmichael1973's Avatar
carmichael1973 carmichael1973 is offline
 
Join Date: Aug 2006
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by zmmmzz View Post
thanks for the explanation!

now I'm trying to set an avatar as default so that when a user registers the avatar is already selected in his or her account instead of 'no avatar specified'.

Is this possible?
It is possible.... If you can give me another couple of days I'll have a total solution for you. Then the above steps won't be needed. I'm very close on this but work is taking alot of my time.
Reply With Quote
  #13  
Old 07-29-2008, 04:21 PM
zmmmzz zmmmzz is offline
 
Join Date: Nov 2007
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok! cant wait
thank you for taking time for this
Reply With Quote
  #14  
Old 08-04-2008, 05:19 PM
trulylowcarb's Avatar
trulylowcarb trulylowcarb is offline
 
Join Date: Apr 2004
Location: Colorado
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you! I was looking for the right code to display avatars in the navbar. I need them to be smaller, too, though.
*installed*
Reply With Quote
  #15  
Old 08-04-2008, 06:20 PM
trulylowcarb's Avatar
trulylowcarb trulylowcarb is offline
 
Join Date: Apr 2004
Location: Colorado
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am sure it is a dirty cheat, but I just used the html to call the avatar directly in my navbar, then added width="25%" height="25%". It seems to work perfectly. For those with no avatar, the space is just blank. I would really like to use the default avatar instead though, I haven't found anything to do that in anything even close to the current version and I have a lot usergroups, so ....
<crossing fingers you'll put it all together for us>
Reply With Quote
  #16  
Old 08-04-2008, 06:33 PM
trulylowcarb's Avatar
trulylowcarb trulylowcarb is offline
 
Join Date: Apr 2004
Location: Colorado
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I take it back - it doesn't update when the avatar is changed or deleted.
Reply With Quote
  #17  
Old 08-04-2008, 11:47 PM
MobileBros MobileBros is offline
 
Join Date: Jan 2007
Location: Columbus
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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!
https://vborg.vbsupport.ru/showpost....19&postcount=8

read that ...... and cant wait for the resize feature either
Reply With Quote
  #18  
Old 08-09-2008, 11:50 AM
Captain Tycoon Captain Tycoon is offline
 
Join Date: Jan 2008
Posts: 121
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works nicely! Will let you know if any bugs or problems appear marked as installed!
Reply With Quote
  #19  
Old 08-14-2008, 07:14 AM
Chris11987 Chris11987 is offline
 
Join Date: Jun 2008
Posts: 210
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
  #20  
Old 08-14-2008, 10:23 AM
carmichael1973's Avatar
carmichael1973 carmichael1973 is offline
 
Join Date: Aug 2006
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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!
Reply With Quote
  #21  
Old 08-16-2008, 02:25 AM
ForgotenDynasty ForgotenDynasty is offline
 
Join Date: Jul 2008
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

would this work on a wordpress blog using the wordpress bridge?
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 01:24 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04496 seconds
  • Memory Usage 2,316KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete