dp.SyntaxHighlighter 1.4.0 (edited to work with pre, thanks to Gert Thiel ) Author: NoWhereMan Author URI: http://flatpress.sf.net */ function plugin_syntaxhighlighter_add($lang=null) { static $scripts = array(); $pdir=plugin_geturl('syntaxhighlighter'); if ($lang) { switch ($lang) { case 'c': case 'cpp': case 'c++': $scripts[] = "\n"; break; case 'css': $scripts[] = "\n"; break; case 'c#': case 'c-sharp': case 'csharp': $scripts[] = "\n"; break; case 'vb': case 'vb.net': $scripts[] = "\n"; break; case 'delphi': case 'pascal': $scripts[] = "\n"; break; case 'js': case 'jscript': case 'javascript': $scripts[] = "\n"; break; case 'php': $scripts[] = "\n"; break; case 'py': case 'python': $scripts[] = "\n"; break; case 'ruby': $scripts[] = "\n"; break; case 'sql': $scripts[] = "\n"; break; case 'xml': case 'xhtml': case 'xslt': case 'html': case 'xhtml': "\n"; } $scripts = array_unique($scripts); } return $scripts; } function plugin_syntaxhighlighter_head() { $pdir=plugin_geturl('syntaxhighlighter'); echo << SHL; } add_action('wp_head', 'plugin_syntaxhighlighter_head'); function plugin_syntaxhighlighter_foot() { $syntaxes = implode(plugin_syntaxhighlighter_add(), "\n"); $pdir=plugin_geturl('syntaxhighlighter'); echo << $syntaxes SHLBOX; } add_action('wp_footer', 'plugin_syntaxhighlighter_foot'); ?>