]>
git.wh0rd.org - tt-rss.git/blob - plugins/vf_shared/init.php
2 class VF_Shared
extends Plugin
{
4 /* @var PluginHost $host */
9 "Feed for all articles actively shared by URL",
14 function init($host) {
17 $host->add_feed(-1, __("Shared articles"), 'plugins/vf_shared/share.png', $this);
20 function api_version() {
25 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
27 function get_unread($feed_id) {
28 $sth = $this->pdo
->prepare("select count(int_id) AS count
29 from ttrss_user_entries where owner_uid = ? and unread = true and uuid != ''");
30 $sth->execute([$_SESSION['uid']]);
32 if ($row = $sth->fetch()) {
40 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
42 function get_total($feed_id) {
43 $sth = $this->pdo
->prepare("select count(int_id) AS count
44 from ttrss_user_entries where owner_uid = ? and uuid != ''");
45 $sth->execute([$_SESSION['uid']]);
47 if ($row = $sth->fetch()) {
55 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
57 function get_headlines($feed_id, $options) {
60 "limit" => $options["limit"],
61 "view_mode" => $this->get_unread(-1) > 0 ?
"adaptive" : "all_articles",
62 "search" => $options['search'],
63 "override_order" => $options['override_order'],
64 "offset" => $options["offset"],
65 "filter" => $options["filter"],
66 "since_id" => $options["since_id"],
67 "include_children" => $options["include_children"],
68 "override_strategy" => "uuid != ''",
69 "override_vfeed" => "ttrss_feeds.title AS feed_title,"
72 $qfh_ret = Feeds
::queryFeedHeadlines($params);
73 $qfh_ret[1] = __("Shared articles");