Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 11-18-2009, 09:49 AM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default adding another parameter when posting

ive an help forum, which helps students to solve problems from a books.
and i want to collect all these solutions into one table so i could do a search in that table and find a specific solution easy.

im trying to add some more parameters(actually 3) to a specific group when they are posting .

like there is the "title:" parameter, so i want to add there also "book name: " , "page number : " , "exercist number : "

i succeed to add the parameters next to the "title:" and the textbox,

but i just dont know how to add the data to vbulletin database , or how to create the table for it, i need to do it manually ?

please help me.

regards,
Reply With Quote
  #2  
Old 11-18-2009, 01:50 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you need a new table, then you are going to have to create it manually. Then you will have to write the code to insert your data into the table.
Reply With Quote
  #3  
Old 11-18-2009, 06:57 PM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes ive created the table i wanted , but where do i write the code to inesrt the data i wrote above into the table ??

for e.g , where is the code which inserts the "title" thread name into the right table .. ?
Reply With Quote
  #4  
Old 11-18-2009, 07:03 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know where you would add it. What is it based on - stuff they insert into a new thread? If so, look at the newthread template for a good hook location to plugin to.
Reply With Quote
  #5  
Old 11-18-2009, 09:33 PM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i want to know where the code that they add the newthread information into the database ??

or where the code that they add the newpost information into the database ??

there isnt such code like "insert into" or "$db" in newthread nor newreply...
Reply With Quote
  #6  
Old 11-18-2009, 10:40 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

check out the function build_new_post in includes/functions_newpost.php . That is where a new post gets created.
Reply With Quote
  #7  
Old 11-19-2009, 05:31 AM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok thanks i can see that, i looked over the code and found the "build_new_post" function.

though i still cant understand how to do what i wanted.

next to the title : textbox ive added bookname:textbox .

now i want to insert the text in the bookname textbox into the table ive created (vb_Solutions) .

how can i do it ?

where is the code that acutally adds the title information into the database ? so ill see an e.g ...

regards,
Reply With Quote
  #8  
Old 11-19-2009, 01:51 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You'll want to use the datamangers there. You can read up on datamanagers in the articles forum. Basically, first you need to add the fields to the $validfields array (again, search the files to find it - hint, check the beginning of vB_DataManager_Thread for a hook - threaddata_start), and then you will have to set each of the fields prior to them being saved in the datamanager.

I would strongly suggest finding some modification here that is similar to what you want and looking to see how they did this.
Reply With Quote
  #9  
Old 11-19-2009, 02:16 PM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ive looked weeks for a mod that will fit to me, but found nothing.

anyway thanks alot for the help...

it did help me.

if u know a mod that could help me then ill be glad to hear..
Reply With Quote
  #10  
Old 11-19-2009, 03:31 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think the Thank You mod adds a field to a thread and then writes to it at times. Just find a mod that does similar things as yours, like that one, and see how they added their field to the $validfields array. I'm not saying to use their mod, just look at what they did and the hooks they used.
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 10:54 PM.


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.05929 seconds
  • Memory Usage 2,236KB
  • Queries Executed 11 (?)
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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete