Update of /cvsroot/phpcvsview/phpcvsview/geshi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8380
Added Files:
geshi.php
Log Message:
- Added GeSHi source code to the repository. For details relating to GeSHi please see it's website at http://qbnz.com/highlighter/
--- NEW FILE: geshi.php ---
<?php
/*************************************************************************************
* geshi.php
* ---------
* Author: Nigel McNie (ora...@gm...)
* Copyright: (c) 2004 Nigel McNie
* Release Version: 1.0.4
* CVS Revision Version: $Revision: 1.1 $
* Date Started: 2004/05/20
* Last Modified: $Date: 2004/12/20 07:28:58 $
*
* The GeSHi class for Generic Syntax Highlighting. Please refer to the documentation
* at http://qbnz.com/highlighter/documentation.php for more information about how to
* use this class.
*
* For changes, release notes, TODOs etc, see the relevant files in the docs/ directory
*
*************************************************************************************
*
[...2374 lines suppressed...]
* Easy way to highlight stuff. Behaves just like highlight_string
*/
function geshi_highlight ( $string, $language, $path, $return = false )
{
$geshi = new GeSHi($string, $language, $path);
$geshi->set_header_type(GESHI_HEADER_DIV);
if ( $return )
{
return str_replace('<div>', '<code>', str_replace('</div>', '</code>', $geshi->parse_code()));
}
echo str_replace('<div>', '<code>', str_replace('</div>', '</code>', $geshi->parse_code()));
if ( $geshi->error() )
{
return false;
}
return true;
}
}
?>
|