diff options
| author | Simon McFarlane <simon@piston.pw> | 2015-06-01 16:08:19 -0700 |
|---|---|---|
| committer | Simon McFarlane <simon@piston.pw> | 2015-06-01 16:08:19 -0700 |
| commit | 209bc5400144e448e95a68e01d842c6fab53ae71 (patch) | |
| tree | ab4cc6ad241e8daccb546514330d3a5f2906e846 /templates/themes/ukko/theme.php | |
| parent | d1c1e5a589f30d640f5eb6303e7059105a6297f8 (diff) | |
| parent | 7ab9cc43d101ed002bce392beefe1c435ab2d5b1 (diff) | |
Merge pull request #18 from lainchan/vichan-merge
Merge with the latest upstream vichan
Diffstat (limited to 'templates/themes/ukko/theme.php')
| -rw-r--r-- | templates/themes/ukko/theme.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/templates/themes/ukko/theme.php b/templates/themes/ukko/theme.php index b2624ed7..d6fc303c 100644 --- a/templates/themes/ukko/theme.php +++ b/templates/themes/ukko/theme.php @@ -2,11 +2,21 @@ require 'info.php'; function ukko_build($action, $settings) { + global $config; + $ukko = new ukko(); $ukko->settings = $settings; - - file_write($settings['uri'] . '/index.html', $ukko->build()); - file_write($settings['uri'] . '/ukko.js', Element('themes/ukko/ukko.js', array())); + + if (! ($action == 'all' || $action == 'post' || $action == 'post-thread' || $action == 'post-delete')) { + return; + } + + if ($config['smart_build']) { + file_unlink($settings['uri'] . '/index.html'); + } + else { + file_write($settings['uri'] . '/index.html', $ukko->build()); + } } class ukko { |
