MyBB Community Forums

Full Version: How do you get $myb->post_code in xmlhttp?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to develop a plugin and where it loads a row of chats on an interval in a box.
Kinda like shoutbox, but this plugin focuses on the being able to add people as a friend. It's a must to what I'm trying to accomplish through this plugin.

Here is the code for hooking it into the xmlhttp

$plugins->add_hook("xmlhttp", "shortchat_load_rows");

and the template contains the following link:

"usercp.php?action=do_editlists&add_username={$username}&my_post_key={$mybb->post_code}"

Obviously, I need the post code to make this happen.

here is an example output on the website:

Quote:"http://lcoalhost/mybb/usercp.php?action=do_editlists&add_username=testuser2&my_post_key="

The post codes is completely empty hence the request will be denied due to the lack of the code.

I'm developing this while working on a local server. (I don't have any websites yet)
Sorry if you couldn't test it, but I hope my post was clear enough.

Thanks.
Make sure to global $mybb Smile
(2013-04-28, 06:10 PM)Euan T Wrote: [ -> ]Make sure to global $mybb Smile

Yeah, it's already set. Here:

global $db, $mybb, $parser, $charset, $lang, $templates;