Simple Machines Community Forum

SMF Development => Feature Requests => Applied or Declined Requests => Aiheen aloitti: shadow82x - marraskuu 30, 2007, 06:45:04 IP

Otsikko: who's online auto refresh
Kirjoitti: shadow82x - marraskuu 30, 2007, 06:45:04 IP
Something I believe SMF should have is an automatic who's online list refresher. (ie your browser reloads every 30 seconds) It would come to great use. Also maybe a manual [refresh] link too.
Otsikko: Re: who's online auto refresh
Kirjoitti: karlbenson - marraskuu 30, 2007, 07:13:22 IP
If it just refreshed the whos online that would be fine.

But theres nothing worse than a site/page that constantly automatically reloads the entire page.
Otsikko: Re: who's online auto refresh
Kirjoitti: 1MileCrash - marraskuu 30, 2007, 07:22:50 IP
Sorry to disagree, but i couldn't imagine a more useless way to slow down smf.

This would only be useful if one were to sit on the page index without visiting any pages..for 30+ seconds...only to see if someone else came online..

Think about it.
Otsikko: Re: who's online auto refresh
Kirjoitti: Thantos - joulukuu 03, 2007, 12:36:23 AP
This should be left up to the browser.  Any good browser will let you automatically refresh on a timer.
Otsikko: Re: who's online auto refresh
Kirjoitti: steve in houston - joulukuu 03, 2007, 08:15:13 IP
i just made a simple solution, works good on my test forum.


make a php file called online.php and put this in the contents (change SSI path)

<?php require("/home/XXX/public_html/SSI.php"); ?>
<html>
<head>
<meta http-equiv="refresh" content="30">
<script type="text/javascript">
   parent.document.getElementById('usersOnline').innerHTML='<?php ssi_whosOnline(); ?>';
</script>
</head>

<body>
</body>
</html>


then open BoardIndex.template.php and add this to the <td> that shows the users online:
id="usersOnline"

and add this somewhere on your BoardIndex page:
<iframe src="online.php" frameborder="0" width="0" height="0" style="width:0;height:0;display:none;"></iframe>

this will hide a frame thats source is the online.php script, which refreshes every 30 seconds and updates the usersOnline field on the parent page.  this solution wont work on all browsers, but its still pretty cool.