vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   FORM to THREAD/ FORUM/ POLL/ PM/ EMAIL - CUSTOMIZABLE FORMS - Mod Apps, Orders, News. (https://vborg.vbsupport.ru/showthread.php?t=66082)

Erwin 08-21-2004 12:54 PM

Quote:

Originally Posted by Merjawy
A might be a bug report for Erwin :)

when posing a new thread all fine, when posting a reply to an existing thread the disable smiles is checked by default

Fixed in version 1.5.

ChrisBaktis 08-21-2004 02:20 PM

Erwin,

Just a question...are you going to update this to accept picture attachments?

Thanks

Chris

spence2 08-21-2004 04:31 PM

Is there a character limit to the textarea?

Erwin 08-22-2004 12:17 AM

Quote:

Originally Posted by ChrisBaktis
Erwin,

Just a question...are you going to update this to accept picture attachments?

Thanks

Chris

I might, but that would mean changing the templates as well, and obviously the attachment won't be PMed unless the PM attachment hack is used, and I don't use that hack. :)

But I don't think it would be hard to do. Are there many people who want that option? :)

oldford 08-22-2004 01:51 AM

Quote:

Originally Posted by Erwin
Are there many people who want that option? :)

Yes! I'd like to use this hack for my classifieds forum to force people to include the info they always forget (price, location, name, etc.). Allowing attachments is a big part of placing classified ads.

Thanks for the great hack BTW. I got it running pretty easily, but would definitely like the attachment option.

PKRWUD 08-22-2004 09:13 AM

Quote:

Originally Posted by Erwin
I've added redirect in version 1.5 - you can choose to redirect to the post, the thread or the forum, or to a thank you message which you can customize. :)

I live in Melbourne.


You totally ROCK!

Thanks so much!!!

duncan99 08-22-2004 05:03 PM

Thanks Erwin for the hack, its great I will install it. One question though, how can I change the redirect option to the forum where the user run the form.php ?

Merjawy 08-22-2004 07:10 PM

Quote:

Originally Posted by Erwin
Fixed in version 1.5.


Great, thnx Erwin
I will check it soon

as for attachment, I am not much fan of that I don't even have PM attachment hack but its a nice option to have if you got the time and not so much of trouble. :)

thnx again

Erwin 08-22-2004 08:19 PM

Quote:

Originally Posted by duncan99
Thanks Erwin for the hack, its great I will install it. One question though, how can I change the redirect option to the forum where the user run the form.php ?

Instructions in the php file itself.

duncan99 08-22-2004 08:57 PM

Quote:

Originally Posted by Erwin
Instructions in the php file itself.

I found out after the user submit the form, the redirection sends the user to the forum where the answer form will be there. In my case I set the answer form in the Admin forum which the user is not allow to have access. So how can I set the redirection to the forum I specify?

* duncan99 installed

Erwin 08-22-2004 11:41 PM

Quote:

Originally Posted by duncan99
I found out after the user submit the form, the redirection sends the user to the forum where the answer form will be there. In my case I set the answer form in the Admin forum which the user is not allow to have access. So how can I set the redirection to the forum I specify?

* duncan99 installed

You mean another forum? By default it php file redirects to the forum where the thread is made.

To specify an alternative forum -

Go down to near the end of the php file, replace $forum[forumid] in the $url line to the number of the user forum.

duncan99 08-23-2004 12:37 AM

Thank you, it works great.

oldford 08-23-2004 03:03 AM

Quote:

Originally Posted by PKRWUD
This is how I did it...

In Forumdisplay template, find:
Code:

<a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]">
And replace it with:
Code:

<a href="<if condition="$foruminfo['forumid'] == xx">form.php<else />newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]</if>">
Except you would sustitute your forum ID where it says xx. Works excellent.

Thanks for this. It works great. :)

Now can anyone tell me how that line should look if you want to have more than 1 forum? (example: forum A should use formA.php, forum B should use formB.php, etc.) Basically, how do you extend the "if condition" to work for more than 1 forumid?

Merjawy 08-23-2004 06:16 AM

Quote:

Originally Posted by oldford
Thanks for this. It works great. :)

Now can anyone tell me how that line should look if you want to have more than 1 forum? (example: forum A should use formA.php, forum B should use formB.php, etc.) Basically, how do you extend the "if condition" to work for more than 1 forumid?


https://vborg.vbsupport.ru/showpost....8&postcount=11

mOdEtWo 08-23-2004 12:19 PM

I try to make the form reply to a thread, and I know I have given the right options (enabled, forumid, threadid). When the form is submitted, I get a mysql error:

Code:

mysql error: Table 'forums.post' doesn't exist
mysql error number: 1146

Is there something wrong with the post sql code?

PHP Code:

                $DB_site->query("
                        INSERT INTO " 
TABLE_PREFIX "post
                                (threadid, title, username, userid, dateline, pagetext, allowsmilie,
                                 showsignature, iconid, visible)
                        VALUES
                                (
$thread[threadid], '".addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle',
                                 '" 
addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " TIMENOW ",
                                 '" 
addslashes($formsend) . "', 1, 1,
                                 0, 1)
                "
); 


oldford 08-23-2004 01:42 PM

Quote:

Originally Posted by Merjawy

I thought that was to insert one form result into two different forums at the same time? Maybe I'm wrong?

All I'm talking about is the redirect code when you click on "New Thread". I have different form.php files for each forum. I just need the redirect to understand that if it's forumid 123 then clicking on "New Thread" should redirect to form123.php. And if it's forumid 456 it should go to form456.php

PKRWUD 08-23-2004 04:59 PM

I'm very new to PHP, and I don't know that this is correct, but I believe this will work for you...

In Forumdisplay template, find:
Code:

<a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]">
And replace it with this:
Code:

<a href="<if condition="$foruminfo['forumid'] == xx">form.php<elseif condition="$foruminfo['forumid'] == yy">form2.php<elseif condition="$foruminfo['forumid'] == zz">form3.php<else />newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]</if>">
xx is the forum ID for form.php, yy is the forum ID for form2.php, and zz is the forum ID for form3.php.

Back up your template first, but I believe this will work for you. If it doesn't, change the closing </if> tag to </endif>.

oldford 08-23-2004 06:24 PM

Thanks, but I get a parse error. I tried both </if> and </endif>

PKRWUD 08-23-2004 06:53 PM

Damn. Well, I'm sorry, I really thought that would do it. I'll see what I can find out.

Isaiah33 08-23-2004 11:51 PM

a nice feature to this would be to be able to customize everything in admincp

Erwin 08-24-2004 02:11 AM

Quote:

Originally Posted by Isaiah33
a nice feature to this would be to be able to customize everything in admincp

Can be done, but would take a whole more coding on my behalf, and add extra queries to call up the variables from the database - I released this as courtesy for other forum admins - I don't have the time to code an Admin CP backend - wish I did. :)

Virulent1 08-24-2004 04:00 AM

im having some trouble.. install is fine.. got everything to work.. but its about modifing this form.php...

PREVIEW HERE: http://www.craq.org/vb/form.php

See theres a textbox under the first question.. i dont want that there... and i dont want "Choose one of the following choices" either... i want Yes or No to be where that textbox is now... and Under "How long will you be able to moderate" theres suppose to be 3 choices and only 2 show up... and i don't want that text box beside it there either... well thats it.. please someone help :( heres my current code:


PHP Code:

<?php

/*======================================================================*\
|| #################################################################### ||
|| # FORM TO THREAD/ FORUM/ PM/ EMAIL - Totally CUSTOMIZABLE FORMS    # ||
|| # Version 1.3 for vBulletin 3.x.x by Dr Erwin Loh                  # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000?2004 Dr Erwin Loh. All Rights Reserved.          # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| #################################################################### ||
\*======================================================================*/

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

globalize($_POST, array(
'normalanswer1' => STR,
'radioanswer1' => STR,
'radioanswer2' => STR,
'radioanswer3' => STR,
'radioanswer3other' => STR,
'answer1' => STR,
'answer2' => STR,
'answer3' => STR,
'longanswer1' => STR,
'action' => STR
));

// #######################################################################
// ######################## CUSTOMIZE VARIABLES ##########################
// #######################################################################

////////////////////////////////////////////////////////////////////////////////////////////////////
////// BEGIN CUSTOMIZATION BELOW////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array 
////////////////////////////////////////////////////////////////////////////////////////////////////

if (!in_array($bbuserinfo['usergroupid'], array(2,5,6,7))) print_no_permission();

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF THIS PHP FILE AND TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS!
//You can easily make more forms by just copying this file, renaming it, and modifying the variable in
//this file. You can keep the same templates for different forms. For more customization, you can 
//use different templates, by renaming and modifying the templates.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of this file
$phpfilename "form.php";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//CHOOSE WHETHER YOU WANT FORM TO BE POSTED IN A NEW THREAD, NEW POLL, REPLY TO EXISITING THREAD, PMed OR EMAILED
///////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE POSTED - 1 = yes, 0 = no
$formforum "0";

//FORUM TO POST NEW THREAD IN
$formforumid "0";

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll "1";
$formoption1 "Yes";
$formoption2 "No";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO REPLY TO EXISTING THREAD
$formreply "0";

//EXISTING THREAD ID FOR FORM TO REPLY IN
$formreplythreadid "0";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE PMED - 1 = yes, 0 = no
$formpm "1";

//USERID TO PM TO
$formpmid "1";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE EMAILED - 1 = yes, 0 = no
$formemail "1";

//EMAIL ADDRESS TO EMAIL TO
$formemailaddress "virulent@verizon.net";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall "1";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formtitle "Moderator Application";

////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose "The purpose of this form is to allow everyone at craQ [dot] org to have an equal chance at becoming a moderator.";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion1 "Would you be able to contribute to a monthly donation for server expenses?";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion1 "Choose one of the following choices";

// The following choices must NOT have quotation marks
$radiochoice1a "yes";
$radiochoice1b "no";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion2 "How old are you? [Be honest]";

// The following choices must NOT have quotation marks
$radiochoice2a "13 or below";
$radiochoice2b "14 - 18";
$radiochoice2c "18+";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 3 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion3 "How often will you be on to moderate? [Be honest]";

// The following choices must NOT have quotation marks
$radiochoice3a "1 Hour/Less a day";
$radiochoice3b "2-4 Hours a day";
$radiochoice3c "4+ Hours a Day";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//QUESTION 1 (do not use quotation marks or you will get a parse error)
$question1 "What is your name?";
$explain1 "Please enter your real name here.";

//QUESTION 2 (do not use quotation marks or you will get a parse error)
$question2 "What is your email?";
$explain2 "Please enter your real email here.";

//QUESTION 3 (do not use quotation marks or you will get a parse error)
$question3 "What is your website?";
$explain3 "Please enter your URL here.";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//LONG TEXT AREA INPUT: QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$longquestion1 "Please write down a paragraph about yourself.";
$longexplain1 "For example, a bit about your experience in this area.";

////////////////////////////////////////////////////////////////////////////////////////////////
////// END OF CUSTOMIZATION ////////////////////////////////////////////////////////////////////
/////  DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING!!! ////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

// start navbar
$navbits = array(
    
"$phpfilename?$session[sessionurl]=> $formtitle
);

$navbits construct_navbits($navbits);
eval(
'$navbar = "' fetch_template('navbar') . '";');

if (
$action=="submit") {

if (
$answerall == "1") {
    if (
$normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == '' OR $radioanswer3 == '' OR $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $longanswer1 == '')
    {
    
$errormessage "$bbuserinfo[username], you need to answer every question!";
    eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");');
    exit();
    }
}

    eval(
'$formsend = "' fetch_template('formanswers') . '";');

    if (
$formforum == "1") {

                    
$DB_site->query("
                                INSERT INTO " 
TABLE_PREFIX "thread(title, lastpost, forumid, open, replycount,
                                postusername, postuserid, lastposter, dateline, iconid, visible, attach)
                                VALUES
                                        ('"
.addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle', " TIMENOW ", $formforumid,
                                         1, 0, '" 
addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
                                         '" 
addslashes($bbuserinfo['username']) . "', " TIMENOW ", 0, 1,
                                         0)
                        "
);
                
$thread['threadid'] = $DB_site->insert_id();
                
$DB_site->query("
                        INSERT INTO " 
TABLE_PREFIX "post
                                (threadid, title, username, userid, dateline, pagetext, allowsmilie,
                                 showsignature, iconid, visible)
                        VALUES
                                (
$thread[threadid], '".addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle',
                                 '" 
addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " TIMENOW ",
                                 '" 
addslashes($formsend) . "', 1, 1,
                                 0, 1)
                "
);
                
$post['postid'] = $DB_site->insert_id();
                
$DB_site->query("
                                UPDATE " 
TABLE_PREFIX "thread
                                SET firstpostid = 
$post[postid]
                                WHERE threadid = 
$thread[threadid]
                        "
);
                
$DB_site->query("
                                UPDATE " 
TABLE_PREFIX "forum
                                SET replycount = replycount +  1,
                                " 
iif($type == 'thread''threadcount = threadcount + 1,') . "
                                lastpost = " 
TIMENOW ",
                                lastposter = '" 
addslashes($bbuserinfo['username']) . "',
                                lastthread = '"
.addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle',
                                lastthreadid = 
$thread[threadid]
                                WHERE forumid = 
$formforumid
                        "
);

    }

    if (
$formpoll == "1") {
              
$DB_site->query("INSERT INTO " TABLE_PREFIX "poll (question,dateline,options,votes,active,numberoptions,timeout,multiple,public) VALUES ('".addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle'," TIMENOW ",'$formoption1|||$formoption2','" addslashes("0|||0") . "',1,2,0,0,0)");
            
$pollid $DB_site->insert_id();
            
$DB_site->query("UPDATE " TABLE_PREFIX "thread SET pollid = '".$pollid."' WHERE threadid = '".$thread[threadid]."'");
}

    if (
$formreply == "1") {
      
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$formreplythreadid','".addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".time()."','" addslashes($formsend) . "','$allowsmilie','$signature','$ipaddress','$iconid','1')");
      
$DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " TIMENOW ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid"); 
    }

    if (
$formpm == "1") {
$DB_site->query("INSERT INTO " TABLE_PREFIX "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature)\nVALUES\n\t($bbuserinfo[userid], '" addslashes($bbuserinfo['username']) . "', '".addslashes(htmlspecialchars($formtitle))."', '".addslashes(htmlspecialchars($formsend))."', '" addslashes(serialize($tostring)) . "', 0, " TIMENOW ", 1)");
$pmtextid $DB_site->insert_id();
$DB_site->query("INSERT INTO " TABLE_PREFIX "pm (pmtextid, userid, messageread) VALUES ($pmtextid$formpmid, 0)");
$DB_site->shutdown_query("UPDATE " TABLE_PREFIX "user SET pmtotal=pmtotal+1, pmunread=pmunread+1 WHERE userid = $formpmid");
    }

    if (
$formemail == "1") {
    
vbmail($formemailaddress$formtitle$formsend);
    }

    
$errormessage "$bbuserinfo[username], thank you for submitting the $bbtitle $formtitle!";
    eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");');
   exit();
}

eval(
'print_output("' fetch_template('form') . '");');
?>


mOdEtWo 08-24-2004 04:32 AM

Quote:

Originally Posted by mOdEtWo
I try to make the form reply to a thread, and I know I have given the right options (enabled, forumid, threadid). When the form is submitted, I get a mysql error:

Code:

mysql error: Table 'forums.post' doesn't exist
mysql error number: 1146

Is there something wrong with the post sql code?

PHP Code:

                $DB_site->query("
                        INSERT INTO " 
TABLE_PREFIX "post
                                (threadid, title, username, userid, dateline, pagetext, allowsmilie,
                                 showsignature, iconid, visible)
                        VALUES
                                (
$thread[threadid], '".addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle',
                                 '" 
addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " TIMENOW ",
                                 '" 
addslashes($formsend) . "', 1, 1,
                                 0, 1)
                "
); 


Erwin, got any idea why I get a database error on this?

Does "post into an existing thread" work for anyone else?

Merjawy 08-24-2004 06:29 AM

Quote:

Originally Posted by mOdEtWo
Does "post into an existing thread" work for anyone else?

I can't answer your first question

but your second, yes it worked fine for me on new thread and post to existing thread as a reply

Isaiah33 08-24-2004 06:48 AM

ok i isntallaed and customized it makes a great poll but doesnt show any of the vouch questions or answers

Erwin 08-24-2004 12:13 PM

The code works.

Quote:

mysql error: Table 'forums.post' doesn't exist
The code can't find your post table for whatever reason. Is your database prefix forums?

PKRWUD 08-24-2004 12:29 PM

Quote:

Originally Posted by Virulent1
im having some trouble.. install is fine.. got everything to work.. but its about modifing this form.php...

PREVIEW HERE: http://www.craq.org/vb/form.php

See theres a textbox under the first question.. i dont want that there... and i dont want "Choose one of the following choices" either... i want Yes or No to be where that textbox is now... and Under "How long will you be able to moderate" theres suppose to be 3 choices and only 2 show up... and i don't want that text box beside it there either... well thats it.. please someone help :( heres my current code:


PHP Code:

<?php

/*======================================================================*\
|| #################################################################### ||
|| # FORM TO THREAD/ FORUM/ PM/ EMAIL - Totally CUSTOMIZABLE FORMS    # ||
|| # Version 1.3 for vBulletin 3.x.x by Dr Erwin Loh                  # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000?2004 Dr Erwin Loh. All Rights Reserved.          # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| #################################################################### ||
\*======================================================================*/

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

globalize($_POST, array(
'normalanswer1' => STR,
'radioanswer1' => STR,
'radioanswer2' => STR,
'radioanswer3' => STR,
'radioanswer3other' => STR,
'answer1' => STR,
'answer2' => STR,
'answer3' => STR,
'longanswer1' => STR,
'action' => STR
));

// #######################################################################
// ######################## CUSTOMIZE VARIABLES ##########################
// #######################################################################

////////////////////////////////////////////////////////////////////////////////////////////////////
////// BEGIN CUSTOMIZATION BELOW////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array 
////////////////////////////////////////////////////////////////////////////////////////////////////

if (!in_array($bbuserinfo['usergroupid'], array(2,5,6,7))) print_no_permission();

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF THIS PHP FILE AND TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS!
//You can easily make more forms by just copying this file, renaming it, and modifying the variable in
//this file. You can keep the same templates for different forms. For more customization, you can 
//use different templates, by renaming and modifying the templates.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of this file
$phpfilename "form.php";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//CHOOSE WHETHER YOU WANT FORM TO BE POSTED IN A NEW THREAD, NEW POLL, REPLY TO EXISITING THREAD, PMed OR EMAILED
///////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE POSTED - 1 = yes, 0 = no
$formforum "0";

//FORUM TO POST NEW THREAD IN
$formforumid "0";

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll "1";
$formoption1 "Yes";
$formoption2 "No";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO REPLY TO EXISTING THREAD
$formreply "0";

//EXISTING THREAD ID FOR FORM TO REPLY IN
$formreplythreadid "0";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE PMED - 1 = yes, 0 = no
$formpm "1";

//USERID TO PM TO
$formpmid "1";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE EMAILED - 1 = yes, 0 = no
$formemail "1";

//EMAIL ADDRESS TO EMAIL TO
$formemailaddress "virulent@verizon.net";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall "1";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formtitle "Moderator Application";

////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose "The purpose of this form is to allow everyone at craQ [dot] org to have an equal chance at becoming a moderator.";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion1 "Would you be able to contribute to a monthly donation for server expenses?";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion1 "Choose one of the following choices";

// The following choices must NOT have quotation marks
$radiochoice1a "yes";
$radiochoice1b "no";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion2 "How old are you? [Be honest]";

// The following choices must NOT have quotation marks
$radiochoice2a "13 or below";
$radiochoice2b "14 - 18";
$radiochoice2c "18+";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 3 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion3 "How often will you be on to moderate? [Be honest]";

// The following choices must NOT have quotation marks
$radiochoice3a "1 Hour/Less a day";
$radiochoice3b "2-4 Hours a day";
$radiochoice3c "4+ Hours a Day";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//QUESTION 1 (do not use quotation marks or you will get a parse error)
$question1 "What is your name?";
$explain1 "Please enter your real name here.";

//QUESTION 2 (do not use quotation marks or you will get a parse error)
$question2 "What is your email?";
$explain2 "Please enter your real email here.";

//QUESTION 3 (do not use quotation marks or you will get a parse error)
$question3 "What is your website?";
$explain3 "Please enter your URL here.";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//LONG TEXT AREA INPUT: QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$longquestion1 "Please write down a paragraph about yourself.";
$longexplain1 "For example, a bit about your experience in this area.";

////////////////////////////////////////////////////////////////////////////////////////////////
////// END OF CUSTOMIZATION ////////////////////////////////////////////////////////////////////
/////  DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING!!! ////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

// start navbar
$navbits = array(
    
"$phpfilename?$session[sessionurl]=> $formtitle
);

$navbits construct_navbits($navbits);
eval(
'$navbar = "' fetch_template('navbar') . '";');

if (
$action=="submit") {

if (
$answerall == "1") {
    if (
$normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == '' OR $radioanswer3 == '' OR $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $longanswer1 == '')
    {
    
$errormessage "$bbuserinfo[username], you need to answer every question!";
    eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");');
    exit();
    }
}

    eval(
'$formsend = "' fetch_template('formanswers') . '";');

    if (
$formforum == "1") {

                    
$DB_site->query("
                                INSERT INTO " 
TABLE_PREFIX "thread(title, lastpost, forumid, open, replycount,
                                postusername, postuserid, lastposter, dateline, iconid, visible, attach)
                                VALUES
                                        ('"
.addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle', " TIMENOW ", $formforumid,
                                         1, 0, '" 
addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
                                         '" 
addslashes($bbuserinfo['username']) . "', " TIMENOW ", 0, 1,
                                         0)
                        "
);
                
$thread['threadid'] = $DB_site->insert_id();
                
$DB_site->query("
                        INSERT INTO " 
TABLE_PREFIX "post
                                (threadid, title, username, userid, dateline, pagetext, allowsmilie,
                                 showsignature, iconid, visible)
                        VALUES
                                (
$thread[threadid], '".addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle',
                                 '" 
addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " TIMENOW ",
                                 '" 
addslashes($formsend) . "', 1, 1,
                                 0, 1)
                "
);
                
$post['postid'] = $DB_site->insert_id();
                
$DB_site->query("
                                UPDATE " 
TABLE_PREFIX "thread
                                SET firstpostid = 
$post[postid]
                                WHERE threadid = 
$thread[threadid]
                        "
);
                
$DB_site->query("
                                UPDATE " 
TABLE_PREFIX "forum
                                SET replycount = replycount +  1,
                                " 
iif($type == 'thread''threadcount = threadcount + 1,') . "
                                lastpost = " 
TIMENOW ",
                                lastposter = '" 
addslashes($bbuserinfo['username']) . "',
                                lastthread = '"
.addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle',
                                lastthreadid = 
$thread[threadid]
                                WHERE forumid = 
$formforumid
                        "
);

    }

    if (
$formpoll == "1") {
              
$DB_site->query("INSERT INTO " TABLE_PREFIX "poll (question,dateline,options,votes,active,numberoptions,timeout,multiple,public) VALUES ('".addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle'," TIMENOW ",'$formoption1|||$formoption2','" addslashes("0|||0") . "',1,2,0,0,0)");
            
$pollid $DB_site->insert_id();
            
$DB_site->query("UPDATE " TABLE_PREFIX "thread SET pollid = '".$pollid."' WHERE threadid = '".$thread[threadid]."'");
}

    if (
$formreply == "1") {
      
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$formreplythreadid','".addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".time()."','" addslashes($formsend) . "','$allowsmilie','$signature','$ipaddress','$iconid','1')");
      
$DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " TIMENOW ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid"); 
    }

    if (
$formpm == "1") {
$DB_site->query("INSERT INTO " TABLE_PREFIX "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature)\nVALUES\n\t($bbuserinfo[userid], '" addslashes($bbuserinfo['username']) . "', '".addslashes(htmlspecialchars($formtitle))."', '".addslashes(htmlspecialchars($formsend))."', '" addslashes(serialize($tostring)) . "', 0, " TIMENOW ", 1)");
$pmtextid $DB_site->insert_id();
$DB_site->query("INSERT INTO " TABLE_PREFIX "pm (pmtextid, userid, messageread) VALUES ($pmtextid$formpmid, 0)");
$DB_site->shutdown_query("UPDATE " TABLE_PREFIX "user SET pmtotal=pmtotal+1, pmunread=pmunread+1 WHERE userid = $formpmid");
    }

    if (
$formemail == "1") {
    
vbmail($formemailaddress$formtitle$formsend);
    }

    
$errormessage "$bbuserinfo[username], thank you for submitting the $bbtitle $formtitle!";
    eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");');
   exit();
}

eval(
'print_output("' fetch_template('form') . '");');
?>



Here's the form.php file the way you want it...

Code:

<?php

/*======================================================================*\
|| #################################################################### ||
|| # FORM TO THREAD/ FORUM/ PM/ EMAIL - Totally CUSTOMIZABLE FORMS++++# ||
|| # Version 1.3 for vBulletin 3.x.x by Dr Erwin Loh++++++++++++++++++# ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000?2004 Dr Erwin Loh. All Rights Reserved.++++++++++# ||
|| # This file may not be redistributed in whole or significant part. # ||
|| #################################################################### ||
\*======================================================================*/

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

globalize($_POST, array(
'radioanswer1' => STR,
'radioanswer2' => STR,
'radioanswer3' => STR,
'answer1' => STR,
'answer2' => STR,
'answer3' => STR,
'longanswer1' => STR,
'action' => STR
));

// #######################################################################
// ######################## CUSTOMIZE VARIABLES ##########################
// #######################################################################

////////////////////////////////////////////////////////////////////////////////////////////////////
////// BEGIN CUSTOMIZATION BELOW////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array
////////////////////////////////////////////////////////////////////////////////////////////////////

if (!in_array($bbuserinfo['usergroupid'], array(2,5,6,7))) print_no_permission();

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF THIS PHP FILE AND TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS!
//You can easily make more forms by just copying this file, renaming it, and modifying the variable in
//this file. You can keep the same templates for different forms. For more customization, you can
//use different templates, by renaming and modifying the templates.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of this file
$phpfilename = "form.php";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//CHOOSE WHETHER YOU WANT FORM TO BE POSTED IN A NEW THREAD, NEW POLL, REPLY TO EXISITING THREAD, PMed OR EMAILED
///////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE POSTED - 1 = yes, 0 = no
$formforum = "0";

//FORUM TO POST NEW THREAD IN
$formforumid = "0";

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll = "1";
$formoption1 = "Yes";
$formoption2 = "No";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO REPLY TO EXISTING THREAD
$formreply = "0";

//EXISTING THREAD ID FOR FORM TO REPLY IN
$formreplythreadid = "0";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE PMED - 1 = yes, 0 = no
$formpm = "1";

//USERID TO PM TO
$formpmid = "1";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE EMAILED - 1 = yes, 0 = no
$formemail = "1";

//EMAIL ADDRESS TO EMAIL TO
$formemailaddress = "virulent@verizon.net";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall = "1";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formtitle = "Moderator Application";

////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose = "The purpose of this form is to allow everyone at craQ [dot] org to have an equal chance at becoming a moderator.";


////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion1 = "Would you be able to contribute to a monthly donation for server expenses?";

// The following choices must NOT have quotation marks
$radiochoice1a = "yes";
$radiochoice1b = "no";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion2 = "How old are you? [Be honest]";

// The following choices must NOT have quotation marks
$radiochoice2a = "13 or below";
$radiochoice2b = "14 - 18";
$radiochoice2c = "18+";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 3 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion3 = "How often will you be on to moderate? [Be honest]";

// The following choices must NOT have quotation marks
$radiochoice3a = "1 Hour/Less a day";
$radiochoice3b = "2-4 Hours a day";
$radiochoice3c = "4+ Hours a Day";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//QUESTION 1 (do not use quotation marks or you will get a parse error)
$question1 = "What is your name?";
$explain1 = "Please enter your real name here.";

//QUESTION 2 (do not use quotation marks or you will get a parse error)
$question2 = "What is your email?";
$explain2 = "Please enter your real email here.";

//QUESTION 3 (do not use quotation marks or you will get a parse error)
$question3 = "What is your website?";
$explain3 = "Please enter your URL here.";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//LONG TEXT AREA INPUT: QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$longquestion1 = "Please write down a paragraph about yourself.";
$longexplain1 = "For example, a bit about your experience in this area.";

////////////////////////////////////////////////////////////////////////////////////////////////
////// END OF CUSTOMIZATION ////////////////////////////////////////////////////////////////////
/////++DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING!!! ////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

// start navbar
$navbits = array(
++++"$phpfilename?$session[sessionurl]" => $formtitle
);

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

if ($action=="submit") {

if ($answerall == "1") {
++++if ($normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == '' OR $radioanswer3 == '' OR $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $longanswer1 == '')
++++{
++++$errormessage = "$bbuserinfo[username], you need to answer every question!";
++++eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
++++exit();
++++}
}

++++eval('$formsend = "' . fetch_template('formanswers') . '";');

++++if ($formforum == "1") {

++++++++++++++++++++$DB_site->query("
++++++++++++++++++++++++++++++++INSERT INTO " . TABLE_PREFIX . "thread(title, lastpost, forumid, open, replycount,
++++++++++++++++++++++++++++++++postusername, postuserid, lastposter, dateline, iconid, visible, attach)
++++++++++++++++++++++++++++++++VALUES
++++++++++++++++++++++++++++++++++++++++('".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle', " . TIMENOW . ", $formforumid,
+++++++++++++++++++++++++++++++++++++++++1, 0, '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
+++++++++++++++++++++++++++++++++++++++++'" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", 0, 1,
+++++++++++++++++++++++++++++++++++++++++0)
++++++++++++++++++++++++");
++++++++++++++++$thread['threadid'] = $DB_site->insert_id();
++++++++++++++++$DB_site->query("
++++++++++++++++++++++++INSERT INTO " . TABLE_PREFIX . "post
++++++++++++++++++++++++++++++++(threadid, title, username, userid, dateline, pagetext, allowsmilie,
+++++++++++++++++++++++++++++++++showsignature, iconid, visible)
++++++++++++++++++++++++VALUES
++++++++++++++++++++++++++++++++($thread[threadid], '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
+++++++++++++++++++++++++++++++++'" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " . TIMENOW . ",
+++++++++++++++++++++++++++++++++'" . addslashes($formsend) . "', 1, 1,
+++++++++++++++++++++++++++++++++0, 1)
++++++++++++++++");
++++++++++++++++$post['postid'] = $DB_site->insert_id();
++++++++++++++++$DB_site->query("
++++++++++++++++++++++++++++++++UPDATE " . TABLE_PREFIX . "thread
++++++++++++++++++++++++++++++++SET firstpostid = $post[postid]
++++++++++++++++++++++++++++++++WHERE threadid = $thread[threadid]
++++++++++++++++++++++++");
++++++++++++++++$DB_site->query("
++++++++++++++++++++++++++++++++UPDATE " . TABLE_PREFIX . "forum
++++++++++++++++++++++++++++++++SET replycount = replycount +++1,
++++++++++++++++++++++++++++++++" . iif($type == 'thread', 'threadcount = threadcount + 1,') . "
++++++++++++++++++++++++++++++++lastpost = " . TIMENOW . ",
++++++++++++++++++++++++++++++++lastposter = '" . addslashes($bbuserinfo['username']) . "',
++++++++++++++++++++++++++++++++lastthread = '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
++++++++++++++++++++++++++++++++lastthreadid = $thread[threadid]
++++++++++++++++++++++++++++++++WHERE forumid = $formforumid
++++++++++++++++++++++++");

++++}

++++if ($formpoll == "1") {
++++++++++++++$DB_site->query("INSERT INTO " . TABLE_PREFIX . "poll (question,dateline,options,votes,active,numberoptions,timeout,multiple,public) VALUES ('".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle'," . TIMENOW . ",'$formoption1|||$formoption2','" . addslashes("0|||0") . "',1,2,0,0,0)");
++++++++++++$pollid = $DB_site->insert_id();
++++++++++++$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET pollid = '".$pollid."' WHERE threadid = '".$thread[threadid]."'");
}

++++if ($formreply == "1") {
++++++$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pagetext,allowsmilie,showsignatu++re,ipaddress,iconid,visible) VALUES (NULL,'$formreplythreadid','".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".time()."','" . addslashes($formsend) . "','$allowsmilie','$signature','$ipaddress','$iconid','1')");
++++++$DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " . TIMENOW . ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid");
++++}

++++if ($formpm == "1") {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature)\nVALUES\n\t($bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', '".addslashes(htmlspecialchars($formtitle))."', '".addslashes(htmlspecialchars($formsend))."', '" . addslashes(serialize($tostring)) . "', 0, " . TIMENOW . ", 1)");
$pmtextid = $DB_site->insert_id();
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid, messageread) VALUES ($pmtextid, $formpmid, 0)");
$DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1 WHERE userid = $formpmid");
++++}

++++if ($formemail == "1") {
++++vbmail($formemailaddress, $formtitle, $formsend);
++++}

++++$errormessage = "$bbuserinfo[username], thank you for submitting the $bbtitle $formtitle!";
++++eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
+++exit();
}

eval('print_output("' . fetch_template('form') . '");');
?>


And change your formanswer template as follows...

Code:

$formtitle
$bbuserinfo[username]

$radioquestion1
$radioanswer1

$radioquestion2
$radioanswer2

$radioquestion3
$radioanswer3

$question1
$answer1

$question2
$answer2

$question3
$answer3

-----------------------------------------------------
$longquestion1

$longanswer1

------------------------------------------------------


mOdEtWo 08-24-2004 02:52 PM

Quote:

Originally Posted by Erwin
The code can't find your post table for whatever reason. Is your database prefix forums?

Nope, prefix is "vb3". Name is "forum".

Strange thing, "post a new thread" works, but not "reply to a thread". My post table is there, hehe. ;)

Virulent1 08-24-2004 04:58 PM

hey PKRWUD, thanks alot.. i did what you said but im having a bit of trouble :[ .. i get this error:
Code:

Parse error: parse error, unexpected T_INC, expecting T_VARIABLE or '$' in /home/*****/public_html/vb/form.php on line 193
then if i delete those + signs in front of line 193 i get the same error except on another line with the + signs? any ideas? i dont want to go delete them all if i dont know what im doing.

Virulent1 08-24-2004 10:56 PM

nvm all set

Erwin 08-25-2004 03:46 AM

Quote:

Originally Posted by mOdEtWo
Nope, prefix is "vb3". Name is "forum".

Strange thing, "post a new thread" works, but not "reply to a thread". My post table is there, hehe. ;)

Although your prefix is 'vb3' for some reason the code is looking for the post table with the prefix 'forums' - look at your error message:

Quote:

mysql error: Table 'forums.post' doesn't exist
It should say 'vb3.post' not 'forums.post' shouldn't it?

Isaiah33 08-25-2004 04:01 AM

Erwin.... I want to know if you can a part where guest can apply to get into the board. And with the poll option we select yes they shall get a email that says they got accept and gives a random password or a password they selcted. And if the voters say no they get a email that he got decilned. but it doesnt send email untill the poll gets enough votes or admin auto matic selects a button that accepts with out reaching the # of required yes.

mfowler70 08-25-2004 01:04 PM

Works great!

Erwin 08-26-2004 12:25 AM

Quote:

Originally Posted by Isaiah33
Erwin.... I want to know if you can a part where guest can apply to get into the board. And with the poll option we select yes they shall get a email that says they got accept and gives a random password or a password they selcted. And if the voters say no they get a email that he got decilned. but it doesnt send email untill the poll gets enough votes or admin auto matic selects a button that accepts with out reaching the # of required yes.

Anything is possible with coding. :) But that's a totally different and very customized feature you're asking for - not hard to do, but I won't be doing it.

Isaiah33 08-26-2004 08:02 AM

theres no way you can do becuase i suck being a coder and i know i wouldn't be able to.

oldford 08-27-2004 02:08 AM

Quote:

Originally Posted by oldford
I thought that was to insert one form result into two different forums at the same time? Maybe I'm wrong?

All I'm talking about is the redirect code when you click on "New Thread". I have different form.php files for each forum. I just need the redirect to understand that if it's forumid 123 then clicking on "New Thread" should redirect to form123.php. And if it's forumid 456 it should go to form456.php

Does anyone else have any thoughts on this code? PKRWUD seemed pretty close, but I still got errors. Thanks!

PKRWUD 08-27-2004 03:54 AM

Quote:

Originally Posted by Virulent1
nvm all set

I'm sorry, I've been away from my Mac for a few days. I just looked at the code I posted for you, and for the first time saw all those "+" signs. That's what I get for re-writing it for you in a text app instead of BBEdit! My bad. I'm glad you got it figured out!

:)

alqadir 08-27-2004 09:57 PM

Quote:

Originally Posted by PKRWUD
This is how I did it...

In Forumdisplay template, find:
Code:

<a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]">
And replace it with:
Code:

<a href="<if condition="$foruminfo['forumid'] == xx">form.php<else />newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]</if>">
Except you would sustitute your forum ID where it says xx. Works excellent.

can i send variables in the form.php. ie. if i made a link that said
<a href="form.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]">

Can I access the forumid variable inside the form.php?
Will the form.php call work?

I am essentially trying to override the newthread.php.

Thanks for all your help so far.

SnowBot 08-28-2004 03:01 AM

If i choose this option in the form.php file

Quote:

//REDIRECT OPTIONS:
// 0 - thank you message
How can i add the navbar and a link back to the forum? Like a " Click Here to return to the forum"

Thanks

Snowy

PKRWUD 08-28-2004 03:16 AM

Quote:

Originally Posted by SnowBot
If i choose this option in the form.php file



How can i add the navbar and a link back to the forum? Like a " Click Here to return to the forum"

Thanks

Snowy


Add $navbar directly underneath $header in the Form template.


All times are GMT. The time now is 09:13 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.02504 seconds
  • Memory Usage 2,252KB
  • 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
  • (11)bbcode_code_printable
  • (4)bbcode_php_printable
  • (25)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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