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; + } + +}