Version: , by Admin (Coder)
Developer Last Online: Nov 2024
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.
I'm afraid giving you just the forumhome template is not gonna be useful
Took me about 3-4 hours of trial and error just trying to put it together ... what I did was set up a "mock-up" page with the layout as I want it to be ... then I just insert the relevant code and then chop it up by the <tr>'s and insert each one in the templates I mentioned
Hey man, I think I just posted what you are looking for. I installed it all together, then wrote a walkthrough of most of it for a friend, thought someone might find it usefull, so uploaded the zip here...
Originally posted by JTMON 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.
have you checked the path to the image matches with what you have in index.php
ie mine is images/noavatar.gif
Really nice hack Firefly. I would install it but the default avatar size for our message board is 105x150 making the avatar take up too much board real estate. Awesome job though Firefly!
Well it's been images for me this whole time. I never saw vbimages. I changed the coding so if they don't have an avatar it gives them the no avatar but it's also linked to the edit avatar page
// init db **********************
// load db class
$dbservertype = strtolower($dbservertype);
$dbclassname="$boardpath/admin/db_$dbservertype.php";
require($dbclassname);
$dbpassword="";
$DB_site->password="";
// end init db
// load options
$optionstemp=$DB_site->query_first("SELECT template FROM template WHERE title='options'");
eval($optionstemp[template]);
// ################ END INIT #################
if ($bbuserid!="") {
$user=getuserinfo($bbuserid);
$username=$user[username];
$lastday=vbdate($dateformat,$user[lastvisit]+3600);
$lasttime=vbdate($timeformat,$user[lastvisit]+3600);
$templatesetid=$DB_site->query_first("SELECT templatesetid AS templatesetid FROM style WHERE styleid=$user[styleid]");
$templatesetid=$templatesetid[templatesetid];