Select Page

Geshi update for Mambo 4.5.2

GeSHi – Generic Syntax Highlighter: GeSHi started as an idea to create a generic syntax highlighter for the phpBB forum system, but has been generalised to this project. GeSHi aims to be a simple but powerful highlighting script, with the following goals:

  • Support for a wide range of popular languages
  • Easy to add a new language for highlighting
  • Highly customisable output formats

GeSHi aims to do this all as quickly as possible. Many customisable features of GeSHi facilitate speed increases, and you can easily find a balance between the amount of highlighting done and the speed in which it is done. from

My upgrade is for mambo 4.5.2…

  • Mambo 4.5.2 already contains Geshi ( in version 1.0.4
  • Geshi 1.0.7 has beeen release in 2005/06/17
  • Geshi 1.0.7 is a major bugfix release over the previous versions, and upgrading is strongly recommended. In addition, four new languages have been added, including highlighting for diff output.

#### Upgrade ####

  1. Download geshi1.0.7 for in my dowmload section
  2. Upgrade Is easy just copy the mambots directory of this archive to the main root of mambo on your server with FTP.
  3. In /css you have the css use on my homepage 

#### What NEW ####
I’ve changed the mambot (/mambots/content/geshi.php ) a little bit:

  • support for CSS: default true, it reduce bandwith!
  • support for code header: default true
  • support for code footer: defaukt false
  • 38 languages from the standard geshi distribution are now shipped (400kb) delete unneede languages in

to change the value of these flags: open the file /mambots/content/geshi.php and change their default value
 //new code by Walter Cedric

 $useCSS = mosGetParam( $args, 'useCSS', 'true' );
 $useHeader = mosGetParam( $args, 'useHeader', 'true' );
 $useFooter = mosGetParam( $args, 'useFooter', 'false' );

      specify for each <pre> </pre> tag ther value see "example of use"

### use a CSS ###
– Point a browser to
 and follow instructions, you can at the end copy a css template for geshi (cut and paste from your browser in a file)
– Create a file named sourceCodeGeshi.css in directory.
– update four index.jsp from to include the new css on all page:

<link  href="<?php echo $mosConfig_live_site;?>
rel="stylesheet" type="text/css"/>

– You can delete the generator
afterward, even if I think it is not a big security issue…

### use a header or footer ###

  • footer or header are portion of html code that geshi can add during the rendering of source code.
  • the header and footer are now hardcoded in /mambots/content/geshi.php
     if ($useHeader) {
       $header="<div class=\"sourcecodehead\">
    <div class=\"sourcecodetitle\">
    <LANGUAGE> Source code
     if ($useFooter) {
       $footer="<div class=\"sourcecodefooter\">
    <div class=\"sourcecodetitle\">footer


#### example of use ####,
   lang="" is recommended since geshi can not detect thhe language automatically:

   example with java:
 <pre lang="java" useCSS="false" useHeader="false">
 private long startStatistics() {
     long before = System.currentTimeMillis();
     if (logger.isDebugEnabled()) {
       logger.debug("Start conversion " );
     return before;

    publish of course the Geshi mambots in Mambo!

Have fun!

Kudo to the Geshi developer!
Kudo to all GPL project around the world!
Open source is the future of computing 😉

About The Author

Cédric Walter

I worked with various Insurances companies across Switzerland on online applications handling billion premium volumes. I love to continuously spark my creativity in many different and challenging open-source projects fueled by my great passion for innovation and blockchain technology.In my technical role as a senior software engineer and Blockchain consultant, I help to define and implement innovative solutions in the scope of both blockchain and traditional products, solutions, and services. I can support the full spectrum of software development activities, starting from analyzing ideas and business cases and up to the production deployment of the solutions.I'm the Founder and CEO of Disruptr GmbH.