Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #31  
Old 07-14-2013, 05:05 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As Kevins mod shows the last 3 digits 0.03 would be $ppd or posts per day.
Reply With Quote
  #32  
Old 07-15-2013, 10:00 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

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?
I get the following kh99:

Posts Per Day : 9,624 4896 0

It is working because 9,624 / 4896 is the total post per day i am getting.....but it wont display it on the postbit_legacy...

Any thoughts?

--------------- Added [DATE]1373886774[/DATE] at [TIME]1373886774[/TIME] ---------------

I changed it to the following:

Code:
if (($days = round((TIMENOW-$post['joindateline']) / 86400)) <= 0)
{
   $days = 1;
}
$ppd = round($post['posts'] / $days, 4);
$template_hook['postbit_userinfo_right_after_posts'] .= "<dt>Posts Per Day</dt><dd>$ppd</dd>";
and got :


Posts Per Day : 0.0018

instead of the 1.97 ......

--------------- Added [DATE]1373888531[/DATE] at [TIME]1373888531[/TIME] ---------------

So I have been told that because my total post count is 9,625, this plugin's code is interpreting the "," as an integer? So it has to be converted to a float so that it rounds of the number correctly since it has the "," in the number?

--------------- Added [DATE]1373925272[/DATE] at [TIME]1373925272[/TIME] ---------------

Any update on this you guys?
Reply With Quote
  #33  
Old 08-02-2013, 05:54 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry for the delay in getting back to this. I searched for it because someone else asked about the number being formatted with commas, and that is in fact why it's not working. But while looking in to that issue I found that posts per day is already calculated by the vb code, so you shouldn't need a plugin at all, you should just be able to add {vb:raw post.postsperday} to your template.
Reply With Quote
Благодарность от:
CAG CheechDogg
  #34  
Old 08-02-2013, 07:45 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good one!, i guess when i looked at it in the memberinfo template i thought it wouldn't be available in other templates but in vb3 using $post[postsperday] gave the correct value!
Reply With Quote
  #35  
Old 08-04-2013, 12:33 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

Quote:
Originally Posted by kh99 View Post
Sorry for the delay in getting back to this. I searched for it because someone else asked about the number being formatted with commas, and that is in fact why it's not working. But while looking in to that issue I found that posts per day is already calculated by the vb code, so you shouldn't need a plugin at all, you should just be able to add {vb:raw posts.postsperday} to your template.

Still didn't work, it shows just the "Posts Per Day:" but not the stats ...

--------------- Added [DATE]1375581510[/DATE] at [TIME]1375581510[/TIME] ---------------

So I tried the following in postbit_legacy:

Code:
<div class="pbit"><div>Posts Per Day: {vb:raw prepared.postsperday}</div></div>
and

Code:
<div class="pbit"><div>Posts Per Day: {vb:raw posts.postsperday}</div></div>
After using the above, I still get nothing for the stats....just blank
Reply With Quote
  #36  
Old 08-04-2013, 01:26 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, there was a typo. I think it should be {vb:raw post.postsperday}
Reply With Quote
  #37  
Old 08-04-2013, 01:36 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

Quote:
Originally Posted by kh99 View Post
Sorry, there was a typo. I think it should be {vb:raw post.postsperday}

Awesome! You are the Man man ! Perfect, correct Posts Per Day results !

I used the following:

Code:
<dt>Posts Per Day</dt><dd>{vb:raw post.postsperday}</dd>
--------------- Added [DATE]1375584066[/DATE] at [TIME]1375584066[/TIME] ---------------

Hey! lol...it shows the stats for some and not for others....any ideas? lol....but it's working correctly...maybe a usergroup's permission?

--------------- Added [DATE]1375584454[/DATE] at [TIME]1375584454[/TIME] ---------------

Disregard kh99...I had it wrapped around a condition lol....*facepalm*....lol...sorry Bro...but thank you so much , once again you have been great help!
Reply With Quote
  #38  
Old 08-10-2013, 08:18 PM
maupassant maupassant is offline
 
Join Date: Feb 2009
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I added
PHP Code:
<dt>Posts Per Day</dt><dd>{vb:raw post.postsperday}</dd
in postbit_legacy and nothing happened. I don't see the Posts Per Day phrase, and I don't see the Posts Per Day stats either.

PHP Code:
                <vb:if condition="$post['joindate']"><dt>{vb:rawphrase join_date}</dt> <dd>{vb:raw post.joindate}</dd></vb:if>
                    <
vb:if condition="$post['field2']"><dt>{vb:rawphrase location_perm}</dt> <dd>{vb:raw post.field2}</dd></vb:if>
                    <
vb:if condition="$post['age']"><dt>{vb:rawphrase age}</dt> <dd>{vb:raw post.age}</dd></vb:if>
                    <
dt>{vb:rawphrase posts}</dt> <dd>{vb:raw post.posts}</dd>
                                        <
dt>Posts Per Day</dt><dd>{vb:raw post.postsperday}</dd>    
                    {
vb:raw template_hook.postbit_userinfo_right_after_posts}
                </
dl>
                <
vb:if condition="$show['infraction'] OR $show['reppower']">
                <
dl class="user_rep">
                    <
vb:if condition="$show['infraction']">
                    <
dt>{vb:rawphrase infractions}</dt
                    <
dd>{vb:raw post.warnings}/{vb:raw post.infractions
Reply With Quote
  #39  
Old 08-10-2013, 09:17 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you're not seeing "Posts Per Day" then either it's the wrong template or the wrong style. If you have your info across the top of the post (like this site) then you should edit postbit instead of postbit_legacy. Also make sure you're editing the same style you're using to view the forum.
Reply With Quote
  #40  
Old 08-10-2013, 11:34 PM
maupassant maupassant is offline
 
Join Date: Feb 2009
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
If you're not seeing "Posts Per Day" then either it's the wrong template or the wrong style. If you have your info across the top of the post (like this site) then you should edit postbit instead of postbit_legacy. Also make sure you're editing the same style you're using to view the forum.
Many thanks ! I now added it in postbit and it works !

--------------- Added [DATE]1376182069[/DATE] at [TIME]1376182069[/TIME] ---------------

Let me know if I should start another thread for this, but I would like also to see this info displayed in each member's profile in the Admin Control Panel. Can it be done by adding the same code in the right template, and if so, what is the template I have to edit ?

Also, but I know I'm pushing my luck here, would it be possible to add this as a field in Search For Users - Advanced Search in the ACP : "Posts Per Day less than 0.15" ?
Reply With Quote
Reply


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 04:39 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.06341 seconds
  • Memory Usage 2,311KB
  • Queries Executed 14 (?)
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
  • (5)bbcode_code
  • (2)bbcode_php
  • (4)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
  • (3)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete