The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How did you do that? I'm tossing ideas about with my forumhome template that uses the avatar, but people with no avatar and guests just see something crappy. I was thinking of adding a row into the customavatars table with userid 0 but I'm afraid that would break something. How did you get the default avatar and avatar for guests?
|
#2
|
||||
|
||||
I put this on index.php:
PHP Code:
Code:
<img src="$avatarurl"> |
#3
|
||||
|
||||
Okie .. first off, thanks for posting this!! Great stuff!
But I do have a question ... I've installed it but I allow folks to either a) Select an Avatar from those present -OR- b) Upload their own. Currently the hack is only showing up for those who uploaded their own avatar images. Anyone who selected one of our avatars gets the "noavatar.gif" instead of their selected avatar. (Is there a work around for this?) Also, I thought for guests I would make the "guestavatar.gif" say just "Please Register" .. In the code below .. is there a way to link that particular image to the registration page? (I tried, but it didn't work). PHP Code:
Thanks in advance for any help, I realize that folks have been buggin' the bejesus out of you and wish that I didn't have to. ~Kat |
#4
|
||||
|
||||
Ok, after you installed the above hack, do this.
Instead of this: Code:
if ($checkavatar=$DB_site->query_first("SELECT filename FROM customavatar WHERE userid='$bbuserinfo[userid]'")) $avatarurl='avatar.php?userid='.$bbuserinfo[userid]; else $avatarurl='{imagesfolder}/noavatar.gif'; Code:
$avatarurl=getavatarurl($bbuserinfo[userid]); if ($avatarurl=='') $avatarurl='{imagesfolder}/noavatar.gif'; |
#5
|
||||
|
||||
To make the link you wanted, after you installed the above hack, do this.
Instead of this: Code:
$avatarurl=getavatarurl($bbuserinfo[userid]); if ($avatarurl=='') $avatarurl='{imagesfolder}/noavatar.gif'; Code:
$avatarurl=getavatarurl($bbuserinfo[userid]); if ($avatarurl=='') $avatarurl='{imagesfolder}/noavatar.gif'; $avatarimage='<img src="'.$avatarurl.'">'; Code:
$avatarurl='{imagesfolder}/guestavatar.gif'; Code:
$avatarimage='<a href="register.php?s='.$session[sessionhash].'&action=signup"><img src="{imagesfolder}/guestavatar.gif"></a>'; Code:
$avatarimage Code:
<img src="$avatarurl"> |
#6
|
||||
|
||||
Wow .. fast and speedy and good stuff! Thank you very very much.
One problem though ... I know this is going to sound totally stupid, but I couldn't figure out how to properly integrate the three templates: forumhome, forumhome_unregmessage & forumhome_welcometext So I had to do the following .. which I know isn't what you are supposed to do .. but is how I did it to get it to work ;x (FYI: I tried placing the "avatarurl" image code in both the uregmessage & welcometext but they wouldn't show up .. I would get the broken link box for some reason) forumhome: Code:
<!-- top welcome box --> <table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="{contenttablewidth}" align="center"><tr><td> <table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%"> <tr> $welcometext $unregwelcomemessage <tr> <td bgcolor="{firstaltcolor}" colspan="5"><smallfont><img src="$avatarurl" align="left"> The time now is $timenow. You last visited: $bbuserinfo[lastvisitdate].<br> There have been <b>$getnewthread[threads]</b> threads and <b>$getnewpost[posts]</b> posts since your last visit!<br> $newposts</smallfont></td></tr></table> <!-- /top welcome box --> Code:
<td bgcolor="{categorybackcolor}" colspan="5"><normalfont color="{categoryfontcolor}"><b>Welcome to the $bbtitle!</b></normalfont><br> <smallfont color="{categoryfontcolor}"> If this is your first visit, be sure to check out the <a href="misc.php?s=$session[sessionhash]&action=faq"><b>FAQ</b></a>. You may have to <a href="register.php?s=$session[sessionhash]"><b>register</b></a> before you can post.</smallfont></td></tr> Code:
<td bgcolor="{categorybackcolor}" colspan="5"><normalfont color="{categoryfontcolor}"><b>Welcome back $username!</b></normalfont></td> </tr> (NOTE: It's only the images from avatars which were uploaded which don't show up .. the noavatar.gif and guestavatar.gif seemed to work fine). Any ideas? Thanks again for your quick and great work .. if there's no work around for the above problem at least I got the selected avatars to work and that's the most important issue of all! ~Kat |
#7
|
||||
|
||||
Help me help you.
In index.php, where did you place the code for the avatar and everything? |
#8
|
||||
|
||||
Doh! I should have thought to list that last night .. okie I put your code and the code for the # of posts here:
Code:
// if user is know, then welcome $getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'"); $getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'"); if ($bbuserinfo['userid']!=0) { $username=$bbuserinfo['username']; eval("\$welcometext = \"".gettemplate('forumhome_welcometext')."\";"); eval("\$logincode = \"".gettemplate('forumhome_logoutcode')."\";"); eval("\$newposts = \"".gettemplate('forumhome_newposts')."\";"); } else { $welcometext = ""; eval("\$newposts = \"".gettemplate('forumhome_todayposts')."\";"); eval("\$logincode = \"".gettemplate('forumhome_logincode')."\";"); } if ($bbuserinfo['userid']!=0) { $avatarurl=getavatarurl($bbuserinfo[userid]); if ($avatarurl=='') $avatarurl='{imagesfolder}/noavatar.gif'; } else { $avatarurl='{imagesfolder}/guestavatar.gif'; } Code:
$birthdaybits=""; Thanks again. Donna |
#9
|
||||
|
||||
Ok, let me show you something.
This is what you posted: Code:
// if user is know, then welcome $getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'"); $getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'"); if ($bbuserinfo['userid']!=0) { $username=$bbuserinfo['username']; eval("\$welcometext = \"".gettemplate('forumhome_welcometext')."\";"); eval("\$logincode = \"".gettemplate('forumhome_logoutcode')."\";"); eval("\$newposts = \"".gettemplate('forumhome_newposts')."\";"); } else { $welcometext = ""; eval("\$newposts = \"".gettemplate('forumhome_todayposts')."\";"); eval("\$logincode = \"".gettemplate('forumhome_logincode')."\";"); } if ($bbuserinfo['userid']!=0) { $avatarurl=getavatarurl($bbuserinfo[userid]); if ($avatarurl=='') $avatarurl='vbimages/noavatar.gif'; } else { $avatarurl='vbimages/guestavatar.gif'; } That's why it won't show up in that template, because that template is being "called" before you do the avatar thing. Anyway, I combined some stuff for you. Use this, instead of that block you posted: Code:
// if user is know, then welcome $getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'"); $getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'"); if ($bbuserinfo['userid']!=0) { $avatarurl=getavatarurl($bbuserinfo[userid]); if ($avatarurl=='') $avatarurl='vbimages/noavatar.gif'; $username=$bbuserinfo['username']; eval("\$welcometext = \"".gettemplate('forumhome_welcometext')."\";"); eval("\$logincode = \"".gettemplate('forumhome_logoutcode')."\";"); eval("\$newposts = \"".gettemplate('forumhome_newposts')."\";"); } else { $avatarurl='vbimages/guestavatar.gif'; $welcometext = ""; eval("\$newposts = \"".gettemplate('forumhome_todayposts')."\";"); eval("\$logincode = \"".gettemplate('forumhome_logincode')."\";"); } |
#10
|
||||
|
||||
FireFly,
Thank you ever so much for your time! This ended up working out perfectly for me! AND .. I appreciate the little PhP lesson as well since I didn't even realize that it was calling one thing before the other (this will come in handy in the future as I learn PhP). Thanks again .. it looks awesome and everyone seems to like it very much! You are wonderful! Donna |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|