vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Not a request but some guided help please as im stuck with the php of this (https://vborg.vbsupport.ru/showthread.php?t=46715)

Dean C 12-16-2002 01:27 PM

Not a request but some guided help please as im stuck with the php of this
 
I need three new rows added to the post table..

Lets call them field1, field2 and field3

Now i need it so that if a user is posting a new thread in forumid "x" it will insert the relevant data for these fields into the post table..

It would be helpful if i could have the code for the templates too so i can add the relavant fields to the 'newthread' template..

Also i'd like it so i can have three variables: $field1, $field2 & $field3 that i can insert into the 'newthread' template so that if the information in the post table is there - it will show it :) - Don't worry about templating it just set it up so that it outputs some text and whatever is in the post table..

Then finally i need it to produce an error if field1, field2 or field3 is not filled in when posting a new thead in forumid "x"...

Hopefully someone can help me with this..

I'm trying to learn how to do things like this so please can you tell me how to do it and why you do it this way..

Thanks for your time

- miSt

Xenon 12-16-2002 02:31 PM

ohohoh, relativly simple, but long to describe :)

ok, i think some of the things i'll explain now :)

in newthread.php find this:
PHP Code:

  eval("dooutput(\"".gettemplate("newthread")."\");"); 

before it put this:
PHP Code:

if ($forumid==x) {
  eval(
"\$extrafields = \"".gettemplate("newthread_extrafields")."\";");
} else {
  
$extrafields "";


then create a new template called newthread_extrafields and put in the html-code for the inputboxes :)

after that add $extrafields into your newthread-template where you want this options.

That is the part, your extra options just appear in newthread, when forumid = x.

Dean C 12-16-2002 03:09 PM

But i need the extra rows in the user table?

- miSt


All times are GMT. The time now is 02:42 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.00905 seconds
  • Memory Usage 1,715KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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