Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Kaip ištaisyti tai?

Parašė RAMIAKSS· 2011 Bir. 15 14:06:45
#3

Pabandysiu aciu uz atsakima ;)
Suradau kad ce yra avataras bet kaip ideti Kad jeigu naudotojas neturi avataro kad rodytu paveiksleli koki tai as noriu i syta koda

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&#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 "<center>N&#279;ra super administratori&#371;!</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&#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 "<center>N&#279;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&#371;: <b>".dbresult($result, 0)."</b></center>";
 $result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_level>='102' ORDER BY user_level DESC,user_id");
 while($data = dbarray($result)) {
 echo "<br><img src='".BASEDIR."images/avatars/".$data['user_avatar']."' height='45' width='45' border='2'> <a href='profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a>\n";
 
 }
 $level102 = $locale['user2']; // Administrator
 $level103 = $locale['user3']; // Super Administrator
 
 closeside();

Redagavo RAMIAKSS· 2011 Bir. 15 14:06:31