Version: 4.1, by Abe1
Developer Last Online: Jun 2010
Category: New Posting Features -
Version: 3.6.x
Rating:
Released: 09-14-2006
Last Update: 04-23-2008
Installs: 1216
Uses Plugins Template Edits
No support by the author.
Form Hack 4.1
Features:
Ever wanted an online form that a user can fill out, which when submitted gets:
Posted into a new thread in a forum of your choice
Create a new poll in the new thread with options of your choice
Posted as a reply in an existing thread of your choice
PMed to you or someone else
Emailed to an email address you specify
Choose to redirect to the post, thread or forum, or a custom thank you message
Choose to redirect to edit post
See a preview before they submit
Or any combination or all of the above?
Well, this is the hack for you!
You can use this for:
Moderator Applications
Quiz Submit Form which gets PMed to a moderator
Contact Form that goes to PM, email or thread
Guests to apply to be members
Report a Moderator form that goes as a PM to you
Guests can PM you for whatever reason
Order form to buy things
Donation form
News or Articles submissions that can go straight to a thread
Or anything you like - this hack is totally customizable via the AdminCP.
The beauty of this hack is that once you install this hack, to make a new form all you need to do is copy the main hook, rename it to whatever you want, edit the variables in the hook, and you have a totally new form!!! You do not need to touch the templates again, but can always create new ones and use different templates for different forms.
Format of the form:
One main input question
3 Radio buttons Choice questions
3 Normal text input questions
1 Drop down menu
3 Check boxes
1 Long answer question
1 VB message editor text box question
Upload attachments
This is customizable via the hook.
Also:
You can set the usergroups you want access to this form.
Depending on your forum permissions, if the new thread is in a public forum, members can reply to it. This hack allows a form to submit the new thread or post wherever you want it to go.
Force the user to answer all questions.
INSTALLATION Easy - takes only a few minutes:
Import the XML into products. (admin cp -> Plug-in System -> Manage Products -> Add/Import Product)
Edit the main plug-in - the instructions are all inside the hook itself, in the top half. Follow the instructions carefully!
To get to the form, go to: /newthread.php?do=form (change "form" to the name of your form if you have few)
Done!
Use this hack to make as many forms as you like!
Enjoy!
Updates:
Version 4.0: (09/15/2006)
Ported over for vb3.6
Send to multiple emails.
Send multiple PMs.
Parse emails for BBCode
And finally, ATTACHMENTS!
Version 4.1: (04/24/2008)
Fixed for vb 3.6.10
Small bug fixed.
List of the 2 quick edits are in the zip file so you don't have to start making a form from scratch.
MAKE SURE YOU CLICK INSTALL! You will get an email when a new version is released.
I've managed to install everything but something's still not working and I can't figure out why. It creates a new thread in the proper subfourm but it lists all answers under the first question and after that, it lists questions 2-6.
I'm using 6 long questions and the following is my answers template:
I've managed to install everything but something's still not working and I can't figure out why. It creates a new thread in the proper subfourm but it lists all answers under the first question and after that, it lists questions 2-6.
I'm using 6 long questions and the following is my answers template:
Does anyone know what I'm doing wrong here?
It is hard to isolate and help without seeing all your code. It looks like it should be working correctly.
The answers template looks right and it should be working correctly as long at you have your plugin set up right.
A lot of people make the mistake when editing there plugin and thinking that only have to edit Part 1 and Part 2 of the plugin code. But they also have to edit and add code below this line:
\f0\fs24 \cf0 // 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 = "moderatorsearch";\ \ 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(\ 'longanswer1' => TYPE_STR,\ 'longanswer2' => TYPE_STR,\ 'longanswer3' => TYPE_STR,\ 'longanswer4' => TYPE_STR,\ 'longanswer5' => TYPE_STR,\ 'longanswer6' => TYPE_STR,\ ));\ \ // Part 2\ $longanswer1 = $vbulletin->GPC['longanswer1'];\ $longanswer2 = $vbulletin->GPC['longanswer2'];\ $longanswer3 = $vbulletin->GPC['longanswer3'];\ $longanswer4 = $vbulletin->GPC['longanswer4'];\ $longanswer5 = $vbulletin->GPC['longanswer5'];\ $longanswer6 = $vbulletin->GPC['longanswer6'];\ \ ////////////////////////////////////////////////////////////////////////////////////////////////////\ //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 = "moderatorsearch";\ // Name of the answer template\ $answertemplate = "moderatoranswers";\ \ ////////////////////////////////////////////////////////////////////////////////////////////////////\ \ ////////////////////////////////////////////////////////////////////////////////////////////////////\ //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 = "18";\ \ //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 = "20";\ \ ////////////////////////////////////////////////////////////////////////////////////////////////////\ \ //ENABLE FORM TO BE PMED (guests CANNOT use this option) - 1 = yes, 0 = no\ $formpm = "0";\ \ //USERNAME TO PM TO (separate multiple usernames with a ';')\ $formpmname = "Sarah Walker";\ \ ////////////////////////////////////////////////////////////////////////////////////////////////////\ \ //ENABLE FORM TO BE EMAILED - 1 = yes, 0 = no\ $formemail = "1";\ \ //EMAIL ADDRESS TO EMAIL TO (separate multiple usernames with a ';')\ $formemailaddress = "webmaster@chuck-boards.com";\ \ ////////////////////////////////////////////////////////////////////////////////////////////////////\ \ //ENABLE ATTACHMENTS - 1 = yes, 0 = no\ //attachments can only be used if the form is going to make a new thread or post\ $allow_attachments = "1";\ \ ////////////////////////////////////////////////////////////////////////////////////////////////////\ \ \ \ ////////////////////////////////////////////////////////////////////////////////////////////////////\ //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 (thread or reply)\ //\ // Feel free to change the thank you message if you choose option 0\ ////////////////////////////////////////////////////////////////////////////////////////////////////\ \ $redirectoption = "0";\ \ $errormessage = "Thank you for submitting your application. We will let you know if you've made it!"; //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 = "Moderator Search: Round 2";\ \ ////////////////////////////////////////////////////////////////////////////////////////////////////\ //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 = "Please answer all the questions. Read them carefully, then state what you think is wrong with the scenario and provide examples of PMs or posts if necessary.";\ \ ////////////////////////////////////////////////////////////////////////////////////////////////////\ \ ////////////////////////////////////////////////////////////////////////////////////////////////////\ //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 = "Question #1:";\ $longexplain1 = "Someone has posted in a thread. Their signature contains 5 animated icons with pictures of an upcoming episode.";\ \ $longquestion2 = "Question #2:";\ $longexplain2 = "While browsing the boards, you notice the following post in the <strong>Couples</strong> subforum:<br/>\ <i>plz h3lp me. i w4Nt A cUst0m 4vat4R BuT d0n'T kn0w wh3r3 to Upl04d it. h3lP!</i>.";\ \ $longquestion3 = "Question #3:";\ $longexplain3 = "A friend of yours PMs you to ask if you could change his/her username to Ellie Bartowski.";\ \ $longquestion4 = "Question #4:";\ $longexplain4 = "You come across a minor disagreement between two members but decide to leave them alone and resolve their differences. When you log in the next day, there have been multiple other people jumping in and the whole thread has turned into a fighting arena..";\ \ $longquestion5 = "Question #5:";\ $longexplain5 = "You come across a forum that looks like a clone from Chuck Boards - same subforum names, same avatars, same headers.";\ \ $longquestion6 = "Why me?";\ $longexplain6 = "Please write a short essay on why we should pick you to become a moderator.";\ \ ////////////////////////////////////////////////////////////////////////////////////////////////////\ \ ////////////////////////////////////////////////////////////////////////////////////////////////\ ////// END OF CUSTOMIZATION ////////////////////////////////////////////////////////////////////\ ///// DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING!!! ////////////////////////////////\ ////////////////////////////////////////////////////////////////////////////////////////////////////\ ////////////////////////////////////////////////////////////////////////////////////////////////////\ \
It might also have something to do with putting html in this line of cose in you plugin:
Code:
$longexplain2 = "While browsing the boards, you notice the following post in the <strong>Couples</strong> subforum:<br/>\
<i>plz h3lp me. i w4Nt A cUst0m 4vat4R BuT d0n'T kn0w wh3r3 to Upl04d it. h3lP!</i>.";
I have no idea where the first few lines come from, I think it has something to do with TextEdit, where I c&p the whole thing.
I'll remove the html though. I can't believe I didn't think of that myself. Thank you!
ETA: I've removed the html code and something changed, but not like I wanted it to. It now submits the answer of question 6 to where number 1 should be and answers 1-5 get completely lost on the way to the thread.
I have no idea where the first few lines come from, I think it has something to do with TextEdit, where I c&p the whole thing.
I'll remove the html though. I can't believe I didn't think of that myself. Thank you!
ETA: I've removed the html code and something changed, but not like I wanted it to. It now submits the answer of question 6 to where number 1 should be and answers 1-5 get completely lost on the way to the thread.
That tells you that something is messed up in the plugin edits that youd did.