RaythMistwalker Posted October 31, 2011 Share Posted October 31, 2011 $bbreplace = array ( '/(\[[bb]\])(.+)(\[\/[bb]\])/', '/(\[[ii]\])(.+)(\[\/[ii]\])/', '/(\[[uu]\])(.+)(\[\/[uu]\])/', '/(\[[ss]\])(.+)(\[\/[ss]\])/', '/(\[url=http://)(.+)(\])(.+)(\[\/url\])/', '/(\[img\])(.+)(\[\/img\])/', '/(\[img\])(.+)(\[\/IMG\])/', '/(\[color=)(.+)(\])(.+)(\[\/COLOR\])/', '/(\[color=)(.+)(\])(.+)(\[\/color\])/', '/(\[size=)(.+)(\])(.+)(\[\/SIZE\])/', '/(\[size=)(.+)(\])(.+)(\[\/size\])/', '/(\[list\](.+)(\[\/list\])/', '/(\[list=1\](.+)(\[\/list\])/', '/(\[lLIST\](.+)(\[\/LIST\])/', '/(\[list=1\](.+)(\[\/LIST\])/', '/(\[*\](.+)/' ); $bbreplacements = array ( '<b>\\2</b>', '<i>\\2</i>', '<u>\\2</u>', '<s>\\2</s>', '<a href="\\2">\\4</a>', '<img src="\\2">', '<img src="\\2">', '<font color="\\2">\\4</font>', '<font color="\\2">\\4</font>', '<font size="\\2">\\4</font>', '<font size="\\2">\\4</font>', '<ul>\\2</ul>', '<ol>\\2</ol>', '<ul>\\2</ul>', '<ol>\\2</ol>', '<li>\\2</li>' ); $PostText = preg_replace($bbreplace, $bbreplacements, $PostText); This is what I have to do BB Codes so Far. Now when I go to view the thread I get: Warning: preg_replace() [function.preg-replace]: Compilation failed: missing ) at offset 25 in /home/rayth/public_html/forum/viewthread.php on line 95 Line 95: $PostText = preg_replace($bbreplace, $bbreplacements, $PostText); From testing I didn't get this error untill I added the tags Quote Link to comment https://forums.phpfreaks.com/topic/250198-bb-code-error/ Share on other sites More sharing options...
RaythMistwalker Posted November 1, 2011 Author Share Posted November 1, 2011 Just noticed the error in that post. Was meant to say this error didn't appear untill I added the tags for [ list] Quote Link to comment https://forums.phpfreaks.com/topic/250198-bb-code-error/#findComment-1283866 Share on other sites More sharing options...
seany123 Posted November 1, 2011 Share Posted November 1, 2011 If this is solved please mark the Thread is solved. Quote Link to comment https://forums.phpfreaks.com/topic/250198-bb-code-error/#findComment-1283882 Share on other sites More sharing options...
RaythMistwalker Posted November 1, 2011 Author Share Posted November 1, 2011 It's not solved. Whenever the tags used to add [ list] function are added to the script i get that error. Quote Link to comment https://forums.phpfreaks.com/topic/250198-bb-code-error/#findComment-1283943 Share on other sites More sharing options...
seany123 Posted November 1, 2011 Share Posted November 1, 2011 Well this line: '/(\[lLIST\](.+)(\[\/LIST\])/', should it not be '/(\[list\](.+)(\[\/LIST\])/', Quote Link to comment https://forums.phpfreaks.com/topic/250198-bb-code-error/#findComment-1283997 Share on other sites More sharing options...
RaythMistwalker Posted November 1, 2011 Author Share Posted November 1, 2011 Ok Fixed that and I still have the same error Quote Link to comment https://forums.phpfreaks.com/topic/250198-bb-code-error/#findComment-1284045 Share on other sites More sharing options...
RaythMistwalker Posted November 2, 2011 Author Share Posted November 2, 2011 anyone? Quote Link to comment https://forums.phpfreaks.com/topic/250198-bb-code-error/#findComment-1284238 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.