diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-04-16 11:38:12 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-04-16 11:38:12 +0000 |
commit | b9952f537d5f1a102e145b0529c78bc31a1509af (patch) | |
tree | 51f6a0ab5c46bd4643c5b2ac0579a4a411e45977 /index.php | |
parent | 49a7dccb64a239097d44e235b525708c6a39d29e (diff) | |
download | brdo-b9952f537d5f1a102e145b0529c78bc31a1509af.tar.gz brdo-b9952f537d5f1a102e145b0529c78bc31a1509af.tar.bz2 |
Large commit, read it carefully, and make the required changes to
your theme:
- corrected some missing translations in story.module. Oops!
- grealty simplified the "moderation threshold mechanism"(tm) so
that module writers don't have to worry about this. As a result
story.module and book.module became a bit smaller and easier to
grasp.
- greatly simplified new "category" and "topic" code which is soon
going to replace the "section" code. Needs more work though so
hang on thight.
- includes/section.inc and modules/section.module are replaced by
includes/structure.module and modules/structure.module.
- beautified example.theme a bit without adding HTML complexity:
it is a good example but still useful as a theme
- made theme example use "categories" and "topics"
--> TAKE A LOOK AT IT AND UPDATE YOUR THEME
- made theme marvin use "categories" and "topics"
--> TAKE A LOOK AT IT AND UPDATE YOUR THEME
- added 2 new "story listings" to administrator interface of
story.module to verify story integrity.
- optimized comment table a bit (work in progress)
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -4,16 +4,12 @@ include_once "includes/common.inc"; if (variable_get(dev_timing, 0)) timer_start(); -// Initialize/pre-process variables: -$number = ($user->nodes) ? $user->nodes : 10; -$date = ($date > 0) ? $date : time(); +$result = db_query("SELECT nid FROM node WHERE type = 'story' AND status = '$status[posted]' AND timestamp <= ". ($date > 0 ? $date : time()) ." ". ($category ? "AND cid = '$category'" : "") ." ". ($topic ? "AND tid = '$topic'" : "") ." ORDER BY timestamp DESC LIMIT ". ($user->nodes ? $user->nodes : 10)); -// Perform query: -$result = db_query("SELECT n.*, s.*, u.userid, COUNT(c.lid) AS comments FROM node n LEFT JOIN story s ON n.nid = s.nid LEFT JOIN comments c ON n.nid = c.lid LEFT JOIN users u ON n.author = u.id WHERE n.status = '$status[posted]' AND n.type = 'story' ". ($section ? "AND s.section = '$section' " : "") ."AND n.timestamp <= $date GROUP BY n.nid ORDER BY n.timestamp DESC LIMIT $number"); - -// Display nodes: $theme->header(); -while ($story = db_fetch_object($result)) $theme->story($story); +while ($node = db_fetch_object($result)) { + node_view(node_get_object("nid", $node->nid)); +} $theme->footer(); if (variable_get(dev_timing, 0)) timer_print(); |