summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-06-10 15:01:20 +0000
committerDries Buytaert <dries@buytaert.net>2001-06-10 15:01:20 +0000
commitd397bbe93587f015cd8db0dbf16ef6d1c1aef78b (patch)
tree82b3b8dc63b04c11aeadd5b18cee796e4da43144 /index.php
parent6b34310626b960a18646259d8d7caa1b6b2da1da (diff)
downloadbrdo-d397bbe93587f015cd8db0dbf16ef6d1c1aef78b.tar.gz
brdo-d397bbe93587f015cd8db0dbf16ef6d1c1aef78b.tar.bz2
This a rather large commit that needs a lot of fine-tuning. If you
update, you'll break your site as you need switching from structure to index.module: so this can be considered an intermediate commit. If you upgrade, and you are welcome to, just create a collection called "section" (for now) and assign your nodes some attributes in the described format. Feedback and bugreports are welcomed. Questions will be answered. CHANGES: - comment system: + when replying to a node (rather then to a comment), that node is displayed above the reply form. + when replying to a comment (rather then to a node), that comment is displayd above the reply form. - removed structure.inc, removed structure.module. - node.inc: + added 2 new node functions called 'node_attribute_edit()' and 'node_attribute_save()' used to 'hook in' any indexing system including your home-brewed stuff if you'd want to. Currently, index.module is the facto default index system. See story.module for usage. - book.module, story.module, poll.module, page.module, forum.module: + added preview functionality to administration section (via node module). + removed all references to structure.inc (category, topic). - moderate.module: + removed all references to structure.inc (category, topic). - book.module, story.module, page.module, forum.module: + increased the sizes of some textareas. - submit.php: + removed all references to structure.inc (category, topic). - marvin.theme: + removed dead code: function story() was depricated. - unconed.theme: + removed hardcoded references to drop.org. - marvin.theme, unconed.theme, jeroen.theme, yaroon.theme, example.theme: + removed all references to structure.inc (category, topic). TODO: - file.module, trip_link.module: + update preview functionality: see story.module for example. + remove references to 'cid' and 'tid', use 'attribute' instead: see story.module for example. - extend and build upon index.module as well as making it configurable
Diffstat (limited to 'index.php')
-rw-r--r--index.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/index.php b/index.php
index c8ea0b143..eb80ef99a 100644
--- a/index.php
+++ b/index.php
@@ -4,16 +4,13 @@ include_once "includes/common.inc";
page_header();
-if ($category) {
- $c = "AND cid = '". check_input($category) ."'";
+foreach(explode("&", $QUERY_STRING) as $attribute) {
+ if ($attribute) $query .= "attribute LIKE '%". check_input(strtr($attribute, "=", ":")) ."%' AND ";
}
-if ($topic) {
- foreach (topic_tree($topic) as $key=>$value) $t .= "tid = '$key' OR ";
- $t = "AND ($t tid = '". check_input($topic) ."')";
-}
+$query = !$date ? $query : "";
-$result = db_query("SELECT nid, type FROM node WHERE promote = '1' AND status = '". node_status("posted") ."' AND timestamp <= '". ($date > 0 ? check_input($date) : time()) ."' $c $t ORDER BY timestamp DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get(default_nodes_main, 10)));
+$result = db_query("SELECT nid, type FROM node WHERE $query promote = '1' AND status = '". node_status("posted") ."' AND timestamp <= '". ($date > 0 ? check_input($date) : time()) ."' ORDER BY timestamp DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get(default_nodes_main, 10)));
$theme->header();
while ($node = db_fetch_object($result)) {