summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-05-04 15:26:21 +0300
committerAndrew Dolgov <[email protected]>2017-05-04 15:26:21 +0300
commit4a0da0e5bf06e91cd3d461c98d54a0723ed0529c (patch)
treecf338df462e52a51bcd03c14b4ea7d075c89c59f /include
parent2ed0d6c433c9ef5a6b9137725030f64b4b38392e (diff)
move get_article_labels to Article
Diffstat (limited to 'include')
-rw-r--r--include/labels.php46
-rw-r--r--include/rssfuncs.php2
2 files changed, 1 insertions, 47 deletions
diff --git a/include/labels.php b/include/labels.php
index 9e2674b98..fd0d40af6 100644
--- a/include/labels.php
+++ b/include/labels.php
@@ -11,52 +11,6 @@
}
}
- function get_article_labels($id, $owner_uid = false) {
- $rv = array();
-
- if (!$owner_uid) $owner_uid = $_SESSION["uid"];
-
- $result = db_query("SELECT label_cache FROM
- ttrss_user_entries WHERE ref_id = '$id' AND owner_uid = " .
- $owner_uid);
-
- if (db_num_rows($result) > 0) {
- $label_cache = db_fetch_result($result, 0, "label_cache");
-
- if ($label_cache) {
- $label_cache = json_decode($label_cache, true);
-
- if ($label_cache["no-labels"] == 1)
- return $rv;
- else
- return $label_cache;
- }
- }
-
- $result = db_query(
- "SELECT DISTINCT label_id,caption,fg_color,bg_color
- FROM ttrss_labels2, ttrss_user_labels2
- WHERE id = label_id
- AND article_id = '$id'
- AND owner_uid = ". $owner_uid . "
- ORDER BY caption");
-
- while ($line = db_fetch_assoc($result)) {
- $rk = array(label_to_feed_id($line["label_id"]),
- $line["caption"], $line["fg_color"],
- $line["bg_color"]);
- array_push($rv, $rk);
- }
-
- if (count($rv) > 0)
- label_update_cache($owner_uid, $id, $rv);
- else
- label_update_cache($owner_uid, $id, array("no-labels" => 1));
-
- return $rv;
- }
-
-
function label_find_caption($label, $owner_uid) {
$result = db_query(
"SELECT caption FROM ttrss_labels2 WHERE id = '$label'
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index a7d30d674..5e1bdd2cb 100644
--- a/include/rssfuncs.php
+++ b/include/rssfuncs.php
@@ -683,7 +683,7 @@
if (db_num_rows($result) != 0) {
$base_entry_id = db_fetch_result($result, 0, "id");
$entry_stored_hash = db_fetch_result($result, 0, "content_hash");
- $article_labels = get_article_labels($base_entry_id, $owner_uid);
+ $article_labels = Article::get_article_labels($base_entry_id, $owner_uid);
$entry_language = db_fetch_result($result, 0, "lang");
$existing_tags = Article::get_article_tags($base_entry_id, $owner_uid);