MyBB Community Forums

Full Version: View Today's Posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I went to view today's posts on my forum, then I clicked a thread; but it gave me this error above the forum.

The following warnings occurred:
Warning [2] preg_replace() [function.preg-replace]: Compilation failed: missing terminating ] for character class at offset 28 - Line: 346 - File: inc/class_parser.php PHP 5.2.17 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/class_parser.php 346 preg_replace
/inc/class_parser.php 154 postParser->parse_mycode
/inc/functions_post.php 570 postParser->parse_message
/showthread.php 951 build_postbit
Warning [2] preg_replace() [function.preg-replace]: Compilation failed: missing terminating ] for character class at offset 28 - Line: 346 - File: inc/class_parser.php PHP 5.2.17 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/class_parser.php 346 preg_replace
/inc/class_parser.php 154 postParser->parse_mycode
/inc/functions_post.php 584 postParser->parse_message
/showthread.php 951 build_postbit
I guess you've any custom mycodes installed incorrectly.

Can you please enlist your installed MyCodes ?
I only have a spoiler code.

Regular Expression-

/[spoiler\](.*?)\[/spoiler\]

Replacement-

<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px"><input type="button" value="Show Spoiler" style="width:100px;font-size:10px;margin:0px;padding:0px;" 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 Spoiler'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show Spoiler'; }" />
</div>
<div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">
<div style="display: none;">$1</div>
</div>
</div>
Reupload inc/class_parser.php
Your regular expression is incorrect, it should be like this;
\[spoiler\](.*?)\[/spoiler\]