Log in

View Full Version : Should I extend or bypass ThreadPost DataManager?


Whissi
08-22-2007, 04:18 PM
Hello,

currently I am using the ThreadPost DataManager (DM), to create new threads from external scripts. I like that concept.

Now I need to add a new field into the "thread" table, to store additional information for a new custom feature. But when I add a new field, the DM wouldn't be able to work with that newly created field (it doesn't know anything about it).

What would you suggest me to do?
Extend DM (I hope it is possible to check and save data in custom additional fields; I didn't find any tutorial about extending the DM - maybe I used the wrong search term?)
Bypass DM an use own code to save my additional data into that custom field when required

Paul M
08-22-2007, 08:07 PM
You can add fields to the DM valid list via the hook/plugin system (threaddata_start & threadfpdata_start).

$this->validfields['fieldname'] = array(TYPE_STR, REQ_NO);

Set the type and other fields as required.

Whissi
08-23-2007, 07:56 AM
You can add fields to the DM valid list via the hook/plugin system (threaddata_start & threadfpdata_start).

$this->validfields['fieldname'] = array(TYPE_STR, REQ_NO);

Set the type and other fields as required.
So you recommend to extend DM. :)
Thanks.

Marco van Herwaarden
08-23-2007, 09:54 AM
No, it is not extending the DM, it is just using it as designed. ;)