From b24504b121315813939fa5af1963bee93b6d9d4d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 30 Oct 2012 12:58:35 +0400 Subject: [PATCH] add ability to auto-assign articles to labels (bump schema) --- classes/feeds.php | 2 +- include/functions.php | 14 +++++++++++- include/rssfuncs.php | 41 ++++++++++++++++++++++++++++++----- schema/ttrss_schema_mysql.sql | 5 ++++- schema/ttrss_schema_pgsql.sql | 5 ++++- schema/versions/mysql/98.sql | 7 ++++++ schema/versions/pgsql/98.sql | 7 ++++++ 7 files changed, 72 insertions(+), 9 deletions(-) create mode 100644 schema/versions/mysql/98.sql create mode 100644 schema/versions/pgsql/98.sql diff --git a/classes/feeds.php b/classes/feeds.php index 8dad1658..ed33b30c 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -162,7 +162,7 @@ class Feeds extends Handler_Protected { $last_updated = strtotime(db_fetch_result($result, 0, "last_updated")); $cache_images = sql_bool_to_bool(db_fetch_result($result, 0, "cache_images")); - if (!$cache_images && time() - $last_updated > 120) { + if (!$cache_images && time() - $last_updated > 120 || isset($_REQUEST['DevForceUpdate'])) { include "rssfuncs.php"; update_rss_feed($this->link, $feed, true, true); } diff --git a/include/functions.php b/include/functions.php index 2e230c3c..4d7f61a2 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,6 +1,6 @@ diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index 8ac8611c..4b2a3369 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -306,7 +306,7 @@ create table ttrss_tags (id integer primary key auto_increment, create table ttrss_version (schema_version int not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8; -insert into ttrss_version values (97); +insert into ttrss_version values (98); create table ttrss_enclosures (id integer primary key auto_increment, content_url text not null, @@ -448,12 +448,15 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) valu insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_INCLUDE_CHILDREN', 1, 'false', '', 1); +insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('AUTO_ASSIGN_LABELS', 1, 'true', 'Assign articles to labels automatically', 3); + update ttrss_prefs set access_level = 1 where pref_name in ('ON_CATCHUP_SHOW_NEXT_FEED', 'SORT_HEADLINES_BY_FEED_DATE', 'VFEED_GROUP_BY_FEED', 'FRESH_ARTICLE_MAX_AGE', 'CDM_EXPANDED', 'SHOW_CONTENT_PREVIEW', + 'AUTO_ASSIGN_LABELS', 'HIDE_READ_SHOWS_SPECIAL'); create table ttrss_user_prefs ( diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index 377261df..a8a76931 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -254,7 +254,7 @@ create index ttrss_tags_post_int_id_idx on ttrss_tags(post_int_id); create table ttrss_version (schema_version int not null); -insert into ttrss_version values (97); +insert into ttrss_version values (98); create table ttrss_enclosures (id serial not null primary key, content_url text not null, @@ -388,12 +388,15 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) valu insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_INCLUDE_CHILDREN', 1, 'false', '', 1); +insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('AUTO_ASSIGN_LABELS', 1, 'true', 'Assign articles to labels automatically', 3); + update ttrss_prefs set access_level = 1 where pref_name in ('ON_CATCHUP_SHOW_NEXT_FEED', 'SORT_HEADLINES_BY_FEED_DATE', 'VFEED_GROUP_BY_FEED', 'FRESH_ARTICLE_MAX_AGE', 'CDM_EXPANDED', 'SHOW_CONTENT_PREVIEW', + 'AUTO_ASSIGN_LABELS', 'HIDE_READ_SHOWS_SPECIAL'); create table ttrss_user_prefs ( diff --git a/schema/versions/mysql/98.sql b/schema/versions/mysql/98.sql new file mode 100644 index 00000000..1984a432 --- /dev/null +++ b/schema/versions/mysql/98.sql @@ -0,0 +1,7 @@ +begin; + +insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,access_level) values('AUTO_ASSIGN_LABELS', 1, 'true', 'Assign articles to labels automatically', 3, 1); + +update ttrss_version set schema_version = 98; + +commit; diff --git a/schema/versions/pgsql/98.sql b/schema/versions/pgsql/98.sql new file mode 100644 index 00000000..1984a432 --- /dev/null +++ b/schema/versions/pgsql/98.sql @@ -0,0 +1,7 @@ +begin; + +insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,access_level) values('AUTO_ASSIGN_LABELS', 1, 'true', 'Assign articles to labels automatically', 3, 1); + +update ttrss_version set schema_version = 98; + +commit; -- 2.39.5