zmmmzz
03-01-2008, 08:33 PM
I'd like to add a custom field to new threads.
So far I have this.
I execute this SQL Query:
ALTER TABLE table ADD (
var VARCHAR(10) not null default ''
)
Table is the name of the vb thread table and var is the name of the field I'm adding.
In the template I add this:
<div style="padding:$stylevar[formspacer]px">
<div>
<input type="text" class="bginput" size="10" name="var" value="" id="var" tabindex="1" /> $vbphrase[var_name]</div>I add 3 new plugins:
newpost_process
if ($type == 'thread')
{
$dataman->setr('var', $post['var']);
}
newthread_post_start
$vbulletin->input->clean_array_gpc('p', array('var' => TYPE_STR));
$newpost['var'] =& $vbulletin->GPC['var'];
threadfpdata_start
$this->validfields['var'] = array(TYPE_STR, REQ_NO); I got this info from a vb.org article. Now I want to display the variable in postbit or showthread.
I think I need to add a new plugin to global_start but I'm not sure. How do I call it?
So far I have this.
I execute this SQL Query:
ALTER TABLE table ADD (
var VARCHAR(10) not null default ''
)
Table is the name of the vb thread table and var is the name of the field I'm adding.
In the template I add this:
<div style="padding:$stylevar[formspacer]px">
<div>
<input type="text" class="bginput" size="10" name="var" value="" id="var" tabindex="1" /> $vbphrase[var_name]</div>I add 3 new plugins:
newpost_process
if ($type == 'thread')
{
$dataman->setr('var', $post['var']);
}
newthread_post_start
$vbulletin->input->clean_array_gpc('p', array('var' => TYPE_STR));
$newpost['var'] =& $vbulletin->GPC['var'];
threadfpdata_start
$this->validfields['var'] = array(TYPE_STR, REQ_NO); I got this info from a vb.org article. Now I want to display the variable in postbit or showthread.
I think I need to add a new plugin to global_start but I'm not sure. How do I call it?