XF 1.5 Making "spoiler" not searchable?

Nutz

Member
We have an annual scavenger hunt on our forum and were using the spoiler feature. We have found that many members were cheating their way around this by searching the word "spoiler". :D

Is there a way to exclude the word "spoiler" from xenforo's search or change the title of the word spoiler to a word three letters or less so that it is not searchable?

Thank you in advance.
 
I think the browser console would be a far stretch for the majority of members. Would there be a way to exclude it from searches?

The white text is an extremely creative idea, thank you. If I don't find a non searchable option that might work. :)
 
Not sure if you're comfortable editing files (and it's usually frowned upon). If so, at the bottom of /library/XenForo/Search/SourceHandler/MySqlFt.php you can change
PHP:
public static $stopWords = array(
to
PHP:
public static $stopWords = array('spoiler',

* this won't do anything if you use ElasticSearch though.
 
Thank you. I'm not completely uncomfortable editing files however I have another staff member that makes these decisions with me.

We also have our test board for possible disasters. :LOL: Many many thanks Daniel.
 
Is there a way to exclude the word "spoiler" from xenforo's search or change the title of the word spoiler to a word three letters or less so that it is not searchable?
It doesn't look like you have actually hadny replies to this yet.

The answer is yes, you can change the world spoiler to anything by simply editing the phrase spoiler in ACP > Appearance > Search phrase. Change it to and or ***, I don't think people will have much luck doing a search either with xenforo search or browser console.
 
That wouldn't actually work.

The text in messages is still going to be:
[SPOILER="Title"]Some text inside...[/SPOILER]

Searching for "spoiler" will find any message that uses the spoiler tag.
 
My thinking was that if your spoilers are called something else visually (ie what people see, not the SPOILER bbcode) then they won't think to search for the word spoiler. However I suppose by now they have twigged as you say so I can see why that won't work.

Another thing would be to make it an image they have have to search for. I have done that it it works quite well asa competition.
 
I do admire their deviousness. :LOL: We have quite a dedicated cast of members.

The images are another great idea although this time I'm hoping to use the "timed spoiler" add on to limit the early starters.

Hopefully I've thought of everything. ;)
 
Not sure if you're comfortable editing files (and it's usually frowned upon). If so, at the bottom of /library/XenForo/Search/SourceHandler/MySqlFt.php you can change
PHP:
public static $stopWords = array(
to
PHP:
public static $stopWords = array('spoiler',

* this won't do anything if you use ElasticSearch though.

This worked perfectly. Thank you for taking the time to reply.
 
@Daniel Hood

The addition of "spoiler" to the stop words seems to be a bit inconsistent. I can't search for it on my desktop but can on my phone. I had some other mods test the function and some can search it and some get the error. Any idea as to why it's not acting as a permanent stop?
 
Figured I'd update this as I figured out another way.

Adding spoiler to the stop words worked for some members and devices although it really acted inconsistently and I could not find a cause.

What did work was adding spoiler to our censor list. ;) The spoiler tags still work as they should and they are completely unsearchable.

Thanks everyone!
 
Top Bottom