View Full Version : [Good] Dataman ?!
K1ng0e
06-20-2006, 08:59 PM
Hello all!
I try to change a title of a thread with posting.php ->
[EDIT] Good !
And my error:
Fatal error: Direct Instantiation of vB_DataManager_ThreadPost class prohibited. in /includes/class_dm_threadpost.php on line 30
calorie
06-21-2006, 04:40 PM
Look in the postings.php file for the following:
if ($_POST['do'] == 'updatethread')
{
// blah blah
if ($threaddeleted != 1)
{
// see how datamanager and title are handled here
}
// blah blah
}
K1ng0e
06-21-2006, 04:48 PM
It's the same of my code ...
This is my new code:
$vbulletin->input->clean_array_gpc('p', array(
'ip' => TYPE_STR,
'title' => TYPE_STR
));
$newtitle = "<b><font color=yellow>[Servie (" . $vbulletin->userinfo['username'] . ")]</font></b>" . $vbulletin->GPC['title'];
$threadinfo['title'] = addslashes($newtitle);
$threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_STANDARD, 'threadpost');
$threadman->set_existing($threadinfo);
$dataman->setr('title', $newtitle);
$dataman->pre_save();
// process errors if there are any
$errors_title = array_merge($errors_title, $dataman->errors);
if (empty($errors_title))
{
$dataman->save();
}
and my new error:
Fatal error: Call to a member function on a non-object in /home/zech/public_html/forum/postings.php(196) : eval()'d code on line 102
Line 102:
$dataman->pre_save();
Alan @ CIT
06-21-2006, 05:07 PM
You need to use $threadman->setr(), $threadman->pre_save() and $threadman->save(), not $dataman->...()
Thanks,
Alan.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.