Here is the Mod. Did you try it before ?
##
##
## Mod title: Userstats
##
## Mod version: 1.0.1
## Works on PunBB: 1.2.5
## Release date: 2005-07-01
## Author: Tobi (tobi@tobi.gr)
##
## Description: This mod comes together with the Plugin AP_user_statistics and
## one does not make any sense without the other!
## For your convenience the plugin file AP_user_statistics.php
## is included with this mod.
## It allows the Administrator to see statistics for:
## - How many and which users visited in a certain period
## - Which topics they saw
## - The total number of visits per day for a given period
## - The most read topics for a given period
##
## Affected files: functions.php
## viewtopic.php
##
## Affects DB: Yes
##
## Notes: 1. The install_mod routine currently works only for MySQL.
## 2. The table YOURBOARDstatviews_all can become pretty big
## depending on how many registered users visit your board.
## It has to be cleaned up manually unless I decide to add
## a routine for it (or somebody else does) ;-)
## 3. As long as your statistics tables in the database are not filled
## with user entries you will of course receive some errors ;-)
##
## Release Notes: - Text Modifications in AP_USer_statistics.php
## - Nicer error messages when no matches are found to dismplay by the plugin
## - Removed YOURBOARDstatviews_daily from the install_mod.php
## The routines behind it are not currently implemented.
##
## DISCLAIMER: Please note that "mods" are not officially supported by
## PunBB. Installation of this modification is done at your
## own risk. Backup your forum database and any and all
## applicable files before proceeding.
##
##
#
#---------[ 1. UPLOAD ]------------------------------------------------------
#
install_mod.php
#---------[ 2. RUN ]---------------------------------------------------
#
install_mod.php
#
#---------[ 3. DELETE ]---------------------------------------------------
#
install_mod.php
#
#---------[ 4. OPEN ]---------------------------------------------------
#
include/functions.php
#
#---------[ 5. FIND (line:76) ]---------------------------------------------------
#
// Update the online list
if (!$pun_user['logged'])
$db->query('INSERT INTO '.$db->prefix.'online (user_id, ident, logged) VALUES('.$pun_user['id'].', \''.$db->escape($pun_user['username']).'\', '.$now.')') or error('Unable to insert into online list', __FILE__, __LINE__, $db->error());
}
#
#---------[ 6. CHANGE TO ]---------------------------------------------------
#
// Update the online list
// MOD USERSTATS CHANGE
if (!$pun_user['logged']) {
$db->query('INSERT INTO '.$db->prefix.'online (user_id, ident, logged) VALUES('.$pun_user['id'].', \''.$db->escape($pun_user['username']).'\', '.$now.')') or error('Unable to insert into online list', __FILE__, __LINE__, $db->error());
$db->query('INSERT INTO'.$db->prefix.'statuser (user_id, user_ip) VALUES('.$pun_user['id'].','.$db->escape(get_remote_address()).')') or error('Unable to insert into user statistics', __FILE__, __LINE__, $db->error());
}
// END MOD USERSTATS CHANGE
#
#---------[ 7. FIND (line:92) ]---------------------------------------------------
#
$idle_sql = ($pun_user['idle'] == '1') ? ', idle=0' : '';
#
#---------[ 8. BEFORE, ADD ]---------------------------------------------------
#
// MOD USERSTATS CHANGE
if ($pun_user['idle'] == 1) {
$db->query('INSERT INTO '.$db->prefix.'statuser (user_id, user_ip) VALUES('.$pun_user['id'].',"'.$db->escape(get_remote_address()).'")') or error('Could not insert into statistics', __FILE__, __LINE__, $db->error());
}
// END MOD USERSTATS CHANGE
#
#---------[ 9. OPEN ]---------------------------------------------------
#
viewtopic.php
#
#---------[ 10. FIND (line:102) ]---------------------------------------------------
#
if (!$db->num_rows($result))
message($lang_common['Bad request']);
#
#---------[ 11. BEFORE, ADD ]---------------------------------------------------
#
// MOD USERSTATS
$statresult = $db->query('insert into '.$db->prefix.'statviews_all(user_id, topic_id) VALUES (' . $pun_user['id'] . ', '.$id.')') or error('Unable to update view statistics', __FILE__, __LINE__, $db->error());
// MOD USERSTATS