The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
adding another parameter when posting
ive an help forum, which helps students to solve problems from a books.
and i want to collect all these solutions into one table so i could do a search in that table and find a specific solution easy. im trying to add some more parameters(actually 3) to a specific group when they are posting . like there is the "title:" parameter, so i want to add there also "book name: " , "page number : " , "exercist number : " i succeed to add the parameters next to the "title:" and the textbox, but i just dont know how to add the data to vbulletin database , or how to create the table for it, i need to do it manually ? please help me. regards, |
#2
|
||||
|
||||
If you need a new table, then you are going to have to create it manually. Then you will have to write the code to insert your data into the table.
|
#3
|
|||
|
|||
yes ive created the table i wanted , but where do i write the code to inesrt the data i wrote above into the table ??
for e.g , where is the code which inserts the "title" thread name into the right table .. ? |
#4
|
||||
|
||||
I don't know where you would add it. What is it based on - stuff they insert into a new thread? If so, look at the newthread template for a good hook location to plugin to.
|
#5
|
|||
|
|||
i want to know where the code that they add the newthread information into the database ??
or where the code that they add the newpost information into the database ?? there isnt such code like "insert into" or "$db" in newthread nor newreply... |
#6
|
||||
|
||||
check out the function build_new_post in includes/functions_newpost.php . That is where a new post gets created.
|
#7
|
|||
|
|||
ok thanks i can see that, i looked over the code and found the "build_new_post" function.
though i still cant understand how to do what i wanted. next to the title : textbox ive added bookname:textbox . now i want to insert the text in the bookname textbox into the table ive created (vb_Solutions) . how can i do it ? where is the code that acutally adds the title information into the database ? so ill see an e.g ... regards, |
#8
|
||||
|
||||
You'll want to use the datamangers there. You can read up on datamanagers in the articles forum. Basically, first you need to add the fields to the $validfields array (again, search the files to find it - hint, check the beginning of vB_DataManager_Thread for a hook - threaddata_start), and then you will have to set each of the fields prior to them being saved in the datamanager.
I would strongly suggest finding some modification here that is similar to what you want and looking to see how they did this. |
#9
|
|||
|
|||
ive looked weeks for a mod that will fit to me, but found nothing.
anyway thanks alot for the help... it did help me. if u know a mod that could help me then ill be glad to hear.. |
#10
|
||||
|
||||
I think the Thank You mod adds a field to a thread and then writes to it at times. Just find a mod that does similar things as yours, like that one, and see how they added their field to the $validfields array. I'm not saying to use their mod, just look at what they did and the hooks they used.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|