vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Newthread.php and saving custom field to database (https://vborg.vbsupport.ru/showthread.php?t=314028)

Medi0cr3 08-30-2014 04:00 PM

Newthread.php and saving custom field to database
 
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

Quote:

Originally Posted by Medi0cr3 (Post 2513142)
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/...nager_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 [DATE]1409420788[/DATE] at [TIME]1409420788[/TIME] ---------------

I found this,
http://www.vbulletin.com/forum/forum...itional-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


All times are GMT. The time now is 11:54 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.00996 seconds
  • Memory Usage 1,725KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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