$node = new StdClass();
$node->type = 'bzl_img';
$node->uid = $_GET['user_id'];
$node->field_bzl_img_ref[0]['nid']=$_GET['bz_id'];
$node->status = 0;
$node->field_bzl_img_main[0]['value']=0;
$node->field_bzl_user_img = array(
array(
'fid' => $fid,
'title' => $FinalFilename,
'filename' => $FinalFilename,
'filepath' => $target,
'filesize' => filesize($target),
'mimetype' => $filemime,
'data' => array(
'description' => $FinalFilename,
),
'list' => 1,
),
);
node_save($node);
$node->type = 'bzl_img';
$node->uid = $_GET['user_id'];
$node->field_bzl_img_ref[0]['nid']=$_GET['bz_id'];
$node->status = 0;
$node->field_bzl_img_main[0]['value']=0;
$node->field_bzl_user_img = array(
array(
'fid' => $fid,
'title' => $FinalFilename,
'filename' => $FinalFilename,
'filepath' => $target,
'filesize' => filesize($target),
'mimetype' => $filemime,
'data' => array(
'description' => $FinalFilename,
),
'list' => 1,
),
);
node_save($node);
1 comment:
Best way to create node
http://api.drupal.org/api/drupal/modules--node--node.pages.inc/function/node_object_prepare/6
Post a Comment