Popup warning for NSFW category

Suppose we have a category for NSFW content, is a popup warning before entry easy to implement? Something that tells the user he/she is entering NSFW category, something like:

“The content of this section is for mature audiences only and may not be suitable for minors. If you are a minor or if it is illegal for you to access mature images and language, do not proceed.”

5 个赞

I think you could trigger popup with custom JS snippet added in /admin/customize/css_html.

For example, if your category name is nsfw, try something along this lines (when document is ready):

  if ($('#topic-title a.badge-category:contains("nsfw")').length) { 
   console.log('This post belongs to NSFW category'); 
  }
2 个赞

Thanks for replying. :smile:

If I understand you correctly, the popup comes when you finish writing your post, am I right? That’s not quite what I have in mind.

What I was thinking is, for example you have categories like: Meta, Games, Anime, and Sex. You want a popup warning to appear when people click on Sex, warning them of explicit content.

Hm… to facilitate your requirement you can add jQuery .on('click') listener to every link of a topic from NSFW category.
It would trigger a custom popup requiring confirmation before going further.
You could even store confirmation in a cookie, so that on this specific machine user does not have to confirm each time.

I don’t know if such feature will arrive to upstream any time soon.
If you really need this feature custom JS is the easiest way to go IMO.
If you need more specific help (eg. custom code for your forum) feel free to PM me :wink:

1 个赞

补一下进度。这个功能绝对会很有用!

2 个赞

可以很轻松地为此构建一个主题组件,建议在 Marketplace 上悬赏 200 美元。

7 个赞