Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu


Started by Bugo, April 24, 2023, 09:12:24 PM

Previous topic - Next topic


Link to the mod

This spoiler uses a native HTML5 tag - details

If you want to change a background color, just edit /Themes/default/css/spoiler.css


I'm assuming this is quite different than your other spoiler mod?
My pet rock isn't well today. I think it's stoned.


Yes, it has no customization and is better integrated with the SCEditor.


Thanks Bugo. Will give this one a go.  ;D
My pet rock isn't well today. I think it's stoned.


Thanks Bugo

Added Italian translation ;)
Italian SMF - Supporto Italiano per la board SMF - Ci trovate tutti li!! :)


Hi @Bugo

I found an issue with Chrome
Don't work text selection and copy

With firefox, no problem.
Italian SMF - Supporto Italiano per la board SMF - Ci trovate tutti li!! :)


Change rule for .bbc_spoiler in the file /Themes/default/css/spoiler.css in this way:
Code (css) Select
.bbc_spoiler {
    display: block;
    box-sizing: border-box;
    /* user-select: none; */
    overflow: hidden;
    background: #cfc;
    color: #000;
    border-radius: 6px;
    box-shadow: 0 1px 5px 2px rgba(34, 60, 80, 0.2);
    margin-bottom: 4px;
    padding: 6px 12px;


The fix work!
Thanks :)
Italian SMF - Supporto Italiano per la board SMF - Ci trovate tutti li!! :)


Thanks for this new and sleeker spoiler, @Bugo!

One thing I get, though, is an error message every now and then pointing to a "Cron" error. I believe I also got that the first time after installing the mod today.

/usr/home/myforum/data/Sources/Class-Spoiler.php (Line 122)
You cannot view this attachment.

You cannot view this attachment.

What's also weird is that the log always shows this error in connection with just one user (the one in my attachment). I went through the posts (not that many) and I couldn't spot any spoilers which the user might have used to cause this. Also, I think I just got this error after me posting and using a quote, without using a spoiler though. At least my error log was empty until I posted..


Here is the backtrace code I got when I first installed it on our test forum.

QuoteType of error
Error message
    2: Undefined array key "spoiler"


URL of page causing the error;area=packages;sa=install2;;pid=0

    #0: smf_error_handler()
    Called from /usr/home/myForum/data2/Sources/Class-Spoiler.php on line 122

    #1: bbcCodes()
    Called from /usr/home/myForum/data2/Sources/Subs.php on line 5791

    #2: call_integration_hook()
    Called from /usr/home/myForum/data2/Sources/Subs.php on line 2483

    #3: parse_bbc()
    Called from /usr/home/myForum/data2/Sources/Subs.php on line 4323

    #4: setupThemeContext()
    Called from /usr/home/myForum/data2/Sources/Subs.php on line 4529

    #5: template_header()
    Called from /usr/home/myForum/data2/Sources/Subs.php on line 4172

    #6: obExit()
    Called from /usr/home/myForum/data2/index.php on line 187


I have already fixed this problem, the update will be after the release of SMF 2.1.4


Great! Thanks for your support, Bugo! It also good to know that's nothing to do with my theme edits.



I don't know whether your fix already addresses this but I might have found a correlation for another issue I had after installing your mod.
Like I described above, I would get the "undefined key 'Spoiler' " error message after installing and also every once in a while associated with certain users. All of a sudden I was also unable for these users to access the Track Activity tab which produced a Cron error. I went ahead an added $txt['spoiler'] to the index.English.php and both the "undefined" and "cron" error vanished.
=> the

Seems like the $txt['spoiler'] code does not get pulled from the Spoiler folder in Default.