Is PHP syntax highlighting gone?

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
Profo
Registered User
Posts: 34
Joined: Wed May 13, 2009 1:51 pm

Is PHP syntax highlighting gone?

Post by Profo »

I'm still doing some local tests, but I realized that all PHP syntax highlighting colours are gone after upgrading from 3.1.

An example:

Code: Select all

require($phpbb_root_path . 'includes/startup.' . $phpEx);
require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
The code above is properly highlighted in 3.1 using [code=php], but in 3.2 renders as standard code (not highlighted).

Has this changed somehow (maybe a different BBcode) or is it gone?
User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7816
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: Is PHP syntax highlighting gone?

Post by JimA »

Yes, phpBB 3.2 uses an external library for its BBCode parsing, which no longer includes syntax highlighting.
Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.
Profo
Registered User
Posts: 34
Joined: Wed May 13, 2009 1:51 pm

Re: Is PHP syntax highlighting gone?

Post by Profo »

Ah, OK. Thanks JimA!

BTW I would suggest to update the BBCode FAQ language files, specially this part:
PHP syntax highlighting can be enabled using ... and is recommended when posting PHP code samples as it improves readability.
User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7816
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: Is PHP syntax highlighting gone?

Post by JimA »

Could you please report that idea to the Bug Tracker so our developers can take that into consideration? :)
Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.
Profo
Registered User
Posts: 34
Joined: Wed May 13, 2009 1:51 pm

Re: Is PHP syntax highlighting gone?

Post by Profo »

Done!
User avatar
kinerity
Community Team Member
Community Team Member
Posts: 2834
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Truscott
Contact:

Re: Is PHP syntax highlighting gone?

Post by kinerity »

There is an (unreleased) extension I found a while back that would enable syntax highlighting in 3.2 - not just PHP. I'll see if I can find it again.
Kailey Truscott - Community Team
GitHub repositories (including un-released extensions)
User avatar
Puchahawa
Registered User
Posts: 769
Joined: Sat Jan 01, 2011 10:33 pm
Name: Randy

Re: Is PHP syntax highlighting gone?

Post by Puchahawa »

This may be the one Kinerity is thinking about. It's called Codebox plus. :)
Avatar courtesy of artist Faith Coyotë
User avatar
kinerity
Community Team Member
Community Team Member
Posts: 2834
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Truscott
Contact:

Re: Is PHP syntax highlighting gone?

Post by kinerity »

I said "unreleased" - as in it was never even posted here. ;)

Anyway, I found it (link). I did some quick testing and it does seem to work.

Code: Select all

[code]<?php
print 'Hello World!';
?>
[/code]
code.png
code.png (4.29 KiB) Viewed 1020 times
Kailey Truscott - Community Team
GitHub repositories (including un-released extensions)
User avatar
JoshyPHP
Code Contributor
Posts: 1157
Joined: Mon Jul 11, 2011 12:28 am

Re: Is PHP syntax highlighting gone?

Post by JoshyPHP »

It's funny, I forgot about that extension. I published it on GitHub a year ago but I don't really intend to maintain it. Fortunately, it shouldn't require any maintenance since all it does is add a little script to the prosilver style. I've just updated it for highlight.js 9.5.0.
I wrote the thing that does BBCodes in 3.2+.
Post Reply

Return to “[3.2.x] Support Forum”