diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2011-04-13 23:47:47 +1000 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2011-04-13 23:47:47 +1000 |
| commit | 459f442b5764497e30dcf6c00394addc052420f2 (patch) | |
| tree | 3a069f176cacc2c7897aa51f7cd93b0150289866 /inc | |
| parent | b8951025635edc3c291d39bbab9f248e8c3de720 (diff) | |
Some sort of theme/homepage start
Diffstat (limited to 'inc')
| -rw-r--r-- | inc/config.php | 9 | ||||
| -rw-r--r-- | inc/functions.php | 19 |
2 files changed, 28 insertions, 0 deletions
diff --git a/inc/config.php b/inc/config.php index 58b6a860..020120e3 100644 --- a/inc/config.php +++ b/inc/config.php @@ -208,6 +208,13 @@ //$config['dir']['static'] = $config['root'] . 'static/'; // Where to store the .html templates. This folder and templates must exist or fatal errors will be thrown. $config['dir']['template'] = getcwd() . '/templates'; + // For the homepage generation files (themes, etc.) + $config['dir']['homepage'] = getcwd() . '/templates/homepage'; + // Same as above, but a URI (accessable by web interface, not locally) + $config['dir']['homepage_uri'] = 'templates/homepage'; + // Homepage directory + $config['dir']['home'] = ''; + // Static images // These can be URLs OR base64 (data URI scheme) //$config['image_sticky'] = $config['dir']['static'] . 'sticky.gif'; @@ -393,6 +400,8 @@ $config['mod']['noticeboard_delete'] = ADMIN; // Public ban messages; attached to posts $config['mod']['public_ban'] = MOD; + // Manage and install themes for homepage + $config['mod']['themes'] = ADMIN; // Mod links (full HTML) // Correspond to above permission directives diff --git a/inc/functions.php b/inc/functions.php index 7ec58e79..144cdec1 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -93,6 +93,25 @@ } } + function loadThemeConfig($_theme) { + global $config; + + // Load theme information into $theme + include $config['dir']['homepage'] . '/' . $_theme . '/theme.php'; + return $theme; + } + + function themeSettings() { + $query = query("SELECT * FROM `theme_settings`") or error(db_error()); + $settings = Array(); + + while($s = $query->fetch()) { + $settings[$s['name']] = $s['value']; + } + + return $settings; + } + function sprintf3($str, $vars, $delim = '%') { $replaces = array(); foreach($vars as $k => $v) { |
