如何更新xf_tinhte_xentag_tag行中的latest_tagged_content?

时间:2014-10-24 09:54:02

标签: php xenforo

我已经创建了一个XenForo线程,并且已在db和serialized标签中创建的帖子位于该线程中,但标记行未更新为包含latest_tagged_content。

使用新主题/帖子更新标记行的最佳方法是什么?

$writer = XenForo_DataWriter::create('XenForo_DataWriter_Discussion_Thread');
$writer->set('user_id', $user_id);
$writer->set('username', "xxxxx");
$writer->set('node_id', $node['node_id']);
$writer->set('title', "Initial Post");
$writer->set('tinhte_xentag_tags', serialize(Array('tag_text'=>$tag['tag_text'])));
$postWriter = $writer->getFirstMessageDw();
$postWriter->set('message', "Initial Post");
$writer->save();

1 个答案:

答案 0 :(得分:0)

我找到了感兴趣的人的答案

$writer = XenForo_DataWriter::create('XenForo_DataWriter_Discussion_Thread');
$writer->set('user_id', $user_id);
$writer->set('username', "NSX News");
$writer->set('node_id', $node['node_id']);
$writer->set('title', "Initial Post");
$writer->Tinhte_XenTag_setTags(Array('tag_text'=>$tag['tag_text']));
$postWriter = $writer->getFirstMessageDw();
$postWriter->set('message', "Initial Post");
$writer->save();