vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Adding additional fields on New Thread (https://vborg.vbsupport.ru/showthread.php?t=97086)

CommuneZoom 09-28-2005 07:18 PM

Adding additional fields on New Thread
 
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 :).

merk 09-29-2005 10:48 PM

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
PHP Code:

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 :)

merk 09-29-2005 11:23 PM

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.

merk 10-01-2005 06:16 AM

Quote:

Originally Posted by KirbyDE
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

Quote:

Originally Posted by KirbyDE
- 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


All times are GMT. The time now is 09:24 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01120 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete