vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Avatar on homepage (https://vborg.vbsupport.ru/showthread.php?t=32560)

JTMON 12-04-2001 08:21 PM

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

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



Airwaves 12-04-2001 08:27 PM

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

JTMON 12-04-2001 08:35 PM

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.

Airwaves 12-05-2001 05:05 AM

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.

trilOByte 12-05-2001 05:25 AM

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

JTMON 12-05-2001 11:04 AM

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

VolsReport 12-06-2001 01:08 AM

Does it work for v2.03?

Airwaves 12-06-2001 08:53 AM

Quote:

Originally posted by JTMON


It does for me :rolleyes:

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

take a look at http://www.airwavescomms.co.uk/forums

Lesane 12-06-2001 09:20 AM

Quote:

Originally posted by VolsReport
Does it work for v2.03?
Yes

Dark Blaze 12-06-2001 10:41 AM

Great Hack Chen, well done :)

JTMON 12-06-2001 10:43 AM

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

take a look at http://www.airwavescomms.co.uk/forums

Looking Good

VolsReport 12-06-2001 06:05 PM

Quote:

Originally posted by Lesane


Yes

Thanx...Ima add it now...

TechTalk 12-15-2001 10:03 PM

What if the user has uploaded their own avatar (goes into the customavatar table in DB) How can we make that show up?

Admin 12-16-2001 11:30 AM

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

TechTalk 12-16-2001 01:48 PM

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.

zajako 04-01-2002 04:45 AM

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.

Admin 04-01-2002 05:03 AM

Just stick $bbuserinfo[field7] for example in the template.

zajako 04-01-2002 04:15 PM

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

Admin 04-01-2002 04:21 PM

Huh? Why do try to get an avatar for the field7 as a userid? If you just want to display field7, stick $bbuserinfo[field7].

zajako 04-01-2002 05:44 PM

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.

Platinum [JSI] 05-17-2002 09:50 PM

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?

Admin 05-18-2002 06:20 AM

Where did you add $avatarimage?

ceo_tfw 05-27-2002 07:33 AM

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

mrdave 06-26-2002 05:27 PM

Please help, the problem is in the new avatar.php

pharcyde 07-07-2002 12:35 AM

firefly, is there a script that will make it work with 2.2.6???

Admin 07-07-2002 02:11 PM

What error are you getting when trying to use it with 2.2.6?

pharcyde 07-07-2002 09:07 PM

the avatar wont show up at all... www.turbine7.com in the "aeternalis" skin and the others that use the welcome panel hack

iblis 07-21-2002 11:18 AM

Im using vbhome, anyone know how to add this to my index site?

Kuipo 11-03-2002 12:34 PM

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?

Esdee 11-24-2002 11:37 AM

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>';
}


212rikanmofo 04-19-2003 09:51 AM

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?


All times are GMT. The time now is 01:02 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.01343 seconds
  • Memory Usage 1,790KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (31)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete