News:

SMF 2.0.19 has been released! Please update. Read more.

Main Menu

Users Online Today Mod

Started by Nibogo, November 06, 2005, 01:42:31 AM

Previous topic - Next topic

Carceri

To all of you that experience this problem:

2: in_array(): Wrong datatype for second argument
File: /home/content/M/R/e/MReimann/html/smf/Sources/BoardIndex.php
Line: 271

This is because you are running SMF 1.0.5. I have only made this mod for SMF 1.1 RC1. Apparently $user_info['buddies'] is not defined in SMF 1.0.5. A quick fix for this problem is to delete the following from BoardIndex after applying the patch:


$is_buddy = in_array($row['ID_MEMBER'], $user_info['buddies']);
if ($is_buddy)
{
$link = '<b>' . $link . '</b>';
}


and probably also the line


'is_buddy' => $is_buddy,


Please note that this mod does not support SMF 1.0.5 and there is no guarantee that it will work for that version, even with the fix mentioned here.

Rebelbelle

Quote from: 1948Pal on November 07, 2005, 10:39:11 PM
This is a nice mod, but isn't this exactly the same mod made by FaSan, I think, who's mod was removed from SMF for some reason?

I have that mod on another one of my boards.  What I really liked about that one, is it also added the users online in a day to the statistics center.  Does the current mod do that?

DemonicInfluence

Nope. But you can get that mod from fasan's site.

jerm

think you could make it possible for this to appear on the [stats] page as "most online users today" ?

DemonicInfluence

Probably. but it would require more coding.

Carceri

Quote from: electrohome88 on November 11, 2005, 03:40:16 PM
think you could make it possible for this to appear on the [stats] page as "most online users today" ?
Sure, the question is how to do it. All the other stats that relate to 'today' are using as today, the forum time and does not take into account the other users' timezones, so I guess that this "most online users today" should do the same, otherwise it will be confusing, right?

But the list of users online today on the front page, are shown as today taking into account the timezone of the user viewing the frontpage.

In order to make it consistent, I would suggest the following:

- Add a "most online users today" to the [stats] page showing the number of online users today, where today is seem from the forum time.

- Make the list on the frontpage display the users online today according to the forum time, not the user's time (the popup with the last time the user was seen will still be shown in the user's time)

Comments, ideas, etc.?

DemonicInfluence


jerm

i would keep it the same way it does the other stats.. where it goes by the forum time

Carceri

Okay, the latest version (1.3.0 RC1) should now act according to the description above. Please test it and report any problems.

Nightstalker

Are there any plans to make this mod work with SMF 1.05.

Cheers.

Carceri

When everything is working as it should for 1.1 RC1, I might make a version compatible with 1.0.5.

DemonicInfluence

#51
1.3 doesn't seem to work.. like, the stats don't show up(no tables?) and the time is still wacky on mouse over...

jonc

I installed the mod both v1.20 and v1.30 both version only worked when my local time is 13:00 to 0:00.  From 0:00 to 12:59 the mod doesn't work.

My local time is GMT+8, and my SMF time offset is set to 13hrs

Carceri

Libo: Have you copied BoardIndex.template.php and Stats.template.php from the default theme to your custom theme or modified your themefiles accordingly?

jonc: Thans for the info (finally someone provided a concrete example where it doesn't work). Still I would like to know what doesn't work. What does the time show and what should it show. If you click the username, what does "Last Active:" say?

jonc

#54
When you roll the mouseover it shows the "last active" time.  Everythings OK except nothing shows up (no name, no time) between 0:00 to 12:59 GMT+8 visit hxxp:www.mykapitbahay.com [nonactive]

Carceri

Thanks for the info. I can see the problem now and will fix it when I have the time, probably in a day or two.

beemer

Well if it helps I havnt found any problems running gmt 0 offset

Great mod thanx

http://www.bmw7resource.co.uk/forum/index.php
http://www.bmw7resource.co.uk
SMF 1.1 RC1
MKP 1.1 RC1
Helios Multi RC1
-------------------------------------------------------
http://www.thefishsheadnhorsesarse.co.uk
SMF 1.1 RC2
TinyPortal 0.8.6

Carceri

#57
The problem is related to the SMF time offset. If the forum is set to the same timezone as the server running the forum, everything should be fine. Problems only occur if you change the "Overall time offset" to something different from 0.

The fix is rather simple. When calculating the time for midnight, I need to convert midnight seen from the forum time, into midnight as seen from the timezone of the server since the lastLogin times in the database are represented in the servers timezone.

A quick untested fix is to replace the following two lines in BoardIndex.php

$frag = explode('-', strftime('%Y-%m-%d', forum_time(false)));
$midnight = mktime(0, 0, 0, (int) $frag[1], (int) $frag[2], (int) $frag[0]);


with

$frag = explode('-', strftime('%Y-%m-%d', time()));
$midnight = forum_time(false, mktime(0, 0, 0, (int) $frag[1], (int) $frag[2], (int) $frag[0]));


Please report back if this works or not.

Another needed fix is to have information such as today or yesterday in the popup time, since with certain configurations of timezones you can end up having users online today seen from the forum time, be yesterday seen from your time.

Edit: 1.3.0 RC2 includes all these fixes

DemonicInfluence

Quote from: Carceri on November 15, 2005, 01:58:09 AM
Libo: Have you copied BoardIndex.template.php and Stats.template.php from the default theme to your custom theme or modified your themefiles accordingly?

jonc: Thans for the info (finally someone provided a concrete example where it doesn't work). Still I would like to know what doesn't work. What does the time show and what should it show. If you click the username, what does "Last Active:" say?

Yes, i'm using default with the normal code...

This still doesn't work. It is 3 hours behind my fourm time(which is my server time...)

It doesn't add the time difference between server and forum time... That's what's going wrong...

Stat thing doesn't work. Maybe no mysql tables? In the stats.php you should query the tables that have the info..

jonc

Cool!  Everything's fine now!

I uninstalled 1.30 RC1 and install 1.30 RC2!

Thanks for the mod!  :D

Advertisement: