Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
text is also available
* @param object The article params
* @param integer The 'page' number
*/
public function onContentPrepare($context, &$article, &$params, $page = 0)
{
// Simple performance check to determine whether bot should process further.
if (JString::strpos($article->text, 'pre>') === false)
{
return true;
}
// Define the regular expression for the bot.
$regex = "#(.*?)
#s";
// Perform the replacement.
$article->text = preg_replace_callback($regex, array(&$this, '_replace'), $article->text);
return true;
}
/**
* Replaces the matched tags.
*
* @param array An array of matches (see preg_match_all)
* @return string
*/
protected function _replace(&$matches)
{
jimport('joomla.utilities.utility');
require_once __DIR__ . '/geshi/geshi.php';
$args = JUtility::parseAttributes($matches[1]);
$text = $matches[2];
$lang = JArrayHelper::getValue($args, 'lang', 'php');
$lines = JArrayHelper::getValue($args, 'lines', 'false');
$html_entities_match = array("|\
|", "#<#", "#>#", "|'|", '#"#', '# #');
$html_entities_replace = array("\n", '<', '>', "'", '"', ' ');
$text = preg_replace($html_entities_match, $html_entities_replace, $text);
$text = str_replace('<', '<', $text);
$text = str_replace('>', '>', $text);
$text = str_replace("\t", ' ', $text);
$geshi = new GeSHi($text, $lang);
if ($lines == 'true')
{
$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
}
$text = $geshi->parse_code();
return $text;
}
}