<?php
define('PUN', true);
$pun_root = 'forum/'; // change here
require $pun_root ."include/parser.php";
ob_start();
?>
here comes the html code that you want
<?php
$contents = ob_get_contents();
// apply bbcode
$contents = do_bbcode($contents);
// if you want to apply smilies also
$contents = do_smilies($contents);
print $contents;
?>
i think it's ok with this code.
Edit:
but smilies will have problem because if you check the do_smilies function, you can see the code: src=img/smilies/... blah...
if you want to apply it change it like
$message = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="'.$pun_root.'img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.$smiley_text[$i].'">$2', $message);
and $pun_root should be declared as global in do_smilies function.
Edit:
I think i forgot including functions.php