Skip to content
Snippets Groups Projects
Commit 76f30557 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

* 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.
parent a59a55c4
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
<?PHP <?PHP
include "functions.inc"; include "functions.inc";
### Log valid referers:
if (($url) && (strstr(getenv("HTTP_REFERER"), $url))) {
addRefer($url);
}
include "theme.inc"; include "theme.inc";
$theme->header();
dbconnect(); $theme->header();
### Initialize variables: ### Initialize variables:
$number = ($user->storynum) ? $user->storynum : 10; $number = ($user->storynum) ? $user->storynum : 10;
$date = ($date) ? $date : time(); $date = ($date) ? $date : time();
### Perform query: ### 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: ### Display stories:
while ($story = mysql_fetch_object($result)) { while ($story = db_fetch_object($result)) {
### Compose more-link: ### Compose more-link:
$morelink = "[ "; $morelink = "[ ";
if ($story->article) { if ($story->article) {
...@@ -30,7 +23,7 @@ ...@@ -30,7 +23,7 @@
$bytes = strlen($story->article); $bytes = strlen($story->article);
$morelink .= "\"><FONT COLOR=\"$theme->hlcolor2\"><B>read more</B></FONT></A> | $bytes bytes in body | "; $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); } if (!$query) { $count = 0; } else { $count = mysql_num_rows($query); }
$morelink .= "<A HREF=\"article.php?sid=$story->sid"; $morelink .= "<A HREF=\"article.php?sid=$story->sid";
if (isset($user->umode)) { $morelink .= "&mode=$user->umode"; } else { $morelink .= "&mode=threaded"; } if (isset($user->umode)) { $morelink .= "&mode=$user->umode"; } else { $morelink .= "&mode=threaded"; }
...@@ -42,8 +35,6 @@ ...@@ -42,8 +35,6 @@
$theme->abstract($story->aid, $story->informant, $story->time, stripslashes($story->subject), stripslashes($story->abstract), stripslashes($story->comments), $story->category, $story->department, $morelink); $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(); $theme->footer();
?> ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment