summaryrefslogtreecommitdiff
path: root/plugins/nsfw
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-06-04 15:34:04 +0400
committerAndrew Dolgov <[email protected]>2013-06-04 15:34:04 +0400
commit445d1c10440e54d4c35150aaebf58868c4aaf3c6 (patch)
tree78b6fd112678a97e2c22ae5591d736a2a01a9216 /plugins/nsfw
parent53a49ff82a02299627ba15d81b7a011d50162133 (diff)
fix nsfw plugin
Diffstat (limited to 'plugins/nsfw')
-rw-r--r--plugins/nsfw/init.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/nsfw/init.php b/plugins/nsfw/init.php
index a57aa4456..79979076b 100644
--- a/plugins/nsfw/init.php
+++ b/plugins/nsfw/init.php
@@ -24,8 +24,9 @@ class NSFW extends Plugin {
function hook_render_article($article) {
$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>
<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) {
$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>
<div class='nswf content' style='display : none'>".$article["content"]."</div></div>";
}