PDA

View Full Version : Help - Avatar not displayed for a usergroup


wwwabbit
08-02-2003, 01:00 AM
First off, I am VERY new to PHP, it makes sense to me some what, and I have written some small stuff on the side but we are talking simple fill in the form, wow it saves it in a mySQL database stuff. So seeing the code for VB is a little more complicated then I know what to do with.

That being said, can anyone help me out? I have VB 2.3.0 and I want to make it so the users that are "Registered" which have a usergroupid of 2, avatars don't show up in the posts. My thought line is where it goes to check for an avatar in the showthreads.php file, putting in something like a:

if $usergroupid == "2" {
// do nothing
}
else
{
// do the normal check/load avatar stuff
}

How far off am I for something like this, and where would I put this, I can't seem to make sense of where it is doing the loading/checking for the avatar....

Thanks!
~Brian

wwwabbit
08-03-2003, 02:06 PM
Anyone?

wwwabbit
08-06-2003, 04:51 AM
pppplease help and poor php coder guy..... ppppplease?

wwwabbit
08-08-2003, 02:48 PM
bump

g-force2k2
08-08-2003, 03:34 PM
open admin/functions.php

find:

if ($post[avatarid]!=0) {
$avatarurl=$post[avatarpath];
} else {
if ($post[hascustomavatar] and $avatarenabled) {
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
} else {
$avatarurl="";
}
}
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="";
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}

replace with:

if( $post[usergroupid] == 2 )
{
$post[avatar] = "";
}
else
{
if ($post[avatarid]!=0) {
$avatarurl=$post[avatarpath];
} else {
if ($post[hascustomavatar] and $avatarenabled) {
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
} else {
$avatarurl="";
}
}
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="";
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}
}

that should do the trick regards,
g-force2k2