vBulletin Mods

The Official vBulletin Modifications Site

Syntax Highlight Colors
by JamesC70
15 Jan 2018 02:54

After a decade of running vBulletin, I finally decided that I wanted to use the [ PHP ] BBCode .... only to see that the orange clashes with my theme. :(

After hours of looking through vB3.8.11 code and the modifications on this site, I finally decided to look at the source code of a post that uses the [ PHP ] code. It's a simple CSS span, why not try to fix it through the Replacement Variable Manager?

Lo and behold, IT WORKED! :D

If anyone else needs to know how to do it:
1. Post something with the [ PHP ] BBCode, so you can witness whether it works.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

2. Look at the source code of your post, and you will see that orange is style="color: #FF8000". Red is style="color: #DD0000", blue is style="color: #0000BB", and green is style="color: #007700".

3. Enter your Admin Control Panel > Styles & Templates > Replacement Variable Manager, select a style, and Add New Replacement Variable.

For example, to change orange to green:
Search for Text box: style="color: #FF8000"
Replace with Text box: style="color: #007700"

4. Press Save, then refresh your post with the [ PHP ] code to see the change. :)

Note to vb.org moderators: posted as a Template Modification because there really isn't any other place for this within the Modifications area. It's not enough for an Article, and if I put it under Graphics it's not easily found with a site search for "syntax colors", All Mods, Titles Only. ;)

All times are GMT. The time now is 17:07.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.