
03-24-2006, 07:48 PM
|
|
|
Join Date: May 2005
Location: Cheyenne, wy
Posts: 1,380
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by Virtuosofriend
Hmmm.Do you have to edit a php file or something?
Can you post here the file modification,if any,it seems it is not in the instructions.
|
here ya go:
Quote:
[Total Time Spent On Board
Author: tnguy3n
Live Demo: http://www.vbviet.org
This hack shows total time that users spent on the board.
To show all time units including seconds, minutes, hours, etc, uncomment lines for thoese variables in "Total Spent Time On Board" plugin.
Query: 1
File mod: 1
Template mod: 1
#----------------------- \?/ ----------------------#
######### QUERY #########
ALTER TABLE `user` ADD `timeonboard` INT( 10 ) NOT NULL AFTER `lastactivity` ;
######### FILE MODIFICATION ##########
Open includes/class_core.php, (1 change)
FIND:
// on this to be updated in real time.
$this->registry->db->shutdown_query("
UPDATE " . TABLE_PREFIX . "user
SET lastactivity = " . TIMENOW . "
WHERE userid = " . $this->userinfo['userid'] . "
", 'lastvisit');
REPLACE WITH:
// on this to be updated in real time.
/* $this->registry->db->shutdown_query("
UPDATE " . TABLE_PREFIX . "user
SET lastactivity = " . TIMENOW . "
WHERE userid = " . $this->userinfo['userid'] . "
", 'lastvisit');
*/
if(TIMENOW - $this->userinfo['lastactivity'] > $this->registry->options['cookietimeout'])
{
$newtime = '0';
}
else
{
$newtime = TIMENOW - $this->userinfo['lastactivity'];
}
$this->registry->db->shutdown_query("
UPDATE " . TABLE_PREFIX . "user
SET lastactivity = " . TIMENOW . ",
timeonboard = timeonboard + $newtime
WHERE userid = " . $this->userinfo['userid'] . "
", 'lastvisit');
########## PLUGINS ###########
UPLOAD timeonboard.xml plugin
########## TEMPLATE MOD ############
In postbit(_legacy),
FIND:
<div>
$vbphrase[posts]: $post[posts]
</div>
BELOW, ADD:
<div>
<strong>Time spent on board:</strong><br /> $post[timeonboard]
</div>
<! --- all done --- >
|
|