############################################### 
##   Hack Title:   Add Last User Visit Date to Members List
##                 (A phpBB2 Quickie)
##   Author:       Nivisec (support@nivisec.com)
##                 http://www.nivisec.com
##   Description:  Adds a new field in the members list that displays the date
##                 that the user last visited on.  "Never" will be displayed if
##                 the user has never logged in.
##
##   Compatibility:   2.0.x
## 
##   Support:      http://www.phpbbhacks.com/forums 
##   Copyright:      2003 Billy Sauls
## 
############################################### 
# 
#-----[ OPEN ]------------------------------------------ 
# 
memberlist.php

#
#-----[ FIND ]------------------------------------------ 
#
	'L_POSTS' => $lang['Posts'], 

#
#-----[ AFTER, ADD ]------------------------------------------ 
#
	'L_LAST_VISITED' => ' ', 

#
#-----[ FIND ]------------------------------------------ 
#
		$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
		$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

#
#-----[ AFTER, ADD ]------------------------------------------ 
#
		$visit_time_sql = "SELECT user_session_time
			FROM " . USERS_TABLE . "
			WHERE user_id = " . $user_id . "
			LIMIT 1";

		if (!$visit_time_result = $db->sql_query($visit_time_sql))
		{
			message_die(GENERAL_ERROR, 'Error getting user last visit time', '', __LINE__, __FILE__, $visit_time_sql);
		}

		$visit_time_row = $db->sql_fetchrow($visit_time_result);
		$last_visit_time = (!empty($visit_time_row['user_session_time'])) ? create_date($lang['DATE_FORMAT'], $visit_time_row['user_session_time'], $board_config['board_timezone']) : '';

#
#-----[ FIND ]------------------------------------------ 
#
			'YIM' => $yim,

#
#-----[ AFTER, ADD ]------------------------------------------ 
#
			'LAST_VISIT_TIME' => $last_visit_time,

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/memberlist_body.tpl

#
#-----[ FIND ]------------------------------------------ 
#
	  <th class="thTop" nowrap="nowrap">{L_JOINED}</th>

#
#-----[ AFTER, ADD ]------------------------------------------ 
#
	  <th class="thTop" nowrap="nowrap">{L_LAST_VISITED}</th>

#
#-----[ FIND ]------------------------------------------ 
#
	  <td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gensmall">{memberrow.JOINED}</span></td>

#
#-----[ AFTER, ADD ]------------------------------------------ 
#
	  <td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gensmall">{memberrow.LAST_VISIT_TIME}</span></td>

#
#-----[ FIND ]------------------------------------------ 
#   If you have added other columns to your member list, this
#   will look different.  Just change the colspan="#" part to
#   be one greater if it isn't 8.  (ie if it is 10, change it
#   to 11).
#
	  <td class="catbottom" colspan="8" height="28">&nbsp;</td>

#
#-----[ REPLACE WITH ]------------------------------------------ 
#
	  <td class="catbottom" colspan="9" height="28">&nbsp;</td>

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
#
#End
