add ability to hide feeds from browser (closes #21)

master
Andrew Dolgov 19 years ago
parent 5b35b4de9b
commit e3c99f3b63

@ -1531,7 +1531,8 @@
print "<p>Showing top 50 registered feeds, sorted by popularity:</p>"; print "<p>Showing top 50 registered feeds, sorted by popularity:</p>";
$result = db_query($link, "SELECT feed_url,count(id) AS subscribers $result = db_query($link, "SELECT feed_url,count(id) AS subscribers
FROM ttrss_feeds WHERE auth_login = '' AND auth_pass = '' FROM ttrss_feeds
WHERE auth_login = '' AND auth_pass = '' AND private = false
GROUP BY feed_url ORDER BY subscribers DESC LIMIT 50"); GROUP BY feed_url ORDER BY subscribers DESC LIMIT 50");
print "<ul class='browseFeedList' id='browseFeedList'>"; print "<ul class='browseFeedList' id='browseFeedList'>";
@ -1738,6 +1739,19 @@
print "<td><input type=\"password\" id=\"iedit_pass\" print "<td><input type=\"password\" id=\"iedit_pass\"
value=\"$auth_pass\"></td></tr>"; value=\"$auth_pass\"></td></tr>";
$row_class = toggleEvenOdd($row_class);
$private = sql_bool_to_bool(db_fetch_result($result, 0, "private"));
if ($private) {
$checked = "checked";
} else {
$checked = "";
}
print "<tr class='$row_class'><td>Options:</td>";
print "<td><input type=\"checkbox\" id=\"iedit_private\"
$checked> Hide from feed browser</td></tr>";
print "</table>"; print "</table>";
print "</div>"; print "</div>";
@ -1759,6 +1773,7 @@
$auth_login = db_escape_string($_POST["login"]); $auth_login = db_escape_string($_POST["login"]);
$auth_pass = db_escape_string($_POST["pass"]); $auth_pass = db_escape_string($_POST["pass"]);
$parent_feed = db_escape_string($_POST["pfeed"]); $parent_feed = db_escape_string($_POST["pfeed"]);
$private = db_escape_string($_POST["private"]);
if (strtoupper($upd_intl) == "DEFAULT") if (strtoupper($upd_intl) == "DEFAULT")
$upd_intl = 0; $upd_intl = 0;
@ -1791,7 +1806,8 @@
update_interval = '$upd_intl', update_interval = '$upd_intl',
purge_interval = '$purge_intl', purge_interval = '$purge_intl',
auth_login = '$auth_login', auth_login = '$auth_login',
auth_pass = '$auth_pass' auth_pass = '$auth_pass',
private = '$private'
WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]); WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]);
} }

@ -868,6 +868,15 @@
} }
} }
function sql_bool_to_bool($s) {
if ($s == "t" || $s == "1") {
return true;
} else {
return false;
}
}
function toggleEvenOdd($a) { function toggleEvenOdd($a) {
if ($a == "even") if ($a == "even")
return "odd"; return "odd";

@ -676,6 +676,8 @@ function feedEditSave() {
var purge_intl = document.getElementById("iedit_purgintl").value; var purge_intl = document.getElementById("iedit_purgintl").value;
var fcat = document.getElementById("iedit_fcat"); var fcat = document.getElementById("iedit_fcat");
var private = document.getElementById("iedit_private").checked;
var fcat_id = 0; var fcat_id = 0;
if (fcat) { if (fcat) {
@ -706,7 +708,8 @@ function feedEditSave() {
feed + "&l=" + param_escape(link) + "&t=" + param_escape(title) + feed + "&l=" + param_escape(link) + "&t=" + param_escape(title) +
"&ui=" + param_escape(upd_intl) + "&pi=" + param_escape(purge_intl) + "&ui=" + param_escape(upd_intl) + "&pi=" + param_escape(purge_intl) +
"&catid=" + param_escape(fcat_id) + "&login=" + param_escape(auth_login) + "&catid=" + param_escape(fcat_id) + "&login=" + param_escape(auth_login) +
"&pfeed=" + param_escape(parent_feed_id) + "&pass=" + param_escape(auth_pass); "&pfeed=" + param_escape(parent_feed_id) + "&pass=" + param_escape(auth_pass) +
"&private=" + param_escape(private);
xmlhttp.open("POST", "backend.php", true); xmlhttp.open("POST", "backend.php", true);
xmlhttp.onreadystatechange=feedlist_callback; xmlhttp.onreadystatechange=feedlist_callback;

Loading…
Cancel
Save