Popup warning for NSFW category

AI-generated summary

The discussion revolves around implementing a popup warning for the NSFW category on a forum. ximi inquires about the feasibility of such a feature. lidel suggests using a custom JS snippet in the /admin/customize/css_html section to trigger a popup when a user accesses the NSFW category. However, ximi clarifies that the desired feature is a warning that appears when users click on the NSFW category, not after writing a post. lidel proposes adding a jQuery .on('click') listener to NSFW category links to trigger a custom popup requiring confirmation, which can be stored in a cookie for future visits. The feature is deemed useful by nekodroid, and sam recommends a theme component with a $200 bounty on the Marketplace.

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개의 좋아요