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 $languages = 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";
//~ }
$languages[] = "{$lang}";
$languages = array_unique($languages);
//}
//return $scripts;
return $languages;
}
function plugin_syntaxhighlighter_head() {
$pdir=plugin_geturl('syntaxhighlighter');
echo <<
SHL;
}
add_action('wp_head', 'plugin_syntaxhighlighter_head');
function plugin_syntaxhighlighter_foot() {
//$used_languages = implode(plugin_syntaxhighlighter_add(), "\n");
$used_languages = json_encode(plugin_syntaxhighlighter_add());
$pdir=plugin_geturl('syntaxhighlighter');
echo <<
SHLBOX;
}
add_action('wp_footer', 'plugin_syntaxhighlighter_foot');
?>