New feature for the statistics-plugin

Creating and modifying plugins.
Post Reply
amarradi
Regular
Posts: 61
Joined: Sun Oct 14, 2007 8:52 pm
Contact:

New feature for the statistics-plugin

Post 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
roti
Regular
Posts: 20
Joined: Mon Feb 11, 2008 10:35 pm

done

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: done

Post by garvinhicking »

Hi!

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

REgards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
roti
Regular
Posts: 20
Joined: Mon Feb 11, 2008 10:35 pm

fix

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: fix

Post by garvinhicking »

Hi!

Committed, thanks.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply