Re: Code



FXDWG wrote:
> Lets first start out with the small bits. What exactly kind of
> improvements would you like to make? Once we know what direction you
> want to go, we can help you get there. Hopefully.
>
> Scotty
Well, mostly we're trying to fix bugs that we stumble across.
So with that in mind, let me present one.
We are running a portal on our site.
On that portal we're supposed to be able to see an avatar.
A number of other people have commented in support forums that the error lies with in a certain file.
We have looked at this file and even attempted to institute the suggested fixes. But none of them work.
Now I AM confident the error is in the file suggested. But I am dubious of the suggested fixes.
Anyone want to look at the code and suggest a solution?
Here is the section of code that we believe to be in error.
if ($row['user_avatar'] && $user->optionget('viewavatars'))
{
$avatar_img = '';
switch ($row['user_avatar_type'])
{
case AVATAR_UPLOAD:
$avatar_img = $config['avatar_path'] . '/';
break;

case AVATAR_GALLERY:
$avatar_img = $config['avatar_gallery_path'] . '/';
break;
}
$avatar_img .= $row['user_avatar'];
$avatar_img = '<img src="' . $avatar_img . '" width="' . $row['user_avatar_width'] . '" height="' . $row['user_avatar_height'] . '" alt="' . $username . '" title="' . $username . '" />';
$user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] .'"' : ''; }
Here is the suggested fix for this problem. It doesn't work, we tried it.
if ($row['user_avatar'] && $user->optionget('viewavatars'))
{
$avatar_img = '';
/*
switch ($row['user_avatar_type'])
{
case AVATAR_UPLOAD:
$avatar_img = $config['avatar_path'] . '/';
break;

case AVATAR_GALLERY:
$avatar_img = $config['avatar_gallery_path'] . '/';
break;
}
*/
$avatar_img .= $row['user_avatar'];
$avatar_img = '<img src="./download.php?avatar=' . $avatar_img . '" width="' . $row['user_avatar_width'] . '" height="' . $row['user_avatar_height'] . '" alt="' . $username . '" title="' . $username . '" />';
$user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] .'"' : ''; }

Jamie,

This is PHPBB, right?

I would suggest you ask this on the PHPBB user forums. Had you done so, you would have had an answer by now.

The people there are familiar with the code, and should be able to tell you almost immediately why it isn't working.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================

.