diff options
| author | Savetheinternet <savetheinternet@tinyboard.org> | 2011-12-23 13:07:52 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@tinyboard.org> | 2011-12-23 13:07:52 +1100 |
| commit | d60658736e32f112d9965b20b322cb35e713b2f0 (patch) | |
| tree | 11f34b42198a1cb05df74a30a3a3581424114f96 /templates/themes/rrdtool/info.php | |
| parent | 0dd36bda5409124d4986ddf6a83c8804d2b72318 (diff) | |
option to graph post rates by 'minute', 'day', 'year', etc.
Diffstat (limited to 'templates/themes/rrdtool/info.php')
| -rw-r--r-- | templates/themes/rrdtool/info.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/templates/themes/rrdtool/info.php b/templates/themes/rrdtool/info.php index 921d75b4..73658a22 100644 --- a/templates/themes/rrdtool/info.php +++ b/templates/themes/rrdtool/info.php @@ -58,23 +58,30 @@ ); $theme['config'][] = Array( - 'title' => 'Width', + 'title' => 'Graph Width', 'name' => 'width', 'type' => 'text', - 'comment' => '(graph width)', 'size' => 3, 'default' => '700' ); $theme['config'][] = Array( - 'title' => 'Height', + 'title' => 'Graph Height', 'name' => 'height', 'type' => 'text', - 'comment' => '(graph height)', 'size' => 3, 'default' => '150' ); + $theme['config'][] = Array( + 'title' => 'Graph Rate', + 'name' => 'rate', + 'type' => 'text', + 'comment' => 'Graph posts per X? ("minute", "day", "year", etc.)', + 'size' => 3, + 'default' => 'hour' + ); + $theme['install_callback'] = 'rrdtool_install'; if(!function_exists('rrdtool_install')) { function rrdtool_install($settings) { @@ -89,6 +96,9 @@ if(!is_numeric($settings['height']) || $settings['height'] < 1) return Array(false, 'Invalid height: <strong>' . $settings['height'] . '</strong>!'); + if(!in_array($settings['rate'], Array('second', 'minute', 'day', 'hour', 'week', 'month', 'year'))) + return Array(false, 'Invalid rate: <strong>' . $settings['rate'] . '</strong>!'); + $job = '*/' . $settings['interval'] . ' * * * * php -q ' . str_replace('\\', '/', dirname(__FILE__)) . '/cron.php' . PHP_EOL; if(function_exists('system')) { |
