diff options
author | Andrew Dolgov <[email protected]> | 2019-08-15 10:23:06 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-08-15 10:23:06 +0300 |
commit | 4b2664a7543581d6886a7fc94ced5be5b3d0f0fc (patch) | |
tree | 1f62c214c99f57fd913798b85e92b4a9d124f48b /init.php | |
parent | 46f54330a29b1c7964737bd1b358eeb1bbed50ea (diff) |
support HOOK_ARTICLE_IMAGE for similarity checking
Diffstat (limited to 'init.php')
-rwxr-xr-x | init.php | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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) { |