The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help update using datamanager
pls help me Update custom field in Thread using datamanager. I have user code
PHP Code:
|
#2
|
|||
|
|||
I'm not sure what you're trying to do, but if you put that code at hook threaddata_start then you're creating a Thread datamanager in the Thread datamanager constructor, which isn't good.
What are you doing, adding a field to the thread creation page, then trying to get the value to the database when the thread is created? |
Благодарность от: | ||
RichieBoy67 |
#3
|
|||
|
|||
Quote:
Code:
$threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_STANDARD, 'threadpost'); $threadman->set_existing($threadinfo); $threadman->set('custom_field', $custom_field); $threadman->save(); Code:
$this->validfields['custom_field'] = array(TYPE_INI, REQ_NO); P/S: I do not want use Code:
UPDATE " . TABLE_PREFIX . "thread ..... |
#4
|
||||
|
||||
Try replacing all instances of "custom field" with "custom_field"...you cannot have spaces embedded in variable names.
|
Благодарность от: | ||
RichieBoy67 |
#5
|
|||
|
|||
, That is just an example.
|
#6
|
|||
|
|||
Hmm...ok. Well, there is no TYPE_INI, maybe you mean TYPE_INT. But I don't know if that would stop it from working. Are you sure $threadinfo is set? You might have to set that yourself. Or it might be enough to just do something like
Code:
$threadman->set_existing(array('threadid' => $threadid)); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|