Quote:
Originally Posted by SirAdrian
-Add field to databaseSee KirbyDE's post above (best done with install code though) -Add the form element to newthread...Edit the newthread template and add your field. -Clean data, place into GPC array:Hook: newthread_post_start
PHP Code:
$vbulletin->input->clean_array_gpc('p', array(
'fieldname' => TYPE_UINT
));
$newpost['fieldname'] = $vbulletin->GPC['fieldname'];
-Set datamanager value:Hook: newpost_process
PHP Code:
if ($type == 'thread')
{
$dataman->setr('fieldname', $post['fieldname']);
}
-Validate the field for the datamanger (if you don't you get an error): Hook: threadfpdata_start
PHP Code:
$this->validfields['fieldname'] = array(TYPE_UINT, REQ_NO);
-Replace every occurance of "fieldname" with your form element name (preferably have it the same as the database field you make), and also replace every occurance of TYPE_UINT with how you want to clean your data.
|
Hi SirAdrian,
I did find the "newthread" template so I can add the new form field, but for the life of me I couldn't find:
newthread_post_start
newpost_process
threadfpdata_start
I'm currently running vB version 3.0.7. Could that be why?
Anyone else successfully get this to work or know of any other helpful links?
Thanks in advance for your help!