copyright 2006 Maxime Lardenois version 1.0 modified 15/01/2006 - 19:09 *******************************************************************************/ // Include files require_once("rj_common.php"); // Extract parameters $codeType = getPostedValue('codeType'); $codeHeader = getPostedValue('codeHeader'); $codeContent = getPostedValue('codeContent'); $lineNumbers = getPostedValue('lineNumbers'); $startLine = getPostedValue('startLine'); $useClasses = getPostedValue('useClasses'); //=== // Note: The old InsertCode plugin did some extra adjustments to the strings here. // The equivalent code and my reasons for commenting it out are listed below. // // The code content had leading and trailing whitespace removed. I'm assuming that // if you entered whitespace you wanted to keep it // $codeContent = trim($codeContent); // // The header content had leading and trailing whitespace removed along with HTML // tags being stripped from it. Once again, I'm assuming you said information was // added for a reason. // $codeHeader = strip_tags(trim($codeHeader)); // // A manual tab replacement was done, but GeSHi contains logic to do tab processing // appropriate for the format parametersgiven to it. // $codeContent = str_replace("\t", " ", $codeContent); // //=== // initialize GeSHi $geshi =& new GeSHi($codeContent, $codeType); //=== // Tell GeSHi to use stylesheets. Note that this should be the fist thing // called when stylesheets are going to be used. if( $useClasses == "true" ) { $geshi->enable_classes(); } //=== // We could set an overall class here, but it isn't necessary due to the // fact we already surround the output in