Posted by hanzhong520 on November 20, 2008 at 5:10pm
chào mọi người,
vấn đề là thế này, mình tạo 1 content type Tài Sản (dùng CCK), chỉ có 2 field (tên tài sản, nơi san xuat).
mình ko muốn nhập mỗi lần 1 cái :( (chậm mà mệt nửa :D)
có cách nào nhập 1 lúc nhiều cái ko?
thanks
Comments
Me too, chỉ có hơi khác
Me too, chỉ có hơi khác là ở đây các node đã được tạo và tôi dùng workflow state. Khi dùng view để list một loạt các node ra thì để chuyển state của các node phải đi đến từng node edit là rất mệt. Liệu có các nào giống như trong menu Content, có một nút tick vào đó là tick hết các row trong list, rồi chọn Update Option không nhỉ? E là hơi khó.
Thí dụ cụ
Thí dụ cụ thể:
<?php
// ...
global $user;
$node->field_txnid = array (array ('value' => $txn->txnid));
$dtime = strtotime ($txn->delivery['shipping']['shipping_time']);
$node->uid = $txn->uid;
$node->type = 'shipping_infomation';
$node->title = '[TXNID: '.$txn->txnid.'] ' . $txn->delivery['shipping']['shipping_receiver'];
$node->body = implode ("\n", array (
'<b>Thành phố người nhận:</b> ' . db_result (db_query ("SELECT name FROM {term_data} WHERE tid = %d", $txn->delivery['shipping']['city_fieldset']['shipping_city'])),
'<b>Địa chỉ người nhận:</b> ' . $txn->delivery['shipping']['shipping_location'],
'<b>Số điện thoại người nhận:</b> ' . $txn->delivery['shipping']['shipping_phone'],
'<b>Gửi đến staff:</b> <blockquote>' . $txn->delivery['shipping']['shipping_note'] . '</blockquote>'
));
$node->teaser = node_teaser($node->body);
$node->filter = variable_get('filter_default_format', 1);
$node->status = 1;
$node->promote = 0;
$node->comment = 0;
$node->created = $dtime;
$node->changed = $dtime;
node_save($node);
// ...
?>
--
Thế Hồng