|
@ -96,23 +96,30 @@ |
|
|
function loadThemeConfig($_theme) { |
|
|
function loadThemeConfig($_theme) { |
|
|
global $config; |
|
|
global $config; |
|
|
|
|
|
|
|
|
if(!file_exists($config['dir']['homepage'] . '/' . $_theme . '/theme.php')) |
|
|
if(!file_exists($config['dir']['homepage'] . '/' . $_theme . '/info.php')) |
|
|
return false; |
|
|
return false; |
|
|
|
|
|
|
|
|
// Load theme information into $theme |
|
|
// Load theme information into $theme |
|
|
include $config['dir']['homepage'] . '/' . $_theme . '/theme.php'; |
|
|
include $config['dir']['homepage'] . '/' . $_theme . '/info.php'; |
|
|
return $theme; |
|
|
return $theme; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function rebuildTheme($action) { |
|
|
function rebuildTheme($action) { |
|
|
|
|
|
global $config; |
|
|
|
|
|
|
|
|
$query = query("SELECT `value` AS `theme` FROM `theme_settings` WHERE `name` = 'theme'") or error(db_error()); |
|
|
$query = query("SELECT `value` AS `theme` FROM `theme_settings` WHERE `name` = 'theme'") or error(db_error()); |
|
|
if($theme = $query->fetch()) { |
|
|
if($theme = $query->fetch()) { |
|
|
// A theme is installed |
|
|
// A theme is installed |
|
|
|
|
|
$_theme = $theme['theme']; |
|
|
|
|
|
|
|
|
$theme = loadThemeConfig($theme['theme']); |
|
|
$theme = loadThemeConfig($_theme); |
|
|
|
|
|
|
|
|
|
|
|
if(file_exists($config['dir']['homepage'] . '/' . $_theme . '/theme.php')) { |
|
|
|
|
|
include $config['dir']['homepage'] . '/' . $_theme . '/theme.php'; |
|
|
$theme['build_function']($action, themeSettings()); |
|
|
$theme['build_function']($action, themeSettings()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function themeSettings() { |
|
|
function themeSettings() { |
|
|
$query = query("SELECT * FROM `theme_settings`") or error(db_error()); |
|
|
$query = query("SELECT * FROM `theme_settings`") or error(db_error()); |
|
|