![]() |
|
Article Options |
[HOW TO] Add custom fields to new threads
by
![]() Rating:
![]() 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:
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
and above that add:
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 :
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
newthread_post_start
threadfpdata_start
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 ![]() Last edited by jaybolt; 28 Apr 2006 at 09:01.. |
||||||||||||||||||||||||||||
Views: 17767
|
Comments |
#2
|
|||
|
|||
can you give me a screen shot of your edit plugin screen
No members have liked this post.
Last edited by ibuddy; 09 Oct 2006 at 12:25. |
#3
|
|||
|
|||
How do you access it once it's in there?
No members have liked this post.
|
#4
|
|||
|
|||
Is it possible to do this, but then to only have it appear in a single forum, with subforums?
No members have liked this post.
|
#5
|
|||
|
|||
i used the hack, but the data is not getting inserted into the db... has anyone used this successfully... help
kamal No members have liked this post.
|
#6
|
|||
|
|||
Originally Posted by dfe
Per style only. So, copy your style, put as default for that forum and only make the template edits there.![]()
Thanks BTW. No members have liked this post.
|
#7
|
|||
|
|||
Where can I see this in action?
Where can I see this in action? No members have liked this post.
Last edited by SoftDux; 21 Jun 2007 at 08:19. Reason: Automerged Doublepost |
#8
|
|||
|
|||
Could this also be used to add custom fields to forums?
Thanks No members have liked this post.
|
#9
|
|||
|
|||
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? No members have liked this post.
|
#10
|
|||
|
|||
great article but its not inserting any data into the database using vb3.6.8 ? any ideas.
__________________
Thanks No members have liked this post.
Last edited by wolfe; 17 Oct 2007 at 13:02. |
#11
|
|||
|
|||
Originally Posted by FatalBreeze
I'd like to know that also..![]()
solution is in threadadmin_update .... No members have liked this post.
Last edited by Lionel; 27 Oct 2007 at 01:09. |
#12
|
|||
|
|||
Brandon No members have liked this post.
|
#13
|
|||
|
|||
Shouldn't you be using 'set' rather than 'setr'? I remember Andreas telling me not to use setr, as it bypasses some vB checks. I'm no genius at the stuff, so please excuse me if I'm wrong.
No members have liked this post.
|
#14
|
|||
|
|||
it's working fine for me (tested on clean 3.6.8 pl2 install) although you need to do more edits to actually show the $var in the thread, it does get inserted into the database for sure. If it's not working make sure you have used the right table name.. and the same $var everywhere.. Thanks for the article jaybolt.
so, how would you use it in a thread? change a query in showthread.php and select the var, then put the $var into your showthread template wherever you want it.
__________________
EnjoyCG : free CG tutorials & community No members have liked this post.
Last edited by Jelmertjee; 08 Nov 2007 at 10:13. |
#15
|
|||
|
|||
I did not have to do any additional edits on 3.68 patch level 2
No members have liked this post.
|
![]() |
![]() |
||||
Article | Author | Type | Replies | Last Post |
Miscellaneous Hacks Custom Field Columns: Display Custom Fields in Two Columns on Memberlist Search | calorie | vBulletin 3.7 Add-ons | 5 | 05 Aug 2008 10:50 |
«
Previous Article
|
Next Article
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Article Options | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 14:15.