Input

type = ‘blog’;
$node->promote = 1;

//deciding the status (published or not)
$nodeStatus = 0;
if($row[‘entry_status’]==2){$nodeStatus=1;}
$node->status = $nodeStatus;

//determining the user
$node->uid = $row[‘entry_author_id’];
switch ($row[‘entry_author_id’]){
case 2:
$node->name = ‘Aaron’;
break;
case 3:
$node->name = ‘Peter Daou’;
break;
case 4:
$node->name = ‘Mark Leon Goldberg’;
break;
case 5:
$node->name = ‘Delegates Lounge’;
break;
case 6:
$node->name = ‘Peter’;
break;
case 7:
$node->name = ‘Jessica Valenti’;
break;
case 8:
$node->name = ‘Matthew Cordell’;
break;
case 9:
$node->name = ‘Susan Myers’;
break;
case 10:
$node->name = ‘Robert Skinner’;
break;
case 11:
$node->name = ‘Guest’;
break;
case 12:
$node->name = ‘John Boonstra’;
break;
case 13:
$node->name = ‘Vanessa Valenti’;
break;
case 14:
$node->name = ‘Kenneth Bledsoe’;
break;
case 1:
$node->name = ‘Zaphod’;
$node->uid = 15;
break;
}
$node->format = 2; // Full HTML
$node->created = strtotime($row[‘entry_created_on’]);
$node->updated = $node->created;
$node->date = $row[‘entry_created_on’];
echo(date(“r”,$node->created).’
‘);

$noder = ‘archives/’.date(“Y”,$node->created).’/’.date(“m”,$node->created).’/’.$row[‘entry_basename’].’.php’;
$node->path = $noder;
$node->title = $row[‘entry_title’];
$node->teaser = $row[‘entry_text’];
$alsoMore = $row[‘entry_text’].’‘.$row[‘entry_text_more’];
$node->body = $alsoMore;

$resultB = mysql_query(“SELECT * FROM mt_placement WHERE placement_entry_id='”.$row[‘entry_id’].”‘”)
or die(mysql_error());

$taxCount=0;
while($rowB = mysql_fetch_array($resultB)){
echo($rowB[‘placement_category_id’]);
$node->taxonomy[$taxCount] = $rowB[‘placement_category_id’];
$term = taxonomy_get_term($rowB[‘placement_category_id’]);
$node->taxonomy_term = (string) $term->name;
echo($term->name);
}

node_invoke_nodeapi($node, “mtimport”);
$newnode = node_submit($node);
node_save($newnode);
}
}

echo(‘start‘);

?>

Get occasional updates from UN Dispatch

* indicates required

Our free service for global affairs professionals

  • Want to learn more?