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
  #32  
Old 01-05-2009, 02:02 PM
Cobra-J82's Avatar
Cobra-J82 Cobra-J82 is offline
 
Join Date: Apr 2008
Location: Montreal
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have 3.7.4
I tried everything u guys said
It just gives blank
Reply With Quote
  #33  
Old 01-14-2009, 10:43 PM
BucShot's Avatar
BucShot BucShot is offline
 
Join Date: Jan 2008
Location: Central Florida
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm running 3.8.0 on a test site and only wanted to display a small version of the member's avatar so I streamlined the code to this.
Code:
<img width="50" src="$vboptions[bburl]/image.php?u=$bbuserinfo[userid]" alt="Your Avatar" border="0" />
You people running vBa in a different directory will need to edit your header and navbar replacement info in your vBa settings.
Reply With Quote
  #34  
Old 01-24-2009, 07:09 PM
thunder_sti thunder_sti is offline
 
Join Date: Sep 2006
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can someone come up with a fix. I cant manage to install this avatar thingy into my navbar.



unless, the instructions are just confusing.

Can anyone help me ?

Thanks
Reply With Quote
  #35  
Old 02-06-2009, 12:57 PM
ViciousCode ViciousCode is offline
 
Join Date: Oct 2008
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

there is one thing missing...

what if the user is using a avatar from a different site, for example, from google images
or is using gallery avatars from the images/avatars directory
Reply With Quote
  #36  
Old 04-09-2009, 01:12 AM
columbusgeek's Avatar
columbusgeek columbusgeek is offline
 
Join Date: Sep 2007
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A simple tweak.

If you dont want the goofy vbulletin image to come up for guests, simply add:
<if condition="$show['member']"> to the beginning of the code and a </if> to the end of the code. Then the avatar will only show for logged in users.
Reply With Quote
  #37  
Old 04-13-2009, 11:53 PM
tomotron tomotron is offline
 
Join Date: Nov 2005
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ViciousCode View Post
there is one thing missing...

what if the user is using a avatar from a different site, for example, from google images
or is using gallery avatars from the images/avatars directory
This also doesn't seem to work if you store custom avatars in the filesystem as opposed to the database... anyone know a workaround?
Reply With Quote
  #38  
Old 04-15-2009, 05:16 AM
The D The D is offline
 
Join Date: May 2007
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tomotron View Post
This also doesn't seem to work if you store custom avatars in the filesystem as opposed to the database... anyone know a workaround?
I think that may be my problem as well. When I use any of the above codes, it only shows up as a text link 'Your avatar'. I figure it has to do with the filesystem storage type?

If not, I have no idea why it won't work..
Reply With Quote
  #39  
Old 05-08-2009, 10:21 AM
ViciousCode ViciousCode is offline
 
Join Date: Oct 2008
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

isnt the "&dateline=date" missing?
Reply With Quote
  #40  
Old 07-12-2009, 01:30 AM
fourat fourat is offline
 
Join Date: Mar 2008
Posts: 174
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if the member not have avatar how i put "noavater.gif" ?
Reply With Quote
  #41  
Old 07-30-2009, 03:40 AM
miner's Avatar
miner miner is offline
 
Join Date: Mar 2005
Posts: 594
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by trulylowcarb View Post
I take it back - it doesn't update when the avatar is changed or deleted.

Yes it happens the same for me, the avatar does not update, but it does change in the postbit!
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:53 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.04871 seconds
  • Memory Usage 2,317KB
  • 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
  • (6)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