Advertisement:

Author Topic: Simple trick to change the background color of text -- in BBCode form!  (Read 1840 times)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,691
  • Mod King
    • XPtsp.com Community
I received a mod request that is probably too simple to make into a mod.  So I thought I'd post it as a tip/trick.

In Sources/Subs.php, find this line:
Code: (Find) [Select]
'tag' => 'bdo',and add this block BEFORE the array declaration:
Code: (Insert) [Select]
array(
'tag' => 'background',
'type' => 'unparsed_equals',
'test' => '(#[\da-fA-F]{3}|#[\da-fA-F]{6}|[A-Za-z]{1,20}|rgb\(\d{1,3}, ?\d{1,3}, ?\d{1,3}\))\]',
'before' => '<div style="background-color: $1;">',
'after' => '</div>',
'block_level' => true,
),

If you don't want the entire line as that background color, change the div to span for both the before and after.  Hope this is helpful....
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!