print "<li class=\"feedCat\" id=\"FCAT-$cat_id\">
<a href=\"javascript:toggleCollapseCat($cat_id)\">$tmp_category</a>
- <a href=\"javascript:viewCategory($cat_id)\">
+ <a href=\"javascript:viewCategory($cat_id)\" id=\"FCAP-$cat_id\">
<span id=\"FCATCTR-$cat_id\"
class=\"$catctr_class\">($cat_unread unread)$ellipsis</span></a>
<!-- <div style=\"float : right\">
$limit = $_GET["limit"];
$cat_view = $_GET["cat"];
- if (!$feed) {
- return;
- }
-
if (!$skip) $skip = 0;
if ($subop == "undefined") $subop = "";
} */
if ($cat_view) {
+
+ if ($feed > 0) {
+ $cat_qpart = "cat_id = '$feed'";
+ } else {
+ $cat_qpart = "cat_id IS NULL";
+ }
+
$tmp_result = db_query($link, "SELECT feed_url FROM ttrss_feeds
- WHERE cat_id = '$feed' AND owner_uid = " . $_SESSION["uid"]);
+ WHERE $cat_qpart AND owner_uid = " . $_SESSION["uid"]);
while ($tmp_line = db_fetch_assoc($tmp_result)) {
$feed_url = $tmp_line["feed_url"];
if ($subop == "MarkAllRead") {
- if (sprintf("%d", $feed) != 0) {
+ if (preg_match("/^[0-9][0-9]*$/", $feed) != false) {
if ($cat_view) {
+ if ($feed > 0) {
+ $cat_qpart = "cat_id = '$feed'";
+ } else {
+ $cat_qpart = "cat_id IS NULL";
+ }
+
$tmp_result = db_query($link, "SELECT id
- FROM ttrss_feeds WHERE cat_id = '$feed' AND owner_uid = " .
+ FROM ttrss_feeds WHERE $cat_qpart AND owner_uid = " .
$_SESSION["uid"]);
while ($tmp_line = db_fetch_assoc($tmp_result)) {
if ($search && $search_mode == "All feeds") {
$query_strategy_part = "ttrss_entries.id > 0";
$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
- } else if (sprintf("%d", $feed) == 0) {
+ } else if (preg_match("/^[0-9][0-9]*$/", $feed) == false) {
$query_strategy_part = "ttrss_entries.id > 0";
$vfeed_query_part = "(SELECT title FROM ttrss_feeds WHERE
id = feed_id) as feed_title,";
if ($cat_view) {
- $query_strategy_part = "cat_id = $feed";
+ if ($feed > 0) {
+ $query_strategy_part = "cat_id = '$feed'";
+ } else {
+ $query_strategy_part = "cat_id IS NULL";
+ }
+
$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
} else {
print "<div id=\"headlinesContainer\">";
- if (sprintf("%d", $feed) != 0) {
+ if (preg_match("/^[0-9][0-9]*$/", $feed) != false) {
- if ($feed > 0) {
+ if ($feed >= 0) {
$feed_kind = "Feeds";
} else {
$feed_kind = "Labels";
if (cat_view_mode) {
query = query + "&cat=1";
}
-
+
var headlines_frame = parent.frames["headlines-frame"];
// alert(headlines_frame)
query = query + "&ts=" + timestamp
}
+ parent.debug(query);
+
headlines_frame.location.href = query;
cleanSelectedList("feedList");
var cat_elem = document.getElementById("FCAT-" + cat);
var cat_list = document.getElementById("FCATLIST-" + cat).parentNode;
- var caption = cat_elem.lastChild;
+ var caption = document.getElementById("FCAP-" + cat);
if (cat_list.className.match("invisible")) {
cat_list.className = "";