DIV bbcode

Started on the old forum in September 2013 · view the original in the archive · old links redirect here

1 reply · 836 views · started 13 years ago · 1 min read

2 participants
pmbguy Senior · 344 posts #1

ok, been trying to figure this out in an easier way, but got div bbcodes... One has preset bg n text color, n the other one you can choose your bg n text color...

Hope this helps somebody, as you see I coded it for lava a while back, but never had a chance to use it...

$text = preg_replace("/\[div\](.*?)\[\/div\]/is","<div style='border:1px solid black; background:white; color:black;'>$1</div>",$text);
 $text = preg_replace("/\[divbg\=(.*?)\](.*?)::(.*?)\[\/divbg\]/is","<div style='border:1px solid black; background:$1; color:$2'>$3</div>",$text);

First One Works Like: [div]Text Goes Here[/div]

Second One Works Like: [divbg=background_color]text_color**::**Your Text n Stuff Here[/divbg]

Replace background_color for your desired bgcolor, n text_color for your desired text color in the second one... Please note: There are two:'s between the text color and text... like: :: If you leave them out this bbcode won't work...

Ok, for a demo, check out ThumbType... I added this bbcode there n removed the full html support thing...

subzero Super moderator Fellow · 3,954 posts #2

Thats good idea ! but never code div in a site that used bbcodes in div .. unless using div to reclose.

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close