我不知道该怎么做;我想手动提交评论。
I am not sure how to do this; I want to manually submit a comment.
如果您使用 Drupal 6,您需要查看 comment_form_submit() 和 comment_save()。对于 Drupal 7,comment_save()更像是一个真正的 API 函数,因此,如果您正确准备注释,那么这就是您所需要的。
If you are using Drupal 6, you'll want to take a look at both comment_form_submit() and comment_save(). For Drupal 7, comment_save() is much more of a true API function, so if you are properly preparing your comment, that's all you should need.
$user = user_load(array(uid => $a_uid)); $forum_comment_fields = array(); $forum_comment_fields['values']['author'] = $user->name; $forum_comment_fields['values']['subject'] = ""; $forum_comment_fields['values']['comment'] = $comment; $forum_comment_fields['values']['op'] = t('Save'); $forum_comment_fields['values']['nid'] = $nid; $forum_comment_fields['values']['date'] = $created; comment_form_submit("comment_form", $forum_comment_fields);
我觉得日期不对...
I think the date is incorrect...
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(2)
如果您使用 Drupal 6,您需要查看 comment_form_submit() 和 comment_save()。对于 Drupal 7,comment_save()更像是一个真正的 API 函数,因此,如果您正确准备注释,那么这就是您所需要的。
If you are using Drupal 6, you'll want to take a look at both comment_form_submit() and comment_save(). For Drupal 7, comment_save() is much more of a true API function, so if you are properly preparing your comment, that's all you should need.
我觉得日期不对...
I think the date is incorrect...