Free Arcade Script

FAS Customization => Addons/Modifications => V3.x => : Frank November 01, 2014, 07:49:50 PM

: Member Name On-Line
: Frank November 01, 2014, 07:49:50 PM
Here's a mod that will count and add the "Members Name" On-Line...  8)

Just copy it to a "user_online.php" block-file and hook it in where you want it?



:

<?php

/**
* @package (c) 2008 - 2014 Free Arcade Script
* @version $Id: user_online.php Version.1.0
* Author: Frank.
**/

echo'<div class="side_nav">Members On Line</div>
<div id="side_holder" style="padding:8px 0px 8px 0px" align="center">'
;

$sql $db->query(sprintf("SELECT * FROM fas_users WHERE status!=0 ORDER BY username ASC")) or die(mysql_error()); 

echo 
'

<div style="vertical-align: top; text-align: left;">'
;
while($row $db->fetch_row($sql)){
$status_ol $row['status'];
if($status_ol >= time()-15*60){
$status ''.$row['username'].'';
echo '<div style="display: inline; vertical-align: top; font-weight: bold; font-size: 9px;"> '.$status.' </div>';
}
}
if(empty($status)){echo '<div style="text-align: center; font-weight: bold; font-size: 10px;">no members online</div>';}
echo 
'</div>
</div>
<div style="clear:both"></div>'


?>


: Re: Member Name On-Line
: am-fs November 27, 2014, 10:43:32 AM
Here is the code for the monster template for Members Online
make a file users_online.php upload it to templates/monster/blocks

:
<?php

/**
* @package (c) 2008 - 2014 Free Arcade Script
* @version $Id: user_online.php Version.1.0
* Author: Frank.
**/

echo '<div class="header">
Members Online
</div>
<div class="content" style="padding:8px 0px 8px 0px" align="center">'
;

$sql $db->query(sprintf("SELECT * FROM fas_users WHERE status!=0 ORDER BY username ASC")) or die(mysql_error()); 

echo 
'

<div style="vertical-align: top; text-align: left;">'
;
while($row $db->fetch_row($sql)){
$status_ol $row['status'];
if($status_ol >= time()-15*60){
$status ''.$row['username'].'';
echo '<div style="display: inline; vertical-align: top; font-weight: bold; font-size: 12px;"> '.$status.' </div>';
}
}
if(empty($status)){echo '<div style="text-align: center; font-weight: bold; font-size: 10px;">no members online</div>';}
echo 
'</div>
</div>'


?>


add to monster/templates.php
:
include("templates/$template/blocks/users_online.php");
: Re: Member Name On-Line
: Frank November 27, 2014, 08:44:29 PM
I'd only make one late change to that ->

:
$status_ol = intval($row['status']);
if($status_ol >= time()-15*60){
$status = ''.htmlspecialchars(stripslashes($row['username'])).'';

 8)
TinyPortal © 2005-2012