1 (edited by Ev!L-E!NsTe!N 2015-02-13 02:32)

Topic: ...

...

Re: ...

mmmmm work to do, nice these colors but a hell of a job if you ask me

Get working !!!!??? Start your own Forum!! Every day fresh!! (HIT ME!!)

3 (edited by Aleksei 2004-04-22 08:37)

Re: ...

$code = highlight_string($code, true);

that`s it wink
if you want perfect line number <-> code alignment then use this one:

<?php
function phpHighlight($code){

   $code = "<?php\n".$code."\n?>";
   $code = stripslashes($code);
   $code = highlight_string($code, true);
   $code = explode('<br />', $code);
 
   $text = "<div style='margin:0px 5% 0px 5%;'>PHP:<hr /><table
       style='padding:0px; border-spacing: 0px 0px;'>";
 
   for($x=0;$x<sizeof($code);$x++)
       $text .= "<tr><td style='font-family:Verdana; font-size:10px;
           vertical-align:middle; background-color:#FFFFE1;'>".
           ($x+1)."</td><td><div style='margin:0px 5px 0px 5px;'>".
           $code[$x]."</div></td></tr>";

   $text .= "</table><hr /></div>";
   return $text;
 
}
?>

(C)Malcolm

http://www.php.net/manual/en/function.h … string.php

Re: ...

Do you want all posted text to be parsed like that or only the one in the \[code\] block?

If the code block:

Open:
include/parser.php

Find (line 276):
$message = pun_htmlspecialchars($message);

Replace with:
$message = highlight_string(pun_htmlspecialchars($message), true);

Re: ...

You shouldn't run both highlight_string and htmlspecialchars. Try this:

$message = highlight_string($message, true);

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: ...

Oops :P