$instance_id = db_fetch_result($result, 0, "id");
- $result = db_query($link, "SELECT feed_url, title, subscribers
+ $result = db_query($link, "SELECT feed_url, site_url, title, subscribers
FROM ttrss_feedbrowser_cache ORDER BY subscribers DESC LIMIT 100");
$feeds = array();
function update_feedbrowser_cache($link) {
- $result = db_query($link, "SELECT feed_url,title, COUNT(id) AS subscribers
+ $result = db_query($link, "SELECT feed_url, site_url, title, COUNT(id) AS subscribers
FROM ttrss_feeds WHERE (SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf
WHERE tf.feed_url = ttrss_feeds.feed_url
AND (private IS true OR feed_url LIKE '%:%@%/%'))
- GROUP BY feed_url, title ORDER BY subscribers DESC LIMIT 1000");
+ GROUP BY feed_url, site_url, title ORDER BY subscribers DESC LIMIT 1000");
db_query($link, "BEGIN");
$subscribers = db_escape_string($line["subscribers"]);
$feed_url = db_escape_string($line["feed_url"]);
$title = db_escape_string($line["title"]);
+ $site_url = db_escape_string($line["site_url"]);
$tmp_result = db_query($link, "SELECT subscribers FROM
ttrss_feedbrowser_cache WHERE feed_url = '$feed_url'");
if (db_num_rows($tmp_result) == 0) {
db_query($link, "INSERT INTO ttrss_feedbrowser_cache
- (feed_url, title, subscribers) VALUES ('$feed_url',
- '$title', '$subscribers')");
+ (feed_url, site_url, title, subscribers) VALUES ('$feed_url',
+ '$site_url', '$title', '$subscribers')");
++$count;
require_once "functions.php";
define('EXPECTED_CONFIG_VERSION', 22);
- define('SCHEMA_VERSION', 84);
+ define('SCHEMA_VERSION', 85);
if (!file_exists("config.php")) {
print "<b>Fatal Error</b>: You forgot to copy
create table ttrss_version (schema_version int not null) TYPE=InnoDB DEFAULT CHARSET=UTF8;
-insert into ttrss_version values (84);
+insert into ttrss_version values (85);
create table ttrss_enclosures (id integer primary key auto_increment,
content_url text not null,
create table ttrss_feedbrowser_cache (
feed_url text not null,
+ site_url text not null,
title text not null,
subscribers integer not null) DEFAULT CHARSET=UTF8;
create table ttrss_linked_feeds (
feed_url text not null,
+ site_url text not null,
title text not null,
created datetime not null,
updated datetime not null,
create table ttrss_version (schema_version int not null);
-insert into ttrss_version values (84);
+insert into ttrss_version values (85);
create table ttrss_enclosures (id serial not null primary key,
content_url text not null,
create table ttrss_feedbrowser_cache (
feed_url text not null primary key,
title text not null,
+ site_url text not null,
subscribers integer not null);
create table ttrss_labels2 (id serial not null primary key,
create table ttrss_linked_feeds (
feed_url text not null,
+ site_url text not null,
title text not null,
created timestamp not null,
updated timestamp not null,
--- /dev/null
+begin;
+
+alter table ttrss_feedbrowser_cache add column site_url text;
+update ttrss_feedbrowser_cache set site_url = '';
+alter table ttrss_feedbrowser_cache change site_url site_url text not null;
+
+alter table ttrss_linked_feeds add column site_url text;
+update ttrss_linked_feeds set site_url = '';
+alter table ttrss_linked_feeds change site_url site_url text not null;
+
+update ttrss_version set schema_version = 85;
+
+commit;
--- /dev/null
+begin;
+
+alter table ttrss_feedbrowser_cache add column site_url text;
+update ttrss_feedbrowser_cache set site_url = '';
+alter table ttrss_feedbrowser_cache alter column site_url set not null;
+
+alter table ttrss_linked_feeds add column site_url text;
+update ttrss_linked_feeds set site_url = '';
+alter table ttrss_linked_feeds alter column site_url set not null;
+
+update ttrss_version set schema_version = 85;
+
+commit;