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 :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
C++ Syntax Highlighting? [message #40828] Wed, 16 April 2008 05:06 Go to next message
keithieopia is currently offline  keithieopia   United States
Messages: 2
Registered: April 2008
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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 13:31 Go to previous message
Ilia is currently offline  Ilia   United States
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
The post_proc.php.t code works with the message buffer, you can add C++ syntax highlighting there...

FUDforum Core Developer
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
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: Mon Dec 18 11:31:14 EST 2017

Total time taken to generate the page: 0.00610 seconds