Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions

Reply
 
Thread Tools Display Modes
  #21  
Old 07-13-2013, 09:09 PM
maupassant maupassant is offline
 
Join Date: Feb 2009
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I probably didn't do this right. What I did is put your code in a new plugin using postbit_display_complete as hook location. And nothing new appears (no Posts Per Day).

Quote:
Originally Posted by Simon Lloyd View Post
My apologies

here's mine with the round incorporated
PHP Code:
$postdays $vbulletin->db->query_read("SELECT joindate,posts FROM " TABLE_PREFIX "user WHERE userid = $post[userid]");
{
$mpostdays $vbulletin->db->fetch_array($postdays);
        
$jd time()-$mpostdays['joindate'];
$mpsts round($jd/$mpostdays['posts']/86400);

You'll have to use KH99s use of hook to add it to the template or add $mpsts where you want the value to display. Remember I haven't tested this!!!
Reply With Quote
  #22  
Old 07-14-2013, 04:11 AM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I get the same, didn't notice it yesterday but on some the Post Per Day = 0 and for some it reads out fine...
Reply With Quote
  #23  
Old 07-14-2013, 08:04 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

did you add $mpsts to your template? if I get time later on (got a lot of decking to build) i'll test it myself.
Reply With Quote
  #24  
Old 07-14-2013, 10:57 AM
maupassant maupassant is offline
 
Join Date: Feb 2009
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have to add $mpsts in POSTBIT ? Where exactly ?
Reply With Quote
  #25  
Old 07-14-2013, 11:48 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wherever you want the value to show!, perhaps find where Posts: is already being displayed and add it under there, don't forget to add a phrase (or some text) for Posts per day and the html to have it on a new line..etc
Reply With Quote
  #26  
Old 07-14-2013, 01:26 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CAG CheechDogg View Post
I get the same, didn't notice it yesterday but on some the Post Per Day = 0 and for some it reads out fine...
That's strange. If you want to debug it, you could temporarily change the last line like:

Code:
$template_hook['postbit_userinfo_right_after_posts'] .= "<dt>Posts Per Day</dt><dd>$post[posts] $days $ppd</dd>";

Then see what the three numbers are. Is it possible that the number is so small it's rounding to 0?
Reply With Quote
  #27  
Old 07-14-2013, 02:04 PM
maupassant maupassant is offline
 
Join Date: Feb 2009
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What I get with your correction. The PPD is fine, but now it adds some odd numbers underneath (1615 0.03).

Quote:
Originally Posted by kh99 View Post
That's strange. If you want to debug it, you could temporarily change the last line like:

Code:
$template_hook['postbit_userinfo_right_after_posts'] .= "<dt>Posts Per Day</dt><dd>$post[posts] $days $ppd</dd>";

Then see what the three numbers are. Is it possible that the number is so small it's rounding to 0?
Attached Images
File Type: png Screenshot_1.png (73.2 KB, 0 views)
Reply With Quote
  #28  
Old 07-14-2013, 02:13 PM
maupassant maupassant is offline
 
Join Date: Feb 2009
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In this other profile, still with kh99's correction, the errors are different. The nb for Posts Per Day is wrong (it displays again the nb of posts instead). The real PPD here is 0.24 (displayed just below).
Attached Images
File Type: png Screenshot_2.png (61.8 KB, 0 views)
Reply With Quote
  #29  
Old 07-14-2013, 02:17 PM
maupassant maupassant is offline
 
Join Date: Feb 2009
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Simon Lloyd View Post
Wherever you want the value to show!, perhaps find where Posts: is already being displayed and add it under there, don't forget to add a phrase (or some text) for Posts per day and the html to have it on a new line..etc
I don't know how to do this. I have absolutely no notion about coding and programming. All I can do is add code and/or remove code where someone tells me to. But thanks for trying to help.
Reply With Quote
  #30  
Old 07-14-2013, 04:50 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by maupassant View Post
What I get with your correction. The PPD is fine, but now it adds some odd numbers underneath (1615 0.03).
That change was meant only for testing.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:14 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06818 seconds
  • Memory Usage 2,277KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete