![]() | Join Date: Mar 2008 | Posts: 1 | iTrader: (0) |
Custom fields in new thread
I'd like to add a custom field to new threads.
So far I have this.
I execute this SQL Query:
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:
I add 3 new plugins:
newpost_process
newthread_post_start
threadfpdata_start
I got this info from VB.org. 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:
Code:
ALTER TABLE table ADD (
var VARCHAR(10) not null default ''
) In the template I add this:
Code:
<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>
newpost_process
Code:
if ($type == 'thread')
{
$dataman->setr('var', $post['var']);
} Code:
$vbulletin->input->clean_array_gpc('p', array('var' => TYPE_STR));
$newpost['var'] =& $vbulletin->GPC['var']; Code:
$this->validfields['var'] = array(TYPE_STR, REQ_NO);
I think I need to add a new plugin to global_start but I'm not sure. How do I call it?









Linear Mode

