I am *not* maintaining this MOD anymore! The last version available is 0.4.1. It goes to you complete with bugs etc.
It does work in terms of syntax highlighting, although the ACP is shoddy and there are some extra features (like a dropdown for languages on posting.php) missing/unimplemented.
------
Syntax highlighting will allow users to use [syntax="language"]...[/syntax] to highlight code in just about any installed language, making for far more interesting posts than what boring [code] gives you.

Language packs will be available for may popular languages, and administrators will be able to define their own languages. Syntax Highlighting will come with over 40 installed languages, including php, html, css, java, c, c++, asm, perl, sql, python, css, xml and much more.
This mod takes only around 10 minutes to install, requires no in-line adding or removal, and additions to the DB are optional.

This mod is powered by GeSHi - my generic syntax highlighting project. Being familiar with GeSHi will help you understand how this mod works so you can add your own twist to the highlighting - adding line numbers, changing the styles and more!
Current languages supported are php, c, java, sql, css, quickbasic, asm, ada, apache, nsis, pascal, html, perl, python, lisp, lua, c++, asp, bash, actionscript, xml, vb, openoffice.org basic, visual foxpro and many more.
You can download version 0.4.1 of this mod here (186K), or .tar.gz (130K), or .tar.bz2 (109K)
Archive
Syntax Highlighting 0.4.0 (368K)
Syntax Highlighting 0.3.0 (132K)
Syntax Highlighting 0.2.0 (117K)
Syntax Highlighting 0.1.0 (58K)
Remember that this mod is ALPHA - it's not recommended you use this in a live environment, but you may at your own risk. I see no security worries with it.
Also, it would be helpful if you posted in this thread any bugs/gripes/etc that you find with this mod.

Enjoy!
[NOTE: Mod has been bumped back down to ALPHA!]
Mod file header:
- Code: Select all
##############################################################
## MOD Title: Syntax Highlighting
## MOD Author: 0racle < nigel@geshi.org > (Nigel McNie) http://qbnz.com/highlighter
## MOD Description: Adds [syntax="language"] bbcode to syntax-highlight many languages using GeSHi engine
## Better description would be useful. Note on installable by EM. Note on required
## BBCode mods.
## MOD Version: 0.4.1
##
## Installation Level: TODO(Easy/Intermediate/Advanced)
## Installation Time: TODOx Minutes
## Files To Edit: includes/bbcode.php,
## includes/constants.php,
## language/lang_english/lang_admin.php,
## templates/subSilver/overall_header.tpl,
## templates/subSilver/simple_header.tpl,
## templates/subSilver/bbcode.tpl
## Included Files: (N/A, or list of included files)
## admin/admin_syntax.php,
## cache/syntax/index.htm,
## cache/syntax/cache.txt,
## includes/geshi.php,
## includes/geshi/*.php,
## includes/functions_syntax.php,
## includes/functions_syntax_cache.php,
## templates/subSilver/admin/admin_syntax_body.tpl,
## templates/subSilver/geshi.css,
## templates/subSilver/geshi-dark.css
## License: http://opensource.org/licenses/gpl-license.php GNU Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## - This MOD REQUIRES that you have installed the Multi BBCodes MOD, as per phpBB BBCode
## MOD requirements. You can get this MOD from [here].
##
## - I also STRONGLY RECOMMEND you install the BBCode Organizer MOD, available [here]
##
## - This MOD *has* been installed by easymod by me successfully. No guarantees for you,
## this is alpha software. Please tell me about your experiences with easymod!
##
## - There is a script - install_syntax.php - that will automatically run the SQL needed
## to get this MOD going in advanced mode. Run if a) easymod doesn't do the SQL for you,
## b) you can't do the SQL any other way, and c) if you do run it, run it AFTER ALL
## FILE MODIFICATIONS. It's mentioned in a DIY instruction below so you won't forget.
##
## - HOW TO USE AT YOUR FORUM
## To highlight code in a certain language, you do this:
## [syntax="language"]
## // code...
## [/syntax]
## Where language is a language you have a language file for. The quotemarks are
## optional. For example, this mod comes with language files for php and sql among
## others, so you could go:
## [syntax="php"]// a php comment[/syntax]
## [syntax=sql]-- a sql comment[/syntax]
##
## - You can highlight certain lines "extra" if you want to prove a point - start a line
## in a syntax block with >>> and end it with <<<, and that line will be highlighted
## to stand out.
##
## - This mod comes in two "modes" - simple and advanced. In general, you want the advanced
## mode. To enable advanced mode, all you have to do is run the SQL that this mod
## specifies (in the final release there will be a file available that you only have to
## point your browser at to run the SQL). But if you can't run SQL for some reason,
## then you can still run this mod fine - just install everything except the SQL. To
## configure in simple mode, open includes/bbcode.php and change values as needed. Note
## that if you do change values, you'll need to clear the cache (which you can do in the
## ACP, even in simple mode).
##
## - Language files are in includes/geshi/. To control which languages can be used
## for highlighting, use the ACP (Syntax Highlighting, under General Admin). If you're
## in simple mode, you can only control whether a language is highlighted or not,
## whereas if you're in advanced mode you can control what string the users must use
## to trigger the highlighting, and what is displayed when viewing syntax-highlighted
## code.
##
## - Unfortunately nested syntax blocks *will* break down. This Is Not My Fault!
## phpBB does NOT support marking lowest level block for regexp bbcode, so I can't
## do anything about this. Simple solution: don't do this:
## [syntax="language"]...[syntax="language2"]...[/syntax]...[/syntax]
## As it is, destroying smilies and BBCode inside the syntax blocks is somewhat
## of a hack at the moment...
##
## - The default stylesheet (geshi.css) supplied with this mod works well with
## templates with *light* colours (subSilver, subOracle etc). However, if you're
## using a dark template, you might want to use geshi-dark.css. Of course, you
## can play around with the stylesheets to make your own colour scheme...
## The dark stylesheet is awful, I know. If you fix it up, send it to me and I'll
## include it with the full version.
##
## - Remember to CHMOD the cache/syntax directory to 777, and the cache/syntax/cache.txt
## file to 666!!!
##
## - I suggest you do all your configuration as soon as you install the MOD - that way
## you won't have to clear the cache when it already has lotsa stuff in it.
##
## - And finally, this is ALPHA software. No warranty etc. etc. Please report bugs you
## find by posting in the phpBB dev thread for this MOD, by email to me or by the sf.net
## bugtracker for this MOD.
##
##############################################################
## MOD History:
##
## 2004-08-13 - Version 0.1.0
## - Initial Release
##
## 2004-10-28 - Version 0.2.0
## - GeSHi upgraded to 1.0.2
## * Support for nearly 30 languages
## - geshi-dark.css stylesheet added for dark forums
## - Cache directory used to speed page rendering
##
## 2004-11-13 - Version 0.3.0
## - Custom GeSHi 1.0.2 used
## - Configuration can be done via the ACP
## * Control of the cache directory
## * Which languages are supported
## * What is displayed for various languages
## * Whether to use line numbering/function to URL conversion
## - Better handling of bbcode inside [syntax] blocks
## - Support for >>> ... <<< to extra-highlight a line
## - Automatic cache control - the cache can be kept to a certain size or have items
## older than a certain date removed automatically
## - Support for a "simple mode" which can be used if the user can't run SQL
##
## 2005-08-15 - Version 0.4.0
## - GeSHi upgraded to 1.0.7.1
## * Added languages are c_mac, csharp, diff, div, d, eiffel, gml, matlab,
## mpasm, objc, oracle8, vbnet and vhdl, making a total of 43
## - Install SQL file added
## * Can be run after all file alterations to run the SQL needed to install this MOD
## in advanced mode
##
## 2005-08-23 - Version 0.4.1
## - Added missing function clear_cache() (reported by Logman)
## - Minor bugfix to function to obtain cache directory size (index.htm, not .html)
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
