-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreatenode.php
executable file
·33 lines (30 loc) · 1.26 KB
/
createnode.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$target = 'asdfsadfsdf';
dpm('begin node');
$node = new stdClass();
$node->type = 'lp';
node_object_prepare($node);
$node->title = $target;
$node->created = time();
$node->status = 1;
$node->language = LANGUAGE_NONE;
$node->body[$node->language][0]['value'] = '';
$node->body[$node->language][0]['summary'] = '';
$node->body[$node->language][0]['format'] = 'filtered_html';
//$node->path = array('alias' => html($target));
// $node = node_submit($node);
// dpm('node submitted');
node_save($node);
dpm('node saved');
// content_insert($node);
// dpm('content inserted');
// unset($node);
// dpm('unset content');
// $options['ids']= key($node->nid);
// dpm('now a match');
//$node->field_lp_list['und'] = new array('nid', )
// drupal_set_message(t('%title does not match an existing '.$typename, array('%title' => $options['string'])));
?>