DiscussAnything
11-03-2003, 03:39 PM
This is part of the index.php of vbhome lite:
$allpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] $ignoreusers");
$newpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers");
$unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers");
$pluralpm = iif ( $newpm['messages']!=1 , 's' , '' );
if ( !$newpm['messages'] )
{
$newpm['messages'] = 'No';
}
eval( '$pminfo = "' . gettemplate( 'home_pmloggedin' ) . '";' );
}
What I want to do is make the number of new PMs yellow, to make them stand out more. Currently if there are no PMs, it displays 'No', as the code indicates. The number of new PMs seems to just be the results of a query though, unformatted. What do I have to add to make it yellow only if the result is not 0 ?
Thanks
$allpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] $ignoreusers");
$newpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers");
$unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers");
$pluralpm = iif ( $newpm['messages']!=1 , 's' , '' );
if ( !$newpm['messages'] )
{
$newpm['messages'] = 'No';
}
eval( '$pminfo = "' . gettemplate( 'home_pmloggedin' ) . '";' );
}
What I want to do is make the number of new PMs yellow, to make them stand out more. Currently if there are no PMs, it displays 'No', as the code indicates. The number of new PMs seems to just be the results of a query though, unformatted. What do I have to add to make it yellow only if the result is not 0 ?
Thanks