############################################################## 
## MOD Title:		  Last visit
## MOD Author:		  Niels < ncr@db9.dk > (Niels Chr. Rd) http://mods.db9.dk
## MOD Author, Secondary: acoolwelshbloke < acoolwelshbloke@tec2spec.co.uk > (Paul Norman) http://www.tec2spec.co.uk/forum/
## MOD Description:	  This mod will register when the user last logged in, allong with the info about how many users have visited the board.
## MOD Version:		  1.2.10em
## MOD Compatibility:	  2.0.21
## 
## Installation Level:    Intermediate
## Installation Time:     25 minutes (1mn by EasyMOD of Nuttzy)
## Files To Edit:         13
##
##      			index.php 
##      			memberlist.php 
##      			admin/admin_board.php 
##      			includes/functions.php
##      			includes/page_header.php 
##      			includes/sessions.php 
##      			includes/usercp_viewprofile.php 
##      			language/lang_english/lang_admin.php 
##      			language/lang_english/lang_main.php 
##      			templates/subSilver/index_body.tpl 
##      			templates/subSilver/member_body.tpl    
##      			templates/subSilver/profile_view_body.tpl  
##      			templates/subSilver/admin/board_config_body.tpl    
##
## Included Files: 		None
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
############################################################## 
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
############################################################## 
## Author Notes:
## 
## THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY 
## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 
## TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
## FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL 
## THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
## INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
## ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
## 
## 1. EasyMOD
## -----------
## This MOD is compatible with EasyMOD and can be installed
## by it but is not yet certified EMC (EasyMOD Compliant)!
## http://area51.phpbb.com/phpBB22/viewforum.php?sid=&f=15
##
## Warning 1! At the minimum, you need EasyMOD beta 1 (0.3.0)
## + this fix...
## http://area51.phpbb.com/phpBB/viewtopic.php?sid=&p=130605#130605
## ...or more recent to install this MOD by EM!
##
## Warning 2! At the present time, EM is not able to install
## automatically other languages than English.
## This gap will be solved in future releases but in the meantime,
## if you need to install any other language than English provides
## with this MOD, please proceed manually (cf. comments in
## the DIY action).
##
## 2. Compatibility
## -----------
## This MOD is phpBB 2.0.19 compliant (prior release not tested)
##
## 3. Official last version link
## -----------
## Meanwhile the phpBB group validation and as the MOD is not yet
## in the phpBB MOD database, check this official link for updates...
## http://mods.db9.dk/viewtopic.php?t=5
##
##############################################################
##
## MOD History:
##
##   2006-06-30 - Version 1.2.10
##      - phpBB template & EasyMOD compliance enhancement
##      - Upgrade the instructions to be phpBB 2.0.21 compliant
##
##   2005-12-16 - Version 1.2.9
##      - phpBB template & EasyMOD compliance enhancement
##      - Upgrade the instructions to be phpBB 2.0.19 compliant
## 
##   2003-12-15 - Version 1.2.8
##      - phpBB template & EasyMOD compliance enhancement
##      - Chinese Traditional Taiwan, Danish, Deutsch, Dutch,
##        French, Hungarian, Italian, Polish & Thai translations
##        now provide with the MOD
## 
##   2003-08-10 - Version 1.2.7
##      - search.php was missing - now added again
##
##   2003-08-10 - Version 1.2.6
##      - Merge part 1, 2, 3 & 4
##      - Add French translation if needed
##      - Update instructions to work with 2.0.5/2.0.6
##      - How-to rewrite to be EasyMOD compatible
##
##   ????-??-?? - Version 1.2.5
##      - change the code in index.php - minor speed different
##
##   ????-??-?? - Version 1.2.4
##      - add, posibilty to log guest users time
##
##   ????-??-?? - Version 1.2.3
##      - removed som added code in session.php
##
##   ????-??-?? - Version 1.2.2
##      - fixed that guest users was not counted rigth if
##        mixed timezones
##
##   ????-??-?? - Version 1.2.1
##      - typo, missed a comma in session.php
##
##   ????-??-?? - Version 1.2.0
##      - BETA for phpBB2 version 2.0.2.
##
##   ????-??-?? - Version 1.0.19
##      - guest was still beeing reset, new change to
##        session.php $dato
##
##   ????-??-?? - Version 1.0.18
##      - fixed session.php that guest users are reset from
##        the "today list"
##
##   ????-??-?? - Version 1.0.17
##      - moved some changes from page_header.php over to
##        index.php, for incresed performance
##
##   ????-??-?? - Version 1.0.16
##      - missed something in the page_header.php file
##
##   ????-??-?? - Version 1.0.15
##      - added extra feature, that how meny guest visited
##        the board today are also countet
##
##   ????-??-?? - Version 1.0.14
##      - fixed that the language part was missing from the
##        last hour addition
##
##   ????-??-?? - Version 1.0.13
##      - Now includes the number of users witch have visited
##        the board the last hour
##
##   ????-??-?? - Version 1.0.12
##      - corection to follow phpBB2 coding guidelines
##
##   ????-??-?? - Version 1.0.11
##      - corrected a typo in how timezones are handled
##
##   ????-??-?? - Version 1.0.10
##      - History started, change in how timezones are handled
##
##   ????-??-?? - Version 1.0.0
##      - initial release for RC-2
##
##   ????-??-?? - Version 0.9.0
##      - initial BETA for RC-2
##
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
# 
#-----[ COPY ]------------------------------------------------ 
# 

#
# This MOD needs a database update.
#
# copy last_visit_update.php to /phpbbRootDir/last_visit_update.php
#
# Once you have copied the above file to your phpBB root
# directory, run it with your navigator as shown below...
#
# http://www.yourWebSite.xxx/phpbbRootDir/last_visit_update.php
#
# Once this step has been completed you need to delete it from the
# phpBB root directory!!!
#
# Please, do it NOW! Before editing phpBB files by EM or manually!!!
# Otherwise, you may have an error message during your next
# connection.
#

# 
#-----[ OPEN ]------------------------------------------------ 
# 
index.php

# 
#-----[ FIND ]------------------------------------------------ 
# 
//
// Start output of page

# 
#-----[ BEFORE, ADD ]----------------------------------------- 
# 

// Start add - Last visit MOD
$time_now=time();
$time1Hour=$time_now-3600;
$minutes = date('is', $time_now);
$hour_now = $time_now - (60*($minutes[0].$minutes[1])) - ($minutes[2].$minutes[3]); 
$dato=create_date('H', $time_now,$board_config['board_timezone']);
$timetoday = $hour_now - (3600*$dato); 
$sql = 'SELECT session_ip, MAX(session_time) as session_time FROM '.SESSIONS_TABLE.' WHERE session_user_id="'.ANONYMOUS.'" AND session_time >= '.$timetoday.' AND session_time< '.($timetoday+86399).' GROUP BY session_ip';
if (!$result = $db->sql_query($sql)) message_die(GENERAL_ERROR, "Couldn't retrieve guest user today data", "", __LINE__, __FILE__, $sql); 
while( $guest_list = $db->sql_fetchrow($result))
{ 
	if ($guest_list['session_time'] >$time1Hour) $users_lasthour++;
}
$guests_today = $db->sql_numrows($result);
$sql = 'SELECT user_id,username,user_allow_viewonline,user_level,user_lastlogon FROM ' . USERS_TABLE . ' WHERE user_id!="'.ANONYMOUS.'" AND user_session_time >= '.$timetoday.' AND user_session_time< '.($timetoday+86399).' ORDER BY username'; 
if (!$result = $db->sql_query($sql)) message_die(GENERAL_ERROR, "Couldn't retrieve user today data", "", __LINE__, __FILE__, $sql); 
while( $todayrow = $db->sql_fetchrow($result)) 
{ 
	$style_color = ""; 
	if ($todayrow['user_lastlogon']>=$time1Hour)
	{
		$users_lasthour++;
	}
	switch ($todayrow['user_level'])
	{
		case ADMIN :
		      $todayrow['username'] = '<b>' . $todayrow['username'] . '</b>'; 
      		$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
			break;
		case MOD :
		      $todayrow['username'] = '<b>' . $todayrow['username'] . '</b>'; 
      		$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
			break;
	}
 	$users_today_list.=( $todayrow['user_allow_viewonline'])?' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $todayrow['user_id']) . '"' . $style_color .'>' . $todayrow['username'] . '</a>,' : (($userdata[user_level]==ADMIN) ? ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $todayrow['user_id']) . '"' . $style_color .'><i>' . $todayrow['username'] . '</i></a>,' : '');
	if (!$todayrow['user_allow_viewonline']) $logged_hidden_today++;
	else $logged_visible_today++;
}
if ($users_today_list) 
{
	$users_today_list[ strlen( $users_today_list)-1] = ' '; 
} else
{
	$users_today_list = $lang['None'];
}
$total_users_today = $db->sql_numrows($result)+$guests_today;

$users_today_list = $lang['Registered_users'].' ' . $users_today_list;
$l_today_user_s = ($total_users_today) ? ( ( $total_users_today == 1 )? $lang['User_today_total'] : $lang['Users_today_total'] ) : $lang['Users_today_zero_total'];
$l_today_r_user_s = ($logged_visible_today) ? ( ( $logged_visible_today == 1 ) ? $lang['Reg_user_total'] : $lang['Reg_users_total'] ) : $lang['Reg_users_zero_total'];
$l_today_h_user_s = ($logged_hidden_today) ? (($logged_hidden_today == 1) ? $lang['Hidden_user_total'] : $lang['Hidden_users_total'] ) : $lang['Hidden_users_zero_total'];
$l_today_g_user_s = ($guests_today) ? (($guests_today == 1) ? $lang['Guest_user_total'] : $lang['Guest_users_total']) : $lang['Guest_users_zero_total'];
$l_today_users = sprintf($l_today_user_s, $total_users_today);
$l_today_users .= sprintf($l_today_r_user_s, $logged_visible_today); 
$l_today_users .= sprintf($l_today_h_user_s, $logged_hidden_today); 
$l_today_users .= sprintf($l_today_g_user_s, $guests_today);
// End add - Last visit MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
'FORUM_LOCKED_IMG' =>

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

// Start add - Last visit MOD
'USERS_TODAY_LIST' => $users_today_list,

'L_USERS_LASTHOUR' =>($users_lasthour)?sprintf($lang['Users_lasthour_explain'],$users_lasthour):$lang['Users_lasthour_none_explain'],
'L_USERS_TODAY' =>$l_today_users,
// End add - Last visit MOD

# 
#-----[ OPEN ]------------------------------------------------ 
# 
memberlist.php 

# 
#-----[ FIND ]------------------------------------------------ 
# 
$mode_types_text =

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
$lang['Sort_Joined']

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, $lang['Last_logon']

# 
#-----[ FIND ]------------------------------------------------ 
# 
$mode_types =

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
'joined'

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, 'lastlogon'

# 
#-----[ FIND ]------------------------------------------------ 
# 
for($i = 0

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
0

# 
#-----[ IN-LINE REPLACE WITH ]-------------------------------- 
# 
($userdata['user_level'] == ADMIN ) ? 0:1

# 
#-----[ FIND ]------------------------------------------------ 
# 
'L_JOINED' =>

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

// Start add - Last visit MOD
'L_LOGON' => $lang['Last_logon'], 
// End add - Last visit MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
case 'joined':
$order_by =
break;

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

// Start add - Last visit MOD
case 'lastlogon': 
   $order_by = ($userdata['user_level'] == ADMIN ) ? "user_lastlogon $sort_order LIMIT $start, " . $board_config['topics_per_page'] : "username $sort_order LIMIT $start, " . $board_config['topics_per_page']; 
   break; 
// End add - Last visit MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
$sql = "SELECT username

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
, user_regdate

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, user_lastlogon, user_allow_viewonline

# 
#-----[ FIND ]------------------------------------------------ 
# 
'JOINED' =>

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

// Start add - Last visit MOD
'LAST_LOGON' => ($userdata['user_level'] == ADMIN || (!$board_config['hidde_last_logon'] && $row['user_allow_viewonline'])) ? (($row['user_lastlogon'])? create_date($board_config['default_dateformat'], $row['user_lastlogon'], $board_config['board_timezone']):$lang['Never_last_logon']):$lang['Hidde_last_logon'],
// End add - Last visit MOD

# 
#-----[ OPEN ]------------------------------------------------ 
# 
admin/admin_board.php 

# 
#-----[ FIND ]------------------------------------------------ 
# 
$prune_no = (

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

// Start add - Last visit MOD
$hidde_last_logon_yes = ( $new['hidde_last_logon'] ) ? "checked=\"checked\"" : ""; 
$hidde_last_logon_no = ( !$new['hidde_last_logon'] ) ? "checked=\"checked\"" : ""; 
// End add - Last visit MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
"L_ENABLE_PRUNE" =>

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

// Start add - Last visit MOD
"L_HIDDE_LAST_LOGON" => $lang['Hidde_last_logon'], 
"L_HIDDE_LAST_LOGON_EXPLAIN" => $lang['Hidde_last_logon_expain'], 
// End add - Last visit MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
"PRUNE_NO" =>

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

// Start add - Last visit MOD
"HIDDE_LAST_LOGON_YES" => $hidde_last_logon_yes, 
"HIDDE_LAST_LOGON_NO" => $hidde_last_logon_no, 
// End add - Last visit MOD

# 
#-----[ OPEN ]------------------------------------------------ 
#
includes/functions.php

# 
#-----[ FIND ]------------------------------------------------ 
# 
?>

# 
#-----[ BEFORE, ADD ]----------------------------------------- 
# 

// Start add - Last visit MOD
function make_hours($base_time)
{
	global $lang;
	$years = floor($base_time/31536000);
	$base_time = $base_time - ($years*31536000);
	$weeks = floor($base_time/604800);
	$base_time = $base_time - ($weeks*604800);
	$days = floor($base_time/86400);
	$base_time = $base_time - ($days*86400);
	$hours = floor($base_time/3600);
	$base_time = $base_time - ($hours*3600);
	$min = floor($base_time/60);
	$sek = $base_time - ($min*60);
	if ($sek<10) $sek ='0'.$sek;
	if ($min<10) $min ='0'.$min;
	if ($hours<10) $hours ='0'.$hours;
	$result=(($years)?$years.' '.(($years==1)?$lang['Year']:$lang['Years']).', ':'').
	(($years || $weeks)?$weeks.' '.(($weeks==1)?$lang['Week']:$lang['Weeks']).', ':'').
	(($years || $weeks || $days) ? $days.' '.(($days==1)?$lang['Day']:$lang['Days']).', ':'').
	(($hours)?$hours.':':'00:').(($min)?$min.':' :'00:').$sek;
	return ($result)?$result:$lang['None'];
}
// End add - Last visit MOD

# 
#-----[ OPEN ]------------------------------------------------ 
#
includes/page_header.php

# 
#-----[ FIND ]------------------------------------------------ 
# 
//
// Get basic

# 
#-----[ BEFORE, ADD ]----------------------------------------- 
#

// Start add - Last visit MOD
if ( !$userdata['user_level']==MOD )
{
	$template->assign_block_vars('switch_user_is_not_moderator', array());
} else
{
	$template->assign_block_vars('switch_user_is_moderator', array());
}
// End add - Last visit MOD

# 
#-----[ OPEN ]------------------------------------------------ 
# 
includes/sessions.php 

# 
#-----[ FIND ]------------------------------------------------ 
# 
if (
{
$last_visit = (

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
if 

# 
#-----[ IN-LINE BEFORE, ADD ]--------------------------------- 
# 
// 

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
{ 

# 
#-----[ IN-LINE BEFORE, ADD ]--------------------------------- 
# 
// 

# 
#-----[ FIND ]------------------------------------------------ 
# 
if (!$admin)
{
$sql = "UPDATE " . USERS_TABLE . "
SET

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
user_lastvisit = $last_visit 

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, user_lastlogon = " . time() .  ", user_totallogon=user_totallogon+1 

# 
#-----[ FIND ]------------------------------------------------ 
# 
$sessiondata['userid'] = $user_id;
}

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
}

# 
#-----[ IN-LINE BEFORE, ADD ]--------------------------------- 
# 
//

# 
#-----[ FIND ]------------------------------------------------ 
# 
if ( !empty($session_id) )
{

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

// Start add - Last visit MOD
$expiry_time = $current_time - $board_config['session_length'] ;
// End add - Last visit MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
$sql = "SELECT u.*, s.*
FROM
WHERE
AND

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
";

# 
#-----[ IN-LINE BEFORE, ADD ]--------------------------------- 
# 
 AND session_time > $expiry_time

# 
#-----[ FIND ]------------------------------------------------ 
# 
if ( $userdata['user_id'] != ANONYMOUS )
{

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
if

# 
#-----[ IN-LINE BEFORE, ADD ]--------------------------------- 
# 
//

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
{

# 
#-----[ IN-LINE BEFORE, ADD ]--------------------------------- 
# 
//

#
#-----[ FIND ]---------------------------------------- 
# 
$sql = "UPDATE " . USERS_TABLE . "
SET user_session_time = $current_time, user_session_page = $thispage_id

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
$thispage_id 

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, user_totalpages = user_totalpages+1, user_totaltime = user_totaltime+($current_time-".$userdata['session_time'].")

# 
#-----[ FIND ]---------------------------------------- 
# 
     message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
   }
 }

# 
#-----[ REPLACE WITH ]--------------------------------- 
# 
      message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
    }
//}

# 
#-----[ FIND ]------------------------------------------------ 
# 
WHERE session_time < ' . (time() - (int) $board_config['session_length']) . "

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
session_time < ' . (time() - (int) $board_config['session_length']) . "

# 
#-----[ IN-LINE REPLACE WITH ]-------------------------------- 
# 
' . "UNIX_TIMESTAMP() - session_time >=172800

# 
#-----[ OPEN ]------------------------------------------------ 
# 
includes/usercp_viewprofile.php

# 
#-----[ FIND ]------------------------------------------------ 
# 
'JOINED' =>

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

// Start add - Last visit MOD
'L_LOGON' => $lang['Last_logon'], 
'LAST_LOGON' => ($userdata['user_level'] == ADMIN || (!$board_config['hidde_last_logon'] && $profiledata['user_allow_viewonline'])) ? (($profiledata['user_lastlogon'])? create_date($board_config['default_dateformat'], $profiledata['user_lastlogon'], $board_config['board_timezone']):$lang['Never_last_logon']):$lang['Hidde_last_logon'], 

'L_TOTAL_ONLINE_TIME' => $lang['Total_online_time'],
'TOTAL_ONLINE_TIME' => make_hours($profiledata['user_totaltime']),
'L_LAST_ONLINE_TIME' => $lang['Last_online_time'],
'LAST_ONLINE_TIME' => make_hours($profiledata['user_session_time']-$profiledata['user_lastlogon']),
'L_NUMBER_OF_VISIT' => $lang['Number_of_visit'],
'NUMBER_OF_VISIT' => ($profiledata['user_totallogon']>0) ? $profiledata['user_totallogon']: $lang['None'],
'L_NUMBER_OF_PAGES' => $lang['Number_of_pages'], 
'NUMBER_OF_PAGES' => ($profiledata['user_totalpages']) ? $profiledata['user_totalpages']: $lang['None'], 
// End add - Last visit MOD

# 
#-----[ OPEN ]------------------------------------------------ 
# 
language/lang_english/lang_admin.php

# 
#-----[ FIND ]------------------------------------------------ 
# 
?>

# 
#-----[ BEFORE, ADD ]----------------------------------------- 
# 

// Start add - Last visit MOD
$lang['Hidde_last_logon'] = "Hidden last logon time"; 
$lang['Hidde_last_logon_expain'] = "If this is set to yes, users last logon time, is hidden to other users except administrators"; 
// End add - Last visit MOD

# 
#-----[ OPEN ]------------------------------------------------ 
# 
language/lang_english/lang_main.php

# 
#-----[ FIND ]------------------------------------------------ 
# 
?>

# 
#-----[ BEFORE, ADD ]----------------------------------------- 
# 
 
// Start add - Last visit MOD
$lang['Last_logon'] = 'Last Visit'; 
$lang['Hidde_last_logon'] = 'Hidden'; 
$lang['Never_last_logon'] = 'Never'; 
$lang['Users_today_zero_total'] = 'In total <b>0</b> users have visited this site today :: ';
$lang['Users_today_total'] = 'In total <b>%d</b> user have visited this site today :: ';
$lang['User_today_total'] = 'In total <b>%d</b> users have visited this site today :: ';
$lang['Users_lasthour_explain'] = ', %d of them within the last hour.'; 
$lang['Users_lasthour_none_explain'] = ''; //showen of none have visited the last hour, fill if you like

$lang['Years'] = 'Years';
$lang['Year'] = 'Year';
$lang['Weeks'] = 'Weeks';
$lang['Week'] = 'Week';
$lang['Day'] = 'Day';
$lang['Total_online_time'] = 'Total Online Duration'; 
$lang['Last_online_time'] = 'Last Online Duration'; 
$lang['Number_of_visit'] = 'Number of visits'; 
$lang['Number_of_pages'] = 'Number of page hits'; 
// End add - Last visit MOD

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

# 
#-----[ FIND ]------------------------------------------------ 
# 
rowspan

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
#
rowspan="2"

# 
#-----[ IN-LINE REPLACE WITH ]-------------------------------- 
# 
rowspan="3"

# 
#-----[ FIND ]------------------------------------------------ 
# 
{NEWEST_USER}</span>
</td>
</tr>

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

<!-- Start add - Last visit MOD -->
<tr> 
	<td class="row1" align="left"><span class="gensmall">{L_USERS_TODAY}&nbsp;{L_USERS_LASTHOUR}<br />{USERS_TODAY_LIST}</br></span></td>    
</tr> 
<!-- Start add - Last visit MOD -->

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

# 
#-----[ FIND ]------------------------------------------------ 
#
{L_POSTS}

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

<!-- Start add - Last visit MOD -->
<th class="thTop" nowrap="nowrap">{L_LOGON}</th> 
<!-- End add - Last visit MOD -->

# 
#-----[ FIND ]------------------------------------------------ 
# 
{memberrow.POSTS}

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

<!-- Start add - Last visit MOD -->
<td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gensmall">{memberrow.LAST_LOGON}</span></td> 
<!-- End add - Last visit MOD -->
   
# 
#-----[ FIND ]------------------------------------------------ 
# 
<td class="catBottom"

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
#
colspan="8"

# 
#-----[ IN-LINE REPLACE WITH ]-------------------------------- 
# 
colspan="9"

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

# 
#-----[ FIND ]------------------------------------------------ 
# 
<td width="100%"><b><span class="gen">{JOINED}</span></b></td>
</tr>

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

<!-- Start add - Last visit MOD -->
<tr> 
	<td valign="middle" align="right"><span class="gen">{L_LOGON}:&nbsp;</span></td> 
	<td width="100%"><b><span class="gen">{LAST_LOGON}</span></b></td> 
</tr>
<!-- BEGIN switch_user_is_moderator -->
<tr> 
  <td valign="middle" align="right"><span class="gen">{L_TOTAL_ONLINE_TIME}:&nbsp;</span></td> 
  <td width="100%"><b><span class="gen">{TOTAL_ONLINE_TIME}</span></b></td> 
</tr> 
<tr> 
  <td valign="middle" align="right"><span class="gen">{L_LAST_ONLINE_TIME}:&nbsp;</span></td> 
  <td width="100%"><b><span class="gen">{LAST_ONLINE_TIME}</span></b></td> 
</tr> 
<tr> 
  <td valign="middle" align="right"><span class="gen">{L_NUMBER_OF_VISIT}:&nbsp;</span></td> 
  <td width="100%"><b><span class="gen">{NUMBER_OF_VISIT}</span></b></td> 
</tr> 
<tr> 
<td valign="middle" align="right"><span class="gen">{L_NUMBER_OF_PAGES}:&nbsp;</span></td> 
<td width="100%"><b><span class="gen">{NUMBER_OF_PAGES}</span></b></td> 
</tr> 
<!-- END switch_user_is_moderator -->
<!-- End add - Last visit MOD -->

# 
#-----[ OPEN ]------------------------------------------------ 
# 
templates/subSilver/admin/board_config_body.tpl 

# 
#-----[ FIND ]------------------------------------------------ 
# 
{PRUNE_NO} /> {L_NO}</td>
</tr>

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

<!-- Start add - Last visit MOD -->
<tr> 
   <td class="row1">{L_HIDDE_LAST_LOGON}<br /><span class="gensmall">{L_HIDDE_LAST_LOGON_EXPLAIN}</span></td> 
   <td class="row2"><input type="radio" name="hidde_last_logon" value="1" {HIDDE_LAST_LOGON_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="hidde_last_logon" value="0" {HIDDE_LAST_LOGON_NO} /> {L_NO}</td> 
</tr> 
<!-- End add - Last visit MOD -->

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