summaryrefslogtreecommitdiff
path: root/backend.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-12-10 08:28:55 +0100
committerAndrew Dolgov <[email protected]>2005-12-10 08:28:55 +0100
commit11b0dce2a79cd30263476b7217492055537cbac8 (patch)
treed8d5a37b8fa7ecc42dab2c4ae57d811cc05fe99d /backend.php
parenteb40e11b14b025f3603581977e2f6bbb032967e4 (diff)
display slash:comments in view mode
Diffstat (limited to 'backend.php')
-rw-r--r--backend.php21
1 files changed, 19 insertions, 2 deletions
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 = "&nbsp;";
}
- if ($line["comments"] && $line["link"] != $line["comments"]) {
+/* if ($line["comments"] && $line["link"] != $line["comments"]) {
$entry_comments = "(<a href=\"".$line["comments"]."\">Comments</a>)";
} 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 = "(<a href=\"$comments_url\">$num_comments comments</a>)";
+ } else {
+ if ($line["comments"] && $line["link"] != $line["comments"]) {
+ $entry_comments = "(<a href=\"".$line["comments"]."\">Comments</a>)";
+ }
}
print "<div class=\"postReply\">";