', '
', '', $html);
// Convert dates
if($date){
$a_date = explode('/', $date);
$date = $a_date[1].'/'.$a_date[0].'/'.$a_date[2];
$unix = strtotime($date);
}
if($image){
$photo = $image;
}
if($text){
$html = '', $html); $html = str_replace('
'.$brief.'
'.$text; } // Build an array for Wordpress $date = date("Y-m-d H:i:s", $unix); $postarr = array(); $postarr['post_date'] = $date; $postarr['post_content'] = $html; $postarr['post_title'] = $title; $postarr['post_status'] = 'publish'; $postarr['post_type'] = 'post'; $postarr['post_modified'] = $date; $postarr['post_category'] = array($wp_cat_id); //$postarr['post_content_filtered'] = json_encode(array('keywords' => $keywords, 'image' => $photo)); // Debug echo 'Date: '.$i.')'.date("r", $unix).' - '.$date.'
'.chr(10);
flush();
ob_flush();
print_r($postarr);
echo ''.chr(10); // insert the post if($postarr['post_title']){ //$err = wp_insert_post($postarr, true); } // Show any error if($err){ echo ' - '; #print_r($err); #echo $err; var_dump($err); echo ''.chr(10); } $i++; } echo '
'.chr(10).chr(10); } ?>