Kod
Notice: Constant geshi_version already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 44
Notice: Constant GESHI_LANG_ROOT already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 53
Notice: Constant GESHI_NO_LINE_NUMBERS already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 58
Notice: Constant GESHI_NORMAL_LINE_NUMBERS already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 60
Notice: Constant GESHI_FANCY_LINE_NUMBERS already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 62
Notice: Constant GESHI_HEADER_NONE already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 66
Notice: Constant GESHI_HEADER_DIV already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 68
Notice: Constant GESHI_HEADER_PRE already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 70
Notice: Constant GESHI_CAPS_NO_CHANGE already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 74
Notice: Constant GESHI_CAPS_UPPER already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 76
Notice: Constant GESHI_CAPS_LOWER already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 78
Notice: Constant GESHI_LINK already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 82
Notice: Constant GESHI_HOVER already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 84
Notice: Constant GESHI_ACTIVE already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 86
Notice: Constant GESHI_VISITED already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 88
Notice: Constant GESHI_START_IMPORTANT already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 94
Notice: Constant GESHI_END_IMPORTANT already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 96
Notice: Constant GESHI_NEVER already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 103
Notice: Constant GESHI_MAYBE already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 106
Notice: Constant GESHI_ALWAYS already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 108
Notice: Constant GESHI_SEARCH already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 112
Notice: Constant GESHI_REPLACE already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 115
Notice: Constant GESHI_MODIFIERS already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 117
Notice: Constant GESHI_BEFORE already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 120
Notice: Constant GESHI_AFTER already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 123
Notice: Constant GESHI_CLASS already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 126
Notice: Constant GESHI_COMMENTS already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 129
Notice: Constant GESHI_ERROR_NO_INPUT already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 135
Notice: Constant GESHI_ERROR_NO_SUCH_LANG already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 137
Notice: Constant GESHI_ERROR_FILE_NOT_READABLE already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 139
Notice: Constant GESHI_ERROR_INVALID_HEADER_TYPE already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 141
Notice: Constant GESHI_ERROR_INVALID_LINE_NUMBER_TYPE already defined in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 143
Fatal error: Cannot redeclare class geshi in C:\Program Files (x86)\xampp\xampp\htdocs\function\geshi.php on line 158
<?php
/**
* Tag CODE
* @package Parser
* @subpackage Filters
* @author wookieb
* @version 1.1
*/
class BbCodeFilterCode {
'open' => 'div class="code_wrapper"',
'close' => 'div',
'notallowed_child' => 'all',
'leave_notallowed_child' => 1,
'leave_notallowed_parent' => 1,
'parse_body' => 'parseCode'
)
);
public function parseCode($tag, &$openNode, &$body, &$closeNode)
{
// laczymy tresc w całość
$content = '';
foreach($body as $key => &$node)
{
$content.= $node['text'];
$node['text'] = '';
// usuwamy zbedne elementy
if($key!=0
) unset($body[$key]); }
require_once 'function/geshi.php';
$geshi = new GeSHi($content, 'php');
$geshi->enable_classes(false);
$body[0]['tagText'] = $content;
$body[0]['text'] = $geshi->parse_code();
$body[0]['nohtmlspecialchars'] = 1;
$openNode['text'].='<div class="code_title">Kod</div><div class="code_area">';
$closeNode['text']='</div>'.$closeNode['text'];
}
}