Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /nfs/c01/h06/mnt/10927/domains/dragonprime.net/html/Sources/Load.php(225) : runtime-created function on line 3

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /nfs/c01/h06/mnt/10927/domains/dragonprime.net/html/Sources/Load.php(225) : runtime-created function on line 3
Display Online/Offline status in Chat
DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • September 18, 2019, 04:56:11 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 2702 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
Please take the time to read the FAQ and browse the DragonPedia

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