mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-31 11:41:28 +00:00
feedbrowser_cache: store title; implement by-title search in feed browser
This commit is contained in:
@@ -5797,11 +5797,11 @@
|
||||
|
||||
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");
|
||||
|
||||
@@ -5812,11 +5812,21 @@
|
||||
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");
|
||||
|
||||
Reference in New Issue
Block a user