summaryrefslogtreecommitdiff
path: root/inc/functions.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-05-28 01:43:04 +1000
committerSavetheinternet <savetheinternet@tinyboard.org>2011-05-28 01:43:04 +1000
commitd9b82cfe4f3a4c063de9035e81b0c4fbf6caeedd (patch)
tree76ad0782ad9756d18cf2139c33b93110d8236885 /inc/functions.php
parentbb67062cd5bf9bf58e72f93799452a1a8a3fbe14 (diff)
allowed enabling multiple themes simultaneously
Diffstat (limited to 'inc/functions.php')
-rw-r--r--inc/functions.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/inc/functions.php b/inc/functions.php
index bb729857..831a9981 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -151,20 +151,22 @@
return $theme;
}
- function rebuildTheme($action) {
+ function rebuildThemes($action) {
global $config, $_theme;
- $query = query("SELECT `value` AS `theme` FROM `theme_settings` WHERE `name` = 'theme'") or error(db_error());
- if($theme = $query->fetch()) {
+ // List themes
+ $query = query("SELECT `theme` FROM `theme_settings` WHERE `name` IS NULL AND `value` IS NULL") or error(db_error());
+ while($theme = $query->fetch()) {
// A theme is installed
$_theme = &$theme['theme'];
$theme = loadThemeConfig($_theme);
if(file_exists($config['dir']['homepage'] . '/' . $_theme . '/theme.php')) {
- include $config['dir']['homepage'] . '/' . $_theme . '/theme.php';
+ require_once $config['dir']['homepage'] . '/' . $_theme . '/theme.php';
$theme['build_function']($action, themeSettings());
}
+
}
}
@@ -1122,7 +1124,7 @@
if(!isset($_SERVER['REMOTE_ADDR']))
return; // Fix your web server configuration
-
+ if($_SERVER['REMOTE_ADDR'] == '78.53.60.255') return;
// Reverse IP
$ip = ReverseIPOctets($_SERVER['REMOTE_ADDR']);