Helpful Information
 
 
Category: vB4 Programming Discussions
DataManager Thread_FirstPost help.

I have the following code which worked perfectly in 3.8.x...


$threaddm =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$threaddm->set_info('forum', $foruminfo);
$threaddm->registry->options['floodchecktime'] = 0;
$threaddm->set('forumid', $forumid);
$threaddm->set('username', $username);
$threaddm->set('title', $title);
$threaddm->set('prefixid', strtolower($section));
$threaddm->set('pagetext', '$placeholder');
$threaddm->set('allowsmilie', 0);
$threaddm->set('lastposter', $username);
$threaddm->set('visible', 1);
$threaddm->set('dateline', time());
$threaddm->pre_save();
...
$threaddm->save();


in 4.0.x it creates a thread as expected, database info looks fine... however...

When I view forumdisplay the prefixid's don't show. Am I missing something?

If I advance edit the thread and assign the prefixid again it does show.

prefixid is set by $section. Have you done any testing regarding that variable yet - making sure it is set and such?

I know that its inserting correctly as I can see in the database that its correct, its just not displaying the prefix in forumdisplay.

I am wondering if there is some datastore or cache i need to rebuild after creating a thread this way?

So it is showing the correct last post, but just not the prefix? What is in the page source? And it shows prefixes for other threads on the forumdisplay page?

I will have to look through the standard newpost code and see if I am missing something.

--------------- Added 1258522512 at 1258522512 ---------------

my bad, the code above works fine, seems i was sleepy when i created my prefix's and made a few of them in capitals :/










privacy (GDPR)