View Full Version : Adding additional fields on New Thread
CommuneZoom
09-28-2005, 07:18 PM
What PHP file specifically submits the data through a query to create a new thread? I am trying to add 2 additional fields when creating a new thread, but cannot seem to locate the query that adds the data from a typical new thread to the database.
If anyone could please assist with this, I'd appreciate it very much. I have been scanning through files all night :).
It is built using the thread datamanagers.
The best way to handle it would be:
add fields to the newthread template
clean the variables in newthread_post_start ($vbulletin->input->clean_array_gpc()
add fields to database using another query in newpost_complete eg
if($type == 'thread')
{
$vbulletin->db->query_write("DO YOUR QUERY HERE"); # $threadinfo['threadid'] for the new threadid.
}
Or it could very well be possible by modifying the datamanagers, but I'm not that far into the system yet :)
Andreas
09-29-2005, 10:54 PM
- Alter table thread to add your fields
- Adjust Template newthread
- Creae a Plugin for threadpfdata_start to add the fields to its validfields
- Create a Plugin for newthread_post_start to set the fields in $post to the cleaned form data
- Create a Plugin for newpost_process to set the values from $post to the Datamanager
This method does not cause additional queries :)
Can that method be used to add fields in other tables?
The method I mentioned above actually modifies a different table, because im storing certain information outside of that table.
Andreas
09-29-2005, 11:25 PM
No. But as I understood the initial request, he wants to add data to the thread table.
No. But as I understood the initial request, he wants to add data to the thread table.
Sorry, I asked that question for myself :) Oh well, Im happy with my method for a secondary table then :)
waherne
10-09-2005, 09:39 PM
I'm having this same trouble trying to find the code for posting a thread to the thread table. I too want to populate some additional fields in the table. Surely there must be some query somewhere with 'INSERT' within it? Does anyone know where to find it?
pyro.699
10-16-2005, 01:54 PM
- Alter table thread to add your fields
- Adjust Template newthread
- Creae a Plugin for threadpfdata_start to add the fields to its validfields
- Create a Plugin for newthread_post_start to set the fields in $post to the cleaned form data
- Create a Plugin for newpost_process to set the values from $post to the Datamanager
This method does not cause additional queries :)
ok, im needing help in this exact area, infact, ive made 2 posts about it, 1 in php and 1 in services...
Kirby, when you say
- Adjust Template newthread
how do we alter it, what do we add/take out?
and the rest of the crap, what dose that mean? could you elaberate a bit please ^^
EDIT: kirby, do i ahve to edit the 'thead table' if its going to have nothign to do with the table? mine has to do with the postbit :S
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.