Voor Mijnproject.net ben ik bezig met de ubb codes/functie.
<?
function ubb();
//oude elende werkt allemaal
//php
$text = preg_replace('/\[php\](.*)\[\/php\]/si',showsource('\\1'),$text);
//andere opties
return $text;
}
function showsource($text){
ob_start();
highlight_string(stripslashes($text));
$source = ob_get_contents();
ob_end_clean();
$source = explode('<br />',$source);
$geheel .= '<table border="0" cellpadding="4" cellspacing="0"><tr><td>';
for ($i = 1; $i < count($source); $i++) {
$geheel .= '<code>'.$i.'</code><br />';
}
$geheel .= '</td><td><code>';
for ($i = 0; $i < count($source)-1; $i++) {
$src .= $source[$i] . '<br />';
}
$src .= $source[count($source)];
$geheel .= $src.'</code></font></td></tr></table>';
return $geheel;
}
?>
Als ik dit uit voer zie ik alleen de tabelen in bestand ipv van de voledige source. Weet iemand hoe dit is op telossen
587 views