|
|
@ -73,7 +73,17 @@
|
|
|
|
print "<counter id='global-unread' counter='$c_id'/>";
|
|
|
|
print "<counter id='global-unread' counter='$c_id'/>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getTagCounters($link) {
|
|
|
|
function getTagCounters($link, $smart_mode = true) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($smart_mode) {
|
|
|
|
|
|
|
|
if (!$_SESSION["tctr_last_value"]) {
|
|
|
|
|
|
|
|
$_SESSION["tctr_last_value"] = array();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$old_counters = $_SESSION["tctr_last_value"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$tctrs_modified = false;
|
|
|
|
|
|
|
|
|
|
|
|
$result = db_query($link, "SELECT tag_name,count(ttrss_entries.id) AS count
|
|
|
|
$result = db_query($link, "SELECT tag_name,count(ttrss_entries.id) AS count
|
|
|
|
FROM ttrss_tags,ttrss_entries,ttrss_user_entries WHERE
|
|
|
|
FROM ttrss_tags,ttrss_entries,ttrss_user_entries WHERE
|
|
|
@ -94,8 +104,19 @@
|
|
|
|
$unread = $tags[$tag];
|
|
|
|
$unread = $tags[$tag];
|
|
|
|
|
|
|
|
|
|
|
|
$tag = htmlspecialchars($tag);
|
|
|
|
$tag = htmlspecialchars($tag);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!$smart_mode || $old_counters[$tag] != $unread) {
|
|
|
|
|
|
|
|
$old_counters[$tag] = $unread;
|
|
|
|
|
|
|
|
$tctrs_modified = true;
|
|
|
|
print "<tag id=\"$tag\" counter=\"$unread\"/>";
|
|
|
|
print "<tag id=\"$tag\" counter=\"$unread\"/>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($smart_mode && $tctrs_modified) {
|
|
|
|
|
|
|
|
$_SESSION["tctr_last_value"] = $old_counters;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getLabelCounters($link) {
|
|
|
|
function getLabelCounters($link) {
|
|
|
@ -143,7 +164,15 @@
|
|
|
|
print "<feed id=\"$id\" counter=\"$count\"/>";
|
|
|
|
print "<feed id=\"$id\" counter=\"$count\"/>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getFeedCounters($link) {
|
|
|
|
function getFeedCounters($link, $smart_mode = true) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($smart_mode) {
|
|
|
|
|
|
|
|
if (!$_SESSION["fctr_last_value"]) {
|
|
|
|
|
|
|
|
$_SESSION["fctr_last_value"] = array();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$old_counters = $_SESSION["fctr_last_value"];
|
|
|
|
|
|
|
|
|
|
|
|
$result = db_query($link, "SELECT id,
|
|
|
|
$result = db_query($link, "SELECT id,
|
|
|
|
(SELECT count(id)
|
|
|
|
(SELECT count(id)
|
|
|
@ -152,15 +181,25 @@
|
|
|
|
AND unread = true AND owner_uid = ".$_SESSION["uid"].") as count
|
|
|
|
AND unread = true AND owner_uid = ".$_SESSION["uid"].") as count
|
|
|
|
FROM ttrss_feeds WHERE owner_uid = ".$_SESSION["uid"]);
|
|
|
|
FROM ttrss_feeds WHERE owner_uid = ".$_SESSION["uid"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$fctrs_modified = false;
|
|
|
|
|
|
|
|
|
|
|
|
while ($line = db_fetch_assoc($result)) {
|
|
|
|
while ($line = db_fetch_assoc($result)) {
|
|
|
|
|
|
|
|
|
|
|
|
$id = $line["id"];
|
|
|
|
$id = $line["id"];
|
|
|
|
$count = $line["count"];
|
|
|
|
$count = $line["count"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!$smart_mode || $old_counters[$id] != $count) {
|
|
|
|
|
|
|
|
$old_counters[$id] = $count;
|
|
|
|
|
|
|
|
$fctrs_modified = true;
|
|
|
|
print "<feed id=\"$id\" counter=\"$count\"/>";
|
|
|
|
print "<feed id=\"$id\" counter=\"$count\"/>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($smart_mode && $fctrs_modified) {
|
|
|
|
|
|
|
|
$_SESSION["fctr_last_value"] = $old_counters;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function outputFeedList($link, $tags = false) {
|
|
|
|
function outputFeedList($link, $tags = false) {
|
|
|
|
|
|
|
|
|
|
|
|
print "<html><head>
|
|
|
|
print "<html><head>
|
|
|
|