Add to MyYahoo!
Subscribe in NewsGator Online
Add to Newsburst
Add to Google
Add to My AOL
Add to Pluck
Subscribe in FeedLounge
Add to Windows Live
Add to NetVibes
Subscribe in Rojo
Subscribe in Bloglines
Add to MyMSN
Add to Plusmo for your cellphone
Add to PageFlakes
Add to Technorati
Add to BlinkBits
Geshi update for Mambo 4.5.2 Print E-mail
User Rating: / 1
PoorBest 
Monday, 20 June 2005 23:27

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 http://qbnz.com/highlighter/index.php

My upgrade is for mambo 4.5.2...

  • Mambo 4.5.2 already contains Geshi (http://qbnz.com/highlighter/index.php) 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 Mambo.zip 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 www.waltercedric.com 

#### 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
     mambots/content/geshi/geshi/ 

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

 $useCSS = mosGetParam( $args, 'useCSS', 'true' );
 $useHeader = mosGetParam( $args, 'useHeader', 'true' );
 $useFooter = mosGetParam( $args, 'useFooter', 'false' );
  
OR
      specify for each <pre> </pre> tag ther value see "example of use"

### use a CSS ###
- Point a browser to www.yoursite.com/mambots/content/geshi/cssgen.php
 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  www.yoursite.com/templates/mytemplatename/css/ directory.
- update four index.jsp from www.yoursite.com/templates/mytemplatename/index.jsp to include the new css on all page:
   ex:

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

- You can delete the generator
www.yoursite.com/mambots/content/geshi/cssgen.php
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
    </div>
    </div>"; 
       $geshi->set_header_content($header);
     }
     
     if ($useFooter) {
       $footer="<div class=\"sourcecodefooter\">
    <div class=\"sourcecodetitle\">footer
    </div>
    </div>"; 
       $geshi->set_footer_content($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;
   }
 </pre>

    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 ;-)


	
	
	
	
		

Tags See All Tags Add New Tag...

Please Enter New Tags Separated By Comma's
  Or Close


Powered By Joomla Tags

Comments
Add New Search RSS
Write comment
Name:
Email:
 
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
:):grin;)8):p:roll:eek:upset:zzz:sigh:?:cry
:(:x
Please input the anti-spam code that you can read in the image.

3.20 Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated on Monday, 20 June 2005 23:47
 
Content View Hits : 3241841

Enter Amount: