[MODDB] "Posts per day" in Statistics Box 1.0.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Ideas Centre
Locked
User avatar
MartectX
Registered User
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

[MODDB] "Posts per day" in Statistics Box 1.0.0

Post by MartectX »

MOD Title: Posts per day
MOD Description: Adds a little extra info to the statistic box on the index page: Average posts per day since the board came into existence.
MOD Version: 1.0.0
MOD Download: http://mods.martectx.de/posts_per_day.zip

Image
Last edited by MartectX on Sun Sep 28, 2008 11:19 pm, edited 4 times in total.
User avatar
Sunka
Registered User
Posts: 566
Joined: Wed Mar 26, 2008 2:48 pm
Location: Croatia, Zvoneca

Re: [DEV] "Posts per Day" in Statistics Box

Post by Sunka »

Looking interesting...I love statistic information of my forum... :mrgreen:
Waiting for MOD
Error101Burke
Registered User
Posts: 18
Joined: Sun Sep 07, 2008 12:16 pm

Re: [DEV] "Posts per Day" in Statistics Box

Post by Error101Burke »

Yeah, that'd be cool.
User avatar
MartectX
Registered User
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [BETA] "Posts per day" in Statistics Box

Post by MartectX »

BETA 1 ready for download.
User avatar
MartectX
Registered User
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [BETA] "Posts per day" in Statistics Box

Post by MartectX »

Version 0.0.2
  • German language edits
  • subSilver2 edits
User avatar
MartectX
Registered User
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [BETA] "Posts per day" in Statistics Box

Post by MartectX »

I'd submit this to the mod database tonight if there are no complaints - works perfectly on my live board, though.
User avatar
RMcGirr83
Former Team Member
Posts: 22016
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: [BETA] "Posts per day" in Statistics Box

Post by RMcGirr83 »

I would make a small suggestion. According to the code

Code: Select all

$boarddays = ( time() - $config['board_startdate'] ) / 86400;
$posts_per_day = $total_posts / $boarddays;
it would be possible, however unlikely, that a new board with some posts in it during the first day will return inaccurate information. For example, let's say a new board has 10 posts and the $boarddays turns out to be .5....that would result in $posts_per_day = 20. So possibly a fix would be something like this?

Code: Select all

$boarddays = ( time() - $config['board_startdate'] ) / 86400;
$boarddays = ($boarddays <= 1) ? '1' : $boarddays;
$posts_per_day = $total_posts / $boarddays;
or am I being too picky? :?
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
User avatar
MartectX
Registered User
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [BETA] "Posts per day" in Statistics Box

Post by MartectX »

RMcGirr83 wrote:[...] or am I being too picky? :?
Nah, it's good; I'll see to it that this will make it into the final version. Thanks for your suggestion!
User avatar
RMcGirr83
Former Team Member
Posts: 22016
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: [BETA] "Posts per day" in Statistics Box

Post by RMcGirr83 »

I changed your code on my forum to this in index.php

Code: Select all

// posts per day
$boarddays = round(( time() - $config['board_startdate'] ) / 86400);
$boarddays = ($boarddays <= 1) ? '1' : $boarddays;
$posts_per_day = $total_posts / $boarddays;
$l_posts_per_day_s = ($posts_per_day == 0) ? 'POSTS_PER_DAY_ZERO' : 'POSTS_PER_DAY_OTHER';
and it seems to be working very well. :)
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
User avatar
MartectX
Registered User
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [RC] "Posts per day" in Statistics Box 1.0.0

Post by MartectX »

Version 1.0.0
  • Release
  • Now supports MOD Version Check
For updating from 0.0.2 just redo the very first change of index.php!
Locked

Return to “[3.0.x] MODs in Development”