How do I update latest_tagged_content in xf_tinhte_xentag_tag row?

Jason

New Member
#1
I've created a XenForo thread and post which have been created in db and serialized tag is in the thread, but the tag row is not updated to include the latest_tagged_content.

What is the best way to update the tag row with new thread/post?
Mã:
$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();
 
OP
OP
J

Jason

New Member
#2
I found the answer for anyone interested
Mã:
$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();
 

Từ khóa phổ biến

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top