News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Users Online Today Mod

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

Previous topic - Next topic

Jade Elizabeth

Well what do you want from the new version if the author doesn't upgrade the older version?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Sabre™

Quote from: Zygomaticus on March 25, 2008, 08:39:29 PM
Well what do you want from the new version if the author doesn't upgrade the older version?
A cup of tea and a hot donut would be nice :D

LOL..  Sorry, was just browsing the forum and had a looksie in here.
As you were :D
lol
:P
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Jade Elizabeth

Lol like Beauty and the beast?
Well if we know what you want Seek, we may be able to code it for you....I've seen this mod set for weekly, on a 1.1.4 forum.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Basie

It's not the timeframe, it's just that the current version (for 1.1.4) doesnt allow guests to view who has visited. For guests it only displays the total number of visitors.

Jade Elizabeth

Quote from: seek2501 on March 25, 2008, 11:41:46 PM
It's not the timeframe, it's just that the current version (for 1.1.4) doesnt allow guests to view who has visited. For guests it only displays the total number of visitors.

You can put the one you have inside an "if user is logged" thing. If this hasnt been done by someone tomorrow, I'll do it for you and give you the code here :D.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Jade Elizabeth

Okay, I reread, you wanted guests to see it.

Themes > [theme name] > BoardIndex.template.php

Find:
// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online_today']) && !$context['user']['is_guest'])


Replace:
// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online_today']))


I tested it via localhost, it seems to work :D
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Basie

Thanks.

Also I noticed an issue with this mod... If a user is banned and tries to access the forum then they still get listed as having logged in.

Banned users should not be listed?

Carceri

Quote from: seek2501 on March 28, 2008, 02:04:31 AM
Thanks.

Also I noticed an issue with this mod... If a user is banned and tries to access the forum then they still get listed as having logged in.

Banned users should not be listed?

I have not yet tested this myself, but the mod pulls the data from the user database, and if the user is listed as having logged in there, the mod lists him as so. If this is the case, and there is not some other bug, I will not change this, as I want this mod to be consistent with the "last login" time shown in the users profile.

Jade Elizabeth

Quote from: seek2501 on March 28, 2008, 02:04:31 AM
Thanks.

Also I noticed an issue with this mod... If a user is banned and tries to access the forum then they still get listed as having logged in.

Banned users should not be listed?

Now that one I don't know how to fix lol

Quote from: Carceri on March 28, 2008, 02:36:35 AM
Quote from: seek2501 on March 28, 2008, 02:04:31 AM
Thanks.

Also I noticed an issue with this mod... If a user is banned and tries to access the forum then they still get listed as having logged in.

Banned users should not be listed?

I have not yet tested this myself, but the mod pulls the data from the user database, and if the user is listed as having logged in there, the mod lists him as so. If this is the case, and there is not some other bug, I will not change this, as I want this mod to be consistent with the "last login" time shown in the users profile.

Well without knowing, I'd assume it was pulled from the database.
When a banned user tries to login I guess the database logs that, I cannot test it as I have no banned users :P
I had one banned for a few days a while ago, and he claimed he got a blank screen with his "ban message" lol.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Carceri

I just checked... banned users trying to log in still updates their last login time, and hence this mod should also display them as logged in to be consistent with the information found elsewhere on the forum.

stefanmih123

#850
I have SMF 1.1.4 with non-standard theme....Just installed "Users Online Today" and i don't see that anything changed....I know that i have to change something in "BoardIndex.template.php" but i don't know what and where to put it (i want "Users Online Today" to be after or befor standard "Users Online" )

I tried to put this code:

// Load the users online today.
$date = @getdate(forum_time(false));
$midnight = mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']) - ($modSettings['time_offset'] * 3600);

$s = strpos($user_info['time_format'], '%S') === false ? '' : ':%S';
if (strpos($user_info['time_format'], '%H') === false && strpos($user_info['time_format'], '%T') === false)
$time_fmt = '%I:%M' . $s . ' %p';
else
$time_fmt = '%H:%M' . $s;

$result = db_query("
SELECT
mem.ID_MEMBER, mem.lastLogin, mem.realName, mem.memberName, mem.showOnline,
mg.onlineColor, mg.ID_GROUP, mg.groupName
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP)) WHERE mem.lastLogin >= $midnight", __FILE__, __LINE__);

$context['num_hidden_users_online_today'] = 0;
$context['users_online_today'] = array();
$context['list_users_online_today'] = array();

while ($row = mysql_fetch_assoc($result))
{
if (empty($row['showOnline']))
{
$context['num_hidden_users_online_today'] = $context['num_hidden_users_online_today'] + 1;
if (!$user_info['is_admin']) continue;
}

$userday = strftime('%d', forum_time(true));
$loginday = strftime('%d', forum_time(true, $row['lastLogin']));
$yesterday = $userday == $loginday ? '' : $txt['uot_yesterday'];

$lastLogin = $yesterday . strftime($time_fmt, forum_time(true, $row['lastLogin']));
$title = ' title="' . $lastLogin . '"';

// Some basic color coding...
if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '"' . $title . ' style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '"' . $title . '>' . $row['realName'] . '</a>';

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

$context['users_online_today'][$row['lastLogin'] . $row['memberName']] = array(
'id' => $row['ID_MEMBER'],
'username' => $row['memberName'],
'name' => $row['realName'],
'group' => $row['ID_GROUP'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => $link,
'is_buddy' => $is_buddy,
'hidden' => empty($row['showOnline']),
);

$context['list_users_online_today'][$row['lastLogin'] . $row['memberName']] = empty($row['showOnline']) ? '<i>' . $link . '</i>' : $link;
}
mysql_free_result($result);

krsort($context['users_online_today']);
krsort($context['list_users_online_today']);

$context['num_users_online_today'] = count($context['users_online_today']);
if (!$user_info['is_admin'])
{
$context['num_users_online_today'] = $context['num_users_online_today'] + $context['num_hidden_users_online_today'];


but it says:
Quote
The file you tried to save generated the following error:
Parse error: syntax error, unexpected $end in BoardIndex.template.php on line 531


Please HELP ! Appriciate that...
Sorry for my bad English...

perplexed

use the package parser in my signature and upload the zipped mod file to it, then select theme edits.  you can then scroll down and see what edits you need to make to your theme to make it appear :)



FragaCampos

Quote from: Jumbobeef on April 16, 2007, 01:52:36 PM
Help!  I have just downloaded 1.1.2 and tried to add this to my default theme.  Everytime I try, I get the error message:

QuoteThe package you are trying to download or install is either corrupt or not compatible with this version of SMF.

I have read back the last ten pages or so of this thread but I can't seem to find the answer.  Can anyone help please?

Thanks in advance.

Hello there.
Tried to install the mod and got the same error. Any suggestion? Thanks.

Poor_Knight

Quote from: FragaCampos on April 03, 2008, 02:44:44 PM
Quote from: Jumbobeef on April 16, 2007, 01:52:36 PM
Help!  I have just downloaded 1.1.2 and tried to add this to my default theme.  Everytime I try, I get the error message:

QuoteThe package you are trying to download or install is either corrupt or not compatible with this version of SMF.

I have read back the last ten pages or so of this thread but I can't seem to find the answer.  Can anyone help please?

Thanks in advance.

Hello there.
Tried to install the mod and got the same error. Any suggestion? Thanks.

I got this error too. Using 1.1.4. Safe to manual install still - I usually have to anyways.
"Life moves pretty fast. If you don't stop and look around once in a while, you could miss it."
~Ferris Bueller

gxpgreg

Hi, just installed users online today. Using SMF 1.1.4 and the default theme. Installed fine except I am missing the header bar that normally says "Users Logged In Today".  I am also missing the words Total, Visible and Hidden. Anybody have any ideas? Thanks.

-SyN-

Are guest not supposed to see the mod, I can see it when its logged in on my site, but as a guest, it just shows the total.

See for yourself.

http://club-syndicate.net/v3.2

gxpgreg

Quote from: gxpgreg on April 05, 2008, 08:45:23 PM
Hi, just installed users online today. Using SMF 1.1.4 and the default theme. Installed fine except I am missing the header bar that normally says "Users Logged In Today".  I am also missing the words Total, Visible and Hidden. Anybody have any ideas? Thanks.

After running through previous posts I checked my modifications.english.php and the stats.english.php and I have the required lines of code in there that were previously mentioned.  Still just getting the : 7 (: 7, : 0)  without the words Total, Visible and Hidden.

Any ideas would really be appreciated thanks.

SpyDie

gxpgreg,

Post the contents of the default's theme Modifications.english.php file. It can be found in /Themes/default/languages/Modifications.english.php.
Beta. Software undergoes beta testing shortly before it's released. Beta is Latin for 'still doesn't work.'

Advertisement: