The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#802
|
|||
|
|||
so what about my issue. the form still doesnt post to a topic. and if poll is selected it still givs the error
Fatal error: Unable to proceed with save while $errors array is not empty in class vB_DataManager_PM in /includes/class_dm.php on line 758 new error going to uninstall this hack untill these errors are addressed, it's got potential. but thats all right now. It doesnt post to forums. It errors on pm and poll |
#803
|
|||
|
|||
Installed. Working great!
Is it possible to insert a default value in the spaces? I put a link to the form in my postbit to appear at the bottom of every post, and I'd like for one of the fields to automatically contain a link to the thread from which the user came. I think this is possible simply by nabbing the page referrer from the user's browser. I know how to do this via html, but am clueless when it comes to vB coding. Can you help me do this? |
#804
|
|||
|
|||
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:
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> 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> 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. |
#805
|
|||
|
|||
Quote:
Also, if I don't want to enable this form to be a part of any NEW THREAD options (instead I wanna use it as a reply to an existing thread), do I just set $formforumid = "0"? |
#806
|
|||
|
|||
hehe, forgot to put a
HTML Code:
</table>
Got that sucker straightened out. Amazingly good hack, bud. |
#807
|
|||
|
|||
also, is it possible to add an option of inserting some of the members' profile fields into the form?
I have a first/last name custom field in members' profile, and was wondering if I could insert it (in case it has been filled out by a member) into one of the answers automatically... or even the email field, that would be one of the questions on my form, so inserting it automatically would be awesome! |
#808
|
|||
|
|||
Bleh, after all that work I still need a little help.
I'm very new to all of this, so please humor me. How would I take that link: http://www.amend-eq2.com/forums/newt...php?do=Recruit and turn it into a page inside of vBadvanced? Anyone know by chance? |
#809
|
|||
|
|||
Quote:
|
#810
|
|||
|
|||
So far, all I could do was add it to the site navigation module, but yeah, I'd like it integrated. That'd be perfect!
|
#811
|
|||
|
|||
how did you add the navigation module?
and btw, I am not receiving an email confirmation of this (I changed my email in the newthread_start template to my working email) plus I am getting this error message as well: Warning: Cannot use a scalar value as an array in /includes/functions_newpost.php on line 329 can you guys figure out what am I doing wrong here? here are my templates: newthread_start: Code:
// To add more then one form, copy this whole text, and create 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 = "gallery"; if ($_REQUEST['do'] == $formname) { // ####################################################################### // ######################## CUSTOMIZE VARIABLES ########################## // ####################################################################### //////////////////////////////////////////////////////////////////////////////////////////////////// ////// BEGIN CUSTOMIZATION BELOW//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// //VARIABLES //Study how variables are added 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 )); // Part 2 $normalanswer1 = $vbulletin->GPC['normalanswer1']; $dropdownanswer1 = $vbulletin->GPC['dropdownanswer1']; $normalanswer2 = $vbulletin->GPC['normalanswer2']; //////////////////////////////////////////////////////////////////////////////////////////////////// //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))) 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 = "0"; //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 = "1"; //EXISTING THREAD ID FOR FORM TO REPLY IN $formreplythreadid = "4529"; //////////////////////////////////////////////////////////////////////////////////////////////////// //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 = "my@email.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 = "0"; $errormessage = "Thank you for submitting your Guestlist request. Your will receive a confirmation from the Promoter for this event as soon as your request has been processed."; //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 = "1"; //////////////////////////////////////////////////////////////////////////////////////////////////// //TITLE OF FORM (do not use quotation marks or you will get a parse error, besides the quotes around the whole title) //////////////////////////////////////////////////////////////////////////////////////////////////// $formtitle = "GuestList Form"; //////////////////////////////////////////////////////////////////////////////////////////////////// //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 = "$formtitle"; //////////////////////////////////////////////////////////////////////////////////////////////////// //PURPOSE OF FORM (do not use quotation marks or you will get a parse error, besides the quotes around the whole text) //////////////////////////////////////////////////////////////////////////////////////////////////// $formpurpose = "REQUESTS ACCEPTED UNTIL: 8:00 PM ON THE DAY OF THIS EVENT<br />GUESTLIST INCLUDES: Line Bypass | Limited Reduced & Free Cover Passes Available<br />GUESTLIST CLOSES AT: 12:00 AM SHARP<br />DRESS CODE: Style Code<br />YOU MUST BE 19+ YEARS OF AGE TO ATTEND"; //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// //NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text) //////////////////////////////////////////////////////////////////////////////////////////////////// $normalquestion1 = "Your Name: "; $normalquestion2 = "Your E-mail: "; //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// //RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text) //////////////////////////////////////////////////////////////////////////////////////////////////// //$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, besides the quotes around the whole text) //////////////////////////////////////////////////////////////////////////////////////////////////// //$radioquestion2 = "Choose another one of the following choices"; // The following choices must NOT have quotation marks //$radiochoice2a = "good"; //$radiochoice2b = "bad"; //$radiochoice2c = "both"; //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// //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) //////////////////////////////////////////////////////////////////////////////////////////////////// $dropdownquestion1 = "How many guests are you bringing?"; // The following choices must NOT have quotation marks $dropdownchoice1a = "1"; $dropdownchoice1b = "2"; $dropdownchoice1c = "3"; $dropdownchoice1d = "4"; $dropdownchoice1e = "5"; $dropdownchoice1f = "6"; $dropdownchoice1g = "7"; $dropdownchoice1h = "8"; //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// //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'] = "gallery"; } $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 $dropdownanswer1 == '' OR $normalanswer2 == '') { $errormessage = "$bbuserinfo[username], you need to fill out all the fields!"; 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', $formforumid, 0, 1); $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], 0, 1); $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', $vbulletin, ERRTYPE_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', $vbulletin, ERRTYPE_STANDARD, 'threadpost'); $threadman->set_existing($threadinfo); $threadman->set('pollid', $pollid); $threadman->save(); } } if ($formreply == "1") { $threadinfo = verify_id('thread', $formreplythreadid, 0, 1); $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', $vbulletin, ERRTYPE_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($vbulletin, fetch_tag_list()); $preview = $parser->do_parse($formsend); $_REQUEST['action'] = 'gallery'; } } if ($_REQUEST['action'] == 'gallery') { // set message box width to usercp size $stylevar['messagewidth'] = $stylevar['messagewidth_usercp']; $editorid = construct_edit_toolbar($vbtextanswer); eval('print_output("' . fetch_template("$maintemplate") . '");'); } } form template: 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="2"> $vboptions[bbtitle] - $formtitle </td> </tr> <tr> <td class="panelsurround" align="center" colspan="2"> <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" align="right"> <b>$normalquestion1</b> </td> <td class="alt1"> <input type="text" size="30" value="$normalanswer1" name="normalanswer1" /> (first name & last initial) </td> </tr> <tr> <td class="alt1" valign="middle" align="right"> <b>$dropdownquestion1</b> </td> <td class="alt1" valign="middle"> <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> </select></td> </tr> <tr> <td class="alt1" align="right"> <b>$normalquestion2</b> </td> <td class="alt1"> <input type="text" size="30" value="$bbuserinfo[email]" name="normalanswer2" /> (for confirmation of this request only) </td> </tr> <tr> <td valign="top" colspan="2"> <p align="center"> <input type="submit" value="Submit" 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> Code:
$normalquestion1 $normalanswer1 $dropdownquestion1 $dropdownanswer1 $normalquestion2 $normalanswer2 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|