no dobra poczytałem wiem już mniej więcej o co chodzi czyli że jak mam w tym kodzie
Kod
s:135:"<table cellspacing="0" width="100%" class="table-code"><tr><td class="table-padding"><pre style="margin:0px">$1</pre></td></tr></table>";
to na samym początku mam s:135 czyli 135 określa liczbę wszystkich znaków w "" jeżeli chce coś tam dopisać to muszę zwiększyć liczbę 135 o ilość dopisanych znaków ok.
teraz jak chce dopisać ten kod:
Kod
<? highlight_string('$1'); ?>
w ten sposób:
Kod
s:162:"<table cellspacing="0" width="100%" class="table-code"><tr><td class="table-padding"><pre style="margin:0px"><? highlight_string('$1'); ?></pre></td></tr></table>";
skrypt wyświetla kod w znaczniku BBCODE ale nie koloruje składni i na końcu dopisuje w bbcode '); ?>
czyli jednym słowem nie wiem jak tam to dopisać żeby pokolorowało składnie albo nie dokładnie zapoznałem się z funkcją unserialize
a i może to coś blokuje w funkcji bbcoda?
o to skrypt :
Kod
<?php
//----------------------------------------------------
// Obsluga BBCode
//----------------------------------------------------
function make_tags ($text) {
global $database;
global $_TAGS;
// Mozemy postowac HTMLa jako tekst
$text = str_replace('<', '<', $text);
$text = str_replace('>', '>', $text);
// HTML nie moze byc dostepny dla przegladarki
$text = strip_tags($text);
// Wstawianie BB code
if (!$_TAGS) {
$_TAGS = $database->select('*', 'tags');
}
foreach ($_TAGS as $tagRec) {
if ($tagRec['type'] == 'regular') {
$scount = substr_count($text, '[/');
for ($i=0; $i < $scount; $i++) {
$text = preg_replace($tagRec['pattern'].'i', $tagRec['result'], $text);
}
} else {
// Zamykamy niezamniete tagi
if (strlen($tagRec['tag_prefix']) > 1) {
while (substr_count($text, $tagRec['tag_prefix']) < substr_count($result, $tagRec['tag_suffix'])){
$text = $text . $tagRec['tag_suffix'];
}
}
$text = str_replace($tagRec['tag_prefix'], $tagRec['result_prefix'], $text);
$text = str_replace($tagRec['tag_suffix'], $tagRec['result_suffix'], $text);
}
}
// Wstawianie emotikon
$emoticons = EmotsTable();
foreach ($emoticons as $emotRec) {
$text = str_replace($emotRec['text'], '<img border="0" src="'. $emotRec['image'] .'" alt="' . $emotRec['text'] . '" />', $text);
}
// Niewyswietlaj <br />
$text = str_replace('<br />', '<br />', $text);
return $text;
}
function StripBBCode($s) {
$s = str_replace("'", '', $s);
$s = str_replace('"', '', $s);
return preg_replace('#\[.+?\]#', '', $s);
}
?>