2013-03-02, 10:34 AM
I'm using the core function fetch_next_run() for when inserting a task in my plugin and whenever it's ran, the warning below is thrown:
"mktime() expects paramete 1 to be Long, String given"
I've checked the core source of MyBB and am doing exactly as is done in the core, so I assume the above is also thrown there. Here's my code:
"mktime() expects paramete 1 to be Long, String given"
I've checked the core source of MyBB and am doing exactly as is done in the core, so I assume the above is also thrown there. Here's my code:
$taskExists = $db->simple_select('tasks', 'tid', 'file = \'myalerts\'', array('limit' => '1'));
if ($db->num_rows($taskExists) == 0) {
require_once MYBB_ROOT.'/inc/functions_task.php';
$myTask = array(
'title' => $lang->myalerts_task_title,
'file' => 'myalerts',
'description' => $lang->myalerts_task_description,
'minute' => '0',
'hour' => '1',
'day' => '*',
'weekday' => '1',
'month' => '*',
'nextrun' => TIME_NOW + 3600,
'lastrun' => 0,
'enabled' => 1,
'logging' => 1,
'locked' => 0,
);
$task_id = $db->insert_query('tasks', $myTask);
$theTask = $db->fetch_array($db->simple_select('tasks', '*', 'tid = '.(int) $task_id, 1));
$nextrun = fetch_next_run($myTask);
$db->update_query('tasks', 'nextrun = '.$nextrun, 'tid = '.(int) $task_id);
$plugins->run_hooks('admin_tools_tasks_add_commit');
$cache->update_tasks();
}