// error_reporting(0);
$article_filters = get_article_filters($filters, $entry_title,
- $entry_content, $entry_link, $entry_timestamp);
+ $entry_content, $entry_link, $entry_timestamp, $entry_author);
if (defined('DAEMON_EXTENDED_DEBUG') || $_REQUEST['xdebug']) {
_debug("update_rss_feed: article filters: ");
print "</select>";
}
- function get_article_filters($filters, $title, $content, $link, $timestamp) {
+ function get_article_filters($filters, $title, $content, $link, $timestamp, $author) {
$matches = array();
if ($filters["title"]) {
}
}
+ if ($filters["author"]) {
+ foreach ($filters["author"] as $filter) {
+ $reg_exp = $filter["reg_exp"];
+ $inverse = $filter["inverse"];
+ if ((!$inverse && preg_match("/$reg_exp/i", $author)) ||
+ ($inverse && !preg_match("/$reg_exp/i", $author))) {
+
+ array_push($matches, array($filter["action"], $filter["action_param"]));
+ }
+ }
+ }
+
return $matches;
}
require_once "functions.php";
define('EXPECTED_CONFIG_VERSION', 18);
- define('SCHEMA_VERSION', 65);
+ define('SCHEMA_VERSION', 66);
if (!file_exists("config.php")) {
print "<b>Fatal Error</b>: You forgot to copy
'Link');
insert into ttrss_filter_types (id,name,description) values (5, 'date',
'Article Date');
+insert into ttrss_filter_types (id,name,description) values (6, 'author', 'Author');
create table ttrss_filter_actions (id integer not null primary key,
name varchar(120) unique not null,
create table ttrss_version (schema_version int not null) TYPE=InnoDB;
-insert into ttrss_version values (65);
+insert into ttrss_version values (66);
create table ttrss_enclosures (id integer primary key auto_increment,
content_url text not null,
'Link');
insert into ttrss_filter_types (id,name,description) values (5, 'date',
'Article Date');
+insert into ttrss_filter_types (id,name,description) values (6, 'author', 'Author');
create table ttrss_filter_actions (id integer not null primary key,
name varchar(120) unique not null,
create table ttrss_version (schema_version int not null);
-insert into ttrss_version values (65);
+insert into ttrss_version values (66);
create table ttrss_enclosures (id serial not null primary key,
content_url text not null,
--- /dev/null
+begin;
+
+insert into ttrss_filter_types (id, name, description) values (6, 'author', 'Author');
+
+update ttrss_version set schema_version = 66;
+
+commit;
--- /dev/null
+begin;
+
+insert into ttrss_filter_types (id, name, description) values (6, 'author', 'Author');
+
+update ttrss_version set schema_version = 66;
+
+commit;