Announcements

The New PHP-Fusion USA
by NetriX - 4 weeks ago
Free Hosting
by NetriX - 2 months ago

Latest Posts

MySql?
by daimonbok - 15 hours ago
Video Infusion 3.2.0
by NetriX - 21 hours ago
Version 9 with php 7
by daimonbok - 7 days ago
Facebook Connect 3.0.0
by daimonbok - 1 week ago
URL shortening in PHP
by jim09 - 1 week ago
PHP-Fusion 9 Extensive Demo
by NetriX - 1 week ago
[FORUM RANKS] Flat
by Homdax - 4 weeks ago
The New PHP-Fusion USA
by NetriX - 4 weeks ago
[GUIDE] Optimize PHP-Fusion Website
by NetriX - 4 weeks ago
[FORUM RANKS] ForumCore
by NetriX - 4 weeks ago

View Thread

Who is here? 1 guest(s)
 Print Thread
User Last Visit Panel
Dzonson
The panel who recently visited the site and who is on the side.

Create a new document paste and save in php

lastvisit.php
Download source  Code
<?php
if (!defined("IN_FUSION")) { die("Access Denied"); }


echo "<table cellpadding='0' cellspacing='0' style='padding-top: 11px;' width='990px' align='center'><tr>";
$result = dbquery("SELECT user_id, user_name, user_status, user_lastvisit, user_level, user_avatar FROM ".DB_USERS." WHERE user_lastvisit>'0' AND user_status='0' ORDER BY user_lastvisit DESC LIMIT 10");

if (dbrows($result) != 0) {
    $hou_count = 0;
   while ($data = dbarray($result)) {
      $lastseen = time() - $data['user_lastvisit'];
      $week = sprintf("%2d", floor($lastseen / 604800));
      $day  = sprintf("%2d", floor($lastseen / (60 * 60 * 24)));
      $hour = sprintf("%02d", floor((($lastseen % 604800) % 86400) / 3600));
      $minute = sprintf("%02d", floor(((($lastseen % 604800) % 86400) % 3600) / 60));
      $second = sprintf("%02d", floor((((($lastseen % 604800) % 86400) % 3600) % 60)));
      
if ($week > 0){
      if ($week == 1) {
          $text = "Week";
       }
        else {
          $text = "Weeks";
       }
         $lastseen = $week." ".$text;
       }       
        else if ($day > 0){
      if ($day == 1) {
          $text = "Day";
       } else {
            $text = "Days";
       }
         $lastseen = $day." ".$text;
      } else {
          $lastseen = $hour.":".$minute.":".$second ;
      }
if ($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar']) && $data['user_status']!=6 && $data['user_status']!=5) {
         $houa = "<img style='width: 40px; height: 40px; border: 0px;' src='".IMAGES."avatars/".$data['user_avatar']."' alt='User Avatar' />";
      } else {
         $houa = "<img style='width: 40px; height: 40px; border: 0px;' src='".IMAGES."avatars/noavatar100.png' alt='User Avatar' />";
      }
         echo "<td class='theme-online-lusers' style='width: 10%;' align='center' valign='top'><a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$houa."</a><br />".profile_link($data['user_id'], $data['user_name'], $data['user_status'])."<br /><div class='theme-online-lusers_st' style='border: 1px solid #272727; background-color: #363535; padding: 3px; text-align: center;'>".$lastseen."</div></td>";
       $hou_count ++;
   }
  }
        echo "</tr></table>";
        echo "</center>\n";




?>




[fpnotice=info]I would recommend the application includes[/fpnotice]
 
jasmine
krepsen what exactly do you mean by white page? Have you uploaded the script? Not sure I understand what problem you're having. These are PHP scripts, which run on a web server with PHP installed.
 
spkkris
Oryginal thread:
Dark-Fusion.se
 
Jump to Forum:

Similar Threads

Thread Forum Replies Last Post
Different Homepage For Each User Group? Addon Requests 3 10-18-2017 12:06
Adding Selz Link to User Profile Addon Requests 1 10-14-2017 07:42
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


WE RECOMMEND THIS HOST - PHP-Fusion Hosting