well i got it working now. my original idea was to use the exact vbulletin parsing function so the code would highlight just as it does in a vb post.
the problem was that i was running the script outside of the /forum directory so the includes were messing things up.
after a lot of troubleshooting and some help from another, .. i found a pretty cool function that is so simple, but made it work.
the idea here is that i needed to include a file called 'global.php' from the /forum directory. global.php had many includes in it which were reletive to the forum directory.. so naturally if i included that file on a level below /forum , the paths would not match when executed.
here is the solutions:
PHP Code:
<?
// change directory to the forum directory
chdir("forum/");
// execute global.php inside its own directory
include("./global.php");
// change the current directory back to where the current script running is
chdir("./");
?>
i learn something everyday.