SimplePortal

Support => English Support => Topic started by: snadge on August 13, 2013, 07:25:04 PM

Title: this months top posters count going down?
Post by: snadge on August 13, 2013, 07:25:04 PM
Ive changed my 'top posters' from 'all time' which worked fine... to 'this month' and weve noticed that the post count drops sometimes, today i had 235 posts, i refreshed the page some hours later and was down to 218..? - our overal totals remain the same as far as i can tell

can anyone help with this?

thanks
Title: Re: this months top posters count going down?
Post by: FrizzleFried on August 14, 2013, 12:54:13 AM
Ive changed my 'top posters' from 'all time' which worked fine... to 'this month' and weve noticed that the post count drops sometimes, today i had 235 posts, i refreshed the page some hours later and was down to 218..? - our overal totals remain the same as far as i can tell

can anyone help with this?

thanks

Seems to be working right.  My understanding is that it reports a 30 day window.  My guess is that today there were 18 less posts than 31 days ago.  So lets say there were 50 posts made 31 days ago and only 32 posts today... that 50 posts dropped off and only 32 posts were added making the monthly posts drop by 18...

Title: Re: this months top posters count going down?
Post by: [SiNaN] on August 14, 2013, 02:08:14 PM
It's as FrizzleFried said. It counts the posts in the last 30 days, rather than from the beginning of the current month. So I guess the text string "This month" is a bit misleading.

If you want to display the number of posts since the beginning of the current month, this change should work:

Sources/PortalBlocks.php

Code: (Find) [Select]
{
$months = array( 1 => 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$start_time = mktime(0, 0, 0, date("n"), date("j"), date("Y")) - (3600 * 24 * $months[(int) date("m", time())]);
}

Code: (Replace) [Select]
$start_time = mktime(0, 0, 0, date("n"), 1, date("Y"));
Title: Re: this months top posters count going down?
Post by: snadge on August 14, 2013, 07:19:01 PM
thanks man :)

will give it a hoot
Title: Re: this months top posters count going down?
Post by: [SiNaN] on August 15, 2013, 04:26:18 AM
Cool. Let us know if that works out for you. ;)
SimplePortal 2.3.8 © 2008-2024, SimplePortal