Announcements

Spam Blaster Implemented
by NetriX - 6 months ago
The New PHP-Fusion USA
by NetriX - 10 months ago

Official Announcements

View Thread

Who is here? 1 guest(s)
 Print Thread
Last seen users panel
Dzonson
Hello, my question is whether to insert the scroll panel is possible, for example, at the beginning shows only 5 people and the rest need to scroll down.

last_seen_users_panel.php
Download source  Code
<?php
/*---------------------------------------------------+
| PHP-Fusion 7 Content Management System
+----------------------------------------------------+
| Copyright ? 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
//if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }
if (!defined("IN_FUSION")) { die("Access Denied"); }

if (file_exists(INFUSIONS."last_seen_users_panel/locale/".$settings['locale'].".php")) {
   include INFUSIONS."last_seen_users_panel/locale/".$settings['locale'].".php";
} else {
   include INFUSIONS."last_seen_users_panel/locale/Polish.php";
}

openside($locale['lsup000']);
$result = dbquery("SELECT * FROM ".DB_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%'>\n";
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 = $locale['lsup001'];
      } 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;
      }
      
if ($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar']))  {
   $img = "<img src='".BASEDIR."images/avatars/".$data['user_avatar']."'  title='".$data['user_name']."' alt='".$data['user_name']."' style='border:0' align='left' width='30px' height='30px' >";
   }
     else { $img = "<img src='".INFUSIONS."last_seen_users_panel/images/noAvatar.png' title='".$data['user_name']."' style='border:0' width='30px' height='30px' >";
   }
      echo "<tr>\n<td class='side-small' align='left'>\n";
      echo "<table><td><a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' >".$img."</a></td>\n";
      echo "<td class='side-small'>".$locale['lsup007']." <a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' >".$data['user_name']."</a><br />".$locale['lsup008']." ".showdate("%d.%m.%y", $data['user_joined'])."<br>\n";
      echo "".$lastseen."</td>\n</table></td></tr>\n";
   }
}
echo "</table>";
closeside();
?>


 
Jump to Forum:

Similar Threads

Thread Forum Replies Last Post
[PANEL] Top 5 Downloads [7.02.XX] Code Snippets 1 05-23-2018 02:09
Users can't sucessfuly join (v7.02.07) General Support 2 01-16-2018 09:14
Donate Panel [7.02.XX] Code Snippets 13 09-11-2017 22:23
users online panel Addon Requests 2 01-02-2017 09:46
[Themes] Blog-e how to add panel [7.02.XX] Themes 5 07-10-2016 02:04