From 4122da0290d7bdb85e94b3e4b509be3ee56c6356 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 4 May 2017 14:26:44 +0300 Subject: [PATCH] move getArticleFeed to Article move print_label_select to controls --- classes/article.php | 12 +++++++++++- classes/feeds.php | 2 ++ include/controls.php | 25 +++++++++++++++++++++++++ include/functions2.php | 35 ----------------------------------- 4 files changed, 38 insertions(+), 36 deletions(-) diff --git a/classes/article.php b/classes/article.php index 2e7a05e0..b842ea40 100644 --- a/classes/article.php +++ b/classes/article.php @@ -80,7 +80,7 @@ class Article extends Handler_Protected { WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]); } - $feed_id = getArticleFeed($id); + $feed_id = $this->getArticleFeed($id); ccache_update($feed_id, $_SESSION["uid"]); } @@ -371,6 +371,16 @@ class Article extends Handler_Protected { print json_encode($reply); } + function getArticleFeed($id) { + $result = db_query("SELECT feed_id FROM ttrss_user_entries + WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]); + + if (db_num_rows($result) != 0) { + return db_fetch_result($result, 0, "feed_id"); + } else { + return 0; + } + } } diff --git a/classes/feeds.php b/classes/feeds.php index 4c4972d7..4d4707a9 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -1241,5 +1241,7 @@ class Feeds extends Handler_Protected { diff --git a/include/controls.php b/include/controls.php index 0c568308..3ddf4fd9 100644 --- a/include/controls.php +++ b/include/controls.php @@ -300,3 +300,28 @@ function format_inline_player($url, $ctype) { return ""; } + +function print_label_select($name, $value, $attributes = "") { + + $result = db_query("SELECT caption FROM ttrss_labels2 + WHERE owner_uid = '".$_SESSION["uid"]."' ORDER BY caption"); + + print ""; + + +} + diff --git a/include/functions2.php b/include/functions2.php index c89e572f..e9220235 100644 --- a/include/functions2.php +++ b/include/functions2.php @@ -1669,17 +1669,6 @@ return false; } - function getArticleFeed($id) { - $result = db_query("SELECT feed_id FROM ttrss_user_entries - WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]); - - if (db_num_rows($result) != 0) { - return db_fetch_result($result, 0, "feed_id"); - } else { - return 0; - } - } - /** * Fixes incomplete URLs by prepending "http://". * Also replaces feed:// with http://, and @@ -1825,30 +1814,6 @@ return is_html(fetch_file_contents($url, false, $login, $pass)); } - function print_label_select($name, $value, $attributes = "") { - - $result = db_query("SELECT caption FROM ttrss_labels2 - WHERE owner_uid = '".$_SESSION["uid"]."' ORDER BY caption"); - - print ""; - - - } - function format_article_enclosures($id, $always_display_enclosures, $article_content, $hide_images = false) {