vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Total Time Spent On Forums (https://vborg.vbsupport.ru/showthread.php?t=97830)

tnguy3n 10-06-2005 10:00 PM

Total Time Spent On Forums
 
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:
PHP Code:

ALTER TABLE `userADD `timeonboardINT10 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 !

Quote:

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 :-

Quote:

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

Quote:

<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

Quote:

Originally Posted by FleaBag
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

Quote:

Originally Posted by Danieldude
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

Quote:

Originally Posted by Loukrhtia
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

Quote:

Originally Posted by tnguy3n
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

Quote:

Originally Posted by tnguy3n
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?

[edit]

fixed had to edit the sql to include my table prefix[/edit]

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

Quote:

Originally Posted by michaelbenson
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

Quote:

Originally Posted by tnguy3n
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/showthrea...e+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

Quote:

Originally Posted by TygerTyger
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...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

Quote:

Originally Posted by Loukrhtia
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

Quote:

Originally Posted by Loukrhtia
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

Quote:

Originally Posted by tnguy3n
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

Quote:

Originally Posted by Loukrhtia
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

Quote:

Originally Posted by tnguy3n
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

Quote:

Originally Posted by smokering
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

Quote:

Originally Posted by eXtremeTim
How about an avg time per day spent ;)

PHP Code:

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


exceem 10-13-2005 04:22 PM

Quote:

Originally Posted by tnguy3n
and what error you got?

Here is what i got, got around 60 in all
Quote:

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


All times are GMT. The time now is 05:46 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01446 seconds
  • Memory Usage 1,828KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (20)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete