Log in

View Full Version : Datamanager doesn't update forum "last post"


MoMan
11-08-2009, 07:18 PM
I use the following code in a script to move threads to a forum that is otherwise locked:


$threadman->set('title', "$customprefix $threadinfo[title]");
$threadman->set('forumid', 81);
$threadman->save();
$threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$threadman->set_existing($threadinfo);
$threadman->set('lastpost', TIMENOW);
$threadman->save();

However, the "last post" column for that forum never updates unless I run 'rebuild forum information' through cron. What am I missing?

Thanks for any help!

Lynne
11-08-2009, 08:16 PM
See this post - https://vborg.vbsupport.ru/showthread.php?p=960421#post960421

MoMan
11-08-2009, 08:28 PM
Thanks.

It didn't work at first, but I figured out why.

build_forum_counters($threadinfo['forumid']);

Would update the forum counters of the original forum, not of the forum to which the thread was moved. I replaced this with:

build_forum_counters(81);

And we were golden!

Lynne
11-08-2009, 10:10 PM
Glad you got it working. :)