$Id: last_post_date.txt,v 1.2 2003/07/03 12:10:25 nivisec Exp $
############################################### 
##   Hack Title:   Add Last User Post 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 posted on.  "None" will be displayed if
##                 the user has never posted.
##
##   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_POST_TIME' => $lang['Last_Post'] . ' ' . $lang['Time'], 

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

#
#-----[ AFTER, ADD ]------------------------------------------ 
#

		$post_time_sql = "SELECT post_time
			FROM " . POSTS_TABLE . "
			WHERE poster_id = " . $user_id . "
			ORDER BY post_time DESC
			LIMIT 1";

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

		$post_time_row = $db->sql_fetchrow($post_time_result);
		$last_post_time = ( isset($post_time_row['post_time']) ) ? create_date($board_config['default_dateformat'], $post_time_row['post_time'], $board_config['board_timezone']) : $lang['None'];

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

#
#-----[ AFTER, ADD ]------------------------------------------ 
#
			'LAST_POST_TIME' => $last_post_time,

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

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

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

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

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

#
#-----[ FIND ]------------------------------------------ 
#
	  <td class="catbottom" colspan="8" height="28">&nbsp;</td>

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

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