Exemplo n.º 1
0
 function geshi($source, $language)
 {
     if (!xoops_load("geshi", "framework")) {
         if (!@(include_once dirname(__FILE__) . '/geshi.php')) {
             return false;
         }
     }
     // Create the new GeSHi object, passing relevant stuff
     $geshi_handler = XoopsGeshi::getHandler($source, $language);
     // Enclose the code in a <div>
     $geshi->set_header_type(GESHI_HEADER_NONE);
     // Sets the proper encoding charset other than "ISO-8859-1"
     $geshi->set_encoding(_CHARSET);
     $geshi->set_link_target("_blank");
     // Parse the code
     $code = $geshi->parse_code();
     return $code;
 }
Exemplo n.º 2
0
 /**
  * @param string $source
  * @param string $language
  * @return bool
  */
 public function geshi($source, $language)
 {
     if (!@XoopsLoad::load("geshi", "framework")) {
         return false;
     }
     // Create the new XoopsGeshi object, passing relevant stuff
     // XoopsGeshi should be extending geSHi in Frameworks/geshi/xoopsgeshi.php
     $geshi = new XoopsGeshi($source, $language);
     // Enclose the code in a <div>
     $geshi->set_header_type(GESHI_HEADER_NONE);
     // Sets the proper encoding charset other than "ISO-8859-1"
     $geshi->set_encoding(XoopsLocale::getCharset());
     $geshi->set_link_target("_blank");
     // Parse the code
     $code = $geshi->parse_code();
     return $code;
 }