diff options
author | Dries Buytaert <dries@buytaert.net> | 2000-06-16 11:00:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2000-06-16 11:00:57 +0000 |
commit | 76f305571c1829d2d50df35075dcb0d3311836df (patch) | |
tree | bb7e8ee5b32a8e271811bdce5b9c089a83b2ef86 | |
parent | a59a55c4d48711d33359c7426433fd7aa14f8fd1 (diff) | |
download | brdo-76f305571c1829d2d50df35075dcb0d3311836df.tar.gz brdo-76f305571c1829d2d50df35075dcb0d3311836df.tar.bz2 |
* Changed a few things to make development easier without breaking things
to the outside world. It's a first step towards improving the submission
queue.
* More important (to the theme babies): instead of passing individual
parameters I'm considering to pass an object.
$theme->abstract($story->aid, $story->informant, $story->time,
stripslashes($story->subject), stripslashes($story->abstract),
stripslashes($story->comments), $story->category, $story->department,
$morelink);
would become:
$theme->abstract($story);
What do you guys think about pushing this trough? It would be much better
and would give extra `power' to the themes.
-rw-r--r-- | index.php | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -1,26 +1,19 @@ <?PHP include "functions.inc"; - -### Log valid referers: -if (($url) && (strstr(getenv("HTTP_REFERER"), $url))) { - addRefer($url); -} - include "theme.inc"; -$theme->header(); -dbconnect(); +$theme->header(); ### Initialize variables: $number = ($user->storynum) ? $user->storynum : 10; $date = ($date) ? $date : time(); ### Perform query: -$result = mysql_query("SELECT * FROM stories WHERE time <= $date ORDER BY sid DESC LIMIT $number"); +$result = db_query("SELECT * FROM stories WHERE status = 1 AND time <= $date ORDER BY sid DESC LIMIT $number"); ### Display stories: -while ($story = mysql_fetch_object($result)) { +while ($story = db_fetch_object($result)) { ### Compose more-link: $morelink = "[ "; if ($story->article) { @@ -30,7 +23,7 @@ while ($story = mysql_fetch_object($result)) { $bytes = strlen($story->article); $morelink .= "\"><FONT COLOR=\"$theme->hlcolor2\"><B>read more</B></FONT></A> | $bytes bytes in body | "; } - $query = mysql_query("SELECT sid FROM comments WHERE sid = $story->sid"); + $query = db_query("SELECT sid FROM comments WHERE sid = $story->sid"); if (!$query) { $count = 0; } else { $count = mysql_num_rows($query); } $morelink .= "<A HREF=\"article.php?sid=$story->sid"; if (isset($user->umode)) { $morelink .= "&mode=$user->umode"; } else { $morelink .= "&mode=threaded"; } @@ -42,8 +35,6 @@ while ($story = mysql_fetch_object($result)) { $theme->abstract($story->aid, $story->informant, $story->time, stripslashes($story->subject), stripslashes($story->abstract), stripslashes($story->comments), $story->category, $story->department, $morelink); } -mysql_free_result($result); - $theme->footer(); ?> |