]> git.wh0rd.org - tt-rss.git/blobdiff - functions.php
merge two patches: STRIP_IMAGES and ENABLE_FLASH_PLAYER from Sten (bump schema)
[tt-rss.git] / functions.php
index 8e2acb2229e14f9567a89da91180819375e3032f..e00faf6b6a3f30974b47b77c74e4ef2882a53a63 100644 (file)
 //                     $res = strip_tags_long($res, "<p><a><i><em><b><strong><blockquote><br><img><div><span>");                       
                }
 
+               if (get_pref($link, "STRIP_IMAGES")) {
+                       
+                       $res = preg_replace('/<img[^>]+>/is', '', $res);
+
+               }
+
                return $res;
        }
 
 
                                        $filename = substr($url, strrpos($url, "/")+1);
 
-                                       $entry = "<a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
+                                       $entry = ""; 
+                                       
+                                       if (($ctype = __("audio/mpeg")) && 
+                                               (get_pref($link, "ENABLE_FLASH_PLAYER")) ) { 
+                                       
+                                               $entry .= "<object type=\"application/x-shockwave-flash\" data=\"extras/button/musicplayer.swf?song_url=$url\" width=\"20\" height=\"20\"> <param name=\"movie\" value=\"extras/button/musicplayer.swf?song_url=$url\" /> </object>";
+
+                                       }
+
+                                       $entry .= "<a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
                                                $filename . " (" . $ctype . ")" . "</a>";
 
                                        array_push($entries, $entry);
 
 //                                     print "<div class=\"cdmInnerContent\" id=\"CICD-$id\" $cdm_cstyle>";
 
-                                       print $line["content_preview"];
+                                       print sanitize_rss($line["content_preview"]);
 
                                        $e_result = db_query($link, "SELECT * FROM ttrss_enclosures WHERE
                                                post_id = '$id' AND content_url != ''");
 
                                        $filename = substr($url, strrpos($url, "/")+1);
 
-                                       $entry = "<a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
+                                       $entry = ""; 
+                                       
+                                       if (($ctype = __("audio/mpeg")) && 
+                                               (get_pref($link, "ENABLE_FLASH_PLAYER")) ) { 
+                                               
+                                               $entry .= "<object type=\"application/x-shockwave-flash\" data=\"extras/button/musicplayer.swf?song_url=$url\" width=\"20\" height=\"20\"> <param name=\"movie\" value=\"extras/button/musicplayer.swf?song_url=$url\" /> </object>"; 
+                                       
+                                       }
+
+                                       $entry .= "<a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
                                                $filename . " (" . $ctype . ")" . "</a>";
 
                                        array_push($entries, $entry);