schema: ttrss_feeds, new field - include_in_digest

This commit is contained in:
Andrew Dolgov 2006-08-22 08:29:18 +01:00
parent 5f2cd401f9
commit 3dd9183cd6
6 changed files with 29 additions and 2 deletions

View file

@ -1358,6 +1358,18 @@
print "<br><input type=\"checkbox\" id=\"hidden\" name=\"hidden\" print "<br><input type=\"checkbox\" id=\"hidden\" name=\"hidden\"
$checked><label for=\"hidden\">Hide from my feed list</label>"; $checked><label for=\"hidden\">Hide from my feed list</label>";
$include_in_digest = sql_bool_to_bool(db_fetch_result($result, 0, "include_in_digest"));
if ($include_in_digest) {
$checked = "checked";
} else {
$checked = "";
}
print "<br><input type=\"checkbox\" id=\"include_in_digest\"
name=\"include_in_digest\"
$checked><label for=\"include_in_digest\">Include in e-mail digest</label>";
print "</td></tr>"; print "</td></tr>";
print "</table>"; print "</table>";
@ -1389,6 +1401,8 @@
$private = checkbox_to_sql_bool(db_escape_string($_POST["private"])); $private = checkbox_to_sql_bool(db_escape_string($_POST["private"]));
$rtl_content = checkbox_to_sql_bool(db_escape_string($_POST["rtl_content"])); $rtl_content = checkbox_to_sql_bool(db_escape_string($_POST["rtl_content"]));
$hidden = checkbox_to_sql_bool(db_escape_string($_POST["hidden"])); $hidden = checkbox_to_sql_bool(db_escape_string($_POST["hidden"]));
$include_in_digest = checkbox_to_sql_bool(
db_escape_string($_POST["include_in_digest"]));
if (get_pref($link, 'ENABLE_FEED_CATS')) { if (get_pref($link, 'ENABLE_FEED_CATS')) {
if ($cat_id && $cat_id != 0) { if ($cat_id && $cat_id != 0) {
@ -1416,7 +1430,8 @@
auth_pass = '$auth_pass', auth_pass = '$auth_pass',
private = $private, private = $private,
rtl_content = $rtl_content, rtl_content = $rtl_content,
hidden = $hidden hidden = $hidden,
include_in_digest = $include_in_digest
WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]); WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]);
} }

View file

@ -2438,7 +2438,7 @@
ttrss_user_entries,ttrss_entries,ttrss_feeds ttrss_user_entries,ttrss_entries,ttrss_feeds
WHERE WHERE
ref_id = ttrss_entries.id AND feed_id = ttrss_feeds.id ref_id = ttrss_entries.id AND feed_id = ttrss_feeds.id
AND hidden = false AND include_in_digest = true
AND $interval_query AND $interval_query
AND ttrss_user_entries.owner_uid = $user_id AND ttrss_user_entries.owner_uid = $user_id
AND unread = true ORDER BY ttrss_feeds.title, date_entered DESC AND unread = true ORDER BY ttrss_feeds.title, date_entered DESC

View file

@ -65,6 +65,7 @@ create table ttrss_feeds (id integer not null auto_increment primary key,
private bool not null default false, private bool not null default false,
rtl_content bool not null default false, rtl_content bool not null default false,
hidden bool not null default false, hidden bool not null default false,
include_in_digest boolean not null default true,
index(owner_uid), index(owner_uid),
foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE, foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE,
index(cat_id), index(cat_id),

View file

@ -60,6 +60,7 @@ create table ttrss_feeds (id serial not null primary key,
private boolean not null default false, private boolean not null default false,
auth_pass varchar(250) not null default '', auth_pass varchar(250) not null default '',
hidden boolean not null default false, hidden boolean not null default false,
include_in_digest boolean not null default true,
rtl_content boolean not null default false); rtl_content boolean not null default false);
create index ttrss_feeds_owner_uid_index on ttrss_feeds(owner_uid); create index ttrss_feeds_owner_uid_index on ttrss_feeds(owner_uid);

View file

@ -1,5 +1,10 @@
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('DIGEST_ENABLE', 1, 'false', 'Enable e-mail digest',1, insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('DIGEST_ENABLE', 1, 'false', 'Enable e-mail digest',1,
'This option enables sending daily digest of new (and unread) headlines on your configured e-mail address'); 'This option enables sending daily digest of new (and unread) headlines on your configured e-mail address');
alter table ttrss_feeds add column include_in_digest bool;
update ttrss_feeds set include_in_digest = true;
alter table ttrss_feeds change include_in_digest include_in_digest bool not null;
alter table ttrss_feeds alter column include_in_digest set default true;
update ttrss_version set schema_version = 10; update ttrss_version set schema_version = 10;

View file

@ -1,5 +1,10 @@
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('DIGEST_ENABLE', 1, 'false', 'Enable e-mail digest',1, insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('DIGEST_ENABLE', 1, 'false', 'Enable e-mail digest',1,
'This option enables sending daily digest of new (and unread) headlines on your configured e-mail address'); 'This option enables sending daily digest of new (and unread) headlines on your configured e-mail address');
alter table ttrss_feeds add column include_in_digest boolean;
update ttrss_feeds set include_in_digest = true;
alter table ttrss_feeds alter column include_in_digest set not null;
alter table ttrss_feeds alter column include_in_digest set default true;
update ttrss_version set schema_version = 10; update ttrss_version set schema_version = 10;