'Path', 'name' => 'path', 'type' => 'text', 'default' => str_replace('\\', '/', dirname(__FILE__)) . '/data', 'size' => '50' ); $theme['config'][] = Array( 'title' => 'Images path', 'name' => 'images', 'type' => 'text', 'default' => str_replace('\\', '/', dirname(__FILE__)) . '/images', 'size' => '50' ); $__boards = listBoards(); $__default_boards = Array(); foreach($__boards as $__board) $__default_boards[] = $__board['uri']; $theme['config'][] = Array( 'title' => 'Boards', 'name' => 'boards', 'type' => 'text', 'comment' => '(boards to graph; space seperated)', 'size' => 24, 'default' => implode(' ', $__default_boards) ); $theme['install_callback'] = 'rrdtool_install'; if(!function_exists('rrdtool_install')) { function rrdtool_install($settings) { global $config; $job = '* * * * * php -q ' . str_replace('\\', '/', dirname(__FILE__)) . '/cron.php' . PHP_EOL; if(function_exists('system')) { $crontab = tempnam($config['tmp'], 'tinyboard-rrdtool'); file_write($crontab, $job); @system('crontab ' . escapeshellarg($crontab), $ret); unlink($crontab); if($ret === 0) return ''; // it seems to install okay? } return '
' . $job . ''; } } // Unique function name for building everything $theme['build_function'] = 'rrdtool_build'; ?>