View Full Version : Can someone check this?


PianoGenius
07-30-2005, 11:08 PM
Hi,

Can someone check this code to see what's wrong with it? I think it has something to do with the quotes, but I could be wrong. It's not working, regardless.

{
$style_color = '';
if ( $row['user_level'] == ADMIN )
{
$username = '<b style="color:#33CCCC">' . $username . '</b>';
}
else if ( $row['user_level'] == MOD )
{
$username = '<b style="color:#660033">' . $username . '</b>';
}

'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#33CCCC">', '</span>'),
'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#660033 ">', '</span>'),

{
$username = $row['username'];

$style_color = '';
if ( $row['user_level'] == ADMIN )
{
$username = <b style="color:#33CCCC">' . $username . </b>;
}
else if ( $row['user_level'] == MOD )
{
$username = <b style="color:#660033">' . $username . </b>;
}

If you need more context, or more on what it's supposed to do, please go here: http://www.phpbb.com/phpBB/viewtopic.php?p=1690007#1690007

Thanks,
Brendan

Sphere
07-30-2005, 11:18 PM
at least the third piece of code must be:


{
$username = $row['username'];

$style_color = '';
if ( $row['user_level'] == "ADMIN" )
{
$username = "<b style=\"color:#33CCCC\">".$username."</b>";
}
elseif ( $row['user_level'] == "MOD" )
{
$username = "<b style=\"color:#660033\">".$username."</b>";
}


Strings must be double quoted, double quotes within strings must use a escape sign in front of it (for a " it would be \")

PulsarSL
07-31-2005, 06:35 AM
Hi,

Can someone check this code to see what's wrong with it? I think it has something to do with the quotes, but I could be wrong. It's not working, regardless.

{
$style_color = '';
if ( $row['user_level'] == ADMIN )
{
$username = '<b style="color:#33CCCC">' . $username . '</b>';
}
else if ( $row['user_level'] == MOD )
{
$username = '<b style="color:#660033">' . $username . '</b>';
}

'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#33CCCC">', '</span>'),
'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#660033 ">', '</span>'),

{
$username = $row['username'];

$style_color = '';
if ( $row['user_level'] == ADMIN )
{
$username = <b style="color:#33CCCC">' . $username . </b>;
}
else if ( $row['user_level'] == MOD )
{
$username = <b style="color:#660033">' . $username . </b>;
}

If you need more context, or more on what it's supposed to do, please go here: http://www.phpbb.com/phpBB/viewtopic.php?p=1690007#1690007

Thanks,
Brendan

Is there an error you get? Or does it simply not change the colors.

BTW, I like the colors :) Makes me feel powerful :lolol: