changing the user's online to user's online today... or in t

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
User avatar
i_killed_kenny
Registered User
Posts: 71
Joined: Wed Aug 20, 2003 7:44 am

changing the user's online to user's online today... or in t

Post by i_killed_kenny »

URL: http://www.wordbond.com/phpBB2/index.php
Template(s) used: fiBlue
Any and all MODs: quick-reply
Do you use a port of phpBB:
Version of phpBB: 2.0.6
Version of PHP: 4
Which database server and version: MySQL
Host: godaddy.com
Did someone install this for you/who: no, i did
Is this an upgrade/from what to what: 2.0.4
Is this a conversion/from what to what: no
Have you searched for your problem: yes
If so, what terms did you try: current users online
State the nature of your problem: not neccesarily a problem, a question
Do you have a test account for us: no

-----------


how do you go about changing the "user's online" stat at the bottom of the forum index, to "users online today"... or "users online in the last hour". I want my board to seem more active then it is ;)
idea
Registered User
Posts: 247
Joined: Mon Oct 20, 2003 8:29 am

Post by idea »

User avatar
i_killed_kenny
Registered User
Posts: 71
Joined: Wed Aug 20, 2003 7:44 am

Post by i_killed_kenny »

idea wrote: you need a hack for it

http://www.phpbbhacks.com/searchresults ... &Submit=Go



what does this part mean at the end...

Code: Select all

// ############ 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 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 href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>';
	}
	else
	{
		$user_day_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><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;
}

//
// End of MOD
//
this last part of the installation isnt like the rest of it.. what does it mean?
User avatar
i_killed_kenny
Registered User
Posts: 71
Joined: Wed Aug 20, 2003 7:44 am

Post by i_killed_kenny »

forgetit ... i got it :oops:
Locked

Return to “2.0.x Support Forum”