Auto post from file

Started by tdguchi, August 17, 2014, 05:55:28 PM

Previous topic - Next topic

tdguchi

Hi, I have a csv file, which has a subject,body and forum inn the same line, like this:

subject;body;forum
subject;body;forum
subject;body;forum
subject;body;forum

I have splitted the three parts, and what i want is to post with the information of every line... I call this function ...

postear($subject,$message,$foro);

function postear($message,$subject,$foro) {
require '../../SSI.php';

// Create the post
require_once($sourcedir . '/Subs-Post.php');
$msgOptions = array(
'id' => 0,
'subject' => $subject,
'body' =>  $message,
'icon' => 'xx',
'smileys_enabled' => 1,
'attachments' => array(),
);
$topicOptions = array(
'id' => 0,
'board' => $foro,
'poll' => null,
'lock_mode' => 0,
'sticky_mode' => null,
'mark_as_read' => true,
);
$posterOptions = array(
'id' => $user_info['id'],
'update_post_count' => !$user_info['is_guest'] && !isset($_REQUEST['msg']),
);
if ($context['user']['is_logged']){
preparsecode($msgOptions['body']);
createPost($msgOptions, $topicOptions, $posterOptions);
}
}


But it only posts the first line (despite being within a loop)

what could be the problem?

Advertisement: