jaybolt
27 Apr 2006, 21:07
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:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Where table is the name of your vb thread table (eg vb_thread) and var is the name of the field you are adding.
2. Add the fields to the newthread template in admincp / style manager
Find
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
and above that add:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Again, var is the name of the field and the same as in the previous SQL Query. You can smarten this up further using the fieldset tags and creating a custom vbphrase for the $vbphrase[your_phrase] part :
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
3. Go to admincp / add new plug in and add the following three plugins (give them the same name so you recognise them later):
newpost_process
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
newthread_post_start
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
threadfpdata_start
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Once again, var is the name of the variable you have been using for your field name above.
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 :) ]
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:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Where table is the name of your vb thread table (eg vb_thread) and var is the name of the field you are adding.
2. Add the fields to the newthread template in admincp / style manager
Find
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
and above that add:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Again, var is the name of the field and the same as in the previous SQL Query. You can smarten this up further using the fieldset tags and creating a custom vbphrase for the $vbphrase[your_phrase] part :
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
3. Go to admincp / add new plug in and add the following three plugins (give them the same name so you recognise them later):
newpost_process
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
newthread_post_start
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
threadfpdata_start
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Once again, var is the name of the variable you have been using for your field name above.
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 :) ]