All pastes #46208 Raw Edit

Daner Warren

public php v1 · immutable
#46208 ·published 2006-03-19 09:31 UTC
rendered paste body
if (dbrows($result) != 0) {	while ($data = dbarray($result)) {		$lastseen = time() - $data['user_lastvisit'];		$iW=sprintf("%2d",floor($lastseen/604800));		$iD=sprintf("%2d",floor($lastseen/(60*60*24)));		$iH=sprintf("%02d",floor((($lastseen%604800)%86400)/3600));		$iM=sprintf("%02d",floor(((($lastseen%604800)%86400)%3600)/60));		$iS=sprintf("%02d",floor((((($lastseen%604800)%86400)%3600)%60)));		if ($lastseen < 60){			$lastseen= "<nobr><img src='images/online.gif' alt='Online'></NOBR>";		} elseif ($lastseen < 360){			$lastseen= $locale['lsup002']; 		} elseif ($iW > 0){			if ($iW == 1) { $text = $locale['lsup003']; } else { $text = $locale['lsup004']; }			$lastseen = $iW." ".$text;		} elseif ($iD > 0){			if ($iD == 1) { $text = $locale['lsup005']; } else { $text = $locale['lsup006']; }			$lastseen = $iD." ".$text;		} else {			$lastseen = $iH.":".$iM.":".$iS;		}		echo "<tr>\n<td class='side-small' align='left'><img src='".THEME."images/bullet.gif' alt=''>\n";		echo "<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' title='".$data['user_name']."' class='side'>\n";		echo trimlink($data['user_name'], 15)."</a></td><td class='side-small' align='right'>".$lastseen."</td>\n</tr>\n";	}}echo "</table>";closeside();