MyBB Community Forums

Full Version: Get a post's content then print it on other custome page!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everybody!

I have just write small code to show a post's content on my homepage.
I already get data from mySQL with this
$query1 = $db->query("SELECT pid, subject, message FROM ".TABLE_PREFIX."posts ".$where." replyto=0 AND fid=2 ORDER BY pid DESC LIMIT 1");
$result1 = $db->fetch_array($query1);
$title = $result1['subject'];
$news_content = $result1['message'];

but when i print the "news_content" variable, it isn't formated (lose the smiles, line break vv.v...

Anyone can tech me how to keep original format of the post?

I just require 2 files only:
require_once "./global.php";
require_once MYBB_ROOT."inc/class_parser.php";

Thanks in advance!
this post might help
this post is useful for me. Thanks to the author, and thank .m. too ^_^