View Full Version : Newthread.php and saving custom field to database
Medi0cr3
08-30-2014, 04:00 PM
I'm trying to save data from an input field that I have in newthread template into the database. However, I want it to be in the same row as the newly created thread. However its hard when the thread doesn't exist. I cant find any documentation that EASILY describes how this is done, or how the forum's datamanager works.
A little help would be appreciated!!! :eek:
tbworld
08-30-2014, 04:13 PM
I'm trying to save data from an input field that I have in newthread template into the database. However, I want it to be in the same row as the newly created thread. However its hard when the thread doesn't exist. I cant find any documentation that EASILY describes how this is done, or how the forum's datamanager works.
A little help would be appreciated!!! :eek:
You will receive better help if you post your code, since we can get a feel for where you are at and what you are looking for.
I found quite a few references for the datamanager by Googling vbulletin.org using: "vbulletin datamanager forum" as my terms. :)
vBulletin Manual - Datamanager
https://www.vbulletin.com/docs/html/main/data_manager_advanced
Medi0cr3
08-30-2014, 04:26 PM
an Input field. <inpunt name='data'>
some php code to save to a database mysql_query("UPDATE vb_thread SET zevent='$mTime' WHERE threadid='$newT' ", $con);
however ''''WHERE threadid'''' wont exist because the post hastn't been made yet.....
so i have no idea how to do that externally.
tbworld
08-30-2014, 04:37 PM
You should start by looking for a similar modification in-which you can use as a template for your personal code.
Are you looking to create a thread via the datamanager?
Medi0cr3
08-30-2014, 04:38 PM
I am simply trying to put some data into my database from an extra field i have in the template.
i have a conditional that only lets the field show up in newthread template with a specific forumid.
At the exact same time my NEWPOST is made, i want the data from the input field to be saved into the database in the same row as the new post.
--------------- Added 1409420788 at 1409420788 ---------------
I found this,
http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/vbulletin-4-quick-tips-and-customizations/353391-how-to-add-additional-fields
however when he gets to the part that says:
Once you cashed the field variable as described above, you can add it to the post by:
I have no clue what the heck that means without some more Context.
tbworld
08-30-2014, 05:33 PM
I was writing something up when I came across this from @KH99 during a search. Basically it covers everything I was going to suggest, but in an example form (good ol' @KH99). :)
https://vborg.vbsupport.ru/showthread.php?t=307730
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.