]>
git.wh0rd.org - tt-rss.git/blob - plugins/nsfw/init.php
2 class NSFW
extends Plugin
{
9 "Hide article content if tags contain \"nsfw\"",
14 function init($host) {
15 $this->link
= $host->get_link();
18 $host->add_hook($host::HOOK_RENDER_ARTICLE
, $this);
19 $host->add_hook($host::HOOK_RENDER_ARTICLE_CDM
, $this);
24 return file_get_contents(dirname(__FILE__
) . "/init.js");
27 function hook_render_article($article) {
29 if (array_search("nsfw", $article["tags"]) !== FALSE) {
30 $article["content"] = "<div class='nswf wrapper'><button onclick=\"nsfwShow(this)\">".__("Not work safe (click to toggle)")."</button>
31 <div class='nswf content' style='display : none'>".$article["content"]."</div></div>";
37 function hook_render_article_cdm($article) {
38 if (array_search("nsfw", $article["tags"]) !== FALSE) {
39 $article["content"] = "<div class='nswf wrapper'><button onclick=\"nsfwShow(this)\">".__("Not work safe (click to toggle)")."</button>
40 <div class='nswf content' style='display : none'>".$article["content"]."</div></div>";