PDA

View Full Version : Custom fields in new thread


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?

Boofo
03-01-2008, 08:57 PM
Is this supposed to display only in the postbit?

zmmmzz
03-01-2008, 09:40 PM
yes, in postbit

zmmmzz
03-03-2008, 03:38 PM
and maybe in showthread

Opserty
03-03-2008, 04:12 PM
Try $threadinfo[var] or $thread[var] in the postbit one of them might work.