PDA

View Full Version : Total Time Spent On Forums


tnguy3n
10-06-2005, 10:00 PM
Total Time Spent On Board
Author: tnguy3n
Live Demo: http://12.226.255.221/vb35

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 modification: 1
Plugins: 2
Template mod: 2

Update: 10/12/05
Add option to show user's total spent time on forums in the profile.
If you want to run the User's Total Spent Time In Profile as an stand-alone hack, you have to run run following query:
ALTER TABLE `user` ADD `timeonboard` INT( 10 ) NOT NULL AFTER `lastactivity`;

TTG
10-07-2005, 10:29 PM
Instructions = "Open includes/class_score.php"

Guess that should be "Open includes/class_core.php" ?

Get this error when trying to add template edit !

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /usr/home/techguys/public_html/forum/includes/adminfunctions_template.php(3519) : eval()'d code on line 91

glorify
10-07-2005, 10:34 PM
Second anyway :)

Daniel
10-07-2005, 10:38 PM
Will install once someone confirms it works for them ;)

TTG
10-07-2005, 10:47 PM
Ok found the error in the template edit :-

<div>
<strong>Time spent on board:</strong><br /> $post['timeonboard']
</div>

should be :-

<div>
<strong>Time spent on board:</strong><br /> $post[timeonboard]
</div>

Clicked install

Daniel
10-07-2005, 11:08 PM
Anyway to install without running a query?

evenmonkeys
10-07-2005, 11:14 PM
This is not an Extention as it requires editing of the source code. Good'n though.

FleaBag
10-07-2005, 11:42 PM
How does it calculate the time?

tnguy3n
10-08-2005, 12:11 AM
How does it calculate the time?
It tracks the time when a user start to login 'til (s)he logout (or timeout), then add up to total & store in database.

and yes, it should be in Code Modification forum instead. I was confused by vB 3.5 release forums. :ermm:

Daniel
10-08-2005, 12:20 AM
Okay, if there is no way to use this without a query, how would I do it in phpMyAdmin? But when I submit the query I get "You have to choose at least one column to display"

Lea Verou
10-08-2005, 12:30 AM
Okay, if there is no way to use this without a query, how would I do it in phpMyAdmin? But when I submit the query I get "You have to choose at least one column to display"

Will it work if I put it in memberinfo instead of postbit? I really like it but I want a more minimal postbit... :)

utw-Mephisto
10-08-2005, 12:40 AM
Wanted to check demo but your site seems to be down s

tnguy3n
10-08-2005, 09:50 AM
Will it work if I put it in memberinfo instead of postbit? I really like it but I want a more minimal postbit... :)

You can change the hook to memberinfo_complete, then change all vars $post['timeonboard'] to $userinfo['timeonboard'].

Lea Verou
10-08-2005, 10:47 AM
You can change the hook to memberinfo_complete, then change all vars $post['timeonboard'] to $userinfo['timeonboard'].

Wait, I don't know php, I am only good on changing templates! :P
If I just put $userinfo['timeonboard'] in place of $post['timeonboard'] will it work?
Or do I have to alter the code too? What specifically should I do in the php code?

smokering
10-08-2005, 04:19 PM
get no errors all went well but get no info looks as if nothing changed?

FleaBag
10-08-2005, 05:04 PM
It tracks the time when a user start to login 'til (s)he logout (or timeout), then add up to total & store in database.

Ahh! Wondered if it takes into the past too, thought it was too good to be true! ;)

Nice hack though, I'll use it.

exceem
10-08-2005, 09:42 PM
installed, changed the hook so it would display on the member info but all i see is "time on board : sec"

any ideas?



fixed had to edit the sql to include my table prefix

exceem
10-09-2005, 04:04 PM
is there any way to display a "top 10 list of the time spent online" ?

michaelbenson
10-10-2005, 06:25 AM
I had a 3.0.X version of this hack installed, does this mean that the Total Time Spent will be from when i installed that version, or upgraded to this?

tnguy3n
10-10-2005, 11:59 PM
I had a 3.0.X version of this hack installed, does this mean that the Total Time Spent will be from when i installed that version, or upgraded to this?

this plugin is written for vb 3.5, not an update or port of any hack. Check if the hack you installed coincidently had the field name, then you don't have to alter user table, and it would calculate your time rather than new time of this plugin.

Daniel
10-11-2005, 01:24 AM
<a href="https://vborg.vbsupport.ru/showpost.php?p=789743&postcount=10" target="_blank">https://vborg.vbsupport.ru/showp...3&postcount=10</a>
Anyone?

tnguy3n
10-11-2005, 01:32 AM
is that the error message when got when you ran the query? :question:

michaelbenson
10-11-2005, 02:22 PM
this plugin is written for vb 3.5, not an update or port of any hack. Check if the hack you installed coincidently had the field name, then you don't have to alter user table, and it would calculate your time rather than new time of this plugin.
Well there is a vb 3.0.X modification pretty identical
https://vborg.vbsupport.ru/showthread.php?t=60488&highlight=Total+Time+Spent+Forums

Just assumed this was an update of this version.

TygerTyger
10-11-2005, 04:43 PM
I've installed it in memberinfo_complete and it seems to be running fine, but it's simply displaying the time spent as numbers, without hours/seconds or whatever. It simply says time spent: 644

Any idea what the problem might be?

tnguy3n
10-12-2005, 03:01 PM
I've installed it in memberinfo_complete and it seems to be running fine, but it's simply displaying the time spent as numbers, without hours/seconds or whatever. It simply says time spent: 644

Any idea what the problem might be?

check first post. I updated to show user's spent time in profile.

live demo: http://192.168.1.101/vb35/member.php?find=lastposter&f=2

TygerTyger
10-12-2005, 03:11 PM
Works perfectly, thank you very much sir.

I assume the SQL add. is still needed, in which case might be an idea to include it in the Profile version instructions.

I'm not sure if the demo URL is supposed to be based at what appears to be a localhost address lol, but at any rate it doesn't load anything.

Lea Verou
10-12-2005, 03:13 PM
It doesn't work for me :(
No errors but it shows nothing...

tnguy3n
10-12-2005, 03:18 PM
It doesn't work for me :(
No errors but it shows nothing...

That would be correct. You still need to add timeonboard column in user table as in the original hack.

Lea Verou
10-12-2005, 03:20 PM
So the recording will start AFTER I install the hack?? vB doesn't record it?
Cause then the result wouldn't be correct!

tnguy3n
10-12-2005, 03:22 PM
It doesn't work for me :(
No errors but it shows nothing...

did you modify your template?

Lea Verou
10-12-2005, 03:26 PM
did you modify your template?

I did. I probably have to run the query.
But before I do it,. please tell me how the recrding is done. Does this hack record it, so it starts recording AFTER its installation or vB records it and the hack just "grabs" the info?

tnguy3n
10-12-2005, 03:33 PM
I did. I probably have to run the query.
But before I do it,. please tell me how the recrding is done. Does this hack record it, so it starts recording AFTER its installation or vB records it and the hack just "grabs" the info?

start recording after installation of the hack, cuz vbulletin doesn't keep track on when/how long users login.

Lea Verou
10-12-2005, 03:40 PM
start recording after installation of the hack, cuz vbulletin doesn't keep track on when/how long users login.

Then it's not an accurate measure.
Sorry, I'll uninstall :/

tnguy3n
10-12-2005, 03:43 PM
get no errors all went well but get no info looks as if nothing changed?

refresh the page or try to logout then login to see it.

Gizmo5h1t3
10-12-2005, 04:09 PM
installed, works a treat.

/me clicks install

exceem
10-13-2005, 07:56 AM
Ive had to temp uninstall this, i started to get a few random 1 off mysql errors, and the last thing I changed was this hack, going to leave it a few days and see what happens, anyone else getting errors?

tnguy3n
10-13-2005, 10:01 AM
and what error you got?

eXtremeTim
10-13-2005, 01:20 PM
How about an avg time per day spent ;)

tnguy3n
10-13-2005, 04:06 PM
How about an avg time per day spent ;)

$average = (TIMENOW - $post[joindate])/86400;

exceem
10-13-2005, 04:22 PM
and what error you got?
Here is what i got, got around 60 in all

Database error in vBulletin 3.5.0:

Invalid SQL:

SELECT
thread.threadid, post.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, thread.lastposter, thread.lastpost, IF(views<=thread.replycount, thread.replycount+1, views) AS views, thread.forumid, post.postid, pagetext, allowsmilie, forum.title AS forumtitle




FROM vb3_thread AS thread
LEFT JOIN vb3_forum AS forum USING (forumid)
LEFT JOIN vb3_post AS post ON (post.postid = thread.firstpostid)





LEFT JOIN vb3_deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread')
WHERE thread.threadid IN(2258,2396,2370,2343,2307,2301,2263,2173,2090,20 66)

GROUP BY post.postid
ORDER BY sticky DESC,thread.dateline DESC
LIMIT 10;

MySQL Error : Can't create/write to file '/tmp/#sql_7328_0.MYI' (Errcode: 13) Error Number : 1
Date : Tuesday, October 11th 2005 @ 12:37:44 PM
Script : http://www.exceem.co.uk/index.php
Referrer :
IP Address : IPADDRESSREMOVED
Username : Unregistered
Classname : vB_Database



had no errors today, going to reinstall tomorrow and moniter what happens

Bones_3DFC
10-13-2005, 07:43 PM
To undo the query can we simply run a new query with "drop?"
Example:
ALTER TABLE `VB_user` DROP `timeonboard` INT( 10 ) NOT NULL AFTER `lastactivity` ;

curriertech
10-13-2005, 08:19 PM
How hard would it be to let users decide if they want this to show, instead of it being forum-wide? I have a rather tempermental group on my hands, and while some really like this feature, others are crying about it already. :)

tnguy3n
10-13-2005, 09:30 PM
Here is what i got, got around 60 in all


had no errors today, going to reinstall tomorrow and moniter what happens

from the error warning, it must be some other hacks causing that because this hack has nothing to do with showthread or viewing forum query. It only updates the 'timeonboard' field in user table.

tnguy3n
10-13-2005, 09:31 PM
To undo the query can we simply run a new query with "drop?"
Example:
ALTER TABLE `VB_user` DROP `timeonboard` INT( 10 ) NOT NULL AFTER `lastactivity` ;

yup, and reverse your modified file. :)

tnguy3n
10-13-2005, 09:33 PM
How hard would it be to let users decide if they want this to show, instead of it being forum-wide? I have a rather tempermental group on my hands, and while some really like this feature, others are crying about it already. :)

Just simply add an additional field which give users an options whether to show that or not. Then in plugin, put a condition to check whether to show it. :)

tanyeri24
10-13-2005, 11:46 PM
is there any way to display a "top 10 list of the time spent online" ?
is there?

exceem
10-14-2005, 05:57 AM
from the error warning, it must be some other hacks causing that because this hack has nothing to do with showthread or viewing forum query. It only updates the 'timeonboard' field in user table.
The only other hacKs i have installed is vbadvanced, and a "whos visited today"

Ill reinstall today and see what happens, had it just been over1 day I would have put it down to a server glitch, but over 3 days it woudl be something else :ermm:

eXtremeTim
10-14-2005, 06:37 AM
$average = (TIMENOW - $post[joindate])/86400;

Umm that wont work quite right lol. That would give me the number of days they have been registered. ;)

Now I think I see what your saying lol. Your giving me a way to get to the solution. ;)

I didnt need any help there lol I was just more or less trying to suggest it as a feature becuase the 3.0.x version had it as a feature. ;)

tnguy3n
10-14-2005, 01:41 PM
Umm that wont work quite right lol. That would give me the number of days they have been registered. ;)

Now I think I see what your saying lol. Your giving me a way to get to the solution. ;)

I didnt need any help there lol I was just more or less trying to suggest it as a feature becuase the 3.0.x version had it as a feature. ;)

lol... my bad.
try:
$average = $post[timeonboard]/((TIMENOW - $post[joindate])/86400);

GamerJunk.net
10-25-2005, 10:59 AM
Sorry if this has been asked before, but does this also include time spent in the admincp?

Rickie3
11-03-2005, 08:41 AM
i have this installed great hack,i have it showing in post bit,is there any way you can get it to show in member list as well?

Rickie3
11-06-2005, 09:23 AM
"bump" anyone please

funinthesun
11-06-2005, 01:08 PM
I've installed the timeonboardinprofile but nothing shows up? Do I have to install the totaltimeonboard as well? :confused:

007
11-07-2005, 02:03 AM
Um, why is this listed as an Extension when it requires a file edit of class_core.php? A little disapointing to find out after downloading. :( Is there any way this will be possible without file edits in the future?

fiber_cut
11-07-2005, 04:15 AM
I installed this and done as it says I cant get it to display the timespent..

any ideas?

funinthesun
11-07-2005, 08:53 AM
I've installed the timeonboardinprofile but nothing shows up? Do I have to install the totaltimeonboard as well? :confused:

Smitty
11-07-2005, 09:34 AM
I've installed the timeonboardinprofile but nothing shows up? Do I have to install the totaltimeonboard as well? :confused:

Appears it's not supported...

funinthesun
11-07-2005, 03:47 PM
So does anyone have any ideas as to why nothing is showing up then?

tnguy3n
11-15-2005, 01:22 AM
i have this installed great hack,i have it showing in post bit,is there any way you can get it to show in member list as well?

you don't have to install both, but if you install totaltime in profile, you have to insert the query which add a new column timeonboard or you might even get database error.
here's the query:
ALTER TABLE `user` ADD `timeonboard` INT( 10 ) NOT NULL AFTER `lastactivity`;

tnguy3n
11-15-2005, 01:26 AM
i have this installed great hack,i have it showing in post bit,is there any way you can get it to show in member list as well?

Rickie,

you can copy the function to convert times in seconds (timeonbaord) to its proper display, then create a new plugin in memberlist (probably), and change:
$post['timeonboard'] = ....
to
$userinfo['timeonboard'] = ...

in your memberlist template,
add $userinfo[timeomboard] to where you want it to show.


And sorry folks, I barely got any bare time, so support for this hack is very limited.

puertoblack2003
11-19-2005, 12:24 AM
great Hack *******INSTALLED**** no problems

board.trash
11-25-2005, 02:21 PM
another nice hack from my friend tnguy3n :)

Thx ( clicks install )

MissKalunji
11-26-2005, 12:50 AM
nuthing showing for me......

tnguy3n
11-26-2005, 01:44 AM
@ board.trash: thanks, mate.

@ MissKalunji: try to add modify both postbit and postbit_legacy templates.

MissKalunji
11-26-2005, 02:06 AM
@ board.trash: thanks, mate.

@ MissKalunji: try to add modify both postbit and postbit_legacy templates.


im trying on the member info page....

tnguy3n
11-26-2005, 02:10 AM
im trying on the member info page....

It was meant to be an add-on for the Total Time Spent On Forums; however, if you want to install it as a stand-alone, you have to run the following query:
ALTER TABLE `user` ADD `timeonboard` INT( 10 ) NOT NULL AFTER `lastactivity`;

MissKalunji
11-26-2005, 02:53 AM
It was meant to be an add-on for the Total Time Spent On Forums; however, if you want to install it as a stand-alone, you have to run the following query:
ALTER TABLE `user` ADD `timeonboard` INT( 10 ) NOT NULL AFTER `lastactivity`;


not working thanks anyway

ImportPassion
11-29-2005, 02:54 AM
couldn't this be put in a plugin and called on init_startup?


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 timeonboard = timeonboard + $newtime
WHERE userid = " . $this->userinfo['userid']."");


or am i way off base?

Chris M
12-01-2005, 06:41 AM
Moved to correct forum :)

Chris

nintendo
12-03-2005, 09:05 PM
If you get..

You have to choose at least one Column to display

in phpMyAdmin, go to 'user' then use the 'Run SQL query/queries on database' form there, at the bottom

kahmeal
12-07-2005, 04:00 PM
Trying to install this hack but even with all the lines uncommented in total_time_on_board.xml I am only getting a large number like Total Time Spend On Board: 2053

The user table has been modified to include a timeonboard column, it seems like the plugin isn't doing the calculations/formatting at all... Any ideas?

hotwheels
12-28-2005, 06:44 PM
Thanks man, great hack.......... Hotwheels clicks *install*

Ragnarok
12-31-2005, 06:50 AM
Trying to install this hack but even with all the lines uncommented in total_time_on_board.xml I am only getting a large number like Total Time Spend On Board: 2053

The user table has been modified to include a timeonboard column, it seems like the plugin isn't doing the calculations/formatting at all... Any ideas?
Planning to install, any chance of a fix for this? I get the same problem.

Rickie3
01-07-2006, 10:30 AM
ive had this hack installed for a while now,but for some unknown reason it has stalled,meaning my time online hasnt changed for the past week,has remained the same for over a week and not updating,any advise appreciated

lifesourcerec
01-07-2006, 05:29 PM
I've installed it in memberinfo_complete and it seems to be running fine, but it's simply displaying the time spent as numbers, without hours/seconds or whatever. It simply says time spent: 644

Any idea what the problem might be?

I'm having this same issue.

IrPr
01-11-2006, 11:25 PM
I'm having this same issue.

make sure that u upload plugins

peterska2
01-11-2006, 11:35 PM
ive had this hack installed for a while now,but for some unknown reason it has stalled,meaning my time online hasnt changed for the past week,has remained the same for over a week and not updating,any advise appreciated

Let me see......

* peterska2 gazes into crystal ball

You upgraded to 3.5.3
Your times stopped
You didn't re-apply the one code modification.




Don't worry, I do it every time.

lifesourcerec
01-12-2006, 01:56 AM
make sure that u upload plugins

They are uploaded to includes/xml/ and still same results. Everything seems to be in seconds.

Rickie3
01-12-2006, 04:33 AM
Let me see......

* peterska2 gazes into crystal ball

You upgraded to 3.5.3
Your times stopped
You didn't re-apply the one code modification.




Don't worry, I do it every time.
no i didnt upgrade,i installed another hack that required to edit the class_core.PHP,i FTP the file incorrectly lol,all is good now

IrPr
01-12-2006, 08:16 AM
They are uploaded to includes/xml/ and still same results. Everything seems to be in seconds.

same problem here untill re-uploading plugins

make sure u uploaded total time on board.zip plugin

IrPr
01-12-2006, 08:23 AM
Let me see......

* peterska2 gazes into crystal ball

You upgraded to 3.5.3
Your times stopped
You didn't re-apply the one code modification.




Don't worry, I do it every time.

one question
upgrading will lost 'timeonboard' field in 'user' table ?

another1
is it possible to make this without code modification ? a hook plugin or an extension is more stable than code modification

peterska2
01-12-2006, 10:27 AM
It doesn't lose the data, just the bit in the code edit that tells it to add to it.

I believe earlier in the thread someone else asked the same thing and the reply from the author was no due to the nature of the edit.

lifesourcerec
01-12-2006, 01:35 PM
same problem here untill re-uploading plugins

make sure u uploaded total time on board.zip plugin

re-uploaded the plugins 4 times. Still same thing.

lifesourcerec
01-12-2006, 02:37 PM
Here is the part I need to know... in the instructions, it says:


UPLOAD timeonboard.xml plugin


yet, the file is named, "total_time_on_board.xml"

Would that make any difference?

Megareus Rex
01-23-2006, 02:57 PM
Question.

Is there a way to edit exactly how this hack displays the time spent? Like, to change it from using abbreviations to the full words, and adding commas between the different measures of time?

Right now, for me, it displays it like this:
Time spent in the forum:
2 month 0 week 1 day

But I want to have it as:
Time spent in the forum:
2 months, 0 weeks, 1 day

Also, is there a way so it gives the plural of the word if the amount is not 1? And to skip a measure of time if its 0, so it would display like this:
Time spent in the forum:
2 months, 1 day, X hours

fridayweb
01-28-2006, 04:36 PM
I have added everything and it works great, and I too am interested in Megareus Rex's suggestion. I went into the Total Spent Time On Board In Profile plug-in and added 's's and commas to the different words, but I would like there to be a way to show just 'day' instead of 'days' if it is only one, etc.

If this is too much work, then it's not that big a deal. ;)

interceptor
01-31-2006, 11:41 PM
works great.

"Installed"

lifesourcerec
02-02-2006, 03:30 PM
same problem here untill re-uploading plugins

make sure u uploaded total time on board.zip plugin

uploaded the xml file over and over again and still doesn't work.

Megareus Rex
02-11-2006, 09:48 PM
So, any advancement on the changes I suggested...?

ctsolutions
02-13-2006, 03:02 AM
works like a charm, thanks.

Installed

mike

ctsolutions
02-16-2006, 03:24 PM
is there any way to display a "top 10 list of the time spent online" ?



BUMP !!!

Luggruff
02-17-2006, 10:42 AM
is this hack showing how long a user has been logged on the last time, or how long he/she has been logged on no matter if he/she logs out/in?

vietkieu_cz
02-17-2006, 06:59 PM
CHo hỏi làm sao để remove
các Query vậy?

ALTER TABLE `user` ADD `timeonboard` INT( 10 ) NOT NULL AFTER `lastactivity`;

Cách remove thì như thế nào?

Megareus Rex
02-17-2006, 07:28 PM
is this hack showing how long a user has been logged on the last time, or how long he/she has been logged on no matter if he/she logs out/in?

It shows the total time a user has spent logged in on the board since either the hack's installation, or their join date (if they joined after it was installed).

gtsch
02-17-2006, 09:13 PM
When I attempt to run an SQL query it says I'm not authorized, WTF? Am I doing that right?

Rickie3
02-22-2006, 09:43 PM
one of members has brought to my attention that his time on board has decreased,he hadnt been online for 3 days,does this hack drop time online if he hasnt been online

Rickie3
02-23-2006, 08:05 AM
ok for some unknown reason the timeonline has stalled completely,and i have not upgraded my board or made any changes

Satjunkies
03-09-2006, 03:58 AM
For some of you that have install it and cant see...remember you are installing it to the postbit legacy, and have to change it in vbull options to refelct that.

mvolking
03-12-2006, 02:44 AM
I installed the plug in, modified the MEMBERINFO template, and ran the query; I am still not getting anything in the profile!?! Any help??

mvolking
03-12-2006, 08:14 AM
When I attempt to run an SQL query it says I'm not authorized, WTF? Am I doing that right?

You have to make sure that your userid# has permission in the config.php file.

Virtuosofriend
03-20-2006, 09:41 PM
Did everyone else freeze after upgraded to 3.5.4?

mvolking
03-21-2006, 01:56 AM
Did everyone else freeze after upgraded to 3.5.4?

I'm running 3.5.4 and no problems.

Virtuosofriend
03-21-2006, 04:14 PM
Hmmm.Do you have to edit a php file or something?
Query: 1
File modification: 1
Plugins: 2
Template mod: 2

Can you post here the file modification,if any,it seems it is not in the instructions.

hotwheels
03-24-2006, 07:48 PM
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: [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 --- >

lifesourcerec
03-25-2006, 03:56 PM
It's still not calculating into days, hours, etc. and I've uploaded the plugin.

xlegends
03-25-2006, 05:32 PM
For Those Not using Postbit Legacy and using postbit only. Basically modified postbit same way

########## TEMPLATE MOD ############

In postbit,

FIND:

<div>
$vbphrase[posts]: $post[posts]
</div>


BELOW, ADD:

<div>
<strong>Time spent on board:</strong><br /> $post[timeonboard]
</div>

<! --- all done --- >

Virtuosofriend
03-29-2006, 04:38 PM
here ya go:
thanks very much.It seems i had some problems reading the readme text ;x

deeps_ar
03-29-2006, 04:48 PM
Is this working now? Can I go ahead and install it?

---MAD---
04-10-2006, 07:23 AM
does this work on 3.5.4?

speedracer68
04-10-2006, 10:50 PM
I too have the same question. Does it work in 3.5.4? I'm sure some of the guys on my site will be shocked. Also, is the count retroactive or only from the point I install it and on?

Rahuldhanpat
04-11-2006, 12:30 PM
Ok frineds......help me here ....

I m sending my class_core.php plz edit it according to above said and plz give me again......i tried but some error came and my stop to function plz help me :)

And also tell me where to write query"don't mind i m new to this"Learning:)

Rahuldhanpat
04-11-2006, 04:41 PM
still no replies

Rahuldhanpat
04-11-2006, 04:41 PM
Plz send me this file via link .... PM me plz...

Rahuldhanpat
04-11-2006, 05:42 PM
i m not able to run the queries even i made changes in the config.php

// ****** USERS WITH QUERY RUNNING PERMISSIONS ******
// The users specified here will be allowed to run queries from the control panel.
// See the above entries for more information on the format.
// Please note that the ability to run queries is quite powerful. You may wish
// to remove all user IDs from this list for security reasons.
$config['Admin']['canrunqueries'] = '';

// ****** UNDELETABLE / UNALTERABLE USERS ******
// The users specified here will not be deletable or alterable from the control panel by any users.
// To specify more than one user, separate userids with commas.
$config['Admin']['undeletableusers'] = '';

// ****** SUPER ADMINISTRATORS ******
// The users specified below will have permission to access the administrator permissions
// page, which controls the permissions of other administrators
$config['Admin']['superadministrators'] = '1';

Even now same prob...... I m not authorized to run query....

YOimYO
04-13-2006, 11:19 AM
Just installed on 3.54.

Not working.

did all template edits, data base changes, and plugin uploads.

time on board remains at 0 forever :p


any suggestions ?


thx :D



EDIT :

OK found me prob. nvm ;)

works perfect on 3.54 ;)


thanks alot for the usefull hack :)

jodycwilliams
04-24-2006, 01:54 PM
What'd you do to fix it, cause I'm having the same problems? I have the sucker installed per instructions but getting jack to display on the my template.

Thankfully, it is recording the time spent on boards into the DB already, just need to get it to display now.

jodycwilliams
04-24-2006, 06:33 PM
Fixed already, thanks anyhow :P

Great hack. Not the most fun install, but well worth it.

tanyeri24
05-04-2006, 12:33 AM
it stopped to count immediately hmm I had no changes in templates and no changes at plugin. I checked the installation again but all fine still stopped to count, is there an answer?
thanks in advance

lifesourcerec
05-08-2006, 07:37 AM
Still does it in seconds and xml file is not converting to days, hours, seconds. Guess I uninstall.

JohnBee
05-08-2006, 12:08 PM
Hmm installed on 3.5.4

Only the profile version, no display.
Added the query - still nothing.
Installed the original .xml hoping it would spark a response (no go)
Remove the conditional to force display in profile template, I get the writting but no data is display'd

Very odd...

I'll uninstall it unti its sorted out. Nice idea though. I can't wait to use it :)

How can we remove the Query?
ALTER TABLE `VB_user` DROP `timeonboard` INT( 10 ) NOT NULL AFTER `lastactivity` ; (Does not work)

JohnBee
05-08-2006, 12:43 PM
Update...

Okay its working now.

For the exclusive profile option to work the "file edits to includes/class_core.php"
need to be completed otherwise the $timeonboard variable will be blank.

Also I could not get the <if condition="$userinfo['timeonboard']"> to work. I removed it as a temporary fix but I would like to know how to get it working properly.

rmxs
05-12-2006, 07:25 AM
Someone plz update this to 3.5.4??

I cant make it to work..

TTG
05-12-2006, 10:18 AM
Someone plz update this to 3.5.4??

I cant make it to work..

Works fine on my 3.5.4 .. re-check your edits

MustangLisa
05-13-2006, 02:12 PM
I too have the same question. Does it work in 3.5.4? I'm sure some of the guys on my site will be shocked. Also, is the count retroactive or only from the point I install it and on?

I'm wondering the same thing. Would be cool if it was retro since the user registered. Can anybody answer this before I install?

Thanks!

hotwheels
05-14-2006, 12:16 AM
I am not sure if it goes back at all, but i do know that it works on 3.5.4........

halpern
05-14-2006, 03:49 AM
I am a little confused as to how to apply this mod. How and where do you run the SQL query? Also, when I try to search for:

########## TEMPLATE MOD ############

In postbit(_legacy),

FIND:

<div>
$vbphrase[posts]: $post[posts]
</div>

It does not find it. Any help please this is a great hack..Thanks!

JD45
05-15-2006, 07:43 PM
Can't get it to display. Tried all the edits, added the plugin and ran the sql query....

uninstalled

halpern
05-16-2006, 01:48 AM
How do you run the sql query within Admin control panel? I am kind of lost..thanks

JD45
05-16-2006, 08:26 PM
How do you run the sql query within Admin control panel? I am kind of lost..thanks

AdminCP>Maintenance>Run SQL Query

xbits1982
05-23-2006, 07:55 AM
will it work for 3.5.4 ?

peterska2
05-23-2006, 09:08 AM
Yes, it works with 3.5.4

It only starts counting from when it is installed, not from when the site was started.

serhat_kk
05-23-2006, 08:25 PM
Query gives
"Duplicate column name 'timeonboard'" :S

how do i fix ?
thanks

Raptor
05-29-2006, 01:45 PM
yes this work on 3.5.4

HOWEVER it resets the time to 0 when you log off andlog back on - anyway to make this keep total time added each time you log off log on ?

serhat_kk
06-01-2006, 10:17 PM
Query gives error
"Duplicate column name 'timeonboard'" :S

how do i fix ?
thanks

peterska2
06-01-2006, 11:59 PM
Have you previously installed this on a different vB version?

If you are upgrading your vB then you do not need to re-run the query, just reapply the file edits.

redlabour
06-08-2006, 04:08 PM
Will it work in the Future with vBulletin 3.6 (http://www.vbulletin.com/forum/showthread.php?t=187654) ?

DannyBoy8406
06-23-2006, 07:22 PM
Installed and working wonderfully on 3.5.4!!!

Is there a way to add a feature showing a list of like the top X people for online time?

rgbivens
06-25-2006, 03:09 AM
Installed and working wonderfully on 3.5.4!!!

Is there a way to add a feature showing a list of like the top X people for online time?
I guess the guy is no longer supporting this...

I also want to do the same thing so I put in a request here:
https://vborg.vbsupport.ru/showthread.php?p=1015855#post1015855

-Grant

zippokid
06-25-2006, 08:25 AM
FYI after I installed this, my provider suspended my account for too much php/sql activity

G_Man
06-25-2006, 02:23 PM
Installed and working wonderfully on 3.5.4!!!

Is there a way to add a feature showing a list of like the top X people for online time?



I would like to see it in the Memberlist...

Mr.D
07-10-2006, 08:57 AM
3.6 Version would it be ?

alfaowner
07-15-2006, 09:57 PM
If it stopped like mine did, just re edit the class core, worked for me!

Veer
08-04-2006, 06:33 PM
Can't get it to display. Tried all the edits, added the plugin and ran the sql query but found error in query, saying `user` table not exist :(

I uninstalled.

mrmike
08-13-2006, 08:15 AM
Same for me, but I change the `user` to `vbuser` (cause vb is my prefix) and that worked for me!

Good luck!

-->Clicking install ;)<---


Can't get it to display. Tried all the edits, added the plugin and ran the sql query but found error in query, saying `user` table not exist :(

I uninstalled.

shoupz
08-21-2006, 10:26 AM
just installed both, seems to be working perfect.

*shoupz clicks install

mrmike
08-23-2006, 01:30 PM
Is there any chance to make this work with vbux, and earn point per online minutes, days, weeks and so on... Like 1 point per minute online. Would be great! :laugh:

lifesourcerec
08-23-2006, 03:34 PM
It doesn't convert it to days and hours etc., just posts this:


Time spent on board:
95642

lifesourcerec
08-23-2006, 03:46 PM
Query gives error
"Duplicate column name 'timeonboard'" :S

how do i fix ?
thanks

Go into phpAdmin and click on user table, scroll down to see if timeonboard column is listed already.

hotwheels
10-04-2006, 11:55 PM
Works On 3.6

lifesourcerec
10-12-2006, 06:18 PM
Ok, still not converting, and it doesn't show up in plugin manager. Is there a way to manually add it?

Gazer
10-26-2006, 12:01 PM
Works On 3.6

How did you get this to work on 3.6 ??? as mine as just stuck in time :disappointed:

hotwheels
10-26-2006, 01:45 PM
i just followed the instruction's, and it worked

vbreal
11-14-2006, 02:53 AM
works on 3.6.3 for me

wolfe
03-21-2007, 08:15 PM
hi m8 is there any way of this mod working like the old one a while back.

so it allways shows

xx Days, xx Hrs, xx Mins

only no wks, mnths, yrs or secs etc just then and i need it to show days even if it is 0

like

0 Days, 0 Hrs, 21 Mins

thx in advance

wolfe
03-22-2007, 10:30 AM
also i removed this mod by mistake and now theres no product file and the mod aint working no more ?