From 2952d16f78eea91724760f526504010cb8f796a9 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 20 Jan 2001 12:20:31 +0000 Subject: - updated/improved discussion engine: it needs additional fine-tuning though but I think this is stable enough for public consumption and real-life testing. ==> a first big step towards a flexible comment engine. IMPORTANT: - Required theme updatins: UnConeD: check your $theme->controls() as I added a very, very dummy implementation - Required database updates: alter table users modify mode tinyint(1) DEFAULT '' NOT NULL; alter table comments change sid lid int(6) DEFAULT '0' NOT NULL; alter table comments add link varchar(16) DEFAULT '' NOT NULL; update comments set link = 'story'; --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'index.php') diff --git a/index.php b/index.php index 8b5c29ec7..2dc1f4025 100644 --- a/index.php +++ b/index.php @@ -13,7 +13,7 @@ $number = ($user->stories) ? $user->stories : 10; $date = ($date) ? $date : time(); // Perform query: -$result = db_query("SELECT stories.*, users.userid, COUNT(comments.sid) AS comments FROM stories LEFT JOIN comments ON stories.id = comments.sid LEFT JOIN users ON stories.author = users.id WHERE stories.status = 2 AND stories.timestamp <= $date GROUP BY stories.id ORDER BY stories.timestamp DESC LIMIT $number"); +$result = db_query("SELECT stories.*, users.userid, COUNT(comments.lid) AS comments FROM stories LEFT JOIN comments ON stories.id = comments.lid LEFT JOIN users ON stories.author = users.id WHERE stories.status = 2 AND stories.timestamp <= $date GROUP BY stories.id ORDER BY stories.timestamp DESC LIMIT $number"); // Display stories: $theme->header(); -- cgit v1.2.3