summaryrefslogtreecommitdiff
path: root/templates/themes/ukko/theme.php
diff options
context:
space:
mode:
authorSimon McFarlane <simon@piston.pw>2015-05-26 23:31:47 -0700
committerSimon McFarlane <simon@piston.pw>2015-05-29 01:34:53 -0700
commit4b40f69a4e6d190f6d342875bd084c2a6c9d8b0f (patch)
treefcc5dc9efa24afcb0bda3740b59f0c4e81c42f62 /templates/themes/ukko/theme.php
parent2ac451ecb7aaae1ed1402425b8df6a5cb9831f2b (diff)
parentd20149b57929c27da87a7d9603d85717da15c5bc (diff)
Merge remote-tracking branch 'upstream/master' into vichan-merge
Diffstat (limited to 'templates/themes/ukko/theme.php')
-rw-r--r--templates/themes/ukko/theme.php16
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 {