summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-11-17 13:32:48 +0100
committerAndrew Dolgov <[email protected]>2007-11-17 13:32:48 +0100
commit3c66b582e67284ef9509c1ca90d13c319e923faa (patch)
treed7fdeaf26353c438774d0a122058bf3d2f776da5 /functions.php
parentce53e200b475675389f6903f341d99116f3ef0b7 (diff)
show enclosures in CDM (refs #165)
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/functions.php b/functions.php
index 6f45a7fe5..acfc88db5 100644
--- a/functions.php
+++ b/functions.php
@@ -4815,6 +4815,38 @@
// print "<div class=\"cdmInnerContent\" id=\"CICD-$id\" $cdm_cstyle>";
print $line["content_preview"];
+
+ $e_result = db_query($link, "SELECT * FROM ttrss_enclosures WHERE
+ post_id = '$id'");
+
+ if (db_num_rows($e_result) > 0) {
+ print "<div class=\"cdmEnclosures\">";
+
+ if (db_num_rows($e_result) == 1) {
+ print __("Attachment:") . " ";
+ } else {
+ print __("Attachments:") . " ";
+ }
+
+ $entries = array();
+
+ while ($e_line = db_fetch_assoc($e_result)) {
+
+ $url = $e_line["content_url"];
+
+ $filename = substr($url, strrpos($url, "/")+1);
+
+ $entry = "<a href=\"" . htmlspecialchars($url) . "\">" .
+ $filename . " (" . $e_line["content_type"] . ")" . "</a>";
+
+ array_push($entries, $entry);
+ }
+
+ print join(", ", $entries);
+
+ print "</div>";
+ }
+
print "<br clear='both'>";
// print "</div>";