Datamanager + Cronjob?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • high76
    New Member
    • Jan 2007
    • 7

    Datamanager + Cronjob?

    Hi, Im trying to add a thread via cronjob but always got an error:

    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
    calling this file manually it works perfect, the thread is generated. Anyone an idea whats causing the problem via cronjob?

    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();
      } 

    ?>
  • sebbe
    New Member
    • Feb 2006
    • 11
    • 3.6.x

    #2
    Try change this
    PHP Code:
    $threaddm =& datamanager_init('Thread_FirstPost',$vbulletin,ERRTYPE_ARRAY,'threadpost'); 
    to

    PHP Code:
    $threaddm = new vB_DataManager_Thread_FirstPost($vbulletinERRTYPE_STANDARD); 
    sig

    Comment

    Related Topics

    Collapse

    Working...