PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.

#1 2005-11-21 21:25:48

Razmooze
Member
From: Sweden, Göteborg
Registered: 2005-11-21
Posts: 52
Website

Activity Barometer 2.0

Code:

##
##
##        Mod title:  Activity Barometer
##
##      Mod version:  2.0
##   Works on PunBB:  1.2.9, 1.2.10 (maybe all 1.2.*)
##     Release date:  2005-11-08
##           Author:  B. Rasmus (Scratty) Anthin.
##
##      Description:  Shows the "flux" of posts per hour
##                         or number of posts during a day or a week.
##                         (Still one or two minor bugs, but of minor concern).
##
##   Affected files:  index.php
##                         lang/English/index.php
##                         lang/Swedish/index.php
##
##       Affects DB:  No
##
##         Comments:  Skip parts 6-7 if you don't have the swedish language-
##                    mode installed.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

Download here

Offline

 

#2 2005-11-22 00:25:58

Smartys
Member
Registered: 2005-03-18
Posts: 314
Website

Re: Activity Barometer 2.0

Why 2.0?


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#3 2005-11-22 02:18:47

Razmooze
Member
From: Sweden, Göteborg
Registered: 2005-11-21
Posts: 52
Website

Re: Activity Barometer 2.0

Since I made this mod a very long time ago, for punBB 1.1.4. If memory serves, I posted this on the punBB forums. Since punBB 1.2.* looks very different from 1.1.* I practically had to reimplement the whole thing, which I guess is concidered as a "major" update.

Offline

 

#4 2007-01-16 22:58:31

Buffedelic
Member
Registered: 2007-01-13
Posts: 42

Re: Activity Barometer 2.0

Nice mod!

But I would change the code to look more like this, removed the "dorment" part!
Seems more organized to me smile

Code:

                <?php
                // Begin: Activity Barometer mod
                $result = $db->query("SELECT COUNT(*) FROM ".$db->prefix."posts WHERE posted > ".(time()-7*24*3600)) or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());
                $posts_week = $db->result($result);
                $result = $db->query("SELECT COUNT(*) FROM ".$db->prefix."posts WHERE posted > ".(time()-24*3600)) or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());
                $posts_day = $db->result($result);
                $posts_h = $posts_day/24;
                ?>
                <dd> <br /> </dd>
                <dd><?php if ($posts_week > 1) echo $lang_index['number week'].': <strong>'.$posts_week ?> </strong></dd>
                <dd><?php if ($posts_day > 1) echo $lang_index['number day'].': <strong>'.$posts_day ?> </strong></dd>
                <dd><?php if ($posts_h > 1) echo $lang_index['average h'].': <strong>'.number_format($posts_h,1) ?> </strong></dd>
                <?php // End: Activity Barometer mod ?>

Last edited by Buffedelic (2007-01-16 22:59:39)


My forum: http://www.buffedelic.se (only in swedish)

Offline

 

#5 2007-02-11 00:44:19

Razmooze
Member
From: Sweden, Göteborg
Registered: 2005-11-21
Posts: 52
Website

Re: Activity Barometer 2.0

Sure, that's just another flavour smile.

I'm a bit doubtful concerning the importance if this mod, however, it should be fairly simple to infer some admin-settings via a plugin. FYI, I will probably not support this mod anymore or for a very long time, so feel free to modify the mod as you see fit.

Last edited by Razmooze (2007-02-11 00:49:50)

Offline

 

#6 2007-02-11 07:11:20

thegleek
Member
Registered: 2006-08-21
Posts: 54
Website

Re: Activity Barometer 2.0

i still wanna see someone up for the challenge to make some punbb stats that look like this:

http://www.thegleek.com/images/bbstats.gif

god i love how it shows those in bar fashion.... has anyone dealt with MRTG or RRDtool concerning punbb stats?


~thegleek <-- (my site is NSFW)

Offline

 

#7 2007-09-24 20:07:18

alana
Member
From: Maine, USA
Registered: 2007-05-30
Posts: 45
Website

Re: Activity Barometer 2.0

i was thinking recently it would not be too difficult to integrate this mod with sparklines (http://sparkline.org/). i won't have time to try it for a while, but if anyone else is interested in information visualization and has familiarity with php, pls help this idea?

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.