MyBB Community Forums

Full Version: post parser function?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i recently switched from IPB1.3 and i use one of the boards to publish news in my main site, however, unlike ipb, mybb doesn't store parsed information into the database, so i just can't pull out information and output them directly in my main site.

what's the file/functions i can include/call to parse the information before outputing it to the main site?

___

just a suggestion also, if messages where stored into the database already parsed, wouldn't it make the forum faster?
function postify($message, $allowhtml="no", $allowmycode="yes", $allowsmilies="yes", $allowimgcode="yes", $archive=0)

taken from inc/functions_post.php

You can just pass in the text from the db to this function. Rest is optional, but should come from the forum table.

EDIT: You'll have to make sure that the functions_post.php file is included in the file you are going to use it in. It's not included by default.
gracias ! =)
actually, that doesn't seem to be enough to parse the messages
i think there's a bunch of classes that needs to be declared before i can do that.

can anyone help me out a bit?
it seems i need the $plugins class, and nl2br function
hmm...just found where those are, seems like i'm gonna need to pretty much include the entire library to parse those messages =/
All you need to do is declare "global $plugins" or whatever it complains about. The nl2br function should already be there. It's standard PHP function O_O
You can do
include "./global.php";
That would set up all the MyBB classes, so then you can include the functions_post.php file and use the function.
thanks, that works. although i had to create a modified version of global and init.php files since my site and forums do not reside in the same folder, and i think the multi-level of "includes" confuses PHP.