Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: kasko buginasi paneles

Parašė Karolis· 2011 Kov. 13 13:03:30
#2


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 "<b>Super administracija</b><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&#281;s]</font>';
 
      } elseif ($lastseen < 360){
 
         $lastseen= '<font color="c4248d">[Atsijung&#281;s]</font>';
 
      } elseif ($iW > 0){
 
         if ($iW == 1) { $text = "savaite"; } else { $text = "savaites"; }
 
         $lastseen = '<font color="c4248d">[Atsijung&#281;s]</font>';
 
      } elseif ($iD > 0){
 
         if ($iD == 1) { $text = "diena"; } else { $text = "dienos"; }
 
         $lastseen = '<font color="c4248d">[Atsijung&#281;s]</font>';
 
      } else {
 
         $lastseen = '<font color="c4248d">[Atsijung&#281;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 "N&#279;ra super administratori&#371;!";
 
}
 
 
 
$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><b>Administracija</b><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&#281;s]</font>';
 
      } elseif ($lastseen < 360){
 
         $lastseen= '<font color="c4248d">[Atsijung&#281;s]</font>';
 
      } elseif ($iW > 0){
 
         if ($iW == 1) { $text = "savaite"; } else { $text = "savaites"; }
 
         $lastseen = '<font color="c4248d">[Atsijung&#281;s]</font>';
 
      } elseif ($iD > 0){
 
         if ($iD == 1) { $text = "diena"; } else { $text = "dienos"; }
 
         $lastseen = '<font color="c4248d">[Atsijung&#281;s]</font>';
 
      } else {
 
         $lastseen = '<font color="c4248d">[Atsijung&#281;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 "N&#279;ra administratoriu!";
 
}


Nesu tikras. :)