function update_feedbrowser_cache($link) {
- $result = db_query($link, "SELECT feed_url,COUNT(id) AS subscribers
+ $result = db_query($link, "SELECT feed_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 ORDER BY subscribers DESC LIMIT 200");
+ GROUP BY feed_url, title ORDER BY subscribers DESC");
db_query($link, "BEGIN");
while ($line = db_fetch_assoc($result)) {
$subscribers = db_escape_string($line["subscribers"]);
$feed_url = db_escape_string($line["feed_url"]);
+ $title = db_escape_string($line["title"]);
+
+ $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')");
+
+ ++$count;
+
+ }
- db_query($link, "INSERT INTO ttrss_feedbrowser_cache
- (feed_url, subscribers) VALUES ('$feed_url', '$subscribers')");
-
- ++$count;
}
db_query($link, "COMMIT");
if ($browser_search) {
$search_qpart = " AND (
- UPPER(ttrss_feedbrowser_cache.feed_url) LIKE UPPER('%$browser_search%'))";
- //UPPER(title) LIKE UPPER('%$browser_search%'))";
+ UPPER(ttrss_feedbrowser_cache.feed_url) LIKE UPPER('%$browser_search%') OR
+ UPPER(title) LIKE UPPER('%$browser_search%'))";
} else {
$search_qpart = "";
}
$result = db_query($link, "SELECT ttrss_feedbrowser_cache.feed_url,
- subscribers
+ subscribers,title
FROM
ttrss_feedbrowser_cache
WHERE
require_once "functions.php";
define('EXPECTED_CONFIG_VERSION', 18);
- define('SCHEMA_VERSION', 51);
+ define('SCHEMA_VERSION', 52);
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;
-insert into ttrss_version values (51);
+insert into ttrss_version values (52);
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,
+ title text not null,
subscribers integer not null);
create table ttrss_labels2 (id integer not null primary key auto_increment,
create table ttrss_version (schema_version int not null);
-insert into ttrss_version values (51);
+insert into ttrss_version values (52);
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,
subscribers integer not null);
create table ttrss_labels2 (id serial not null primary key,
--- /dev/null
+alter table ttrss_feedbrowser_cache add column title text;
+update ttrss_feedbrowser_cache set title = '';
+alter table ttrss_feedbrowser_cache change title title text not null;
+
+update ttrss_version set schema_version = 52;
--- /dev/null
+begin;
+
+alter table ttrss_feedbrowser_cache add column title text;
+update ttrss_feedbrowser_cache set title = '';
+alter table ttrss_feedbrowser_cache alter column title set not null;
+
+update ttrss_version set schema_version = 52;
+
+commit;