Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Show Avatar Anywhere Details »»
Show Avatar Anywhere
Version: 1.00, by dsboyce8624 dsboyce8624 is offline
Developer Last Online: Dec 2006 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 06-15-2005 Last Update: Never Installs: 9
Template Edits
 
No support by the author.

Okay, I searched all over for this and finally found something that works for 3.0.7 in a post, to help those who don't look outside the Mod Forums for answers I am going to post it here.

I did not code it or figure it out, all credit goes to Gellpak in this post. Gellpak, if you want to post this as your hack, PM me and I'll pull it.

Place this at the end of phpinclude_start:

Code:
require_once('./includes/init.php');
require_once('./includes/functions_user.php');
$bbuserinfo['user_avatar']=fetch_avatar_url($bbuserinfo['userid']);
if ($bbuserinfo['user_avatar']=='') ($bbuserinfo['user_avatar']='images/misc/noavatar.gif'); 
$bbuserinfo['user_avatar']="<img src='$vboptions[bburl]/{$bbuserinfo['user_avatar']}' border='0'>";
$bbuserinfo['user_avatar']="<a href='$vboptions[bburl]/profile.php?{$session['sessionurl']}&do=editavatar'>{$bbuserinfo['user_avatar']}</a>";
$welcome_avatar=$bbuserinfo['user_avatar'];
Then place the $welcome_avatar variable anywhere you want the avatar to show up.

I corrected his code a bit for people who do not have avatars.

Check the URL and file name for whatever image you use for those without an avatar.

Also, if you use vBadvanced and want this on the main page somewhere add welcome_avatar to the variable list in vBa CMPS Default Settings in the AdminCP.

Supporters / CoAuthors

Show Your Support

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

Comments
  #2  
Old 06-16-2005, 08:07 PM
nexialys
Guest
 
Posts: n/a
Default

[high]* nexialys never understand why people are happy to see their own avatar anywhere... but i'm not everyone, so maybe this kind of hack is good.. ... yes it's good... no kidding, it's working correctly and is useful![/high]
Reply With Quote
  #3  
Old 06-16-2005, 08:09 PM
dsboyce8624 dsboyce8624 is offline
 
Join Date: May 2005
Location: New Jersey
Posts: 413
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wanted to have the avatar in the navbar because it adds a little color.

Guess it's all about how you want things to look.
Reply With Quote
  #4  
Old 06-16-2005, 08:10 PM
dsboyce8624 dsboyce8624 is offline
 
Join Date: May 2005
Location: New Jersey
Posts: 413
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nexialys
[high] ... yes it's good... no kidding, it's working correctly and is useful![/high]
Then click install please.
Reply With Quote
  #5  
Old 06-16-2005, 08:12 PM
M1th's Avatar
M1th M1th is offline
 
Join Date: Jul 2002
Location: UK
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

https://vborg.vbsupport.ru/showthread.php?t=83053
https://vborg.vbsupport.ru/showthrea...threadid=83150

Reply With Quote
  #6  
Old 06-16-2005, 08:14 PM
dsboyce8624 dsboyce8624 is offline
 
Join Date: May 2005
Location: New Jersey
Posts: 413
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Didn't mean to step on yours, just was in a hurry to get what I wanted done and I don't know enough to port yours like you did.
Reply With Quote
  #7  
Old 07-13-2005, 02:25 PM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can't get this working on my vbadvanced page. I've added the necessary info to php_includestart but the path is wrong for vbadvanced...the link for vbadvanced is http://www.tek-wiz.com/image.php?u=1...ine=1120950416


It needs to be forums/images.php?u........etc etc for vbadvanced

I have full paths in my settings for vbadvanced so I can't understand what's not working exactly...I have the $welcome_avatar variable as part of the welcome hack and it works when the navbar is showing the forums but it seems $avatarurl is not getting populated with the info. Any ideas?

Nevermind, I fixed it by grabbing this code from the show avatar in any template hack:

<a href="profile.php?do=editavatar"><img src="http://www.fullurltosite.com/forums/image.php?u=$bbuserinfo[userid]&amp;dateline=$avatar[dateline]" title="$bbuserinfo[username]'s Avatar" alt="Avatar" border="0" /></a>

Instead of $welcome_avatar as it would only work on the forums page. THANK YOU!


EDIT: Ok I spoke too soon, the avatars work for me and guest. But if you are registered it only shows an avatar on the forum page...it seems the dateline info isn't getting to vbadvanced. Any help is greatly appreciated with this, this is my suspect navbar template because it seems to be conditional:

Code:
<!-- breadcrumb, login, pm info -->


<if condition="THIS_SCRIPT == 'index' OR THIS_SCRIPT == 'adv_index'">
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center"> 
<tr>
<!-- Main Welcome Panel Block [] Begin -->
	<td class="alt1" valign="middle" align="center">
	<if condition="$bbuserinfo[userid]!=0">
	<!-- Avatar Cell [] Begin -->
	<if condition="THIS_SCRIPT == 'adv_index'">
	<a href="profile.php?do=editavatar"><img src="http://www.tek-wiz.com/forums/image.php?u=$bbuserinfo[userid]&amp;dateline=$avatar[dateline]" title="$bbuserinfo[username]'s Avatar" alt="Avatar" border="0"</a>
	<else />
	{$welcome_avatar}
	</if>
	<!-- Avatar Cell [] End -->
	</td>

	<td class="alt2" nowrap="nowrap" style="padding:0px">
	<!-- Your Stats [] Begin -->
	<div class="smallfont"><b>Your Info:</b><br />User: <a href="member.php?{$session['sessionurl']}u={$bbuserinfo['userid']}" title="Go To Your Profile">{$bbuserinfo['username']}</a><br />
	<a href="search.php?{$session['sessionurl']}do=getnew">New Posts</a>: {$welcome_new_posts['new_posts']}<br />New Threads: {$welcome_new_topics['new_topics']}<br />
	<if condition="$show[pmstats]"><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl]">$vbphrase[private_messages_nav]</phrase></if></div>
	<!-- Your Stats [] End -->
	<else />
	<!-- Guest [] Begin -->
			<!-- Avatar --> 
		<td class="alt1" valign="middle" align="center"> 
		<a href="register.php?ID=&amp;"><img src="http://www.tek-wiz.com/forums/images/avatars/guestavatar.gif" border="0"></a> 
		</td> 
		<!-- / Avatar --> 

		<td class="alt2" nowrap="nowrap" style="padding:0px"> 
		<!-- login form --> 
		<form action="login.php" method="post" onsubmit="md5hash(vb_login_password,vb_login_md5password)"> 
		<script type="text/javascript" src="clientscript/vbulletin_md5.js"></script> 
		<table cellpadding="0" cellspacing="3" border="0"> 
		<tr> 
		<td class="smallfont">User Name</td> 
		<td><input type="text" class="button" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="1" value="User Name" onfocus="if (this.value == 'User Name') this.value = '';" /></td>

		</tr> 
		<tr> 
		<td class="smallfont">Password</td> 
		<td><input type="password" class="button" name="vb_login_password" size="10" accesskey="p" tabindex="2" /></td> 
		</tr> 
		<tr> 
		<td class="smallfont" colspan="2" nowrap="nowrap"> 
		<label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="3" id="cb_cookieuser_navbar" accesskey="c" checked="checked" />Remember Me?</label> 
		<input type="submit" class="button" value="Log in" tabindex="4" title="Enter your username and password in the boxes provided to login, or click the 'register' button to create a profile for yourself." accesskey="s" /> 
		</td>
		</tr> 
		</table> 
		<input type="hidden" name="ID" value="" /> 
		<input type="hidden" name="s" value="" /> 
		<input type="hidden" name="do" value="login" /> 
		<input type="hidden" name="forceredirect" value="1" /> 
		<input type="hidden" name="vb_login_md5password" /> 
		</form> 
		<!-- / login form --> 
		</td>
	<!-- Guest [] End --></if>
	</td>
	<td class="alt1" valign="top" nowrap="nowrap">
	<!-- Forum Stats [] Begin -->
<td class="alt2" nowrap="nowrap" style="padding:3px">
<div class='smallfont'><b>Forum Stats:</b><br />Threads: $welcome_topics<br />Posts: $welcome_posts<br />Members: $welcome_members<br />
<if condition="THIS_SCRIPT == 'adv_index'">
Welcome to our newest member, 
<a href="member.php?$session[sessionurl]u=$newuserid">$newusername</a>
<else />
<phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase>
</if></div>
	<!-- Forum Stats [] End -->
	</td>
<!-- Main Welcome Panel Block [] End -->
</tr>
</table>
<else />
Like I say the funny thing is that the first conditional seems to work but for me as admin only, any other registered users don't even see a red x empty pic block, it just doesn't even populate the table....I'm stumped..my permissions are ok as far as I can tell.

So guest avatars IE no avatar and not logged in = OK
Admin avatar = ok
Logged in but no avatar selected = OK on forum only
Logged in avatar selected = OK on forum only. :ermm:


FIXED: I had the code that's supposed to be in php includes start in global.php from the welcome panel hack, removing it from global.php let it work all nicey nicey!! THANKS AGAIN!!!
Reply With Quote
  #8  
Old 08-11-2005, 07:19 AM
SilentNoise's Avatar
SilentNoise SilentNoise is offline
 
Join Date: Jan 2003
Location: Edmonton, Alberta, Canada
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dsboyce8624
I wanted to have the avatar in the navbar because it adds a little color.
That's why I just hunted this thing down. Thanks.
Reply With Quote
  #9  
Old 09-21-2005, 05:32 AM
PennylessZ28 PennylessZ28 is offline
 
Join Date: Mar 2002
Location: North America
Posts: 737
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works like a champ in vb 3.0.9
Reply With Quote
  #10  
Old 09-20-2006, 01:10 PM
UnmodNick's Avatar
UnmodNick UnmodNick is offline
 
Join Date: Apr 2003
Location: St Louis, MO.
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know I am way late on this... I am using this on 3.0.8 and it works fine.
My question, is there a way to resize the avatar from it's set size only when specifying $welcome_avatar? This way that avatar can be made smaller and still leave the avatar in the postbit it's regular size.

Yes?
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 10:44 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05589 seconds
  • Memory Usage 2,306KB
  • Queries Executed 24 (?)
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
  • (2)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
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (10)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