summaryrefslogtreecommitdiff
path: root/init.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-08-15 10:23:06 +0300
committerAndrew Dolgov <[email protected]>2019-08-15 10:23:06 +0300
commit4b2664a7543581d6886a7fc94ced5be5b3d0f0fc (patch)
tree1f62c214c99f57fd913798b85e92b4a9d124f48b /init.php
parent46f54330a29b1c7964737bd1b358eeb1bbed50ea (diff)
support HOOK_ARTICLE_IMAGE for similarity checking
Diffstat (limited to 'init.php')
-rwxr-xr-xinit.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/init.php b/init.php
index afd561a..3712bbe 100755
--- a/init.php
+++ b/init.php
@@ -56,6 +56,7 @@ class Af_Zz_Img_Phash extends Plugin {
$host->add_hook($host::HOOK_RENDER_ARTICLE, $this);
$host->add_hook($host::HOOK_RENDER_ARTICLE_CDM, $this);
$host->add_hook($host::HOOK_RENDER_ARTICLE_API, $this);
+ $host->add_hook($host::HOOK_ARTICLE_IMAGE, $this);
}
function hook_prefs_tab($args) {
@@ -381,6 +382,12 @@ class Af_Zz_Img_Phash extends Plugin {
return $this->hook_render_article_cdm($article, true);
}
+ function hook_article_image($enclosures, $content, $site_url) {
+ $article = $this->hook_render_article_cdm(["content" => $content], false);
+
+ return ["", "", $article["content"]];
+ }
+
function hook_render_article_cdm($article, $api_mode = false) {
if (DB_TYPE == "pgsql" && true !== IMG_HASH_SQL_FUNCTION) {