# HG changeset patch # User Dan # Date 1231212576 18000 # Node ID 73f74d395f9538c18f9cd0f9e56a2f18b6575396 # Parent ce2e9caf2dfaf2e886196151384140d1127fa006 Added theme support. Oh yeah, you can customize graphs using graph_{line,bar}.def. diff -r ce2e9caf2dfa -r 73f74d395f95 graphing/class.graph.php --- a/graphing/class.graph.php Sun Jan 04 16:40:36 2009 -0500 +++ b/graphing/class.graph.php Mon Jan 05 22:29:36 2009 -0500 @@ -766,7 +766,7 @@ $this->$func($settings); } } - if (is_array($data['data'])) { + if (isset($data['data']) && is_array($data['data'])) { $this->data = $data['data']; } } diff -r ce2e9caf2dfa -r 73f74d395f95 htdocs/changetz.php --- a/htdocs/changetz.php Sun Jan 04 16:40:36 2009 -0500 +++ b/htdocs/changetz.php Mon Jan 05 22:29:36 2009 -0500 @@ -1,5 +1,6 @@ - - Change time zone - - - - '; + if ( $set_zone ) { $target = rtrim(dirname($_SERVER['REQUEST_URI']), '/') . '/'; @@ -95,5 +62,7 @@
Make sure you have cookies enabled. - - + + diff -r ce2e9caf2dfa -r 73f74d395f95 htdocs/graph.php --- a/htdocs/graph.php Sun Jan 04 16:40:36 2009 -0500 +++ b/htdocs/graph.php Mon Jan 05 22:29:36 2009 -0500 @@ -9,6 +9,8 @@ function makeGraph($type = 'bar') { + global $webtheme; + $class = ( $type == 'line' ) ? 'LineGraph' : 'BarGraph'; $g = new $class(); // _Compat(); @@ -33,6 +35,10 @@ $g->SetScaleRoundY(0); $g->SetScaleRoundX(0); $g->SetAxisStepSize(7); + + if ( file_exists("./themes/$webtheme/graph_$type.def") ) + $g->LoadGraph(realpath("./themes/$webtheme/graph_$type.def")); + return $g; } diff -r ce2e9caf2dfa -r 73f74d395f95 htdocs/index.php --- a/htdocs/index.php Sun Jan 04 16:40:36 2009 -0500 +++ b/htdocs/index.php Mon Jan 05 22:29:36 2009 -0500 @@ -5,21 +5,10 @@ $channel_list = stats_channel_list(); $first_channel = $channel_list[0]; $channel = ( isset($_REQUEST['channel']) && in_array($_REQUEST['channel'], $channel_list) ) ? $_REQUEST['channel'] : $first_channel; + +$title = "$nick - Statistics"; +require("./themes/$webtheme/header.php"); ?> - - - - <?php echo $nick; ?> - Statistics - - -

+

Last 60 minutes

+ Graph image

Last 24 hours

Graph image

Last 2 weeks

Graph image - - - - + - - <?php echo $nick; ?> - updates - - -

Updates and changes

+

2009-01-04

+

Added a last 60 minutes graph.

2008-12-24

now has modular graph support and thus is able to show different graphs. Included now are options for the last 24 hours as before, plus the last two weeks and the last 30 days. More, of course, can be added if needed.

@@ -23,5 +23,6 @@ records after the import of the existing flat file database. It makes for a more portable programming technique and it means it can be easily expanded in the future to include more data. The table's indexed so it should be decently fast.

In addition, smarter functionality is being included, plus a few bugs here and there have been fixed.

- - + diff -r ce2e9caf2dfa -r 73f74d395f95 htdocs/privacy.php --- a/htdocs/privacy.php Sun Jan 04 16:40:36 2009 -0500 +++ b/htdocs/privacy.php Mon Jan 05 22:29:36 2009 -0500 @@ -1,17 +1,16 @@ - - <?php echo $nick; ?> - privacy info - - -

Privacy information

is designed to collect IRC statistics. It does this by recording raw data and then letting the frontend (index.php and the backend access abstraction in stats-fe.php) look at the data and draw graphs and measurements based on it.

@@ -32,5 +31,5 @@

Remove yourself from the anonymization list with:

/msg denonymize

Want to know more about the numbers collects? Download a dump of 's database yourself.

- - + + is a privacy-respecting bot. Read about what information collects +
+ + diff -r ce2e9caf2dfa -r 73f74d395f95 htdocs/themes/generic/header.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/htdocs/themes/generic/header.php Mon Jan 05 22:29:36 2009 -0500 @@ -0,0 +1,45 @@ + + + <?php echo $title; ?> + + + diff -r ce2e9caf2dfa -r 73f74d395f95 stats-fe.php --- a/stats-fe.php Sun Jan 04 16:40:36 2009 -0500 +++ b/stats-fe.php Mon Jan 05 22:29:36 2009 -0500 @@ -14,6 +14,8 @@ require(ENANOBOT_ROOT . '/hooks.php'); require(ENANOBOT_ROOT . '/database.php'); +$webtheme = ( isset($webtheme) && is_dir(ENANOBOT_ROOT . "/htdocs/themes/$webtheme") ) ? $webtheme : 'generic'; + mysql_reconnect(); /**