this is the
sessions.php part for phpBB2.0.17, save it (quote my post, copy and paste the code, don't submit again my post, thx) with a name and try it with EM 0.2.1a.
Greets
- Code: Select all
##############################################################
## MOD Title: Last visit
## MOD Author: Niels < ncr@db9.dk > (Niels Chr. Rød) http://mods.db9.dk
## 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.8
## MOD Compatibility: 2.0.5->2.0.6
##
## Installation Level: Intermediate
## Installation Time: 25 minutes (1mn by EasyMOD of Nuttzy)
## Files To Edit: 14
## index.php
## memberlist.php
## search.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: 0
##
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## 1. EasyMOD
## -----------
## This MOD is compatible and can be installed by EasyMOD
## of Nuttzy (but is not officially EasyMOD Compliant)!
## http://area51.phpbb.com/phpBB22/viewforum.php?sid=&f=15
##
## However, on alpha releases of EM and meanwhile beta or
## final release some actions are NOT performed.
## You'll have to do them manually !
##
## 1.1 SQL commands are not performed
## -----------
## This MOD need a database update.
## Then, in any case if you install this MOD manually or using
## an alpha release of EM, please copying the *_db_update.php
## in your phpBB root directory, run it with your navigator,
## and then 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.
##
## 1.2 Translation are not managed
## -----------
## Moreover, EM can not already manage actions for any other
## language than English (but language intructions are proceed
## to all installed languages in order to prevent errors).
## So the translations provided with this MOD must be installed
## manually if you need them.
##
## 2. 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:
##
## 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
##############################################################
#
#-----[ OPEN ]------------------------------------------------
#
includes/sessions.php
#
#-----[ FIND ]------------------------------------------------
#
if ( $user_id != ANONYMOUS )
{// ( $userdata['user_session_time'] > $expiry_time && $auto_create ) ? $userdata['user_lastvisit'] : (
$last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time;
if (!$admin)
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit
#
#-----[ IN-LINE FIND ]----------------------------------------
#
if
#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
//
#
#-----[ IN-LINE FIND ]----------------------------------------
#
{
#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
//
#
#-----[ 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 )
{
$sql =
SET
#
#-----[ IN-LINE FIND ]----------------------------------------
#
if
#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
//
#
#-----[ IN-LINE FIND ]----------------------------------------
#
{
#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
//
#
#-----[ IN-LINE FIND ]----------------------------------------
#
$thispage_id
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, user_totalpages = user_totalpages+1, user_totaltime = user_totaltime+($current_time-".$userdata['session_time'].")
#
#-----[ FIND ]------------------------------------------------
#
}
//
// Delete expired sessions
#
#-----[ IN-LINE FIND ]----------------------------------------
#
}
#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
//
#
#-----[ FIND ]------------------------------------------------
#
WHERE session_time < $expiry_time
#
#-----[ IN-LINE FIND ]----------------------------------------
#
session_time < $expiry_time
#
#-----[ IN-LINE REPLACE WITH ]--------------------------------
#
UNIX_TIMESTAMP() - session_time >=172800
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
/ me tired now, let us know.