From 11b0dce2a79cd30263476b7217492055537cbac8 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 10 Dec 2005 08:28:55 +0100 Subject: display slash:comments in view mode --- backend.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'backend.php') diff --git a/backend.php b/backend.php index a31afb61b..c087b3225 100644 --- a/backend.php +++ b/backend.php @@ -631,7 +631,8 @@ $result = db_query($link, "SELECT title,link,content,feed_id,comments,int_id, SUBSTRING(updated,1,16) as updated, - (SELECT icon_url FROM ttrss_feeds WHERE id = feed_id) as icon_url + (SELECT icon_url FROM ttrss_feeds WHERE id = feed_id) as icon_url, + num_comments FROM ttrss_entries,ttrss_user_entries WHERE id = '$id' AND ref_id = id"); @@ -669,10 +670,26 @@ $feed_icon = " "; } - if ($line["comments"] && $line["link"] != $line["comments"]) { +/* if ($line["comments"] && $line["link"] != $line["comments"]) { $entry_comments = "(Comments)"; } else { $entry_comments = ""; + } */ + + $num_comments = $line["num_comments"]; + $entry_comments = ""; + + if ($num_comments > 0) { + if ($line["comments"]) { + $comments_url = $line["comments"]; + } else { + $comments_url = $line["link"]; + } + $entry_comments = "($num_comments comments)"; + } else { + if ($line["comments"] && $line["link"] != $line["comments"]) { + $entry_comments = "(Comments)"; + } } print "
"; -- cgit v1.2.3-54-g00ecf