Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 09-28-2005, 07:18 PM
CommuneZoom CommuneZoom is offline
 
Join Date: Sep 2005
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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 .
Reply With Quote
  #2  
Old 09-29-2005, 10:48 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 09-29-2005, 10:54 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

- 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
Reply With Quote
  #4  
Old 09-29-2005, 11:23 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 09-29-2005, 11:25 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No. But as I understood the initial request, he wants to add data to the thread table.
Reply With Quote
  #6  
Old 10-01-2005, 06:16 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 10-09-2005, 09:39 PM
waherne waherne is offline
 
Join Date: Oct 2002
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 10-16-2005, 01:54 PM
pyro.699 pyro.699 is offline
 
Join Date: Sep 2005
Location: Fredericton, New Brunswic
Posts: 261
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:18 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07722 seconds
  • Memory Usage 2,228KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete