vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   add a field to the thread table (https://vborg.vbsupport.ru/showthread.php?t=98350)

pyro.699 10-13-2005 10:13 PM

add a field to the thread table
 
i would like to know how to add a field to the thread table... lol, as the title says...

i would also like to know, how to inflict that on my postbit!

Andreas 10-13-2005 10:15 PM

[sql]ALTER TABLE thread ADD foobar VARCHAR(20) NOT NULL DEFAULT ''[/sql]

pyro.699 10-13-2005 10:36 PM

what? lol

that makes the least of sence.. i know how 2 run the query.. ikd what its for, what files to edit...

(its for an rpg script, the user decideds what the requirements are for the rpg he wants to make, then based on his options, it adds them to the postbit...)

Andreas 10-13-2005 10:46 PM

Your question was
Quote:

i would like to know how to add a field to the thread table
I've answered it. But it seems like you wanted to know smth. else.
So please state exactly what ou want to know.

pyro.699 10-13-2005 11:04 PM

Ok, (=D'')=D < Kirby with boxing gloves ^^

I would like to edit the appearance of forum id #26. Ifs goign to be made to fit a customized rpg script.

CURRENT OPTIONS:
look at my post ^^
Da Link

FEATURES:
User can choose what options he/she wants(in the thread posting area) (options are in link)

Depending on what the user has selected, thats what is displayed in the postbit

WHAT I HAVE DONE SO FAR:
added all current tables
added postbits
created the php file
made the querys


lme know if you need any more info

Guest190829 10-13-2005 11:32 PM

Kirby's sql query is correct

PHP Code:


ALTER TABLE thread ADD foobar VARCHAR
(20NOT NULL DEFAULT '' 

foobar is the new field name.

If you need to get that info in a postbit then you have to use a select query to get the info.

But, why not just use custom profile fields?

pyro.699 10-13-2005 11:49 PM

...

im more asking for a bit of help designing the script... not a request, like iming information i dont really like having people give me the scripts, id like to help build them.

I know that kirbys script is correct, im also asking, what else do i add?

Andreas 10-13-2005 11:50 PM

Quote:

Originally Posted by Danny.VBT
If you need to get that info in a postbit then you have to use a select query to get the info.

$threadinfo['foobar'], no need for a query :)

Guest190829 10-13-2005 11:55 PM

Quote:

Originally Posted by KirbyDE
$threadinfo['foobar'], no need for a query :)

Learn something new everyday. :D

pyro.699 10-14-2005 12:06 AM

ok, i need a bit mroe help... i need ot know how to tel the script to read what the user has selected...

-----
Help from AJ
-----

what i want is to be ale to specify a few things when i go to amke a post, then i want the postbit to be able to read those choices...

Quote:

Originally Posted by AJ
[22:01] Aj - It's That Time of Year Again!: just explain what you did to me
[22:01] Aj - It's That Time of Year Again!: when you make a thread you want to specify some things
[22:01] Aj - It's That Time of Year Again!: thast the main part because you have to add the fields to the datamanager, and learn how to use it

---------------
---NEW POST---
---------------
Quote:

Originally Posted by (=D'')=D
- 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

AJ helped me find this post, can you elaberate a bit more on this? more to my specifications?

like, do i add
PHP Code:

 if (thread id code == 26)
 {
 }; 

to every plugin? or what...

and how do i amke the postbit read what the user selected...

Thanks


All times are GMT. The time now is 10:40 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.01175 seconds
  • Memory Usage 1,738KB
  • 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
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete