make feed browser ignore already subscribed feeds
This commit is contained in:
parent
a0476535ef
commit
dc932d0af3
1 changed files with 17 additions and 1 deletions
16
backend.php
16
backend.php
|
@ -1536,10 +1536,20 @@
|
|||
|
||||
print "<ul class='browseFeedList' id='browseFeedList'>";
|
||||
|
||||
$feedctr = 0;
|
||||
|
||||
while ($line = db_fetch_assoc($result)) {
|
||||
$feed_url = $line["feed_url"];
|
||||
$subscribers = $line["subscribers"];
|
||||
|
||||
$sub_result = db_query($link, "SELECT id
|
||||
FROM ttrss_feeds WHERE feed_url = '$feed_url' AND owner_uid =" .
|
||||
$_SESSION["uid"]);
|
||||
|
||||
if (db_num_rows($sub_result) > 0) {
|
||||
continue; // already subscribed
|
||||
}
|
||||
|
||||
$det_result = db_query($link, "SELECT site_url,title,id
|
||||
FROM ttrss_feeds WHERE feed_url = '$feed_url' LIMIT 1");
|
||||
|
||||
|
@ -1560,6 +1570,12 @@
|
|||
print "<li id=\"FBROW-".$details["id"]."\">$check_box $feed_icon" .
|
||||
$details["title"] .
|
||||
" <span class='subscribers'>($subscribers)</span></li>";
|
||||
|
||||
++$feedctr;
|
||||
}
|
||||
|
||||
if ($feedctr == 0) {
|
||||
print "<li>No feeds found to subscribe.</li>";
|
||||
}
|
||||
|
||||
print "</ul>";
|
||||
|
|
Loading…
Reference in a new issue