From c5be3768787d1dfe51fccaec85077841a1dcccaa Mon Sep 17 00:00:00 2001 From: Jeena Date: Sat, 4 Jul 2020 20:56:46 +0200 Subject: [PATCH] Add existencial comics and smbc --- jp_existencial/init.php | 33 +++++++++++++++++++++++++++++++++ jp_smbc/init.php | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 jp_existencial/init.php create mode 100644 jp_smbc/init.php diff --git a/jp_existencial/init.php b/jp_existencial/init.php new file mode 100644 index 0000000..05f4a06 --- /dev/null +++ b/jp_existencial/init.php @@ -0,0 +1,33 @@ +add_hook($host::HOOK_ARTICLE_FILTER, $this); + } + + function hook_article_filter($article) { + + if (strpos($article["guid"], "existentialcomics") !== FALSE) { + if (strpos($article["plugin_data"], "existentialcomics,$owner_uid:") === FALSE) { + $article["content"] = str_replace('src="//static', 'src="https://static', $article["content"]); + $article["plugin_data"] = "existentialcomics,$owner_uid:" . $article["plugin_data"]; + } else if (isset($article["stored"]["content"])) { + $article["content"] = $article["stored"]["content"]; + } + } + + return $article; + } + + function api_version() { + return 2; + } + +} diff --git a/jp_smbc/init.php b/jp_smbc/init.php new file mode 100644 index 0000000..dddc914 --- /dev/null +++ b/jp_smbc/init.php @@ -0,0 +1,33 @@ +add_hook($host::HOOK_ARTICLE_FILTER, $this); + } + + function hook_article_filter($article) { + + if (strpos($article["guid"], "www.smbc-comics.com") !== FALSE) { + if (strpos($article["plugin_data"], "smbc,$owner_uid:") === FALSE) { + $article["content"] = "

" + $article["content"]; + $article["plugin_data"] = "smbc,$owner_uid:" . $article["plugin_data"]; + } else if (isset($article["stored"]["content"])) { + $article["content"] = $article["stored"]["content"]; + } + } + + return $article; + } + + function api_version() { + return 2; + } + +}