vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   [VB3 RC3] Board Spent Time (https://vborg.vbsupport.ru/showthread.php?t=60488)

Kentaurus 01-21-2004 06:10 PM

Quote:

Originally Posted by mharmon
kentaurus ---

thanks for ther quick reply. I did that query and it didn't give me an error -- although now it still says <1 for both entries on the site.

any suggestions?

That query resets both the average time and the total time. The average time is not stored, it is calculated.

Maybe I should explain how I the average time works, as the < 1 sec might not be a problem at all. The average time is calculated by

time spent on board / days since you registered

that is, if you have been on the board for 50 minutes and you registered 2 days ago the average time would be 25 minutes. If you don't login for two days your average time drops to 12 minutes since you have 4 days registered.

In that case since this hack is new you may have very small total time spent, maybe your user has 10-20 minutes. If you registered a year ago that is 10 minutes / 365 days.. that is a very low number and maybe less than 1.

This is also how the average post count in the forum works, it makes a total posts / days since you registered

mharmon 01-21-2004 06:13 PM

kentaurus :

how often does it update the "time spent in foruns" field?

Zeitgeist 01-21-2004 06:17 PM

Quote:

Originally Posted by mharmon
kentaurus :

how often does it update the "time spent in foruns" field?

Everytime you click on a link in the forum.

GamerzWorld 01-21-2004 06:49 PM

It wont work for Rc3 for me

mharmon 01-21-2004 11:33 PM

Same here...

I actually got mine to say "2" instead of <1 but it never goes above that.. any suggestions guys?? I have to get this hack working! :)

eXtremeTim 01-22-2004 12:05 AM

Quote:

Originally Posted by kentaurus
Actually it's a good idea.

I would like to know if you want it into the memberlist (you see an extra "time spent" column in memberlist and can sort by it) or as a separate page.

Second page would be better. There enough stuff on the member list as it is.

Kentaurus 01-22-2004 08:52 AM

Quote:

Originally Posted by GamerzWorld
It wont work for Rc3 for me

Did you re-made all the file changes for RC3? It's working in my RC3 board.

mharmon, could you give me the registered date and total spent time for the user that appears with "2"?

mharmon 01-22-2004 02:13 PM

There comes a time in every man's life that he must admit he is a dumb ass.

I was changing the wrong line in sessions.php . . . It works great when you change the right one.

Thanks for this great hack! :)

Oblivion Knight 01-23-2004 07:17 PM

Working great for me on RC3, thanks kentaurus.! :)

Kentaurus 01-25-2004 04:55 AM

An update for this one. Some extra modifications that will let you add the board spent time (total and average) to the memberlist. You can also sort by it to see who is the user with most board spent time.

mharmon 01-25-2004 05:16 AM

kentaurus --

it's working great for me now -- is there anyway to take out the "seconds" though on the display in the forums?

mharmon 01-25-2004 06:04 AM

[quoute]test[/quote]

mharmon 01-25-2004 06:04 AM

Quote:

test

Apostle 01-25-2004 10:33 AM

It uh... doesn't work for me :(
I've got it installed on my forums (www.theapostleofgod.com/forums).

I'm using RC3. I followed the instructions, made the postbit changes, updated the sql db, updated all the files, uploaded them all.

I just can't figure out what I'm doing wrong. I dont' get anny errors, but I don't see the time online :(

--Sadly, I have to take this hack out, it has affected new user registration :(

Me2Be 01-25-2004 03:06 PM

Is there a way to remove this from being shown for administrators?

Kentaurus 01-25-2004 03:35 PM

Quote:

Originally Posted by Apostle
It uh... doesn't work for me :(
I've got it installed on my forums (www.theapostleofgod.com/forums).

I'm using RC3. I followed the instructions, made the postbit changes, updated the sql db, updated all the files, uploaded them all.

I just can't figure out what I'm doing wrong. I dont' get anny errors, but I don't see the time online :(

--Sadly, I have to take this hack out, it has affected new user registration :(

You don't seem to have it installed in that URL. The postbit/memberinfo templates show nothing about the users. At the very least it should show < 1 sec. Maybe it is the template modifications?

I don't see how it could break new user registration. It doesn't modify the register.php at all.

Kentaurus 01-25-2004 03:37 PM

Quote:

Originally Posted by Me2Be
Is there a way to remove this from being shown for administrators?

In the postbit template you might have added something like:

Code:

Time in board: $post[timespent]
Change it to:

Code:

<if condition="$post[usergroupid]!=6">
Time in board: $post[timespent]
</if>

Then it is not shown for the administrators

eXtremeTim 01-25-2004 03:47 PM

lets try </if> instead of /if>

eXtremeTim 01-25-2004 04:09 PM

Quote:

Originally Posted by kentaurus
An update for this one. Some extra modifications that will let you add the board spent time (total and average) to the memberlist. You can also sort by it to see who is the user with most board spent time.

Its working great thanks :)

Kentaurus 01-25-2004 04:13 PM

Quote:

Originally Posted by eXtremeTim
Its not working.

Works in my forum. You remembered to go to ACP and check that Board Spent Time checkboxes, right? :)

Kentaurus 01-25-2004 04:17 PM

Quote:

Originally Posted by mharmon
kentaurus --

it's working great for me now -- is there anyway to take out the "seconds" though on the display in the forums?

To get rid of the "seconds" part:

In the hack:

Code:

if ($time <= 1)
  {
  return $ignoredefault ? "" : $vbphrase['less_than_1_second'];
  }
  else if ($time < 60) // 60 is not still a minute
  {
  return $time." ".$vbphrase['seconds'];
  }

change it to

Code:

  if ($time < 60)
  {
  return $ignoredefault ? "" : "< 1 min";
  }


eXtremeTim 01-25-2004 04:21 PM

Quote:

Originally Posted by kentaurus
Works in my forum. You remembered to go to ACP and check that Board Spent Time checkboxes, right? :)

I had fixed it already :).

Kentaurus 01-25-2004 05:18 PM

Quote:

Originally Posted by eXtremeTim
I had fixed it already :).

Care to share what was it? ;)

AutomatikStudio 01-25-2004 07:09 PM

This is rather odd. I had a someone just join and in their profile it says

Time spent in forums: 1 Minute 32 Seconds
Average time: 11 Hours 2 Minutes 24 Seconds

Now...maybe I missed something...but how does only being in the forums for a total of 1 min. and 32 seconds make a total average of over 11 hours?

mharmon 01-26-2004 03:10 AM

kentaurus -- taking the seconds out worked fantastic -- thanks. :)

eXtremeTim 01-26-2004 03:23 AM

Quote:

Originally Posted by kentaurus
Care to share what was it? ;)

ftp client locked up

eXtremeTim 01-26-2004 03:24 AM

Quote:

Originally Posted by mharmon
kentaurus -- taking the seconds out worked fantastic -- thanks. :)

Its becuase they have not been registered a day. So they out of say maybe the hour they have been registered that much time on would give a much higher avg time.

Codeman05 01-26-2004 11:07 PM

Ok well I installed this and all the querys...both fields still say <1 :(
Any ideas? I did edit the right line btw in sessions.php ;)

btw were are these boxes you speak of:
Quote:

Originally Posted by kentaurus
Works in my forum. You remembered to go to ACP and check that Board Spent Time checkboxes, right? :)


Codeman05 01-27-2004 01:06 AM

lmao wow I'm an idiot...upgraded from RC2 -> RC3 and it works fine :)

GREAT hack works perfect :D

mharmon 01-27-2004 07:35 PM

Any update on why in private messages it shows a long number instead of the Days, etc...?

Kentaurus 01-27-2004 07:50 PM

Quote:

Originally Posted by mharmon
Any update on why in private messages it shows a long number instead of the Days, etc...?

In includes/functions_showthread.php

find:
Code:

                // format posts number
                $post['posts'] = vb_number_format($post['posts']);

change it to:
Code:

                // Hack: get the timespent and avgtimespent
                $post['avgtimespent'] = explain_time(floor($post['timespent']/((TIMENOW-$post['joindate'])/86400)));
                $post['timespent'] = explain_time($post['timespent']);

                // format posts number
                $post['posts'] = vb_number_format($post['posts']);


mharmon 01-28-2004 12:33 AM

worked great. thanks for kentaurus

mharmon 01-28-2004 12:49 AM

Actually this didn't work. It fixed the private message problem -- but it then made all the time counts in the threads say <1

Kentaurus 01-28-2004 03:32 AM

Quote:

Originally Posted by mharmon
Actually this didn't work. It fixed the private message problem -- but it then made all the time counts in the threads say <1

Oops, I modified the hack, removed some code and somehow forgot to tell that. If you change that code in functions_showthread now the modifications done in showthread.php should now be undone. That is delete in showthread.php the two ocurrences of

Code:

$post['avgtimespent'] = explain_time(floor($post['timespent']/((TIMENOW-$post['joindate'])/86400)));
$post['timespent'] = explain_time($post['timespent']);

they are no longer needed since now it is done in the functions_showthread part, that also adds compatibility with the private messages and wherever else you use a postbit.

mharmon 01-28-2004 03:38 AM

Kentaurus --

That fixed it.. sorry for being such a pest on this -- it's just such a cool addition. :)

mharmon 01-29-2004 06:50 PM

I found another small bug. If someone has been on the forums 2 Days and 15 minutes for example, it says:

2 Day 15 Minutes

It leaves off the "s" for Days

Kentaurus 01-30-2004 12:36 AM

Quote:

Originally Posted by mharmon
I found another small bug. If someone has been on the forums 2 Days and 15 minutes for example, it says:

2 Day 15 Minutes

It leaves off the "s" for Days

That's right.. I don't know how I didn't spot it. Here is how to fix it.

In the includes/functions_showthread.php

find
PHP Code:

        else
        {
return 
$newtime." ".$vbphrase['day']." ".explain_time($time%86400,true);        
        } 

change it to:
PHP Code:

        else
        {
return 
$newtime." ".$vbphrase['days']." ".explain_time($time%86400,true);        
        } 

That is just adding an "s" to day

The txt is already updated

mharmon 01-30-2004 01:07 AM

kentaurus -- i'm glad i could help you get this hack working 100% :)

sorry I was such a pest. :)

mharmon 01-30-2004 04:13 PM

BTW -- What will this do to server load?

Kentaurus 01-31-2004 02:42 AM

Quote:

Originally Posted by mharmon
BTW -- What will this do to server load?

nothing noticeable, no queries are added (just I query is modified) and there is only some code to format the time the user has been in the forum. It is currently running in my forum that has 100 users online at peak hours.


All times are GMT. The time now is 04:19 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.01543 seconds
  • Memory Usage 1,836KB
  • 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
  • (7)bbcode_code_printable
  • (2)bbcode_php_printable
  • (19)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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