]> git.wh0rd.org Git - tt-rss.git/commitdiff
merge two patches: STRIP_IMAGES and ENABLE_FLASH_PLAYER from Sten (bump schema)
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 1 Aug 2008 03:38:17 +0000 (04:38 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 1 Aug 2008 03:38:17 +0000 (04:38 +0100)
extras/button/license.txt [new file with mode: 0644]
extras/button/musicplayer.swf [new file with mode: 0644]
extras/button/musicplayer_f6.swf [new file with mode: 0644]
functions.php
sanity_check.php
schema/ttrss_schema_mysql.sql
schema/ttrss_schema_pgsql.sql

diff --git a/extras/button/license.txt b/extras/button/license.txt
new file mode 100644 (file)
index 0000000..12d609e
--- /dev/null
@@ -0,0 +1,10 @@
+Copyright (c) 2005, Fabricio Zuardi\r
+All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\r
+\r
+    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\r
+    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\r
+    * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
diff --git a/extras/button/musicplayer.swf b/extras/button/musicplayer.swf
new file mode 100644 (file)
index 0000000..39c8d53
Binary files /dev/null and b/extras/button/musicplayer.swf differ
diff --git a/extras/button/musicplayer_f6.swf b/extras/button/musicplayer_f6.swf
new file mode 100644 (file)
index 0000000..2eb5d57
Binary files /dev/null and b/extras/button/musicplayer_f6.swf differ
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);
index ee715a8234352d6cb3e5dce12e9db835f7a35807..1afd28d945e2c64aa4e78b8f97dc603c288ee508 100644 (file)
@@ -2,7 +2,7 @@
        require_once "functions.php";
 
        define('EXPECTED_CONFIG_VERSION', 17);
-       define('SCHEMA_VERSION', 38);
+       define('SCHEMA_VERSION', 39);
 
        if (!file_exists("config.php")) {
                print __("<b>Fatal Error</b>: You forgot to copy 
index 59a8c83b5c31229e82bef3afc431dc02165f90fb..c2a5ce58047c6280a4619c2b671f511fe98fa9fa 100644 (file)
@@ -209,7 +209,7 @@ create table ttrss_tags (id integer primary key auto_increment,
 
 create table ttrss_version (schema_version int not null) TYPE=InnoDB;
 
-insert into ttrss_version values (38);
+insert into ttrss_version values (39);
 
 create table ttrss_enclosures (id serial not null primary key,
        content_url text not null,
@@ -334,6 +334,10 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_
 
 insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('SYNC_COUNTERS', 1, 'false', 'Prefer more accurate feedlist counters to UI speed',3);
 
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('STRIP_IMAGES', 1, 'false', 'Do not show images in articles', 2);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('ENABLE_FLASH_PLAYER', 1, 'false', 'Enable inline MP3 player', 3, 'Enable the Flash-based XSPF Player to play MP3-format podcast enclosures.');
+
 create table ttrss_user_prefs (
    owner_uid integer not null,
    pref_name varchar(250),
index c0cddfbadcff84cb5f1ff64a48acef0b2b2d9545..ba5ebac28a9c04372871e33c5b2ff057db189b96 100644 (file)
@@ -189,7 +189,7 @@ create index ttrss_tags_owner_uid_index on ttrss_tags(owner_uid);
 
 create table ttrss_version (schema_version int not null);
 
-insert into ttrss_version values (38);
+insert into ttrss_version values (39);
 
 create table ttrss_enclosures (id serial not null primary key,
        content_url text not null,
@@ -308,6 +308,10 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_
 
 insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('SYNC_COUNTERS', 1, 'false', 'Prefer more accurate feedlist counters to UI speed',3);
 
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('STRIP_IMAGES', 1, 'false', 'Do not show images in articles', 2);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('ENABLE_FLASH_PLAYER', 1, 'false', 'Enable inline MP3 player', 3, 'Enable the Flash-based XSPF Player to play MP3-format podcast enclosures.');
+
 create table ttrss_user_prefs (
        owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE,
        pref_name varchar(250) not null references ttrss_prefs(pref_name) ON DELETE CASCADE,