summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.php17
1 files changed, 4 insertions, 13 deletions
diff --git a/index.php b/index.php
index 9fde6521a..70b20ac89 100644
--- a/index.php
+++ b/index.php
@@ -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();
?>