FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » C++ Syntax Highlighting? (Some ideas, but no clue on where to start.)
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
C++ Syntax Highlighting? [message #40828] Wed, 16 April 2008 09:06 Go to next message
keithieopia is currently offline  keithieopia   United States
Messages: 2
Registered: April 2008
Karma: 0
Junior Member
I've come across a lot of other projects utilizing hacked versions of the PHP beautifier script for c++ code. At the very least I'd like to know how to implement a fudcode that parses c++ using this, possibly by finding the proposed fudcode [cpp] and then passing the message string to another php script that returns it all pretty and such, that way other parts of my forum are not slowed down by the parsing. Any suggestions or tips pointing me in the right direction would be greatly appreciated.

Here's the beautifier script, although the way I plan to implement it, I just need to know how to search the message for the [cpp]... in other words where's the template for doing this with all the other fudcode and what's the message buffer variable?



I've actually been using fudforum for a while (5+ years) on different websites, and while I've been lurking on these forums I've basically concluded that the developers are split among allowing more syntax highlighting for different languages. One says it will bloat and slow fudforum and most users don't want it (very true) and the other will say that there are some users that do (also true).

I've come up with a possible solution, of having a option in the admin configuration to turn on advanced fudcode tags such as the syntax highlighting, so the end users not wanting the feature don't have to suffer any slowed processing time. Another idea is to search the message code for a tag before processing it, say the code searches for a [cpp] before even loading the resources to highlight it up, that way the only additional overhead would be that of just another fudcode tag and not anything too advanced.
Re: C++ Syntax Highlighting? [message #40833 is a reply to message #40828] Wed, 16 April 2008 17:31 Go to previous message
Ilia is currently offline  Ilia   United States
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The post_proc.php.t code works with the message buffer, you can add C++ syntax highlighting there...

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to edit RSS picture on post pages?
Next Topic: How to force all users to login first
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Dec 18 05:38:45 GMT 2024

Total time taken to generate the page: 0.06039 seconds