FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Interesting little problem.
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Interesting little problem. [message #12830] Mon, 08 September 2003 23:00 Go to next message
JamesS is currently offline  JamesS   United States
Messages: 275
Registered: July 2002
Location: Atlanta, GA
Karma: 0
Senior Member
In an effort to make FUDforum a little more integrated with my site I use an object tag to embed the forum in a certain page. This works except for one thing: the online users list is flaky. Some times it will show who is logged in and other times it will not. To see what I mean vist http://ug.dyndns.org/forum.php (not an advertisment - just the easiest way to show you what I am talking about)

I know that it is not a problem with FUDforum but with the way I am using it. I am just wondering if anyone might know a way to fix this.
Re: Interesting little problem. [message #12925 is a reply to message #12830] Thu, 18 September 2003 14:53 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Online status on the front page is cached. You can control for how long (by default 5 minutes) via admin control panel. The 'show what people are doing' on the other hand shows the 'live' data.

FUDforum Core Developer
Re: Interesting little problem. [message #12943 is a reply to message #12830] Thu, 18 September 2003 15:32 Go to previous messageGo to next message
JamesS is currently offline  JamesS   United States
Messages: 275
Registered: July 2002
Location: Atlanta, GA
Karma: 0
Senior Member
I kind of thought that might be it. But when I read in the admin control panel it did not sound like that was covered in the cached material. I thought maybe you were doing something like the following for the online users list:

<?php
$five_ago
= time() - 300;
$tmp = mysql_query("SELECT uname FROM users WHERE last_access >= $five_ago");

for (
$i = 0; $row = mysql_fetch_assoc($tmp); $i++ ) {
     
$ar[$i] = $row['uname'];
}

$list = implode(" ", $ar);
?>
Re: Interesting little problem. [message #12960 is a reply to message #12943] Thu, 18 September 2003 16:49 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The logic is far more complex then your example indicates. Basically there is a special table containing the cached values. If the data in that table is older then what your cache limit it set to, the values in that table are rebuilt. If the cached data is not too old, then the values from the cache table are used.

FUDforum Core Developer
Re: Interesting little problem. [message #12964 is a reply to message #12830] Thu, 18 September 2003 17:01 Go to previous messageGo to next message
JamesS is currently offline  JamesS   United States
Messages: 275
Registered: July 2002
Location: Atlanta, GA
Karma: 0
Senior Member
But which way is more expensive?
Re: Interesting little problem. [message #12969 is a reply to message #12964] Thu, 18 September 2003 17:14 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
What do you mean more expensive?

FUDforum Core Developer
Re: Interesting little problem. [message #12984 is a reply to message #12830] Thu, 18 September 2003 18:17 Go to previous messageGo to next message
JamesS is currently offline  JamesS   United States
Messages: 275
Registered: July 2002
Location: Atlanta, GA
Karma: 0
Senior Member
In the admin panel you note that the forum info cache build is fairly CPU intensive. By expensive I mean which way do you think takes more processing power? The way I propose in my post or the way things are truly done by the forum software?
Re: Interesting little problem. [message #12985 is a reply to message #12984] Thu, 18 September 2003 18:22 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Your way is much slower. Because 1) range query are do not get optimized 2) you end up doing a lot of work realtime, which in current approach is cached. That said, you can safely tune the cache down to 1 minute or so.

FUDforum Core Developer
Re: Interesting little problem. [message #12987 is a reply to message #12830] Thu, 18 September 2003 18:31 Go to previous message
JamesS is currently offline  JamesS   United States
Messages: 275
Registered: July 2002
Location: Atlanta, GA
Karma: 0
Senior Member
I have turned it down to two minutes. I was just curious about the different approaches.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Trying a restore but 2.3.3 stable not posted here anymore
Next Topic: Deleting Anonymous User in User Manager
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 22:46:39 GMT 2024

Total time taken to generate the page: 0.02692 seconds