1

Samstag, 25. November 2006, 22:09

Offline timeouts not hidden with "hide if offline" set

First of all apologies for the english, i don't know much german, and it was hard enough just to register and post this.

I noticed that the Web Status plugin does not update with an offline status a lot of the time after you've closed/disconnected a medium, it just stops updating that status.
This leaves the status of the medium as online in the database, but will show correctly as offline on index.php after checking for the timeout.
The problem is, it does the timeout check after its already looked for offline mediums that aren't set to "hide if offline", resulting in the offline status being displayed still.

I've added the following changes to apply this check in the query instead of after.
Lines 41 & 42 in index.php:

Quellcode

1
2
if ($TSUSet["showident"] == "ALL") { $DBData = mysql_query("SELECT * FROM `".TABLE_STATUS."` WHERE `uid` = '".$_GET["uid"]."' AND `visible` = '0' AND (`visoff` = '0' OR (`visoff` = '1' AND `status` <> 'offline')) ORDER BY `medium`", $db); }
else { $DBData = mysql_query("SELECT * FROM `".TABLE_STATUS."` WHERE `uid` = '".$_GET["uid"]."' AND `visible` = '0' AND `ident` = '".$TSUSet["showident"]."' AND (`visoff` = '0' OR (`visoff` = '1' AND `status` <> 'offline')) ORDER BY `medium`", $db); }
Replace with:

Quellcode

1
2
if ($TSUSet["showident"] == "ALL") { $DBData = mysql_query("SELECT * FROM `".TABLE_STATUS."` WHERE `uid` = '".$_GET["uid"]."' AND `visible` = '0' AND (`visoff` = '0' OR (`visoff` = '1' AND `status` <> 'offline' AND `lastupdate` > UNIX_TIMESTAMP(now()) - ".$config["set_timeout"]." )) ORDER BY `medium`", $db); }
else { $DBData = mysql_query("SELECT * FROM `".TABLE_STATUS."` WHERE `uid` = '".$_GET["uid"]."' AND `visible` = '0' AND `ident` = '".$TSUSet["showident"]."' AND (`visoff` = '0' OR (`visoff` = '1' AND `status` <> 'offline' AND `lastupdate` < UNIX_TIMESTAMP(now()) - ".$config["set_timeout"]." )) ORDER BY `medium`", $db); }
And remove the obsolete check at line 48 in index.php:

Quellcode

1
if ($TData["lastupdate"] < (time() - $config['set_timeout'])) { $TData["status"] = "offline"; }

Please understand, this is only intended as a quick fix. Either Web Status plugin should be changed to update the status of all mediums, regardless of if they are active/connected, or you guys need to make update.php set the status of all mediums in the database, that are not reported by the plugin on an update, to offline. I could have done this myself, but it was more work that i was willing to put in right now, and seeing that the project has changed hands now, want to see if you're up to the task ;)

Edit: You'll need to make similar changes to cachegetpic.func.php too i just realized.
Lines 20 and 32 in cachegetpic.func.php:

Quellcode

1
(`visoff` = '1' AND `status` <> 'offline')
Replace with:

Quellcode

1
(`visoff` = '1' AND `status` <> 'offline' AND `lastupdate` > UNIX_TIMESTAMP(now()) - ".$config["set_timeout"]." )
And again, remove the obsolete check at line 70 in cachegetpic.func.php:

Quellcode

1
if ($TData["lastupdate"] < (time() - $config['set_timeout'])) { $TData["status"] = "offline"; }

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »zeal« (26. November 2006, 02:47)


moepschen

Co-Administrator

Beiträge: 2 362

Registrierungsdatum: 2. Mai 2002

Wohnort: Frankfurt (Oder)

Beruf: hab ich und führe ich auch Mo-Fr aus ;)

  • Nachricht senden

2

Sonntag, 26. November 2006, 11:55

RE: Offline timeouts not hidden with "hide if offline" set

Hi, thanks for your message. Sorry, but my english is not good.
This message is translatet with online-translator and my basic knowledge :huhu:
I will attend to it myself. But I have extremely busy another project, at time.
I hope that you have me understood. :sicher:
MfG moepschen

Du brauchst schnell und dringend Hilfe? --- Dann benutze doch mal die Forensuche! Kein Support per E-Mail, PN oder Messenger, dafür ist das Forum da!!!

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »moepschen« (26. November 2006, 12:54)


moepschen

Co-Administrator

Beiträge: 2 362

Registrierungsdatum: 2. Mai 2002

Wohnort: Frankfurt (Oder)

Beruf: hab ich und führe ich auch Mo-Fr aus ;)

  • Nachricht senden

3

Dienstag, 28. November 2006, 20:25

Sorry, I have not yet found any solution for the problem. The problem seems to be a somewhat bigger. Please use for the moment your quick fix.
MfG moepschen

Du brauchst schnell und dringend Hilfe? --- Dann benutze doch mal die Forensuche! Kein Support per E-Mail, PN oder Messenger, dafür ist das Forum da!!!