getClass('code'); $pref = e107::getPref(); $tp = e107::getParser(); if($pref['smiley_activate']) { if (!is_object($tp->e_emote)) { $tp->e_emote = new e_emoteFilter; } $code_text = $tp->e_emote->filterEmotesRev($code_text); } $search = array(E_NL,'\','$', '<'); $replace = array("\r\n","\\",'$', '<'); $code_text = str_replace($search, $replace, $code_text); if(isset($pref['useGeshi']) && $pref['useGeshi'] && file_exists(e_PLUGIN."geshi/geshi.php")) { $code_md5 = md5($code_text); if(!$CodeCache = $e107cache->retrieve('GeshiParsed_'.$code_md5)) { require_once(e_PLUGIN."geshi/geshi.php"); if($parm) { $geshi = new GeSHi($code_text, $parm, e_PLUGIN."geshi/geshi/"); } else { $geshi = new GeSHi($code_text, ($pref['defaultLanGeshi'] ? $pref['defaultLanGeshi'] : 'php'), e_PLUGIN."geshi/geshi/"); } $geshi->line_style1 = "font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"; $geshi->set_encoding('utf-8'); $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); $geshi->set_header_type(GESHI_HEADER_DIV); $CodeCache = $geshi->parse_code(); $e107cache->set('GeshiParsed_'.$code_md5, $CodeCache); } $ret = "".str_replace("&", "&", $CodeCache).""; } else { $code_text = html_entity_decode($code_text, ENT_QUOTES, 'utf-8'); $code_text = trim($code_text); $code_text = htmlspecialchars($code_text, ENT_QUOTES, 'utf-8'); $srch = array('{','}'); $repl = array('{', '}'); $code_text = str_replace($srch, $repl, $code_text); // avoid code getting parsed as templates or shortcodes. if($parm == 'inline') { return "".$code_text.""; } // $highlighted_text = highlight_string($code_text, TRUE); // highlighted_text = str_replace(array("",""),"",$highlighted_text); $divClass = ($parm) ? $parm : 'code_highlight'; $ret = "
".$code_text."
"; } $ret = str_replace("[", "[", $ret); return $ret; } } ?>