*

Recent

Author Topic: Member Name On-Line  (Read 6976 times)

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Member Name On-Line
« on: 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?



Code: [Select]

<?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>'


?>



am-fs

  • Owner
  • Developer
  • Full Member
  • ******
  • Posts: 228
  • Force: +1/-0
    • Great Flash Games
Re: Member Name On-Line
« Reply #1 on: 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

Code: [Select]
<?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
Code: [Select]
include("templates/$template/blocks/users_online.php");

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Member Name On-Line
« Reply #2 on: November 27, 2014, 08:44:29 PM »
I'd only make one late change to that ->

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

 8)