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

Reply
 
Thread Tools
Details »»

Version: , by Admin (Coder) Admin is offline
Developer Last Online: Nov 2024 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 11-20-2001 Last Update: Never Installs: 63
 
No support by the author.

This is what we use on the main page of this forum.
So many people liked it and asked for it, I posted it on at least 5 threads already, but someone wanted a proper release so here it is.

Anyway, in index.php add this:
Code:
if ($bbuserinfo[userid]!=0) {
  $avatarurl=getavatarurl($bbuserinfo[userid]);
  if ($avatarurl=='') {
    $avatarurl='{imagesfolder}/noavatar.gif';
  }
  $avatarimage='<img src="'.$avatarurl.'">';
} else {
  $avatarimage='<a href="register.php?s='.$session[sessionhash].'&action=signup"><img src="{imagesfolder}/guestavatar.gif"></a>';
}
right after this:
Code:
$permissions=getpermissions();
if (!$permissions['canview']) {
	show_nopermission();
}
Now in any of your forumhome_xxx templates, you can use this:
Code:
$avatarimage
to display the user's avatar.

It will display the user's avatar if he has selected one, if he hasn't selected one it will show noavatar.gif (you'll need to upload that to your images folder), and if it's a guest, it will show guestavatar.gif, and link the image to register.php.

Show Your Support

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

Comments
  #12  
Old 11-22-2001, 06:04 AM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome Hack Firefly. What part of the code would I change to make it so the noavatar.gif is linked to userCP?
Reply With Quote
  #13  
Old 11-22-2001, 08:55 AM
Crinos's Avatar
Crinos Crinos is offline
 
Join Date: Oct 2001
Location: Los Angeles, CA
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

w00t! Works great! Excellent hack, cheers!

See it in action
http://www.opentechsupport.net/forums/
Reply With Quote
  #14  
Old 11-22-2001, 11:42 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by JTMON
Awesome Hack Firefly. What part of the code would I change to make it so the noavatar.gif is linked to userCP?
Reply With Quote
  #15  
Old 11-22-2001, 11:11 PM
Matt's Avatar
Matt Matt is offline
 
Join Date: Oct 2001
Location: UK
Posts: 157
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there anyway to encorporate this into a non-vb page?
Reply With Quote
  #16  
Old 11-22-2001, 11:24 PM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For some reason that code didn't work for me firefly. I just get a red x if I don't have an avatar selected, but no noavatar.gif. I have reuploaded the gif file twice too. Otherwise it works great.
Reply With Quote
  #17  
Old 11-23-2001, 12:06 AM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok I got it working now. I had to do this:

Code:
if ($bbuserinfo[userid]!=0) {
  $avatarurl=getavatarurl($bbuserinfo[userid]);
  if ($avatarurl=='') {
    $avatarurl='images/noavatar.gif';
  }
  $avatarimage='<a href="member.php3?s='.$session[sessionhash].'&action=editavatar"><img src="'.$avatarurl.'">';
} else {
  $avatarimage='<a href="register.php?s='.$session[sessionhash].'&action=signup"><img src="images/guestavatar.gif"></a>';
}
I chose to link right into the edit avatar spot instead but I had tack on the code you gave me to the beginning of:

$avatarimage'<img src="'.$avatarurl.'">';
Reply With Quote
  #18  
Old 11-23-2001, 02:17 AM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, the only problem now is I have a box around the avatar?
Reply With Quote
  #19  
Old 11-23-2001, 03:48 AM
Bane's Avatar
Bane Bane is offline
 
Join Date: Oct 2001
Posts: 411
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try changing
Code:
<img src="'.$avatarurl.'">
to
Code:
<img src="'.$avatarurl.'" border="0">
Reply With Quote
  #20  
Old 11-23-2001, 03:51 AM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Bane!! Worked perfectly!
Reply With Quote
  #21  
Old 11-26-2001, 04:18 AM
Jakeman's Avatar
Jakeman Jakeman is offline
 
Join Date: Nov 2001
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey Crinos (Tolitz i presume?), gimme your forumhome template. i want your table layout for the top box with the ava in it... i'm having brain farts here. :stupid:
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 09:31 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.09008 seconds
  • Memory Usage 2,305KB
  • 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
  • (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