MyBB Community Forums

Full Version: Creating tasks?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to update myXBL to use the task system (as advised), but I'm struggling writing the task code. I tried copying some of the default tasks and changing what I needed to, but the task didn't even run (even when set from the ACP)
As far as I know, you should've to assign a function in plugins too to work along with ./inc/tasks/ files.

Also use the following function in plugin.
function FUNCTION_NAME_task() {
	global $db, $mybb;

	require_once MYBB_ROOT . 'inc/functions_task.php';
// your task goes here
}

Ok, thanks. I'll have a go with that and see what happens.
Actually, I've now got a working task file. Is there any way to just add a task as you would from the ACP? I'm sure there's a function I can find, but it would be helpful if somebody could just tell me off the top of their head haha
(2010-12-22, 03:59 PM)euantor Wrote: [ -> ]Ok, thanks. I'll have a go with that and see what happens.
Actually, I've now got a working task file. Is there any way to just add a task as you would from the ACP? I'm sure there's a function I can find, but it would be helpful if somebody could just tell me off the top of their head haha

Look at one of my plugins: VIP Membership
It is a good example of how you can create a task in ACP.
Thanks Pirata.

I actually found the snippet I needed in RSS Feed Poster Smile