Page 1 of 1

New feature for the statistics-plugin

Posted: Wed Jan 30, 2008 3:55 pm
by amarradi
Hello together,

I've installed the Statistics Plugin "serendipity_event_statistics" installed. Now I've an idea. Everyone can see the visitors per month, but not per day or per week. Is it an great event to setup this new function?
I think it will be cool :) :)

Bye
Marcus Radisch

done

Posted: Tue Feb 26, 2008 2:28 pm
by roti
Hi!

I have implemented the idea.

Here it is the code:
http://www.profi-media.com/~roti/etc/se ... istics.zip

Fixed an error with sqlite:
there is not function: REPLACE

Visitor/day + visitor/week with settings.
Adjusted the code, and the lang file.

Translated to hungarian too.

Please test and commit.


Roti

Re: done

Posted: Tue Feb 26, 2008 2:37 pm
by garvinhicking
Hi!

Thank you, that looks solid! I've just committed it to SVN.

REgards,
Garvin

fix

Posted: Mon Mar 03, 2008 9:40 pm
by roti
Hi!

This is monday, and I found a bug in my code, if it is monday or sunday.
The following rows should be added to serendipity_plugin_statistics.php line 196, right after
$lastmonday = date('Ymd', strtotime('last monday'));
$nextsunday = date('Ymd', strtotime('next sunday'));

to check if it is monday or sunday:

if ( date('w', strtotime('today') ) == "1" ) { // now it is monday
$lastmonday = date('Ymd', strtotime('today'));
} else if ( date('w', strtotime('today') ) == "0" ) { // now it is sunday
$nextsunday = date('Ymd', strtotime('today'));
}

Thanx


Roti

Re: fix

Posted: Tue Mar 04, 2008 10:59 am
by garvinhicking
Hi!

Committed, thanks.

Regards,
Garvin