'; $ret .= ''; $ret .= preg_replace_callback( "/(? $val) { $ret .= ''; } } return $ret; } //************************************************************** // footer_class_tag_cb - fill global $languages //************************************************************** function footer_class_tag_cb($matches) { global $languages; $match = $matches[0]; $parts = explode('"', $match); $lang = $parts[1]; $languages[$lang] = true; return $match; } //************************************************************** // do_hilite() - include lang files, execute //************************************************************** function do_hilite() { global $languages; $content = get_the_content(); preg_replace_callback('/class+\s*=\s*"sh_[^"]*"/', "footer_class_tag_cb", $content); if(count($languages) < 1) { return; } foreach($languages as $lang => $val) { echo ''; } ?>
Languages:
...code..., etc. //************************************************************** function hilite_cb($matches) { global $webroot; global $replacementCount; global $languages; $args = explode(',', $matches[2]); $lang = $args[1]; $languages[$lang] = true; $filename = $args[0]; $code = htmlentities(file_get_contents($webroot . $filename)); ob_start(); ?>Open Unformatted Code In New Window