Jump to content
MakeWebGames

Players Online


Galahad

Recommended Posts

This is just a quick module that shows which players are online.

EDIT -

When i post code using the code tags, it automatically adds <BR/> to every line i make. Will post up shortly

 

<?php
defined('IN_EZRPG') or exit;
//21lockdown
//http://ezrpgproject.com
class Module_OnlinePlayers extends Base_Module
{
   public function start()
   {
       requireLogin();


       $query = $this->db->execute('SELECT `username`, `id`, `level`,`last_active` FROM `<ezrpg>players` WHERE `last_active`>?', array(time() - (60*5)));

	$online = Array();
       while ($m = $this->db->fetch($query))
       {
           $online[] = $m;
       }

       $this->tpl->assign('members', $online);
       $this->tpl->display('online.tpl');
   }
}

?>

 

Posted module on PasteBin.com

Link - http://pastebin.com/raw.php?i=XvWZKC8k

Edited by 21Lockdown
Error with CODE tag
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...