]> git.wh0rd.org - tt-rss.git/commitdiff
add ttrss_feeds.update_on_checksum_change
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 29 Mar 2011 08:09:42 +0000 (12:09 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 29 Mar 2011 08:16:09 +0000 (12:16 +0400)
functions.php
modules/pref-feeds.php
schema/ttrss_schema_mysql.sql
schema/ttrss_schema_pgsql.sql
schema/versions/mysql/83.sql
schema/versions/pgsql/83.sql

index e3e477f0f3463914686c403550c74e9ab63e7b19..ec449f27469a67bc4f9227aa6211ccabdbc2c0db 100644 (file)
 
                        $result = db_query($link, "SELECT id,update_interval,auth_login,
                                feed_url,auth_pass,cache_images,update_method,last_updated,
-                               mark_unread_on_update, owner_uid
+                               mark_unread_on_update, owner_uid, update_on_checksum_change
                                FROM ttrss_feeds WHERE id = '$feed'");
 
                }
                $last_updated = db_fetch_result($result, 0, "last_updated");
                $owner_uid = db_fetch_result($result, 0, "owner_uid");
                $mark_unread_on_update = db_fetch_result($result, 0, "mark_unread_on_update");
+               $update_on_checksum_change = db_fetch_result($result, 0, "update_on_checksum_change");
 
                db_query($link, "UPDATE ttrss_feeds SET last_update_started = NOW()
                        WHERE id = '$feed'");
 
                                        $post_needs_update = false;
 
-                                       if (get_pref($link, "UPDATE_POST_ON_CHECKSUM_CHANGE", $owner_uid, false) &&
-                                               ($content_hash != $orig_content_hash)) {
+                                       if ($update_on_checksum_change && $content_hash != $orig_content_hash) {
 //                                             print "<!-- [$entry_title] $content_hash vs $orig_content_hash -->";
                                                $post_needs_update = true;
                                        }
index 76b24bfd0c5af82d5b3836299fb8783dfd764577..9b06cbe5fc49eed48859dac03678de1ec7de88aa 100644 (file)
                                name=\"mark_unread_on_update\"
                                $checked>&nbsp;<label for=\"mark_unread_on_update\">".__('Mark updated articles as unread')."</label>";
 
+                       $update_on_checksum_change = sql_bool_to_bool(db_fetch_result($result, 0, "update_on_checksum_change"));
+
+                       if ($update_on_checksum_change) {
+                               $checked = "checked";
+                       } else {
+                               $checked = "";
+                       }
+
+                       print "<hr/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" id=\"update_on_checksum_change\"
+                               name=\"update_on_checksum_change\"
+                               $checked>&nbsp;<label for=\"update_on_checksum_change\">".__('Mark posts as updated on content change')."</label>";
+
 #                      print "</div>";
                        print "</div>";
 
 
                        print "&nbsp;"; batch_edit_cbox("mark_unread_on_update", "mark_unread_on_update_l");
 
+                       print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"update_on_checksum_change\"
+                               name=\"update_on_checksum_change\"
+                               dojoType=\"dijit.form.CheckBox\">&nbsp;<label id=\"update_on_checksum_change_l\" class='insensitive' for=\"update_on_checksum_change\">".__('Mark posts as updated on content change')."</label>";
+
+                       print "&nbsp;"; batch_edit_cbox("update_on_checksum_change", "update_on_checksum_change_l");
 
                        print "</div>";
 
                        $mark_unread_on_update = checkbox_to_sql_bool(
                                db_escape_string($_POST["mark_unread_on_update"]));
 
+                       $update_on_checksum_change = checkbox_to_sql_bool(
+                               db_escape_string($_POST["update_on_checksum_change"]));
+
                        if (get_pref($link, 'ENABLE_FEED_CATS')) {
                                if ($cat_id && $cat_id != 0) {
                                        $category_qpart = "cat_id = '$cat_id',";
                                        include_in_digest = $include_in_digest,
                                        always_display_enclosures = $always_display_enclosures,
                                        mark_unread_on_update = $mark_unread_on_update,
+                                       update_on_checksum_change = $update_on_checksum_change,
                                        update_method = '$update_method'
                                        WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]);
 
                                                        $qpart = "mark_unread_on_update = '$mark_unread_on_update'";
                                                        break;
 
+                                               case "update_on_checksum_change":
+                                                       $qpart = "update_on_checksum_change = '$update_on_checksum_change'";
+                                                       break;
+
                                                case "cache_images":
                                                        $qpart = "cache_images = '$cache_images'";
                                                        break;
index ab27c1b759f4e53d72971084112c589cc914e9e8..46e08dea450f36fee6d3e850d679d89ae919cf1d 100644 (file)
@@ -123,6 +123,7 @@ create table ttrss_feeds (id integer not null auto_increment primary key,
        update_method integer not null default 0,
        order_id integer not null default 0,
        mark_unread_on_update boolean not null default false,
+       update_on_checksum_change boolean not null default false,
        strip_images boolean not null default false,
        index(owner_uid),
        foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE,
@@ -304,7 +305,6 @@ create table ttrss_prefs (pref_name varchar(250) not null primary key,
        foreign key (section_id) references ttrss_prefs_sections(id)) TYPE=InnoDB DEFAULT CHARSET=UTF8;
 
 insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('PURGE_OLD_DAYS', 3, '60', 'Purge old posts after this number of days (0 - disables)',1);
-insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('UPDATE_POST_ON_CHECKSUM_CHANGE', 1, 'true', 'Update post on checksum change',1);
 
 insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('DEFAULT_UPDATE_INTERVAL', 3, '30', 'Default interval between feed updates',1);
 
index c7c51c5ae9c01d431d11c0c9b1a921c3075f5fc0..8d87663d5ccad0bb2ce757facdb164e252537707 100644 (file)
@@ -86,6 +86,7 @@ create table ttrss_feeds (id serial not null primary key,
        always_display_enclosures boolean not null default false,
        order_id integer not null default 0,
        mark_unread_on_update boolean not null default false,
+       update_on_checksum_change boolean not null default false,
        strip_images boolean not null default false,
        auth_pass_encrypted boolean not null default false);    
 
@@ -267,7 +268,6 @@ create table ttrss_prefs (pref_name varchar(250) not null primary key,
        def_value text not null);
 
 insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('PURGE_OLD_DAYS', 3, '60', 'Purge old posts after this number of days (0 - disables)',1);
-insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('UPDATE_POST_ON_CHECKSUM_CHANGE', 1, 'true', 'Update post on checksum change',1);
        
 insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('DEFAULT_UPDATE_INTERVAL', 3, '30', 'Default interval between feed updates',1);
 
index aa1d6c1ee3d5fc06d838bf35a0fbdd66ea0e15d9..b86091532ba3b4a9c8ad6446fabe8c02746c45af 100644 (file)
@@ -10,9 +10,14 @@ update ttrss_feeds set strip_images = false;
 alter table ttrss_feeds change strip_images strip_images boolean not null;
 alter table ttrss_feeds alter column strip_images set default false;
 
-DELETE FROM ttrss_user_prefs WHERE pref_name IN ('HIDE_FEEDLIST', 'SYNC_COUNTERS', 'ENABLE_LABELS', 'ENABLE_SEARCH_TOOLBAR', 'ENABLE_FEED_ICONS', 'ENABLE_OFFLINE_READING', 'EXTENDED_FEEDLIST', 'OPEN_LINKS_IN_NEW_WINDOW', 'ENABLE_FLASH_PLAYER', 'HEADLINES_SMART_DATE', 'MARK_UNREAD_ON_UPDATE');
+alter table ttrss_feeds add column update_on_checksum_change boolean;
+update ttrss_feeds set update_on_checksum_change = false;
+alter table ttrss_feeds change update_on_checksum_change update_on_checksum_change boolean not null;
+alter table ttrss_feeds alter column update_on_checksum_change set default false;
 
-DELETE FROM ttrss_prefs WHERE pref_name IN ('HIDE_FEEDLIST', 'SYNC_COUNTERS', 'ENABLE_LABELS', 'ENABLE_SEARCH_TOOLBAR', 'ENABLE_FEED_ICONS', 'ENABLE_OFFLINE_READING', 'EXTENDED_FEEDLIST', 'OPEN_LINKS_IN_NEW_WINDOW', 'ENABLE_FLASH_PLAYER', 'HEADLINES_SMART_DATE', 'MARK_UNREAD_ON_UPDATE');
+DELETE FROM ttrss_user_prefs WHERE pref_name IN ('HIDE_FEEDLIST', 'SYNC_COUNTERS', 'ENABLE_LABELS', 'ENABLE_SEARCH_TOOLBAR', 'ENABLE_FEED_ICONS', 'ENABLE_OFFLINE_READING', 'EXTENDED_FEEDLIST', 'OPEN_LINKS_IN_NEW_WINDOW', 'ENABLE_FLASH_PLAYER', 'HEADLINES_SMART_DATE', 'MARK_UNREAD_ON_UPDATE', 'UPDATE_POST_ON_CHECKSUM_CHANGE');
+
+DELETE FROM ttrss_prefs WHERE pref_name IN ('HIDE_FEEDLIST', 'SYNC_COUNTERS', 'ENABLE_LABELS', 'ENABLE_SEARCH_TOOLBAR', 'ENABLE_FEED_ICONS', 'ENABLE_OFFLINE_READING', 'EXTENDED_FEEDLIST', 'OPEN_LINKS_IN_NEW_WINDOW', 'ENABLE_FLASH_PLAYER', 'HEADLINES_SMART_DATE', 'MARK_UNREAD_ON_UPDATE', 'UPDATE_POST_ON_CHECKSUM_CHANGE');
 
 update ttrss_version set schema_version = 83;
 
index 4ba7120c1b8e68af711b5be37942abe031dcf2d7..12ffb17332241758025e143f0f2318370b0a7794 100644 (file)
@@ -10,9 +10,14 @@ update ttrss_feeds set strip_images = false;
 alter table ttrss_feeds alter column strip_images set not null;
 alter table ttrss_feeds alter column strip_images set default false;
 
-DELETE FROM ttrss_user_prefs WHERE pref_name IN ('HIDE_FEEDLIST', 'SYNC_COUNTERS', 'ENABLE_LABELS', 'ENABLE_SEARCH_TOOLBAR', 'ENABLE_FEED_ICONS', 'ENABLE_OFFLINE_READING', 'EXTENDED_FEEDLIST', 'OPEN_LINKS_IN_NEW_WINDOW', 'ENABLE_FLASH_PLAYER', 'HEADLINES_SMART_DATE', 'MARK_UNREAD_ON_UPDATE');
+alter table ttrss_feeds add column update_on_checksum_change boolean;
+update ttrss_feeds set update_on_checksum_change = false;
+alter table ttrss_feeds alter column update_on_checksum_change set not null;
+alter table ttrss_feeds alter column update_on_checksum_change set default false;
 
-DELETE FROM ttrss_prefs WHERE pref_name IN ('HIDE_FEEDLIST', 'SYNC_COUNTERS', 'ENABLE_LABELS', 'ENABLE_SEARCH_TOOLBAR', 'ENABLE_FEED_ICONS', 'ENABLE_OFFLINE_READING', 'EXTENDED_FEEDLIST', 'OPEN_LINKS_IN_NEW_WINDOW', 'ENABLE_FLASH_PLAYER', 'HEADLINES_SMART_DATE', 'MARK_UNREAD_ON_UPDATE');
+DELETE FROM ttrss_user_prefs WHERE pref_name IN ('HIDE_FEEDLIST', 'SYNC_COUNTERS', 'ENABLE_LABELS', 'ENABLE_SEARCH_TOOLBAR', 'ENABLE_FEED_ICONS', 'ENABLE_OFFLINE_READING', 'EXTENDED_FEEDLIST', 'OPEN_LINKS_IN_NEW_WINDOW', 'ENABLE_FLASH_PLAYER', 'HEADLINES_SMART_DATE', 'MARK_UNREAD_ON_UPDATE', 'UPDATE_POST_ON_CHECKSUM_CHANGE');
+
+DELETE FROM ttrss_prefs WHERE pref_name IN ('HIDE_FEEDLIST', 'SYNC_COUNTERS', 'ENABLE_LABELS', 'ENABLE_SEARCH_TOOLBAR', 'ENABLE_FEED_ICONS', 'ENABLE_OFFLINE_READING', 'EXTENDED_FEEDLIST', 'OPEN_LINKS_IN_NEW_WINDOW', 'ENABLE_FLASH_PLAYER', 'HEADLINES_SMART_DATE', 'MARK_UNREAD_ON_UPDATE', 'UPDATE_POST_ON_CHECKSUM_CHANGE');
 
 update ttrss_version set schema_version = 83;