summaryrefslogtreecommitdiff
path: root/includes/theme.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-01-13 16:33:19 +0000
committerDries Buytaert <dries@buytaert.net>2001-01-13 16:33:19 +0000
commit8b4c95b259089c54331e9a6d014495c1ec807cea (patch)
treef034ed8a5ad4c13ddd9c558857b7011f7cc1dceb /includes/theme.inc
parentf9e5aa52ccad84784d8e134129f531751ccd34b2 (diff)
downloadbrdo-8b4c95b259089c54331e9a6d014495c1ec807cea.tar.gz
brdo-8b4c95b259089c54331e9a6d014495c1ec807cea.tar.bz2
- rewrote the block placement stuff and updated the themes.
IMPORTANT: you have to drop 2 tables "blocks" and "layout" and you have to recreate them again with those in database/database.mysql - integrated the documentation written by UnConeD
Diffstat (limited to 'includes/theme.inc')
-rw-r--r--includes/theme.inc19
1 files changed, 3 insertions, 16 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index d6a4dd3e4..4a39bc107 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -58,7 +58,7 @@ function theme_account($theme) {
}
-function theme_main_blocks($theme) {
+function theme_blocks($region, $theme) {
global $id, $PHP_SELF, $user;
switch (strtok($PHP_SELF, ".")) {
@@ -68,26 +68,13 @@ function theme_main_blocks($theme) {
else theme_new_headlines($theme);
break;
case "/index":
- theme_account($theme);
- $result = db_query("SELECT * FROM blocks WHERE status = 2");
+ if ($user->id) $result = db_query("SELECT * FROM blocks b LEFT JOIN layout l ON b.name = l.block WHERE (b.status = 2 OR (b.status AND l.user = '$user->id'))". (($region == "left" || $region == "right") ? ($region == "left" ? " AND b.region = 0" : " AND b.region = 1") : "") ." ORDER BY weight");
+ else $result = db_query("SELECT * FROM blocks WHERE status = 2 ORDER BY weight");
while ($block = db_fetch_object($result)) {
$blocks = module_execute($block->module, "block");
$theme->box($blocks[$block->offset]["subject"], $blocks[$block->offset]["content"]);
}
break;
- default:
- theme_account($theme);
- }
-}
-
-function theme_user_blocks($theme) {
- global $PHP_SELF, $repository, $user;
- if ($user->id && strstr($PHP_SELF, "index.php")) {
- $result = db_query("SELECT * FROM layout l LEFT JOIN blocks b ON l.block = b.name WHERE l.user = '$user->id' AND l.weight > 0 AND b.status = '1' ORDER BY weight");
- while ($block = db_fetch_object($result)) {
- $blocks = module_execute($block->module, "block");
- $theme->box($blocks[$block->offset]["subject"], $blocks[$block->offset]["content"]);
- }
}
}