SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Ubb code
-
Jan 15, 2005, 12:07 #1
- Join Date
- Jul 2004
- Location
- Vlak
- Posts
- 52
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ubb code
Hi,
I am having some problems with my ubb code.
When people dont exit there ["quote"] (It also happens here!) the layout gets messed up.
I have this now:
PHP Code:$bericht = str_replace("[quote]", "<table class=body width=\"100%\" cellspacing=\"1\" cellpadding=\"2\"><tr><td><b>Quote:</b></td></tr><td style=\"BORDER-RIGHT: #CCCCCC 1px solid; BORDER-TOP: #CCCCCC 1px solid; BORDER-BOTTOM: #CCCCCC 1px solid; BORDER-LEFT: #CCCCCC 1px solid\">", $bericht);
$bericht = str_replace("[/quote]", "</td></tr></table>", $bericht);
-
Jan 15, 2005, 12:35 #2
- Join Date
- Jan 2005
- Location
- franklin
- Posts
- 1
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
PHP Code:$string = 'This is [b]cool[/b] - [url=http://www.somesite.com]Somesite[/url]
$replace = array ('/(\[[Bb]\])(.+)(\[\/[Bb]\])/','/(\[url=)(.+)(\])(.+)(\[\/url\])/');
$replacements = array ('<b>\\2</b>','<a href="\\2">\\4</a>');
$string = preg_replace($replace, $replacements, $string);
echo $string;
-
Jan 15, 2005, 14:34 #3
- Join Date
- Jul 2004
- Location
- Vlak
- Posts
- 52
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Does any one has a full working ubb code?
Bookmarks