From 47fecba235400e0d7a5a7c54c9ff201c0840deec Mon Sep 17 00:00:00 2001 From: justauser Date: Sun, 7 Jul 2013 13:53:23 -0400 Subject: [PATCH] changes to add hook_query_headlines --- classes/pluginhost.php | 1 + include/functions.php | 2 +- plugins/query_headlines/init.js | 0 plugins/query_headlines/init.php | 50 ++++++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 plugins/query_headlines/init.js create mode 100644 plugins/query_headlines/init.php diff --git a/classes/pluginhost.php b/classes/pluginhost.php index 53adf01f9..a1bd1b364 100644 --- a/classes/pluginhost.php +++ b/classes/pluginhost.php @@ -37,6 +37,7 @@ class PluginHost { const HOOK_PREFS_EDIT_FEED = 20; const HOOK_PREFS_SAVE_FEED = 21; const HOOK_FETCH_FEED = 22; + const HOOK_QUERY_HEADLINES = 23; const KIND_ALL = 1; const KIND_SYSTEM = 2; diff --git a/include/functions.php b/include/functions.php index 355eec2cd..397605c5a 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2579,7 +2579,7 @@ } } - $content_query_part = "content as content_preview, cached_content, "; + $content_query_part = "content, content as content_preview, cached_content, "; if (is_numeric($feed)) { diff --git a/plugins/query_headlines/init.js b/plugins/query_headlines/init.js new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/query_headlines/init.php b/plugins/query_headlines/init.php new file mode 100644 index 000000000..5d71d0356 --- /dev/null +++ b/plugins/query_headlines/init.php @@ -0,0 +1,50 @@ +host = $host; + $host->add_hook($host::HOOK_QUERY_HEADLINES, $this); + } + + // passes in the array for an item + // second argument is the length of the preview the caller is using + // create a key called "modified_preview" if you change the preview and don't want + // caller to override with their default + + function hook_query_headlines($line, $preview_length = 100,$api_call=false) { + //make the author field empty + $line["author"] = ""; + + // and toss tags, since I don't use + $line["tag_cache"] = ""; + return $line; + + + } + + + function api_version() { + return 2; + } + +} +?>