From: Andrew Dolgov Date: Mon, 6 Mar 2006 04:45:54 +0000 (+0100) Subject: new option: OPEN_LINKS_IN_NEW_WINDOW (closes #47) X-Git-Tag: schema_freeze_for_1.1.4~8 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=68511f86ac18cac0a8484b2c34f625fb4f2f3b99;p=tt-rss.git new option: OPEN_LINKS_IN_NEW_WINDOW (closes #47) --- diff --git a/backend.php b/backend.php index 60399e31..14eccf94 100644 --- a/backend.php +++ b/backend.php @@ -1040,6 +1040,10 @@ print "
Tags: $f_tags_str
"; } + if (get_pref($link, 'OPEN_LINKS_IN_NEW_WINDOW')) { + $line["content"] = preg_replace("/href=/i", "target=\"_new\" href=", $line["content"]); + } + print $line["content"] . ""; print ""; diff --git a/config.php-dist b/config.php-dist index c8d33b4c..76c7052b 100644 --- a/config.php-dist +++ b/config.php-dist @@ -113,6 +113,6 @@ define('SESSION_COOKIE_LIFETIME_REMEMBER', 86400); // Session cookie lifetime if "remember me" is checked on login. - + // vim:ft=php ?> diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index b9e1a08e..c2357f5b 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -240,6 +240,8 @@ 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('HIDE_READ_FEEDS', 1, 'false', 'Hide feeds with no unread messages',2); +insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('OPEN_LINKS_IN_NEW_WINDOW', 1, 'true', 'Open article links in new browser window',2); + create table ttrss_user_prefs ( owner_uid integer not null, pref_name varchar(250), diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index 8db25bd6..2ac43fd6 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -218,6 +218,8 @@ 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('HIDE_READ_FEEDS', 1, 'false', 'Hide feeds with no unread messages',2); +insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('OPEN_LINKS_IN_NEW_WINDOW', 1, 'true', 'Open article links in new browser window',2); + 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, diff --git a/schema/upgrade-1.1.3-1.1.4-mysql.sql b/schema/upgrade-1.1.3-1.1.4-mysql.sql index 12df2044..1018bcf4 100644 --- a/schema/upgrade-1.1.3-1.1.4-mysql.sql +++ b/schema/upgrade-1.1.3-1.1.4-mysql.sql @@ -14,5 +14,7 @@ create table ttrss_sessions (id varchar(250) not null primary key, delete from ttrss_prefs where pref_name = 'ENABLE_SPLASH'; +insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('OPEN_LINKS_IN_NEW_WINDOW', 1, 'true', 'Open article links in new browser window',2); + update ttrss_version set schema_version = 6; diff --git a/schema/upgrade-1.1.3-1.1.4-pgsql.sql b/schema/upgrade-1.1.3-1.1.4-pgsql.sql index da426767..6c406495 100644 --- a/schema/upgrade-1.1.3-1.1.4-pgsql.sql +++ b/schema/upgrade-1.1.3-1.1.4-pgsql.sql @@ -17,6 +17,8 @@ create index ttrss_sessions_expire_index on ttrss_sessions(expire); delete from ttrss_prefs where pref_name = 'ENABLE_SPLASH'; +insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('OPEN_LINKS_IN_NEW_WINDOW', 1, 'true', 'Open article links in new browser window',2); + update ttrss_version set schema_version = 6; commit;