Parašė donataz· 2010 Bir. 9 19:06:19
Justdoit parašė:
openside("Administracija");
$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_lastvisit>='0' AND user_level='103' ORDER BY user_id DESC LIMIT 0,6");
echo "<table width='100%' cellpadding='0' cellspacing='0'>";
echo "<center><b>Super administracija</b></center><br>";
if (dbrows($result) != 0) {
$n = 1;
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= '<font color="#a7fe00">[Prisijungęs]</font>';
} elseif ($lastseen < 360){
$lastseen= '<font color="c4248d">[Atsijungęs]</font>';
} elseif ($iW > 0){
if ($iW == 1) { $text = "savaite"; } else { $text = "savaites"; }
$lastseen = '<font color="c4248d">[Atsijungęs]</font>';
} elseif ($iD > 0){
if ($iD == 1) { $text = "diena"; } else { $text = "dienos"; }
$lastseen = '<font color="c4248d">[Atsijungęs]</font>';
} else {
$lastseen = '<font color="c4248d">[Atsijungęs]</font>';
}
echo "<tr>\n<td class='small' align='left'>\n";
echo "<img src='".THEME."images/bullet.gif'> <a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' title='".$data['user_name']."' class='side'>";
echo $data['user_name']."</a></td><td class='small' align='right'>".$lastseen."</td>\n</tr>\n";
$n++;
}
} else {
echo "<center>Nėra super administratorių!</center>\n";
}
$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_lastvisit>='0' AND user_level='102' ORDER BY user_id DESC LIMIT 0,6");
echo "<table width='100%' cellpadding='0' cellspacing='0'>";
echo "<br><center><b>Administracija</b></center><br>";
if (dbrows($result) != 0) {
$n = 1;
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= '<font color="#a7fe00">[Prisijungęs]</font>';
} elseif ($lastseen < 360){
$lastseen= '<font color="c4248d">[Atsijungęs]</font>';
} elseif ($iW > 0){
if ($iW == 1) { $text = "savaite"; } else { $text = "savaites"; }
$lastseen = '<font color="c4248d">[Atsijungęs]</font>';
} elseif ($iD > 0){
if ($iD == 1) { $text = "diena"; } else { $text = "dienos"; }
$lastseen = '<font color="c4248d">[Atsijungęs]</font>';
} else {
$lastseen = '<font color="c4248d">[Atsijungęs]</font>';
}
echo "<tr>\n<td class='small' align='left'>\n";
echo "<img src='".THEME."images/bullet.gif'> <a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' title='".$data['user_name']."' class='side'>";
echo $data['user_name']."</a></td><td class='small' align='right'>".$lastseen."</td>\n</tr>\n";
$n++;
}
} else {
echo "<center>Nėra administratoriu!</center>\n";
}
echo "</table>";
$result = dbquery("SELECT count(user_id) FROM ".$db_prefix."users WHERE user_level !='101'");
echo "<br><center>Viso administratorių: <b>".dbresult($result, 0)."</b></center>";
closeside();
Atsidekodamas +10 ir komenta ;);)
kita kart kai desi koda,isjunk smailus.