Page 1 of 1

Users Visited In The Last 24 Hours

PostPosted: Sun Apr 02, 2006 3:49 pm
Author: Helter
This Mod Is installed here. You can see it in the "Who is online" box on the index



#
#-----open--------------------------------
#
/language/lang_(every language you have installed)/lang_main.php
#
#-----find--------------------------------
#
$lang['Registered_users'] = 'Registered Users:';
#
#-----add before--------------------------
#
$lang['Day_users'] = '%d registered users visit during the last %d hours:';
$lang['Not_day_users'] = '%d registered users <span>DIDN'T</span> visit during the last %d hours:';

#
#-----open--------------------------------
#
/includes/page_header.php
#
#-----find--------------------------------
#
'LOGGED_IN_USER_LIST' => $online_userlist,
#
#-----add after---------------------------
#
'USERS_OF_THE_DAY_LIST' => $day_userlist,
#
#-----find--------------------------------
#
//
// Obtain number of new private messages
// if user is logged in
//
#
#-----add before--------------------------
#

// ############ Edit below ############
// #
$display_not_day_userlist = 0; // change to 1 here if you also want the list of the users who didn't visit to be displayed
$users_list_delay = 24; // change here to the number of hours wanted for the list
// #
// ############ Edit above ############

$sql = "SELECT user_id, username, user_allow_viewonline, user_level, user_session_time
FROM ".USERS_TABLE."
WHERE user_id > 0
ORDER BY IF(user_level=1,3,user_level) DESC, username ASC";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/day information', '', __LINE__, __FILE__, $sql);
}

$day_userlist = '';
$day_users = 0;
$not_day_userlist = '';
$not_day_users = 0;

while( $row = $db->sql_fetchrow($result) )
{
$style_color = '';
if ( $row['user_level'] == ADMIN )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
}
else if ( $row['user_level'] == MOD )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
}
if ( $row['user_allow_viewonline'] )
{
$user_day_link = '<a>' . $row['username'] . '</a>';
}
else
{
$user_day_link = '<a><i>' . $row['username'] . '</i></a>';
}
if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
{
if ( $row['user_session_time'] >= ( time() - $users_list_delay * 3600 ) )
{
$day_userlist .= ( $day_userlist != '' ) ? ', ' . $user_day_link : $user_day_link;
$day_users++;
}
else
{
$not_day_userlist .= ( $not_day_userlist != '' ) ? ', ' . $user_day_link : $user_day_link;
$not_day_users++;
}
}
}

$day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Day_users'], $day_users, $users_list_delay) ) . ' ' . $day_userlist;

$not_day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Not_day_users'], $not_day_users, $users_list_delay) ) . ' ' . $not_day_userlist;

if ( $display_not_day_userlist )
{
$day_userlist .= '<br>' . $not_day_userlist;
}


#
#-----open---------------------------------
#
/templates/fisubice/index_body.tpl
#
#-----find---------------------------------
#
<td><img>
#
#-----replace by---------------------------
#
<td><img>
#
#-----find---------------------------------
#
<td><span>{TOTAL_USERS_ONLINE} <br> {L_WHOSONLINE}<br>
{RECORD_USERS}<br>
{LOGGED_IN_USER_LIST}</span></td>
</tr>
<tr>
<td><span>{L_ONLINE_EXPLAIN}</span></td>


#
#-----add after----------------------------
#
</tr>
<tr>
<td><span>{USERS_OF_THE_DAY_LIST}</span></td>
#
#-----repeat for all templates-------------
#


#
#-----save/close all files----------------------
#

PostPosted: Sun Apr 02, 2006 5:26 pm
Author: Okki
[size=99px]
[size=99px] [/color][url=http]http][/size]

)/

PostPosted: Sun Apr 09, 2006 7:16 pm
Author: SteveRobWhatever
Will this mod display the admin and mod usernames with the right colors? For some reason I tried to install this on my site a couple weeks ago and ran into some problems. if you notice on this very site HelterSkelter's screenname is not being displayed with the right color. It should be blue but it's coming up green.

Re: Users Visited In The Last 24 Hours

PostPosted: Sun Apr 09, 2006 8:09 pm
Author: Helter
it is green because I am a moderator. I also have some jr admin moduals, so im not sure why diferent mods interpet this differently

PostPosted: Sun Apr 09, 2006 8:31 pm
Author: Jason Sanborn
Pretty cool modification. I think I'm going to add this to my site. ;)

Re: Users Visited In The Last 24 Hours

PostPosted: Mon Apr 10, 2006 12:12 pm
Author: Helter
This is the only mod that I added to the site. Everything else was added using the built-in functions of Integramod. I added it because it shows the true activity. If it still was based on users from the last five minutes, the board would look dead. I did however refrain from adding the flags....lol

I am however under orders not to add additional mods to this sight <img>

PostPosted: Mon Apr 10, 2006 12:23 pm
Author: Jason Sanborn
Well, orders are orders. :)

PostPosted: Mon Apr 10, 2006 1:47 pm
Author: IntegraMOD
"Jason Sanborn";p="839" wrote:Well, orders are orders. :)

I also think that this and the flags mod would be worth including in 1.4.1, also would it be worth re stocking 1.40 with this and the flag mod included?

Re: Users Visited In The Last 24 Hours

PostPosted: Mon Apr 10, 2006 2:00 pm
Author: Helter
140 has some bugs that have been fixed in 141 (under construction)
if we update 140, then it becomes a support nightmare because we then have to determine the date you downloaded 140 in order to offer any support

Re: Users Visited

PostPosted: Mon Apr 10, 2006 6:10 pm
Author: Okki
[size=99px]
[size=99px] [/color][url=http]http][/size]

already there.

Re: Users Visited In The Last 24 Hours

PostPosted: Tue Apr 11, 2006 8:53 am
Author: IntegraMOD
"HelterSkelter";p="862" wrote:140 has some bugs that have been fixed in 141 (under construction)
if we update 140, then it becomes a support nightmare because we then have to determine the date you downloaded 140 in order to offer any support

I understand your point but is it not even better support to have the most upto date version on im 140 with bug fix's for download so that users can update their forums, then when someone posts a bug/error they can be directed to download the latest version with fix's, this could stop possible further because members might not apply the fix properly and cause even more bugs/error's. If it is a case of 141 coming out very soon then this point is not that valid depending on the timescale to the release of 141.

Re: Users Visited In The Last 24 Hours

PostPosted: Thu May 11, 2006 9:32 am
Author: pmidmaker
Hi: I want to put the same but in the "visited users" block, like here (kismod web), in the main portal page with the user's name in scroll, but when I create that block, get this:

[color=darkblue]Could not insert data into block variable table

DEBUG MODE

SQL Error ]

Help me plz.

Re: Users Visited In The Last 24 Hours

PostPosted: Mon Jun 12, 2006 7:00 am
Author: Wiked
MOD looks better than the scrolling block so I just put it on my forum and of course took only 5 mins.

Good work!

Only problem is the BF, ADMIN & MOD colors aren't right for the AcidTechTiger theme

Re: Users Visited In The Last 24 Hours

PostPosted: Wed Aug 02, 2006 5:09 am
Author: Flex
Nice mod, installed and working.

One small question though, as on this site, it is still says: "This data is based on users active over the past five minutes".

Can we get rid of this all together including the separtor line?

Thanks

Re: Users Visited In The Last 24 Hours

PostPosted: Wed Aug 02, 2006 5:48 am
Author: tmotley
Isn't that just the
Code: Select all
<tr><td><span>{L_ONLINE_EXPLAIN}</span></td></tr>

in your index_body.tpl?