mihai11
08-07-2007, 01:25 PM
NEVERMIND, I SORTED OUT !
Hi,
I am using this function to create threads:
function _createThread_vbulletin($forumid, $posttitle, $postpagetext, $postuserid=0)
{
global $vbulletin;
if ($postuserid == 0) $postuserid = $this->postuserid;
echo "forumid = '$forumid', posttitle = '$posttitle', postpagetext = '$postpagetext', postuserid = '$postuserid' <br />";
$threadinfo = array();
$foruminfo = fetch_foruminfo($forumid);
$threaddm =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$threaddm->set('forumid', $forumid);
$threaddm->set('userid', $postuserid);
$threaddm->set('pagetext', $postpagetext);
$threaddm->set('title', $posttitle);
$threaddm->set('allowsmilie', '1');
$threaddm->set('visible', '1');
$threaddm->set_info('forum', $foruminfo);
$threaddm->pre_save();
if(count($threaddm->errors) < 1)
{
$threadid = $threaddm->save();
build_thread_counters($threadid);
}
else return 0;
build_forum_counters($forumid);
return $threadid;
}
I took the function from this thread:
https://vborg.vbsupport.ru/showthread.php?t=97283&page=5
Everything is fine except that there seems to be a hard limit of 45 characters for the thread title . If the thread title is longer than that then the function fails when calling "pre_save".
What can be the issue ?
Regards,
Razvan M.
Hi,
I am using this function to create threads:
function _createThread_vbulletin($forumid, $posttitle, $postpagetext, $postuserid=0)
{
global $vbulletin;
if ($postuserid == 0) $postuserid = $this->postuserid;
echo "forumid = '$forumid', posttitle = '$posttitle', postpagetext = '$postpagetext', postuserid = '$postuserid' <br />";
$threadinfo = array();
$foruminfo = fetch_foruminfo($forumid);
$threaddm =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$threaddm->set('forumid', $forumid);
$threaddm->set('userid', $postuserid);
$threaddm->set('pagetext', $postpagetext);
$threaddm->set('title', $posttitle);
$threaddm->set('allowsmilie', '1');
$threaddm->set('visible', '1');
$threaddm->set_info('forum', $foruminfo);
$threaddm->pre_save();
if(count($threaddm->errors) < 1)
{
$threadid = $threaddm->save();
build_thread_counters($threadid);
}
else return 0;
build_forum_counters($forumid);
return $threadid;
}
I took the function from this thread:
https://vborg.vbsupport.ru/showthread.php?t=97283&page=5
Everything is fine except that there seems to be a hard limit of 45 characters for the thread title . If the thread title is longer than that then the function fails when calling "pre_save".
What can be the issue ?
Regards,
Razvan M.