summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2011-04-14 22:12:56 +1000
committerSavetheinternet <savetheinternet@n0v4.com>2011-04-14 22:12:56 +1000
commit1025fcf1e1e3aa823c94b2a2c0c3069a28c6940e (patch)
treeecb56ba0494d509a33fa8141a2e1085b4f0d9668 /inc
parent702f37ccc50397c0d042627983d26d22195192aa (diff)
themes
Diffstat (limited to 'inc')
-rw-r--r--inc/functions.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/inc/functions.php b/inc/functions.php
index cec25137..f5c502f4 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -96,21 +96,28 @@
function loadThemeConfig($_theme) {
global $config;
- if(!file_exists($config['dir']['homepage'] . '/' . $_theme . '/theme.php'))
+ if(!file_exists($config['dir']['homepage'] . '/' . $_theme . '/info.php'))
return false;
// Load theme information into $theme
- include $config['dir']['homepage'] . '/' . $_theme . '/theme.php';
+ include $config['dir']['homepage'] . '/' . $_theme . '/info.php';
return $theme;
}
function rebuildTheme($action) {
+ global $config;
+
$query = query("SELECT `value` AS `theme` FROM `theme_settings` WHERE `name` = 'theme'") or error(db_error());
if($theme = $query->fetch()) {
// A theme is installed
+ $_theme = $theme['theme'];
- $theme = loadThemeConfig($theme['theme']);
- $theme['build_function']($action, themeSettings());
+ $theme = loadThemeConfig($_theme);
+
+ if(file_exists($config['dir']['homepage'] . '/' . $_theme . '/theme.php')) {
+ include $config['dir']['homepage'] . '/' . $_theme . '/theme.php';
+ $theme['build_function']($action, themeSettings());
+ }
}
}