Thread: Forms Hack
View Single Post
  #817  
Old 04-23-2006, 01:17 AM
Abe1's Avatar
Abe1 Abe1 is offline
 
Join Date: Feb 2004
Location: I LOVE New York!
Posts: 2,886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jodycwilliams
Ok, I modified Form Hack a ton to fit exactly what we need in Everquest 2 guilds for recruiting.

Unfortunately, whenever it posts to the forum, it puts it in my signature.

Here is the Hook

PHP Code:
// To add more then one form, copy this whole text, and creat a new plug-in with the hook location 'newthread_start'.
// After, change the form name. You can't have 2 forms with the same name.

// Name of this form
$formname "Recruit";

if (
$_REQUEST['do'] == $formname)
{

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//VARIABLES
//Study how variables are add here to add or remove any. If you add a variable to your form, you must add it to part one and part two.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Part 1
$vbulletin->input->clean_array_gpc('p', array(
'normalanswer1' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'normalanswer2' => TYPE_STR,
'answer2a' => TYPE_STR,
'dropdownanswer2' => TYPE_STR,
'normalanswer3' => TYPE_STR,
'normalanswer4' => TYPE_STR,
'normalanswer5' => TYPE_STR,
'longanswer1' => TYPE_STR,
'normalanswer6' => TYPE_STR,
'dropdownanswer3' => TYPE_STR,
'longanswer2' => TYPE_STR,
'longanswer3' => TYPE_STR,
'longanswer4' => TYPE_STR,
));

// Part 2
$normalanswer1 $vbulletin->GPC['normalanswer1'];
$dropdownanswer1 $vbulletin->GPC['dropdownanswer1'];
$normalanswer2 $vbulletin->GPC['normalanswer2'];
$dropdownanswer2 $vbulletin->GPC['dropdownanswer2'];
$normalanswer3 $vbulletin->GPC['normalanswer3'];
$normalanswer4 $vbulletin->GPC['normalanswer4'];
$normalanswer5 $vbulletin->GPC['normalanswer5'];
$longanswer1 $vbulletin->GPC['longanswer1'];
$normalanswer6 $vbulletin->GPC['normalanswer6'];
$dropdownanswer3 $vbulletin->GPC['dropdownanswer3'];
$longanswer2 $vbulletin->GPC['longanswer2'];
$longanswer3 $vbulletin->GPC['longanswer3'];
$longanswer4 $vbulletin->GPC['longanswer4'];


////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array.
//To enable this feature, remove the '//' before the 'if'.
////////////////////////////////////////////////////////////////////////////////////////////////////

// if (!in_array($vbulletin->userinfo['usergroupid'], array(2,5,6,7))) print_no_permission();

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS AND WANT TO USE A DIFFERENT LOOKING TEMPLATE
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of the main template
$maintemplate "form";
// Name of the answer template
$answertemplate "formanswers";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 "1";

//FORUM TO POST NEW THREAD IN
//You CAN make this number a variable. You can have a drop down menu or in the link like do=form&f=1. Make sure you add it the variables list.

$formforumid "15";

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll "0";
$polloption[1] = "Yes";
$polloption[2] = "No";
$polloption[3] = "Maybe";

//Make poll public - 1 = yes, 0 = no
$pollpublic "0";

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

//ENABLE FORM TO REPLY TO EXISTING THREAD - 1 = yes, 0 = no
$formreply "0";

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

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

//ENABLE FORM TO BE PMED (guests CANNOT use this option) - 1 = yes, 0 = no
$formpm "0";

//USERNAME TO PM TO
$formpmname "Abe";

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

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

//EMAIL ADDRESS TO EMAIL TO
$formemailaddress "jodycwilliams@hotmail.com";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//REDIRECT OPTIONS:
// 0 - thank you message (thread, reply, pm, or email)
// 1 - redirect to post (thread or reply)
// 2 - redirect to thread (thread only)
// 3 - redirect to forum (thread only)
// 4 - redirect to editpost to upload attachments (thread or reply)
//
// Feel free to change the thank you message if you choose option 0
////////////////////////////////////////////////////////////////////////////////////////////////////

$redirectoption "1";

$errormessage "Thank you for submitting this form!"//This is the thank you message

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
//If you added or deleted variables, you must edit what it checked for. Search for "$answerall ==" and edit 2 lines under it.
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall "0";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error, besides the quotes around the whole title)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formtitle "Recruit Application";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF THREAD/POST/PM/EMAIL (do not use quotation marks in the title or you will get a parse error)
//You may use variables from the form for this.
////////////////////////////////////////////////////////////////////////////////////////////////////

$posttitle "APPLICATION - $normalanswer1 $normalanswer2 $dropdownanswer1 from $dropdownanswer2";

////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose "The purpose of this form is to submit an application for recruitment to Amend.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//Begin Questions
////////////////////////////////////////////////////////////////////////////////////////////////////

//Character Name

$normalquestion1 "What is your character name?";

//Class Question

$dropdownquestion1 "What is your class?";

// The following choices must NOT have quotation marks
$dropdownchoice1a "Guardian";
$dropdownchoice1b "Berserker";
$dropdownchoice1c "Bruiser";
$dropdownchoice1d "Monk";
$dropdownchoice1e "Shadow Knight";
$dropdownchoice1f "Paladin";
$dropdownchoice1g "Inquisitor";
$dropdownchoice1h "Templar";
$dropdownchoice1i "Fury";
$dropdownchoice1j "Warden";
$dropdownchoice1k "Defiler";
$dropdownchoice1l "Mystic";
$dropdownchoice1m "Warlock";
$dropdownchoice1n "Wizard";
$dropdownchoice1o "Coercer";
$dropdownchoice1p "Illusionist";
$dropdownchoice1q "Necromancer";
$dropdownchoice1r "Conjuror";
$dropdownchoice1s "Assassin";
$dropdownchoice1t "Ranger";
$dropdownchoice1u "Brigand";
$dropdownchoice1v "Swashbuckler";
$dropdownchoice1w "Dirge";
$dropdownchoice1x "Troubador";

//Level Question

$normalquestion2 "What is your level?";

//AA Question

$normalquestion3 "How many AA do you currently have?";

//Server Question - No PVP or SE Servers are Listed

$dropdownquestion2 "What server does your character currently reside on?";

// The following choices must NOT have quotation marks
$dropdownchoice2a "Antonia Bayle";
$dropdownchoice2b "Befallen";
$dropdownchoice2c "Blackburrow";
$dropdownchoice2d "Butcherblock";
$dropdownchoice2e "Crushbone";
$dropdownchoice2f "Everfrost";
$dropdownchoice2g "Guk";
$dropdownchoice2h "Innovation";
$dropdownchoice2i "Kithicor";
$dropdownchoice2j "Lucan D'Lere";
$dropdownchoice2k "Mistmoore";
$dropdownchoice2l "Najena";
$dropdownchoice2m "Nektulos";
$dropdownchoice2n "Oasis";
$dropdownchoice2o "Permafrost";
$dropdownchoice2p "Runnyeye";
$dropdownchoice2q "Splitpaw";
$dropdownchoice2r "Storms";
$dropdownchoice2s "Unrest";
$dropdownchoice2t "Valor";
$dropdownchoice2u "Veksar";

//Creation Date Quesiton

$normalquestion4 "What is your character's Creation Date?";

//Playtime Question

$normalquestion5 "What is your character's total /play time?";

//Previous MMO Experience Question

$longquestion1 "Please describe any prior MMO experience.";

//Computer Question

$longquestion2 "Describe your computer's configuration.";

//Internet Connection Question

$dropdownquestion3 "What type of Internet Connection do you have?";

// The following choices must NOT have quotation marks
$dropdownchoice3a "Dial Up";
$dropdownchoice3b "Satellite";
$dropdownchoice3c "Cable/DSL";
$dropdownchoice3d "T1+";

//Teamspeak Prepared Question

$normalquestion6 "Do you have Teamspeak installed and own a Mic and Speakers/Headset?";

//Previous 3 Guilds Question

$longquestion3 "List your previous guilds (3 max).";

//Brief Bio

$longquestion4 "Please type in a brief bio.";


////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 3 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////
//
//$radioquestion3 = "Is it yes or no? If yes, please elaborate";
//
// The following choices must NOT have quotation marks
//$radiochoice3a = "yes";
//$radiochoice3b = "no";
//
////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////
//QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
//$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, besides the quotes around the whole text)
//$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, besides the quotes around the whole text)
//$question3 = "What is your website?";
//$explain3 = "Please enter your URL here.";
//
////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////
//DROP DOWN CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////
//
//
////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////
//LONG TEXT AREA INPUT: QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////
//
//$longquestion1 = "Please write down a paragraph about yourself.";
//$longexplain1 = "For example, a bit about your experience in this area.";
//
////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//VB TEXT AREA INPUT: You can only have ONE vb text question. (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

//$vbtextquestion = "Please write down a paragraph about how you like this forum.";
//$vbtextexplain = "For example, what makes this forum different from all other forums?";

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

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
if ($_REQUEST['action'] == '')
{
  
$_REQUEST['action'] = "form";
}


$bbuserinfo $vbulletin->userinfo;

// start navbar
$navbits = array();
$navbits['newthread.php?' $vbulletin->session->vars['sessionurl'] . "do=$formname"] = $formtitle;

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

if (
$_REQUEST['action'] == "submit")
{

    if (
$answerall == "1")
    {
        if (
$normalanswer1 == '' OR $normalanswer2 == '' OR $normalanswer3 == '' OR $normalanswer4 == '' OR $normalanswer5 == '' OR $normalanswer6 == '' OR $dropdownanswer1 == '' OR $dropdownanswer2 == '' OR $dropdownanswer3 == '' OR $longanswer1 == '' OR $longanswer2 == '' OR $longanswer3 == '' OR $longanswer4 == '')
        {
            
$errormessage "$bbuserinfo[username], you need to answer every question!";
            eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");');
            exit();
        }
    }

    
$vbulletin->input->clean_array_gpc('p', array(
        
'wysiwyg'            => TYPE_BOOL,
        
'message'            => TYPE_STR
        
));

    if (
$vbulletin->GPC['wysiwyg'])
    {
        require_once(
DIR '/includes/functions_wysiwyg.php');
        
$vbtextanswer convert_wysiwyg_html_to_bbcode($vbulletin->GPC['message'], $foruminfo['allowhtml']);
    }
    else
    {
        
$vbtextanswer =& $vbulletin->GPC['message'];
    }

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

    if (
$_POST['submit'] == 'Submit')
    {
        if (
$formforum == "1")
        {
            
$foruminfo verify_id('forum'$formforumid01);
            
$forumperms fetch_permissions($foruminfo[forumid]);
            
$newpost['username'] =& $vbulletin->userinfo['username'];
            
$newpost['message'] =& $formsend;
            
$newpost['title'] =& $posttitle;
            
$newpost['parseurl'] = '1';

            if (
$vbulletin->userinfo['autosubscribe'] != -1)
            {
                
$newpost['emailupdate'] = $vbulletin->userinfo['autosubscribe'];
            }
            else
            {
                
$newpost['emailupdate'] = 9999;
            }

            if (
$vbulletin->userinfo['signature'] != '')
            {
                
$newpost['signature'] = '1';
            }
            else
            {
                
$newpost['signature'] = '0';
            }

            
build_new_post('thread'$foruminfo, array(), array(), $newpost$errors);

            if (
$formpoll == "1")
            {
                
$threadinfo verify_id('thread'$newpost[threadid], 01);
                
$polloptions count($polloption);
                
$question $posttitle;
                
$vbulletin->GPC['options'] = $polloption;

                
$counter 0;
                
$optioncount 0;
                
$badoption '';
                while (
$counter++ < $polloptions)
                { 
// 0..Pollnum-1 we want, as arrays start with 0
                    
if ($vbulletin->options['maxpolllength'] AND vbstrlen($vbulletin->GPC['options']["$counter"]) > $vbulletin->options['maxpolllength'])
                    {
                        
$badoption .= iif($badoption', ') . $counter;
                    }
                    if (!empty(
$vbulletin->GPC['options']["$counter"]))
                    {
                        
$optioncount++;
                    }
                }

                
// Add the poll
                
$poll =& datamanager_init('Poll'$vbulletinERRTYPE_STANDARD);

                
$counter 0;
                while (
$counter++ < $polloptions)
                {
                    if (
$vbulletin->GPC['options']["$counter"] != '')
                    {
                        
$poll->set_option($vbulletin->GPC['options']["$counter"]);
                    }
                }

                
$poll->set('question',    $question);
                
$poll->set('dateline',    TIMENOW);
                
$poll->set('active',    '1');
                
$poll->set('public',    $pollpublic);

                
$pollid $poll->save();
                
//end create new poll

                // update thread
                
$threadman =& datamanager_init('Thread'$vbulletinERRTYPE_STANDARD'threadpost');
                
$threadman->set_existing($threadinfo);
                
$threadman->set('pollid'$pollid);
                
$threadman->save();
            }
        }

        if (
$formreply == "1")
        {
            
$threadinfo verify_id('thread'$formreplythreadid01);
            
$forumperms fetch_permissions($threadinfo[forumid]);
            
$newpost['username'] =& $vbulletin->userinfo['username'];
            
$newpost['message'] =& $formsend;
            
$newpost['title'] =& $posttitle;
            
$newpost['parseurl'] = "1";
        
            if (
$vbulletin->userinfo['autosubscribe'] != -1)
            {
                
$newpost['emailupdate'] = $vbulletin->userinfo['autosubscribe'];
            }
            else
            {
                
$newpost['emailupdate'] = 9999;
            }

            if (
$vbulletin->userinfo['signature'] != '')
            {
                
$newpost['signature'] = '1';
            }
            else
            {
                
$newpost['signature'] = '0';
            }

            
build_new_post('reply'$foruminfo$threadinfo$postinfo$newpost$errors);
        }

        if (
$formpm == "1")
        {
            
$vbulletin->GPC['message'] =& $formsend;
            
$vbulletin->GPC['title'] =& $posttitle;
            
$vbulletin->GPC['recipients'] =& $formpmname;

            
$pm['message'] =& $vbulletin->GPC['message'];
            
$pm['title'] =& $vbulletin->GPC['title'];
            
$pm['recipients'] =& $vbulletin->GPC['recipients'];

            
// create the DM to do error checking and insert the new PM
            
$pmdm =& datamanager_init('PM'$vbulletinERRTYPE_ARRAY);

            
$pmdm->set('fromuserid'$vbulletin->userinfo['userid']);
            
$pmdm->set('fromusername'$vbulletin->userinfo['username']);
            
$pmdm->setr('title'$pm['title']);
            
$pmdm->setr('message'$pm['message']);
            
$pmdm->set_recipients($pm['recipients'], $permissions);
            
$pmdm->set('dateline'TIMENOW);

            
// everything's good!
            
$pmdm->save();
        }

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

        if (
$redirectoption == "1")
        {
            
$vbulletin->url 'showthread.php?' $vbulletin->session->vars['sessionurl'] . "p=$newpost[postid]";
            eval(
print_standard_redirect('redirect_postthanks'));
            exit();
        }
        if (
$redirectoption == "2")
        {
            
$vbulletin->url 'showthread.php?' $vbulletin->session->vars['sessionurl'] . "t=$newpost[threadid]";
            eval(
print_standard_redirect('redirect_postthanks'));
            exit();
        }
        if (
$redirectoption == "3")
        {
            
$vbulletin->url 'forumdisplay.php?' $vbulletin->session->vars['sessionurl'] . "f=$foruminfo[forumid]";
            eval(
print_standard_redirect('redirect_postthanks'));
            exit();
        }
        if (
$redirectoption == "4")
        {
            
$vbulletin->url 'editpost.php?do=editpost&' $vbulletin->session->vars['sessionurl'] . "p=$newpost[postid]";
            eval(
print_standard_redirect('redirect_postthanks'));
            exit();
        }
        eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");');
        exit();
    }
    else
    {
          require_once(
'./includes/class_bbcode.php');
        
$parser =& new vB_BbCodeParser($vbulletinfetch_tag_list());
        
$preview $parser->do_parse($formsend);

        
$_REQUEST['action'] = 'form';
    }
}

if (
$_REQUEST['action'] == 'form')
{
    
// set message box width to usercp size
    
$stylevar['messagewidth'] = $stylevar['messagewidth_usercp'];
    
$editorid construct_edit_toolbar($vbtextanswer);

    eval(
'print_output("' fetch_template("$maintemplate") . '");');
}

Here is the submission template

HTML Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle] - $formtitle</title>
</head>
<body>
$header
$navbar

<!-- main -->
<if condition="$preview">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
	<td class="tcat">
		Preview
	</td>
</tr>
<tr>
	<td class="alt1">
$preview
</td>
</tr>
</table>
</if>

<br />
<form name="vbform" action="newthread.php" method="post"<if condition="!is_browser('webtv')"> onsubmit="return vB_Editor['$editorid'].prepare_submit(0, $vboptions[postminchars])"</if>>
<input type="hidden" value="$formname" name="do" />
<input type="hidden" value="submit" name="action" />

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
	<td class="tcat" colspan="3">
		$vboptions[bbtitle] - $formtitle
	</td>
</tr>
<tr>
	<td class="panelsurround" align="center" colspan="3">

	<table class="panel" cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
	<tr>
		<td align="$stylevar[left]">
			<fieldset class="fieldset" style="margin:0px">
				<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
				<tr>
					<td>
						$formpurpose

					</td>
				</tr>
		</table>
	</fieldset>
</td>
</tr>
</table>
</td>
</tr>
<tr>
	<td class="alt1" colspan="3">
				<b>$normalquestion1</b>
		</td>
	</tr>
<tr>
<td class="alt2" colspan="3">
<input type="text" size="30" value="$normalanswer1" name="normalanswer1" />
</td>
</tr>
<tr>
<td class="alt1" colspan="2">
<b>$dropdownquestion1</b>:
</td>
<td class="alt1" colspan="2">
<select name="dropdownanswer1">
<option value="$dropdownchoice1a" <if condition="$dropdownchoice1a == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1a</option>
<option value="$dropdownchoice1b" <if condition="$dropdownchoice1b == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1b</option>
<option value="$dropdownchoice1c" <if condition="$dropdownchoice1c == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1c</option>
<option value="$dropdownchoice1d" <if condition="$dropdownchoice1d == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1d</option>
<option value="$dropdownchoice1e" <if condition="$dropdownchoice1e == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1e</option>
<option value="$dropdownchoice1f" <if condition="$dropdownchoice1f == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1f</option>
<option value="$dropdownchoice1g" <if condition="$dropdownchoice1g == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1g</option>
<option value="$dropdownchoice1h" <if condition="$dropdownchoice1h == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1h</option>
<option value="$dropdownchoice1i" <if condition="$dropdownchoice1i == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1i</option>
<option value="$dropdownchoice1j" <if condition="$dropdownchoice1j == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1j</option>
<option value="$dropdownchoice1k" <if condition="$dropdownchoice1k == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1k</option>
<option value="$dropdownchoice1l" <if condition="$dropdownchoice1l == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1l</option>
<option value="$dropdownchoice1m" <if condition="$dropdownchoice1m == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1m</option>
<option value="$dropdownchoice1n" <if condition="$dropdownchoice1n == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1n</option>
<option value="$dropdownchoice1o" <if condition="$dropdownchoice1o == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1o</option>
<option value="$dropdownchoice1p" <if condition="$dropdownchoice1p == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1p</option>
<option value="$dropdownchoice1q" <if condition="$dropdownchoice1q == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1q</option>
<option value="$dropdownchoice1r" <if condition="$dropdownchoice1r == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1r</option>
<option value="$dropdownchoice1s" <if condition="$dropdownchoice1s == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1s</option>
<option value="$dropdownchoice1t" <if condition="$dropdownchoice1t == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1t</option>
<option value="$dropdownchoice1u" <if condition="$dropdownchoice1u == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1u</option>
<option value="$dropdownchoice1v" <if condition="$dropdownchoice1v == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1v</option>
<option value="$dropdownchoice1w" <if condition="$dropdownchoice1w == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1w</option>
<option value="$dropdownchoice1x" <if condition="$dropdownchoice1x == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1x</option>
</select></td>
</tr>
<tr>
	<td class="alt1" colspan="2">
				<b>$normalquestion2</b>
		</td>
	<td class="alt1" colspan="2">
				<b>$normalquestion3</b>
	</td>	
	</tr>
<tr>
<td class="alt1" colspan="2">
<input type="text" size="30" value="$normalanswer2" name="normalanswer2" />
</td>
<td class="alt1" colspan="2">
<input type="text" size="30" value="$normalanswer3" name="normalanswer3" />
</td>
</tr>
<tr>
<td class="alt1" colspan="2">
<b>$dropdownquestion2</b>:
</td>
<td class="alt1" colspan="2">
<select name="dropdownanswer2">
<option value="$dropdownchoice2a" <if condition="$dropdownchoice2a == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2a</option>
<option value="$dropdownchoice2b" <if condition="$dropdownchoice2b == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2b</option>
<option value="$dropdownchoice2c" <if condition="$dropdownchoice2c == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2c</option>
<option value="$dropdownchoice2d" <if condition="$dropdownchoice2d == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2d</option>
<option value="$dropdownchoice2e" <if condition="$dropdownchoice2e == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2e</option>
<option value="$dropdownchoice2f" <if condition="$dropdownchoice2f == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2f</option>
<option value="$dropdownchoice2g" <if condition="$dropdownchoice2g == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2g</option>
<option value="$dropdownchoice2h" <if condition="$dropdownchoice2h == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2h</option>
<option value="$dropdownchoice2i" <if condition="$dropdownchoice2i == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2i</option>
<option value="$dropdownchoice2j" <if condition="$dropdownchoice2j == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2j</option>
<option value="$dropdownchoice2k" <if condition="$dropdownchoice2k == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2k</option>
<option value="$dropdownchoice2l" <if condition="$dropdownchoice2l == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2l</option>
<option value="$dropdownchoice2m" <if condition="$dropdownchoice2m == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2m</option>
<option value="$dropdownchoice2n" <if condition="$dropdownchoice2n == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2n</option>
<option value="$dropdownchoice2o" <if condition="$dropdownchoice2o == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2o</option>
<option value="$dropdownchoice2p" <if condition="$dropdownchoice2p == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2p</option>
<option value="$dropdownchoice2q" <if condition="$dropdownchoice2q == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2q</option>
<option value="$dropdownchoice2r" <if condition="$dropdownchoice2r == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2r</option>
<option value="$dropdownchoice2s" <if condition="$dropdownchoice2s == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2s</option>
<option value="$dropdownchoice2t" <if condition="$dropdownchoice2t == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2t</option>
<option value="$dropdownchoice2u" <if condition="$dropdownchoice2u == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2u</option>
</select></td>
</tr>
<tr>
	<td class="alt1" colspan="2">
				<b>$normalquestion4</b>
		</td>
	<td class="alt1" colspan="2">
				<b>$normalquestion5</b>
	</td>	
</tr>
<tr>
	<td class="alt1" colspan="2">
			<input type="text" size="30" value="$normalanswer4" name="normalanswer4" />
		</td>
	<td class="alt1" colspan="2">
			<input type="text" size="30" value="$normalanswer5" name="normalanswer5" />
		</td>
</tr>	
<tr>
	<td class="alt2" colspan="2">
		<b>$longquestion1</b><br />
		$longexplain1</td>
	<td class="alt2" colspan="2">
		<textarea rows="8" cols="50" name="longanswer1">$longanswer1</textarea>
	</td>
</tr>
<tr>
	<td class="alt2" colspan="2">
		<b>$longquestion2</b><br />
		$longexplain2</td>
	<td class="alt2" colspan="2">
		<textarea rows="8" cols="50" name="longanswer2">$longanswer2</textarea>
	</td>
</tr>
<tr>
	<td class="alt1" colspan="2">
		<b>$dropdownquestion3</b>:
	</td>
	<td class="alt1" colspan="3">
		<select name="dropdownanswer3">
		<option value="$dropdownchoice3a" <if condition="$dropdownchoice3a == $dropdownanswer3">selected="selected"</if>>$dropdownchoice3a</option>
		<option value="$dropdownchoice3b" <if condition="$dropdownchoice3b == $dropdownanswer3">selected="selected"</if>>$dropdownchoice3b</option>
		<option value="$dropdownchoice3c" <if condition="$dropdownchoice3c == $dropdownanswer3">selected="selected"</if>>$dropdownchoice3c</option>
		<option value="$dropdownchoice3d" <if condition="$dropdownchoice3d == $dropdownanswer3">selected="selected"</if>>$dropdownchoice3d</option>
	</select></td>
</tr>
<tr>
	<td class="alt1" colspan="2">
			<b>$normalquestion6</b>
		</td>
	<td class="alt1" colspan="2">
			<b>$longquestion3</b>
		</td>
</tr>
<tr>
	<td class="alt1" colspan="2">
			<input type="text" size="30" value="$normalanswer6" name="normalanswer6" />
			</td>
	<td class="alt2" colspan="2">
			<textarea rows="3" cols="50" name="longanswer3">$longanswer3</textarea>
		</td>
</tr>
<tr>
	<td class="alt1" colspan="2">
			<b>$longquestion4</b>
		</td>
	<td class="alt2" colspan="2">
			<textarea rows="5" cols="50" name="longanswer4">$longanswer4</textarea>
		</td>
</tr>
<tr>
<td valign="top" colspan="3">
<p align="center">
<input type="submit" value="Submit" name="submit" style="font-family: Verdana; font-size: 10pt" class="button" />
<input type="submit" value="Preview" name="submit" style="font-family: Verdana; font-size: 10pt" class="button" />
<input type="reset" value="Reset" name="reset" style="font-family: Verdana; font-size: 10pt" class="button" />
</p></td></tr>
</table>

</form>

$footer
</body>
</html>
And here is the answer template I made

HTML Code:
<table>
<tr>
	<td class="alt1" colspan="3">
				<b>$normalquestion1</b>
		</td>
	</tr>
<tr>
<td class="alt2" colspan="3">
$normalanswer1
</td>
</tr>
<tr>
<td class="alt1" colspan="2">
<b>$dropdownquestion1</b>:
</td>
<td class="alt1" colspan="2">
$dropdownanswer1
</td>
</tr>
<tr>
	<td class="alt1" colspan="2">
				<b>$normalquestion2</b>
		</td>
	<td class="alt1" colspan="2">
				<b>$normalquestion3</b>
	</td>	
	</tr>
<tr>
<td class="alt1" colspan="2">
$normalanswer2
</td>
<td class="alt1" colspan="2">
$normalanswer3
</td>
</tr>
<tr>
<td class="alt1" colspan="2">
<b>$dropdownquestion2</b>:
</td>
<td class="alt1" colspan="2">
$dropdownanswer2
</td>
</tr>
<tr>
	<td class="alt1" colspan="2">
		<b>$normalquestion4</b>
		</td>
	<td class="alt1" colspan="2">
		<b>$normalquestion5</b>
	</td>	
</tr>
<tr>
	<td class="alt1" colspan="2">
	        $normalanswer4
		</td>
	<td class="alt1" colspan="2">
		$normalanswer5
		</td>
</tr>	
<tr>
	<td class="alt2" colspan="2">
		<b>$longquestion1</b><br />
		$longexplain1</td>
	<td class="alt2" colspan="2">
		$longanswer1
	</td>
</tr>
<tr>
	<td class="alt2" colspan="2">
		<b>$longquestion2</b><br />
		$longexplain2</td>
	<td class="alt2" colspan="2">
                $longanswer2
	</td>
</tr>
<tr>
	<td class="alt1" colspan="2">
		<b>$dropdownquestion3</b>:
	</td>
	<td class="alt1" colspan="3">
		$dropdownanswer3
</td>
</tr>
<tr>
	<td class="alt1" colspan="2">
		<b>$normalquestion6</b>
	</td>
	<td class="alt1" colspan="2">
		<b>$longquestion3</b>
	</td>
</tr>
<tr>
	<td class="alt1" colspan="2">
	        $normalanswer6	
	</td>
	<td class="alt2" colspan="2">
	        $longanswer3
	</td>
</tr>
<tr>
	<td class="alt1" colspan="2">
		<b>$longquestion4</b>
	</td>
	<td class="alt2" colspan="2">
	       	$longanswer4	
	</td>
</tr>
Any help would be great!

You can see my form at http://www.amend-eq2.com/forums/newt...php?do=Recruit

If I could just fix this one, small issue, I'd be in love with this hack. Great work bud.
You can't use HTML in the answer template. You can use BBcode though.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01616 seconds
  • Memory Usage 2,411KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete