Bah, Cant figure it out. D;
2 2008-03-21 15:38
Re: Custom BBCode. (12 replies, posted in PunBB 1.2 troubleshooting)
Hmm, Seems like a new problem.
http://code.spartan-ware.com/viewtopic.php?id=3
If theres a new line, It breaks?
3 2008-03-21 15:15
Re: Custom BBCode. (12 replies, posted in PunBB 1.2 troubleshooting)
Mmmm. Perfect.
Thanks alot :3
4 2008-03-21 15:06
Re: Custom BBCode. (12 replies, posted in PunBB 1.2 troubleshooting)
Kay, Ive gotten this far
$pattern = array('#\[b\](.*?)\[/b\]#s',
'#\[autoit\](.*?)\[/autoit\]#e',
'#\[i\](.*?)\[/i\]#s',
'#\[u\](.*?)\[/u\]#s',
'#\[url\]([^\[]*?)\[/url\]#e',
'#\[url=([^\[]*?)\](.*?)\[/url\]#e',
'#\[email\]([^\[]*?)\[/email\]#',
'#\[email=([^\[]*?)\](.*?)\[/email\]#',
'#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');
$replace = array('<strong>$1</strong>',
'handle_au3_tag(\'$1\')',
'<em>$1</em>',
'<span class="bbu">$1</span>',
'handle_url_tag(\'$1\')',
'handle_url_tag(\'$1\', \'$2\')',
'<a href="mailto:$1">$1</a>',
'<a href="mailto:$1">$2</a>',
'<span style="color: $1">$2</span>');
function handle_au3_tag($text)
{
$geshi = @new GeSHi($text, "autoit", PUN_ROOT."/include");
$text = $geshi->parse_code();
return $text;
}
And it turns out like this;
http://code.spartan-ware.com/viewtopic.php?id=2
If I use double quotes between the [autoit][/autoit] it comes out with the first post in that thread.
If I use single quotes between the [autoit][/autoit] it comes out fine. ( Second post ).
Any ideas?
5 2008-03-21 14:22
Re: Custom BBCode. (12 replies, posted in PunBB 1.2 troubleshooting)
Im confused.
6 2008-03-21 13:19
Re: Custom BBCode. (12 replies, posted in PunBB 1.2 troubleshooting)
I got it working, Kinda.
I figured out how to get it working, But getting the string is the harder part.
So, theres
$pattern = array('#\[b\](.*?)\[/b\]#s',
'#\[autoit\](.*?)\[/autoit\]#s',
'#\[i\](.*?)\[/i\]#s',
'#\[u\](.*?)\[/u\]#s',
'#\[url\]([^\[]*?)\[/url\]#e',
'#\[url=([^\[]*?)\](.*?)\[/url\]#e',
'#\[email\]([^\[]*?)\[/email\]#',
'#\[email=([^\[]*?)\](.*?)\[/email\]#',
'#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');
$replace = array('<strong>$1</strong>',
'$1',
'<em>$1</em>',
'<span class="bbu">$1</span>',
'handle_url_tag(\'$1\')',
'handle_url_tag(\'$1\', \'$2\')',
'<a href="mailto:$1">$1</a>',
'<a href="mailto:$1">$2</a>',
'<span style="color: $1">$2</span>');
In the replace for the '$1' I want it to be the;
$geshi = @new GeSHi("$1", "autoit", getcwd()."/include");
$geshi->parse_code();
But cant figure out how.