DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • July 17, 2019, 03:59:07 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Display Online/Offline status in Chat  (Read 2648 times)
0 Members and 1 Guest are viewing this topic.
anpera
Guest
« on: June 18, 2004, 04:32:32 AM »

With this hack the small triangles in front of new chat entries show if someone is online or offline. It displays a green triangle for online players and the red one for offline players.

Idea: ThunderEye (he's running something similar on his 0.9.6 server and gave permission to me to make it public)
Coding for 0.9.7: anpera

Code:
---- Open:
common.php

---- Find (in function viewcommentary):
$sql = "SELECT commentary.*,
              accounts.name,
              accounts.login

---- After, add:
,accounts.loggedin,
accounts.location,
accounts.laston

---- Find:
if ($row['postdate']>=$session['user']['recentcomments']) $op[$i]="<img src='images/new.gif' alt='&gt;' width='3' height='5' align='absmiddle'> ".$op[$i];

---- Replace it with:
$loggedin=(date("U") - strtotime($row[laston]) < getsetting("LOGINTIMEOUT",900) && $row[loggedin] && $row[location]==0);
if ($row['postdate']>=$session['user']['recentcomments']) $op[$i]=($loggedin?"<img src='images/new-online.gif' alt='Online' width='3' height='5' align='absmiddle'>":"<img src='images/new.gif' alt='Offline' width='3' height='5' align='absmiddle'> ").$op[$i];


---- Upload to /images:
new-online.gif
Green arrow new-online.gif is here.

("location" can be left out.)
« Last Edit: June 18, 2004, 04:33:16 AM by anpera » Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
108 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search