summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-10-30 14:59:09 +0400
committerAndrew Dolgov <[email protected]>2012-10-30 14:59:09 +0400
commitbb894b29902f78e298c43a8d6a6ac19a856456a8 (patch)
treeaacca15e72a138c4b8430bbfc231d0541f84d9f0 /include
parent3fc6e71ac862242a571a28d3b6efdd6e82a3cb77 (diff)
fix update stopped by get_article_labels()
Diffstat (limited to 'include')
-rw-r--r--include/functions.php24
-rw-r--r--include/rssfuncs.php2
2 files changed, 14 insertions, 12 deletions
diff --git a/include/functions.php b/include/functions.php
index 4d7f61a2b..01ec33187 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -3868,24 +3868,26 @@
}
}
- function get_article_labels($link, $id) {
+ function get_article_labels($link, $id, $owner_uid = false) {
$rv = array();
+ if (!$owner_uid) $owner_uid = $_SESSION["uid"];
$result = db_query($link, "SELECT label_cache FROM
ttrss_user_entries WHERE ref_id = '$id' AND owner_uid = " .
- $_SESSION["uid"]);
-
- $label_cache = db_fetch_result($result, 0, "label_cache");
+ $owner_uid);
- if ($label_cache) {
+ if (db_num_rows($result) > 0) {
+ $label_cache = db_fetch_result($result, 0, "label_cache");
- $label_cache = json_decode($label_cache, true);
+ if ($label_cache) {
+ $label_cache = json_decode($label_cache, true);
- if ($label_cache["no-labels"] == 1)
- return $rv;
- else
- return $label_cache;
+ if ($label_cache["no-labels"] == 1)
+ return $rv;
+ else
+ return $label_cache;
+ }
}
$result = db_query($link,
@@ -3893,7 +3895,7 @@
FROM ttrss_labels2, ttrss_user_labels2
WHERE id = label_id
AND article_id = '$id'
- AND owner_uid = ".$_SESSION["uid"] . "
+ AND owner_uid = ". $owner_uid . "
ORDER BY caption");
while ($line = db_fetch_assoc($result)) {
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index e90b3cc07..12099293c 100644
--- a/include/rssfuncs.php
+++ b/include/rssfuncs.php
@@ -875,7 +875,7 @@
}
}
- $article_labels = get_article_labels($link, $entry_ref_id);
+ $article_labels = get_article_labels($link, $entry_ref_id, $owner_uid);
if (find_article_filter($article_filters, "filter")) {
db_query($link, "COMMIT"); // close transaction in progress