diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2011-04-14 20:43:34 +1000 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2011-04-14 20:43:34 +1000 |
| commit | 641f925dfebf2540a6d7e94e23e302c4a30dc58b (patch) | |
| tree | f40d984c1de2fb914f64ee5e209aee2b1aed81d6 /templates | |
| parent | 757b09dec938c541dc5c858474b07c47b25248dc (diff) | |
better rebuilding system for themes
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/homepage/basic/theme.php | 14 | ||||
| -rw-r--r-- | templates/homepage/frameset/theme.php | 22 | ||||
| -rw-r--r-- | templates/homepage/frameset/thumb.png | bin | 12142 -> 7571 bytes |
3 files changed, 26 insertions, 10 deletions
diff --git a/templates/homepage/basic/theme.php b/templates/homepage/basic/theme.php index 1251cfff..6a6f0bfa 100644 --- a/templates/homepage/basic/theme.php +++ b/templates/homepage/basic/theme.php @@ -25,16 +25,22 @@ // Unique function name for building everything $theme['build_function'] = 'basic_build'; - function basic_build($settings) { - Basic::build($settings); + function basic_build($action, $settings) { + // Possible values for $action: + // - all (rebuild everything, initialization) + // - news (news has been updated) + // - boards (board list changed) + + Basic::build($action, $settings); } // Wrap functions in a class so they don't interfere with normal Tinyboard operations class Basic { - public static function build($settings) { + public static function build($action, $settings) { global $config; - file_put_contents($config['dir']['home'] . $config['file_index'], Basic::homepage($settings)); + if($action == 'all' || $action == 'news') + file_put_contents($config['dir']['home'] . $config['file_index'], Basic::homepage($settings)); } // Build news page diff --git a/templates/homepage/frameset/theme.php b/templates/homepage/frameset/theme.php index 8b96402d..6c82f0b1 100644 --- a/templates/homepage/frameset/theme.php +++ b/templates/homepage/frameset/theme.php @@ -28,18 +28,28 @@ Users never have to leave the homepage; they can do all their browsing from the // Unique function name for building everything $theme['build_function'] = 'frameset_build'; - function frameset_build($settings) { - Frameset::build($settings); + function frameset_build($action, $settings) { + // Possible values for $action: + // - all (rebuild everything, initialization) + // - news (news has been updated) + // - boards (board list changed) + + Frameset::build($action, $settings); } // Wrap functions in a class so they don't interfere with normal Tinyboard operations class Frameset { - public static function build($settings) { + public static function build($action, $settings) { global $config; - file_put_contents($config['dir']['home'] . $config['file_index'], Frameset::homepage($settings)); - file_put_contents($config['dir']['home'] . 'sidebar.html', Frameset::sidebar($settings)); - file_put_contents($config['dir']['home'] . 'news.html', Frameset::news($settings)); + if($action == 'all') + file_put_contents($config['dir']['home'] . $config['file_index'], Frameset::homepage($settings)); + + if($action == 'all' || $action == 'boards') + file_put_contents($config['dir']['home'] . 'sidebar.html', Frameset::sidebar($settings)); + + if($action == 'all' || $action == 'news') + file_put_contents($config['dir']['home'] . 'news.html', Frameset::news($settings)); } // Build homepage diff --git a/templates/homepage/frameset/thumb.png b/templates/homepage/frameset/thumb.png Binary files differindex fd912d1a..df18a8e9 100644 --- a/templates/homepage/frameset/thumb.png +++ b/templates/homepage/frameset/thumb.png |
