Go Back   vBulletin Setup > vBulletinSetup Information > vBulletin Questions


Please Register to get full access to the forums.
Post New Thread  Reply



#1   03-01-2008, 02:46 PM
Zummm will become famous soon enough 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:
Code:
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:

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>
I add 3 new plugins:

newpost_process

Code:
if ($type == 'thread')
{
    $dataman->setr('var', $post['var']);
}
newthread_post_start

Code:
$vbulletin->input->clean_array_gpc('p', array('var' => TYPE_STR));

$newpost['var'] =& $vbulletin->GPC['var'];
threadfpdata_start

Code:
$this->validfields['var'] = array(TYPE_STR, REQ_NO);
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?
Quote   |  



#2   03-02-2008, 11:46 PM
Send a message via AIM to Brandon Send a message via MSN to Brandon Send a message via Yahoo to Brandon Brandon is a glorious beacon of lightBrandon is a glorious beacon of lightBrandon is a glorious beacon of lightBrandon is a glorious beacon of light Join Date: Jul 2006 Posts: 11,228 Location: Topeka, KS
iTrader: (0)
Sponsor our Next Contest!
Re: Custom fields in new thread


Welcome to vBulletin SEO Setup, reply to the PM that you received when you signed up, to gain full access to this site.

Please Read the rules and enjoy!

thanks
-Brandon
--------------------
Brandon Sheley / vBulletin Setup Staff
Check out our Newsletter for the latest vB and SEO news.
Are you looking for vBulletin work to be done on your forums ?
Would you like to Help Support vBulletin Setup.


Add our Facebook Blog, Group and LinkedIn group.. Thanks
Stay up to date by installing our Tool Bar

Last edited by ARealRedneck; 03-03-2008 at 04:53 AM..
Quote   |  
Post New Thread  Reply
vBulletin Setup > vBulletinSetup Information > vBulletin Questions


Tags
new field, thread, variable

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving posts from one thread into a different thread. Lampwick vBulletin Questions 4 06-03-2008 05:00 PM
Custom Thread Fields harmor vBulletin Questions 10 05-22-2008 03:22 PM
extra fields in user's registration n00b.gr vBulletin Questions 2 01-05-2008 06:56 PM
Signup fields dprundle vBulletin Questions 2 09-03-2006 04:48 AM


All times are GMT -6. The time now is 07:15 AM.

vBulletin Setup, vBulletin Setup Forums, vBulletin Services, vBulletin Blogs, vBulletin SEO, vBulletin Questions
vBulletin Skins, Styles, Templates, vBulletin Monetization, Blogs, vBulletin Link Directory,Quality Link Directory