The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
In my php application I got this function
Code:
require_once('./global.htm');
require_once('./includes/class_dm.htm');
require_once('./includes/class_dm_threadpost.htm');
function update_thread($title, $pagetext, $threadid) {
global $vbulletin;
$postdm =& datamanager_init('Post', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$threadinfo = fetch_threadinfo($threadid);
$foruminfo = fetch_foruminfo($threadinfo['forumid']);
$postinfo = fetch_postinfo($threadinfo['firstpostid']);
$userinfo = fetch_userinfo($postinfo['userid']);
$postdm->set_info('forum', $foruminfo);
$postdm->set_info('thread', $threadinfo);
$postdm->set_info('post', $postinfo);
$postdm->set_info('user', $userinfo);
$postdm->set('title', $title);
$postdm->set('pagetext', $pagetext);
$postdm->pre_save();
if (count($postdm->errors) > 0) {
print_r($postdm->errors);
return FALSE;
} else {
print_r($postdm->errors);
echo $postdm->save();
return TRUE;
}
}
|
|
#2
|
|||
|
|||
|
Check whether the following is actually set:
Code:
$threadinfo['firstpostid'] Code:
$postdm->fetch_field('firstpostid');
|
|
#3
|
|||
|
|||
|
Quote:
|
|
#4
|
|||
|
|||
|
It thinks your trying to save a new thread. You need to use the set_existing() method to tell it your working on an existing thread.
Docs for the datamanagers can be found here: http://www.vbulletin.com/docs/html/data_managers Thanks, Alan. |
|
#5
|
|||
|
|||
|
Look in the class_dm_threadpost.php file for the following bit of code:
Code:
if ($this->fetch_field('userid', 'post') == 0 AND $this->fetch_field('username', 'post') == '')
{
$this->error('nousername');
return false;
}
|
|
#6
|
|||
|
|||
|
Quote:
|
|
#7
|
|||
|
|||
|
Your welcome
![]() Thanks, Alan. |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|