From: Andrew Dolgov Date: Wed, 20 Feb 2008 05:52:07 +0000 (+0100) Subject: do not display empty attachments X-Git-Tag: 1.2.20~19 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=4752b0412abb64c6ec32b1ffd18a9b8694598009;p=tt-rss.git do not display empty attachments --- diff --git a/functions.php b/functions.php index 591819ad..3e6c0bcb 100644 --- a/functions.php +++ b/functions.php @@ -4619,7 +4619,7 @@ print $line["content"]; $result = db_query($link, "SELECT * FROM ttrss_enclosures WHERE - post_id = '$id'"); + post_id = '$id' AND content_url != ''"); if (db_num_rows($result) > 0) { print "
"; @@ -4635,11 +4635,14 @@ while ($line = db_fetch_assoc($result)) { $url = $line["content_url"]; + $ctype = $line["content_type"]; + + if (!$ctype) $ctype = __("unknown type"); $filename = substr($url, strrpos($url, "/")+1); $entry = "" . - $filename . " (" . $line["content_type"] . ")" . ""; + $filename . " (" . $ctype . ")" . ""; array_push($entries, $entry); } @@ -4986,7 +4989,7 @@ print $line["content_preview"]; $e_result = db_query($link, "SELECT * FROM ttrss_enclosures WHERE - post_id = '$id'"); + post_id = '$id' AND content_url != ''"); if (db_num_rows($e_result) > 0) { print "
"; @@ -5002,11 +5005,13 @@ while ($e_line = db_fetch_assoc($e_result)) { $url = $e_line["content_url"]; + $ctype = $e_line["content_type"]; + if (!$ctype) $ctype = __("unknown type"); $filename = substr($url, strrpos($url, "/")+1); $entry = "" . - $filename . " (" . $e_line["content_type"] . ")" . ""; + $filename . " (" . $ctype . ")" . ""; array_push($entries, $entry); }