The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
datamanager question
So, I'm trying to add a new thread via a plugin I wrote:
$threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_STANDARD, 'threadpost'); $threadman->set_existing($threadinfo); $threadman->set('pollid', $pollid); $threadman->save(); It works just fine, creating the thread where it is supposed to be created. I've added a new column called "ent_attach" in the thread table and need to set its value to 1 via the above plugin. I tried doing$threadman->setr('ent_attach', 1); as well as $threadman->set('ent_attach', 1); but it's not working. Anything I'm missing? --------------- Added [DATE]1257674386[/DATE] at [TIME]1257674386[/TIME] --------------- Ok I added this: $this->validfields['ent_attach'] = array(TYPE_INT, REQ_NO); via threaddata_start plugin. It is still not working tho. Am I missing something? |
#2
|
||||
|
||||
Adding it to the validfields should work. You have to set the field prior to doing the save - you didn't say exactly where you added that line, nor did you say which hook location you are using.
|
#3
|
|||
|
|||
Adding the validfields php to the threadfpdata_start hook.
I also tried threaddata_start but it seems like threadfp one is the right one. When I set it to REQ_YES instead of REQ_NO, it won't let me post a thread neither from my plugin nor from a new thread page telling me I'm missing that field. The $threadman->set(); i put right before the save(). That goes in a plugin in misc.php page where I'm setting up a custom form for my members. Basically, the goal is to have them fill it out and it posts a new thread in a specific forum and sets that mysql column value to 1. |
#4
|
||||
|
||||
threadfpdata_start is for the first post only. If you are only going to use this when creating a new thread (thus a first post), then that is fine to use.
What hook location are you using in the misc.php file? It would help to see exactly what you have right now since you've changed things. |
#5
|
|||
|
|||
Never mind. I decided to use a simple query to take care of the problem.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|