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 Likes

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 Likes

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 Like

Catching up on this. This feature would definitely be useful!

2 Likes

A theme component can be quite easily built for this, recommend a $200 bounty on marketplace

7 Likes