• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 Making "spoiler" not searchable?

#1
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.
 
#4
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. :)
 

Daniel Hood

Well-known member
#7
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.
 
#8
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.
 

Mr Lucky

Well-known member
#9
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.
 

Chris D

XenForo developer
Staff member
#10
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.
 
#11
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.
Yes, this is what we encountered when using that method.
 

Mr Lucky

Well-known member
#12
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.
 
#13
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. ;)
 
#15
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.
 
#16
@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?
 
#17
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!