Ask a difficult question? Hello everyone, how can I add custom form items (template-data insertion-Data Query) in the discuz system )??
Please give a reply!
Reply to discussion (solution)
What do form items mean? Form? Or php pages and templates?
What do form items mean? Form? Or php pages and templates?
At present, the discuz Post mode is basically the category title post content.
I want to add several items, such as adding area select and remarks input. What is the price for classification information, and the new and old levels choose this?
It is easy to create templates. The difficulty is that the program involved in posting should be changed, the database should be written, and the output should be ensured.
Data can be obtained directly at $ _ POST in the background. if a field is created on the pre_forum_thread table, $ newthread = array (, you can add fields and data to the table. if you create a table separately, you can use DB: insert to insert data.
Data can be obtained directly at $ _ POST in the background. if a field is created on the pre_forum_thread table, $ newthread = array (, you can add fields and data to the table. if you create a table separately, you can use DB: insert to insert data.
Data can be obtained directly at $ _ POST in the background. if a field is created on the pre_forum_thread table, $ newthread = array (, you can add fields and data to the table. if you create a table separately, you can use DB: insert to insert data.
So how to get data? Which program is used to read the database and obtain the Post data? I plan to create a copy and use it again.
Of course, you can use DB: select to write it yourself, but I don't want to. I think this is not closely related to the system.
// Obtain the topic C: t ('forum _ thread')-> fetch (1); // The topic id, returns a one-dimensional array C :: t ('forum _ thread')-> fetch_all (array (1, 2, 3); // The topic id (array), returns a two-dimensional array // gets the post C :: t ('forum _ Post')-> fetch (); // The topic id, and post id, returns a one-dimensional array C: t ('forum _ Post ') -> fetch_all (9, array (25, 26, 27); // The topic id and Post id (array). a two-dimensional array is returned.
Find \ source \ class \ table \ table_forum_post.php and \ source \ class \ table \ table_forum_thread.php for details.