Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 20 Jul 2011, 20:26
Murtific Murtific is offline
 
Join Date: Jul 2011
New Thread and database

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.
Reply With Quote
  #2  
Old 20 Jul 2011, 22:06
kh99's Avatar
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by Murtific View Post
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.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 03:06.

Layout Options | Width: Wide Color: