[HOW TO] Add custom fields to new threads
Ok - this is my first submitted 'how to' and is the result of me wanting to add a couple of new fields to my new threads. A quick search on here showed me a couple of people asking the same but no conclusive answers (there were a couple of threads with 'typos') so here is my code as is. It works for me anyway!
1. To add the fields to the thread table in the database: Go into admincp and down to the bottom. Select Execute SQL Query and then add your fields as follows: Code:
ALTER TABLE table ADD ( 2. Add the fields to the newthread template in admincp / style manager Find Code:
<if condition="$show['misc_options']"> Code:
<div style="padding:$stylevar[formspacer]px"> Code:
<fieldset class="fieldset"> newpost_process Code:
if ($type == 'thread') Code:
$vbulletin->input->clean_array_gpc('p', array('var' => TYPE_STR)); Code:
$this->validfields['var'] = array(TYPE_STR, REQ_NO); I hope this helps - took me a while to get it sorted (and I did find help on here along the way) but this is the completed process. [EDITED: corrected an inevitable type in the SQL query :) ] |
can you give me a screen shot of your edit plugin screen
|
How do you access it once it's in there?
|
Is it possible to do this, but then to only have it appear in a single forum, with subforums?
|
i used the hack, but the data is not getting inserted into the db... has anyone used this successfully... help
kamal |
Quote:
Thanks BTW. |
Where can I see this in action?
Where can I see this in action? |
Could this also be used to add custom fields to forums?
Thanks |
that's a great article!
But if i want to edit my newthread? and then change the value of 'var', how do i do it? |
great article but its not inserting any data into the database using vb3.6.8 ? any ideas.
|
All times are GMT. The time now is 08:35 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|