1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 23:05:56 +00:00

fix nsfw plugin

This commit is contained in:
Andrew Dolgov
2013-06-04 15:34:04 +04:00
parent 53a49ff82a
commit 445d1c1044

View File

@@ -24,8 +24,9 @@ class NSFW extends Plugin {
function hook_render_article($article) { function hook_render_article($article) {
$tags = array_map("trim", explode(", ", $this->host->get($this, "tags"))); $tags = array_map("trim", explode(", ", $this->host->get($this, "tags")));
$a_tags = array_map("trim", explode(", ", $article["tag_cache"]));
if (count(array_intersect($tags, $article["tags"])) > 0) { if (count(array_intersect($tags, $a_tags)) > 0) {
$article["content"] = "<div class='nswf wrapper'><button onclick=\"nsfwShow(this)\">".__("Not work safe (click to toggle)")."</button> $article["content"] = "<div class='nswf wrapper'><button onclick=\"nsfwShow(this)\">".__("Not work safe (click to toggle)")."</button>
<div class='nswf content' style='display : none'>".$article["content"]."</div></div>"; <div class='nswf content' style='display : none'>".$article["content"]."</div></div>";
} }
@@ -35,8 +36,9 @@ class NSFW extends Plugin {
function hook_render_article_cdm($article) { function hook_render_article_cdm($article) {
$tags = array_map("trim", explode(", ", $this->host->get($this, "tags"))); $tags = array_map("trim", explode(", ", $this->host->get($this, "tags")));
$a_tags = array_map("trim", explode(", ", $article["tag_cache"]));
if (count(array_intersect($tags, $article["tags"])) > 0) { if (count(array_intersect($tags, $a_tags)) > 0) {
$article["content"] = "<div class='nswf wrapper'><button onclick=\"nsfwShow(this)\">".__("Not work safe (click to toggle)")."</button> $article["content"] = "<div class='nswf wrapper'><button onclick=\"nsfwShow(this)\">".__("Not work safe (click to toggle)")."</button>
<div class='nswf content' style='display : none'>".$article["content"]."</div></div>"; <div class='nswf content' style='display : none'>".$article["content"]."</div></div>";
} }