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-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 07:34 PM.

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.03486 seconds
  • Memory Usage 1,750KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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