Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: online_user

Parašė weberiz· 2009 Bir. 13 20:06:05
#10

$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_lastvisit>'0' AND user_status='0' ORDER BY user_lastvisit DESC LIMIT 0,5");
echo "<table cellpadding='0' cellspacing='0' width='100%'>";
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
$lastseen = time() - $data['user_lastvisit'];
$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= <font color=\"green\">ONLINE</font>;
} elseif ($lastseen < 9999999){
$lastseen= <font color=\"red\">OFFLINE</font>;
} else {
$lastseen = $iH.":".$iM.":".$iS;
}
echo "<tr>\n<td class='side-small' align='left'>°\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>";

nu gal šitas veiks