PDA

View Full Version : add tags to post via data manager


meshkruaj
12-16-2012, 06:43 PM
hi guys
i need to add tags to post that are being created using the datamanager.

the forum and the 1st thread are created automatically using the datamanager and i`m adding also the tags doing

do_set('taglist','tag1,tag2');

till here everything is ok and i can see the tags listed on the new created posts but when i click them ( to filter the posts by tags ) it says invalid tags .... seems i need to rebuild indexes/tags or im not adding tags OK

can someone tell me how to add tags to post using the datamanagers ?

regards

kh99
12-16-2012, 08:16 PM
I'm looking at threadtag.php, and it looks like you want to do something like this:

$content = vB_Taggable_Content_Item::create($vbulletin, vB_Types::instance()->getContentTypeID('vBForum_Thread'), $threadid);
$limits = $content->fetch_tag_limits();
$errors = $content->add_tags_to_content('tag1,tag2', $limits);


but I haven't actually tried it. Also, in threadtag.php there are some calls to check permissions which probably do a redirect to an error page, so I left them out because I'm not sure if it's appropriate for your application.

meshkruaj
12-16-2012, 08:50 PM
thanks man :)
its Ok now , i have some more quesiton about adding images to the newly created posts but will open a new thread since its another topic