Welcome Guest, Not a member yet? Register   Sign In
Switch not going to last case
#5

(07-07-2017, 10:19 AM)Paradinight Wrote:
PHP Code:
$diff  time() - $questions_userinfo['online'];

if(
$diff >= 600) {
    
$class 'text-danger';
    
$text '[OFFLINE]';
} else if(
$diff >= 300) {
    
$class 'text-warning';
    
$text '[AWAY]';
} else if(
$diff >= 0) {
    
$class 'text-success';
    
$text '[ONLINE]';


$data['online'] = '<span class="'.$class.'">'.$text.'</span>'

Thank you. And thanks to all others who helped. This worked fine.
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
Switch not going to last case - by wolfgang1983 - 07-07-2017, 05:49 AM
RE: Switch not going to last case - by rtenny - 07-07-2017, 05:53 AM
RE: Switch not going to last case - by skunkbad - 07-07-2017, 08:04 AM
RE: Switch not going to last case - by wolfgang1983 - 07-07-2017, 08:58 PM



Theme © iAndrew 2016 - Forum software by © MyBB