drupal/index.php

27 lines
747 B
PHP
Raw Normal View History

<?php
2000-05-18 19:51:59 +00:00
include_once "includes/common.inc";
2000-05-18 19:51:59 +00:00
page_header();
if ($category) {
$c = "AND cid = '". check_input($category) ."'";
}
if ($topic) {
foreach (topic_tree($topic) as $key=>$value) $t .= "tid = '$key' OR ";
$t = "AND ($t tid = '". check_input($topic) ."')";
}
$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)));
2000-05-18 19:51:59 +00:00
IMPORANT - IMPORTANT - :) ========================= Wulp. I did a major upgrade by (a) breaking a lot of stuff and (b) by re-doing those things in a much better way. I redesigned the stories and submissions SQL tables, the way they work and the way they co- operate together. In addition, I changed the way parameters are passed to $theme->abstract() and $theme->article(). Instead of passing a sh!tload of parameters that only cluttered the code and required too much pre-processing on the engine-side, we now pass a singly object $story. $story has more variables then the paramaters we used to pass, so it allows for better theming (if you feel like it). I'm not finished yet but I decided to upload my changes so you can start patching and updating your themes: PLEASE update your themes ASAP! I don't plan making heavy changes like this again, so don't get intimiated. ;) You mainly have to update article() and abstract() as well as a minor update of footer(): article(), abstract(): ---------------------- - use the $story object - see my theme! - the morelink can now be themed. Currently you can use the function morelink_bytes() in function.inc to `render' the old morelink. The idea is to make a morelink_words() or morelink_lines() sooner or later because "188 bytes in body" is not half as clear as "52 words in body". Clearly, "52 words" is much more informative. ;-) footer(): --------- - in the article-part, you need to update the displayRelatedLinks(): instead of passing it $sid, you need to pass it $story (after you globaled $story). Everything should display correct on the following pages: - main page - article page (follow a `read more | xxx bytes in bdoy | x comments' link) - submission queue Check if they work with your theme: they should as they work fine for me (theme `Dries') ... If you got stuck, just look at my theme or ask for a hand on the list! Hopefully you can update your themes asap. Thanks in advance.
2000-06-21 15:41:20 +00:00
$theme->header();
while ($node = db_fetch_object($result)) {
node_view(node_get_object(array("nid" => $node->nid, "type" => $node->type)), 1);
}
2000-05-18 19:51:59 +00:00
$theme->footer();
page_footer();
2000-05-19 11:20:58 +00:00
?>