Hi, Im trying to add a thread via cronjob but always got an error:
calling this file manually it works perfect, the thread is generated. Anyone an idea whats causing the problem via cronjob?
Code:
PHP Fatal error: Call to a member function on a non-object in /var/www/virtual/domain.com/htdocs/global.php on line 241, referer: http://domain.com/admincp/cronadmin.php?do=modify
PHP Code:
<?php
require_once('./global.php');
require_once('./includes/class_dm.php');
require_once('./includes/class_dm_threadpost.php');
$threaddm =& datamanager_init('Thread_FirstPost',$vbulletin,ERRTYPE_ARRAY,'threadpost');
$allowsmilie = '1';
$visible = '1';
$pagetext = "test";
$forumid = 1554;
$bbuserid = 98372;
$title = "Title";
// Insert thread
$threaddm->set('title',$title);
$threaddm->set('pagetext',$pagetext);
$threaddm->set('forumid',$forumid);
$threaddm->set('userid',$bbuserid);
$threaddm->set('open',1);
$threaddm->set('replycount',0);
$threaddm->set('dateline',TIMENOW);
$threaddm->set('views',0);
$threaddm->set('visible',1);
$threaddm->set('allowsmilie',1);
$threaddm->set_info('forum',$newforuminfo);
$threaddm->pre_save();
if(!empty($threaddm->errors))
{
print_r($threaddm->errors);
exit;
}
else
{
$newthreadid = $threaddm->save();
}
?>
Comment