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
  #42  
Old 12-04-2001, 08:21 PM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well here is my altered code that works for me. Note, I didn't care about the guest code as I don't allow guests to view my board

PHP Code:
//Avatar on Homepage Code
if ($bbuserinfo[userid]!=0) {
  
$avatarurl=getavatarurl($bbuserinfo[userid]);
  if (
$avatarurl=='') {
    
$avatarurl='images/noavatar.gif';
  }
  
$avatarimage='<a href="member.php?s='.$session[sessionhash].'&action=editavatar"><img src="'.$avatarurl.'" border="0"></a>';
} else {
  
$avatarimage='<a href="register.php?s='.$session[sessionhash].'&action=signup"><img src="images/guestavatar.gif"></a>';

Reply With Quote
  #43  
Old 12-04-2001, 08:27 PM
Airwaves's Avatar
Airwaves Airwaves is offline
 
Join Date: Nov 2001
Location: Chesterfield, Derbyshire, UK
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well php3 are of no use to me, i have .php

also, i allow guests to view, so thats no use to me either

sorry
Reply With Quote
  #44  
Old 12-04-2001, 08:35 PM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Airwaves
well php3 are of no use to me, i have .php

also, i allow guests to view, so thats no use to me either

sorry

You can use it with no problems. There is no difference other than the extension in the link in the code. I've edited them out now so you should just be able to cut and paste it in and it will work.
Reply With Quote
  #45  
Old 12-05-2001, 05:05 AM
Airwaves's Avatar
Airwaves Airwaves is offline
 
Join Date: Nov 2001
Location: Chesterfield, Derbyshire, UK
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your code doesnt hyperlink to the UserCP when they have no avatar specified.

I will use your code for now, but I really would like that feature.
Reply With Quote
  #46  
Old 12-05-2001, 05:25 AM
trilOByte's Avatar
trilOByte trilOByte is offline
 
Join Date: Nov 2001
Location: England
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Airwaves
Having a bit of trouble with this...


$avatarimage='<a href="register.php?s='.$session[sessionhash].'&action=signup"><img border="0" src="images/avatars/guestavatar.gif"></a>';
Try making the paths absolute for guestavatar.gif and noavatar.gif - ie,

PHP Code:
src="http://www.yoursite.com/forums/images/avatars/guestavatar.gif"></a>'; 
etc....
Reply With Quote
  #47  
Old 12-05-2001, 11:04 AM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Airwaves
Your code doesnt hyperlink to the UserCP when they have no avatar specified.

I will use your code for now, but I really would like that feature.
It does for me
Reply With Quote
  #48  
Old 12-06-2001, 01:08 AM
VolsReport VolsReport is offline
 
Join Date: Dec 2001
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does it work for v2.03?
Reply With Quote
  #49  
Old 12-06-2001, 08:53 AM
Airwaves's Avatar
Airwaves Airwaves is offline
 
Join Date: Nov 2001
Location: Chesterfield, Derbyshire, UK
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by JTMON


It does for me
Yeah sorry, not being a PHP/HTML guru, I didnt realise until I made a test account.

Anyway, thanks for your help, I now have it sorted.

take a look at http://www.airwavescomms.co.uk/forums
Reply With Quote
  #50  
Old 12-06-2001, 09:20 AM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by VolsReport
Does it work for v2.03?
Yes
Reply With Quote
  #51  
Old 12-06-2001, 10:41 AM
Dark Blaze's Avatar
Dark Blaze Dark Blaze is offline
 
Join Date: Nov 2001
Location: World Wide Web
Posts: 149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great Hack Chen, well done
Reply With Quote
  #52  
Old 12-06-2001, 10:43 AM
JTMON's Avatar
JTMON JTMON is offline
 
Join Date: Oct 2001
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Airwaves


Yeah sorry, not being a PHP/HTML guru, I didnt realise until I made a test account.

Anyway, thanks for your help, I now have it sorted.

take a look at http://www.airwavescomms.co.uk/forums
Looking Good
Reply With Quote
  #53  
Old 12-06-2001, 06:05 PM
VolsReport VolsReport is offline
 
Join Date: Dec 2001
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Lesane


Yes
Thanx...Ima add it now...
Reply With Quote
  #54  
Old 12-15-2001, 10:03 PM
TechTalk TechTalk is offline
 
Join Date: Dec 2001
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What if the user has uploaded their own avatar (goes into the customavatar table in DB) How can we make that show up?
Reply With Quote
  #55  
Old 12-16-2001, 11:30 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 TechTalk
What if the user has uploaded their own avatar (goes into the customavatar table in DB) How can we make that show up?
Reply With Quote
  #56  
Old 12-16-2001, 01:48 PM
TechTalk TechTalk is offline
 
Join Date: Dec 2001
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It sure does I was having errors that were causing me problems.

A note to evryone else.... if you use this hack in global.php like I did your users will have problem uploading their avatar (real nasty error). I posted on it here:
http://www.vbulletin.com/forum/showt...threadid=35489

The only solution I could find was to change the variable names from "$avatarurl" and "$avatarimage" to "$theavatarimage" and "$theavatarurl"

Im not sure if the original variables were already in use by Vb or what, but it was causing me loads of problems.
Reply With Quote
  #57  
Old 04-01-2002, 04:45 AM
zajako's Avatar
zajako zajako is offline
 
Join Date: Jan 2002
Location: a place not to far away
Posts: 633
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

umm is there anything simialr to make it so the profile fields can be used on teh index page. an ex is I want a custom field to be displayed under the avatar.
Reply With Quote
  #58  
Old 04-01-2002, 05:03 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just stick $bbuserinfo[field7] for example in the template.
Reply With Quote
  #59  
Old 04-01-2002, 04:15 PM
zajako's Avatar
zajako zajako is offline
 
Join Date: Jan 2002
Location: a place not to far away
Posts: 633
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, i tried that... but there is a problem.

if ($bbuserinfo[userid]!=0) {
$hpmax=getavatarurl($bbuserinfo[field7]);
if ($hpmax=='') {
$hpmax='0';
}

}

THe function for getavatarurl I know.
but what would be the get function used for field 7 and so on.
Right now it just ignores my variable for $hpmax
Reply With Quote
  #60  
Old 04-01-2002, 04:21 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Huh? Why do try to get an avatar for the field7 as a userid? If you just want to display field7, stick $bbuserinfo[field7].
Reply With Quote
  #61  
Old 04-01-2002, 05:44 PM
zajako's Avatar
zajako zajako is offline
 
Join Date: Jan 2002
Location: a place not to far away
Posts: 633
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by FireFly
Just stick $bbuserinfo[field7] for example in the template.
you said stick into the template I though you meant the avatar templet you made.....

awesome it worked thanks so much.
Reply With Quote
  #62  
Old 05-17-2002, 09:50 PM
Platinum [JSI] Platinum [JSI] is offline
 
Join Date: Nov 2001
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the $avatarimage bit isnt working for me, ive added the code to the index.php and added $avatarimage where i want it but i get no image, am i missing some code somewhere?
Reply With Quote
  #63  
Old 05-18-2002, 06:20 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where did you add $avatarimage?
Reply With Quote
  #64  
Old 05-27-2002, 07:33 AM
ceo_tfw's Avatar
ceo_tfw ceo_tfw is offline
 
Join Date: Mar 2002
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works great on mine and thanks, I have a question?

I would like to have more user info on the main page (index page) like how many posts they have made, there awards, threads they have replied to and their posts made in that day,

can anyone help me
Reply With Quote
  #65  
Old 06-26-2002, 05:27 PM
mrdave mrdave is offline
 
Join Date: May 2002
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please help, the problem is in the new avatar.php
Reply With Quote
  #66  
Old 07-07-2002, 12:35 AM
pharcyde pharcyde is offline
 
Join Date: Jun 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

firefly, is there a script that will make it work with 2.2.6???
Reply With Quote
  #67  
Old 07-07-2002, 02:11 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What error are you getting when trying to use it with 2.2.6?
Reply With Quote
  #68  
Old 07-07-2002, 09:07 PM
pharcyde pharcyde is offline
 
Join Date: Jun 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the avatar wont show up at all... www.turbine7.com in the "aeternalis" skin and the others that use the welcome panel hack
Reply With Quote
  #69  
Old 07-21-2002, 11:18 AM
iblis iblis is offline
 
Join Date: Oct 2001
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Im using vbhome, anyone know how to add this to my index site?
Reply With Quote
  #70  
Old 11-03-2002, 12:34 PM
Kuipo's Avatar
Kuipo Kuipo is offline
 
Join Date: Oct 2002
Location: WA
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Im useing an off site avatar hack too, so the url is stored in a field (field7)

i trid to change this:

Quote:
if ($bbuserinfo[userid]!=0) {
$avatarurl=getavatarurl($bbuserinfo[userid]);
if ($avatarurl=='') {
$avatarurl='images/avatars/noavatar.gif';
}
to this:

Quote:
if ($bbuserinfo[userid]!=0) {
$avatarurl=$bbuserinfo[field7];
if ($avatarurl=='') {
$avatarurl='images/avatars/noavatar.gif';
}
But it doesnt seem to be working, is there somthing im doing wrong?
Reply With Quote
  #71  
Old 11-24-2002, 11:37 AM
Esdee's Avatar
Esdee Esdee is offline
 
Join Date: Oct 2002
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hiya
I love your hack, but I have a huge problem with it.

I'm using Vb2.2.8 and the noavatar isn't showing. I just get a red X. The guestavatar works perfectly. I checked the path multiple times and it is correct.

Here's my code

Please help me, someone

Code:
if ($bbuserinfo[userid]!=0) {
  $avatarurl=getavatarurl($bbuserinfo[userid]);
  if ($avatarurl=='') {
  $avatarimage='<a href="usercp.php?s='.$session[sessionhash].'"><img src="images/avatars/noavatar.jpg" border="0"></a>';
  }
  $avatarimage='<img src="'.$avatarurl.'">';
} else {
  $avatarimage='<a href="register.php?s='.$session[sessionhash].'&action=signup"><img src="images/avatars/guestavatar.jpg" border="0"></a>';
}
Reply With Quote
  #72  
Old 04-19-2003, 09:51 AM
212rikanmofo 212rikanmofo is offline
 
Join Date: Nov 2001
Location: paris
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

firefly how would i incorporate this into my postbit template... i want it to show a noavatar.gif when a user doesnt have one selected for my postbit template, how would i do that?
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 04:44 PM.


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.07261 seconds
  • Memory Usage 2,537KB
  • Queries Executed 46 (?)
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
  • (4)bbcode_code
  • (2)bbcode_php
  • (10)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
  • (32)post_thanks_box
  • (32)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (32)post_thanks_postbit_info
  • (31)postbit
  • (32)postbit_onlinestatus
  • (32)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