PDA

View Full Version : Not a request but some guided help please as im stuck with the php of this


Dean C
12-16-2002, 01:27 PM
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:
eval("dooutput(\"".gettemplate("newthread")."\");");

before it put this:
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