2001-03-10 11:07:52 +00:00
< ? php
2000-05-18 19:51:59 +00:00
2001-02-04 22:09:38 +00:00
include_once " includes/common.inc " ;
2000-05-18 19:51:59 +00:00
2000-12-30 11:58:14 +00:00
// Initialize/pre-process variables:
2001-03-24 17:04:11 +00:00
$number = ( $user -> nodes ) ? $user -> nodes : 10 ;
2001-03-07 21:29:40 +00:00
$date = ( $date > 0 ) ? $date : time ();
2000-05-18 19:51:59 +00:00
2000-12-30 11:58:14 +00:00
// Perform query:
2001-03-29 19:50:31 +00:00
$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 " );
2000-05-18 19:51:59 +00:00
2001-03-24 17:04:11 +00:00
// Display nodes:
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 ();
2001-03-08 08:16:23 +00:00
while ( $story = db_fetch_object ( $result )) $theme -> story ( $story );
2000-05-18 19:51:59 +00:00
$theme -> footer ();
2000-05-19 11:20:58 +00:00
?>