MyBB Community Forums

Full Version: Tutorial - Custom PHP syntax highlighting colors.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Most of those who are on shared hosts doesn't happen or find a way to change them. And they are hardly visible if you have dark themes. Here's an easy way to change them which I used when I was a shared hosting user long ago. Moreover I saw a similar thread today so wrote a quick tutorial.

Open showthread.php (You can find it in your root directory, i.e. where index.php, etc, files are located).

After:

define('THIS_SCRIPT', 'showthread.php');

Add after it:

ini_set('highlight.string', '#ffffff'); 
ini_set('highlight.comment', '#00ff00'); 
ini_set('highlight.keyword', '#22ff22'); 
ini_set('highlight.default', '#cecece');

Edit the above colors with your choice and save the file. Now you should have the custom highlighting colors.
Or, if you don't wish to make core edits, I developed a plugin which can be found here:

http://community.mybb.com/thread-120047-...#pid867241

Smile

It'll work globaly, including in PMs, announcements, etc...
Yes. Smile
(2012-06-09, 07:51 PM)Nathan Malcolm Wrote: [ -> ]Or, if you don't wish to make core edits, I developed a plugin which can be found here:

http://community.mybb.com/thread-120047-...#pid867241

Smile

It'll work globaly, including in PMs, announcements, etc...
That is pretty awesome Nathan, can you add admin settings for it so that I don't have to edit the file every time I want to change the colour Toungue
(2012-06-12, 01:55 PM)Aniruddh Wrote: [ -> ]
(2012-06-09, 07:51 PM)Nathan Malcolm Wrote: [ -> ]Or, if you don't wish to make core edits, I developed a plugin which can be found here:

http://community.mybb.com/thread-120047-...#pid867241

Smile

It'll work globaly, including in PMs, announcements, etc...
That is pretty awesome Nathan, can you add admin settings for it so that I don't have to edit the file every time I want to change the colour Toungue

this plugin include the color for the HTML highlight and add settings to the ACP Wink [attachment=26512]
(2012-06-12, 08:17 PM)Solstice Wrote: [ -> ]
(2012-06-12, 01:55 PM)Aniruddh Wrote: [ -> ]
(2012-06-09, 07:51 PM)Nathan Malcolm Wrote: [ -> ]Or, if you don't wish to make core edits, I developed a plugin which can be found here:

http://community.mybb.com/thread-120047-...#pid867241

Smile

It'll work globaly, including in PMs, announcements, etc...
That is pretty awesome Nathan, can you add admin settings for it so that I don't have to edit the file every time I want to change the colour Toungue

this plugin include the color for the HTML highlight and add settings to the ACP Wink

Thanks, but this plugin auto add a "<?PHP" code in first of all codes . Nathan phpcolors is too , same same.
[attachment=30531]
(2013-11-17, 08:52 AM)Midori Wrote: [ -> ]
(2012-06-12, 08:17 PM)Solstice Wrote: [ -> ]
(2012-06-12, 01:55 PM)Aniruddh Wrote: [ -> ]
(2012-06-09, 07:51 PM)Nathan Malcolm Wrote: [ -> ]Or, if you don't wish to make core edits, I developed a plugin which can be found here:

http://community.mybb.com/thread-120047-...#pid867241

Smile

It'll work globaly, including in PMs, announcements, etc...
That is pretty awesome Nathan, can you add admin settings for it so that I don't have to edit the file every time I want to change the colour Toungue

this plugin include the color for the HTML highlight and add settings to the ACP Wink

Thanks, but this plugin auto add a "<?PHP" code in first of all codes . Nathan phpcolors is too , same same.

No it doesn't, also this isn't a "plugin" it literally just changes colors. You must be doing something wrong. This still uses the BBCode that comes with MyBB.