]> git.wh0rd.org Git - tt-rss.git/commitdiff
show enclosures in CDM (refs #165)
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 17 Nov 2007 12:32:48 +0000 (13:32 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 17 Nov 2007 12:32:48 +0000 (13:32 +0100)
functions.php
tt-rss.css

index 6f45a7fe516ddfb77be3dbe82805384b5b58fcce..acfc88db5a68e1390f150fa3ccef0686500ae724 100644 (file)
 
 //                                     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>";
 
index cd33911d4beb4355d3be7f5306c45b1dd641c77d..f58019098eabd74df8ad127e05a55d4bb7a15dba 100644 (file)
@@ -57,12 +57,7 @@ div.postReply div.postIcon {
 }
 
 div.postReply div.postEnclosures {
-       border-width : 1px 0px 0px 0px;
-       border-style : dotted;
-       border-color : #c0c0c0;
-       font-size : 8pt;
        margin-top : 1em;
-       padding-top : 0.2em;
        color : gray;
 }
 
@@ -999,6 +994,11 @@ div.cdmContent {
 
 }
 
+div.cdmEnclosures {
+       margin-top : 1em;
+       color : gray;
+}
+
 a.warning {
        color : #f04040;
 }