Sorry, I misunderstood what you were asking
I put this in libs/ubbthreads.inc.php, the same code you provided, after the email line as directed:
array( "#\[spoiler\](.+?)\[/spoiler\]#i", "<div class=\"ubbcode-block\"><div class=\"ubbcode-header\">Warning, Spoiler: <input type=\"button\" class="form-button" value=\"Show\" onclick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }\" /></div><div class=\"ubbcode-body\"><div style=\"display: none;\">\\1</div></div></div>" ),
And not only do I get the following error, but it prevents the entire forum from loading up. I get a white screen with:
Parse error: syntax error, unexpected T_STRING, expecting ')' in /home2/gbb/public_html/threads/libs/ubbthreads.inc.php on line 1011