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 » Thu Aug 04, 2016 11:47 am

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: 7347
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 » Thu Aug 04, 2016 11:51 am

Yes, phpBB 3.2 uses an external library for its BBCode parsing, which no longer includes syntax highlighting.
Image 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 » Thu Aug 04, 2016 12:04 pm

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: 7347
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 » Thu Aug 04, 2016 12:52 pm

Could you please report that idea to the Bug Tracker so our developers can take that into consideration? :)
Image 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 » Thu Aug 04, 2016 1:13 pm

Done!

User avatar
kinerity
Community Team Member
Community Team Member
Posts: 1838
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 » Fri Aug 05, 2016 12:43 am

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

User avatar
Puchahawa
Registered User
Posts: 767
Joined: Sat Jan 01, 2011 10:33 pm
Name: Randy

Re: Is PHP syntax highlighting gone?

Post by Puchahawa » Fri Aug 05, 2016 2:33 am

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: 1838
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 » Fri Aug 05, 2016 3:18 am

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 703 times
Kailey Truscott - Community Team

User avatar
JoshyPHP
Code Contributor
Posts: 949
Joined: Mon Jul 11, 2011 12:28 am

Re: Is PHP syntax highlighting gone?

Post by JoshyPHP » Fri Aug 05, 2016 10:02 am

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”

Who is online

Users browsing this forum: abrogard, HiFiKabin, insus100, jack terrier, Mannix_, maxwellqc13, Tarantino and 38 guests