Commit e25c50b9 authored by Dries's avatar Dries

- 3 small bugfixes
parent 7241d38e
......@@ -325,6 +325,7 @@ function comment_render($lid, $cid) {
global $link, $theme, $REQUEST_URI, $user;
// Pre-process variables:
$lid = empty($lid) ? 0 : $lid;
$cid = empty($cid) ? 0 : $cid;
$mode = ($user->id) ? $user->mode : 4;
$order = ($user->id) ? $user->sort : 1;
......
......@@ -73,7 +73,7 @@ function drupal_page() {
break;
default:
$theme->header();
drupal_render(0, $cid);
drupal_render($id, $cid);
$theme->footer();
}
}
......
......@@ -73,7 +73,7 @@ function drupal_page() {
break;
default:
$theme->header();
drupal_render(0, $cid);
drupal_render($id, $cid);
$theme->footer();
}
}
......
......@@ -22,7 +22,7 @@ function story_help() {
}
function story_block() {
$result = db_query("SELECT s.id, COUNT(s.id) AS comments, s.subject FROM stories s LEFT JOIN comments c ON s.id = c.lid WHERE s.status = 2 AND c.link = 'link' GROUP BY s.id ORDER BY comments DESC LIMIT 10");
$result = db_query("SELECT s.id, COUNT(s.id) AS comments, s.subject FROM stories s LEFT JOIN comments c ON s.id = c.lid WHERE s.status = 2 AND c.link = 'story' GROUP BY s.id ORDER BY comments DESC LIMIT 10");
while ($story = db_fetch_object($result)) {
$content .= "<LI><A HREF=\"story.php?id=$story->id\">$story->subject</A><BR><SMALL>(". format_plural($story->comments, "comment", "comments") .")</SMALL></LI>\n";
}
......
......@@ -22,7 +22,7 @@ function story_help() {
}
function story_block() {
$result = db_query("SELECT s.id, COUNT(s.id) AS comments, s.subject FROM stories s LEFT JOIN comments c ON s.id = c.lid WHERE s.status = 2 AND c.link = 'link' GROUP BY s.id ORDER BY comments DESC LIMIT 10");
$result = db_query("SELECT s.id, COUNT(s.id) AS comments, s.subject FROM stories s LEFT JOIN comments c ON s.id = c.lid WHERE s.status = 2 AND c.link = 'story' GROUP BY s.id ORDER BY comments DESC LIMIT 10");
while ($story = db_fetch_object($result)) {
$content .= "<LI><A HREF=\"story.php?id=$story->id\">$story->subject</A><BR><SMALL>(". format_plural($story->comments, "comment", "comments") .")</SMALL></LI>\n";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment