PDA

View Full Version : New Thread and database


Murtific
07-20-2011, 07:26 PM
Where is the parts of the code in newthread.php that calls the newthread function to save data into the database. I want to make my own input field and save it to the thread database where i have my own fields when I click on POST A Thread.

or

Does anybody have any suggestions about how to have it submit the new thread and instead of it redirecting you to the new thread, it redirects you to a custom template i have where I can recall the new thread and then insert the data into the database this way. I'd rather do the first way, but i'm clueless about how that part completely functions. :confused:

kh99
07-20-2011, 09:06 PM
Where is the parts of the code in newthread.php that calls the newthread function to save data into the database. I want to make my own input field and save it to the thread database where i have my own fields when I click on POST A Thread.


The actual code that writes to the thread table of the database is in includes/class_dm.php, but you probably want to look at includes/class_dm_threadpost.php. Around line 926 there's an array with a list of fields in the thread table. You might be able to use a plugin on hook location threaddata_start to add to that array (you'll have to actually modify the db and add that field to the table yourself).

That code is used in includes/functions_newpost.php in the build_new_post() function, so you'd have to add code to set your new field.

build_new_post() is called from newthread.php, so you'd probably need to add code there to get your new field from the form data and put it in $newpost to be passed to build_new_post().

I know that's a short description of something that's not obvious, but I hope it helps.