summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2008-10-24 05:49:22 +0100
committerAndrew Dolgov <[email protected]>2008-10-24 05:49:22 +0100
commita3eeb47167559eae03cd9d155a9ff85400094e80 (patch)
tree2b7220ffefb0a3cfc875733371533c84dadb6fb1 /functions.php
parent9c5ee7e11b1ee73c9b1622c508c7d483962c3d8e (diff)
i can haz cheeseburger - enable for CDM
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php37
1 files changed, 29 insertions, 8 deletions
diff --git a/functions.php b/functions.php
index 180654c08..f9c78bee3 100644
--- a/functions.php
+++ b/functions.php
@@ -5284,14 +5284,8 @@
post_id = '$id' AND content_url != ''");
if (db_num_rows($e_result) > 0) {
- print "<div class=\"cdmEnclosures\">";
-
- if (db_num_rows($e_result) == 1) {
- print __("Attachment:") . " ";
- } else {
- print __("Attachments:") . " ";
- }
+ $entries_html = array();
$entries = array();
while ($e_line = db_fetch_assoc($e_result)) {
@@ -5314,14 +5308,41 @@
$entry .= "<a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
$filename . " (" . $ctype . ")" . "</a>";
+ array_push($entries_html, $entry);
+
+ $entry = array();
+
+ $entry["type"] = $ctype;
+ $entry["filename"] = $filename;
+ $entry["url"] = $url;
+
array_push($entries, $entry);
}
- print join(", ", $entries);
+ if (!preg_match("/img/i", $line["content"])) {
+ foreach ($entries as $entry) {
+ if (preg_match("/image/", $entry["type"])) {
+ print "<p><img
+ alt=\"".htmlspecialchars($entry["filename"])."\"
+ src=\"" .htmlspecialchars($entry["url"]) . "\"></p>";
+ }
+ }
+ }
+
+ print "<div class=\"cdmEnclosures\">";
+
+ if (db_num_rows($e_result) == 1) {
+ print __("Attachment:") . " ";
+ } else {
+ print __("Attachments:") . " ";
+ }
+
+ print join(", ", $entries_html);
print "</div>";
}
+
print "<br clear='both'>";
// print "</div>";