summaryrefslogtreecommitdiff
path: root/plugins/vf_shared
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-07-11 13:48:39 +0400
committerAndrew Dolgov <[email protected]>2013-07-11 13:48:39 +0400
commita6a61a8cb14a17a4767c4564b531d9a6595b9124 (patch)
tree30cdd6adea28288efe7a3a993e31235380c40f75 /plugins/vf_shared
parent936d21e13597c2e590cd158020ebd3786336345c (diff)
add plugin to show all shared articles
Diffstat (limited to 'plugins/vf_shared')
-rw-r--r--plugins/vf_shared/init.php60
-rw-r--r--plugins/vf_shared/share.pngbin0 -> 343 bytes
2 files changed, 60 insertions, 0 deletions
diff --git a/plugins/vf_shared/init.php b/plugins/vf_shared/init.php
new file mode 100644
index 000000000..00d288c05
--- /dev/null
+++ b/plugins/vf_shared/init.php
@@ -0,0 +1,60 @@
+<?php
+class VF_Shared extends Plugin {
+
+ private $host;
+
+ function about() {
+ return array(1.0,
+ "Feed for all articles actively shared by URL",
+ "fox",
+ false);
+ }
+
+ function init($host) {
+ $this->host = $host;
+
+ $host->add_feed(-1, __("Shared articles"), 'plugins/vf_shared/share.png', $this);
+ }
+
+ function api_version() {
+ return 2;
+ }
+
+ function get_unread($feed_id) {
+ $result = db_query("select count(int_id) AS count from ttrss_user_entries where owner_uid = ".$_SESSION["uid"]." and unread = true and uuid != ''");
+
+ return db_fetch_result($result, 0, "count");
+ }
+
+ function get_total($feed_id) {
+ $result = db_query("select count(int_id) AS count from ttrss_user_entries where owner_uid = ".$_SESSION["uid"]." and uuid != ''");
+
+ return db_fetch_result($result, 0, "count");
+ }
+
+ //function queryFeedHeadlines($feed, $limit, $view_mode, $cat_view, $search, $search_mode, $override_order = false, $offset = 0, $owner_uid = 0, $filter = false, $since_id = 0, $include_children = false, $ignore_vfeed_group = false, $override_strategy = false, $override_vfeed = false) {
+
+ function get_headlines($feed_id, $options) {
+ $qfh_ret = queryFeedHeadlines(-4,
+ $options['limit'],
+ $this->get_unread() > 0 ? "adaptive" : "all_articles",
+ false,
+ $options['search'],
+ $options['search_mode'],
+ $options['override_order'],
+ $options['offset'],
+ $options['owner_uid'],
+ $options['filter'],
+ $options['since_id'],
+ $options['include_children'],
+ false,
+ "uuid != ''",
+ "ttrss_feeds.title AS feed_title,");
+
+ $qfh_ret[1] = __("Shared articles");
+
+ return $qfh_ret;
+ }
+
+}
+?>
diff --git a/plugins/vf_shared/share.png b/plugins/vf_shared/share.png
new file mode 100644
index 000000000..25eacb7c2
--- /dev/null
+++ b/plugins/vf_shared/share.png
Binary files differ