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 *really* like this mod. I have working forms for several different forums. The issue is updating the FORUMDISPLAY.PHP code so that it will use specific URL's with the right form for the right forum. I know I could put a drop-down/select in the form and use the same form for all the forums, but each form is specific to each forum.
Has anyone come up with a way (IF/THEN perhaps) to accomplish this? I've looked around for a hack/mod to make this change from within the VB administrator area but haven't found anything.
$answer4 is not a default variable that is included in the hack. Any additional variables that you add you also have to add in the lower part of the plugin.
Look for a code in the lower part of the plugin that looks like this:
Code:
if ($answerall == "1")
{
if ($normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == '' OR $radioanswer3 == '' OR $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR ($checkboxchoice1_1 AND $checkboxchoice1_2 AND $checkboxchoice1_3) OR $longanswer1 == '')
{
$errormessage = "$bbuserinfo[username], you need to answer every question!";
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit();
}
You will need to ad the "OR $answer4" in there in the proper format.
I love this Hack, and gotta say its keeping me busy but the work is paying off big dividends as the site is working great... Very streamlined, and neat with these news integrated Forms.
I do have a question, How can I have the date and time automatically inserted into form like we do for $bbuserinfo[username] stuff?
I love this Hack, and gotta say its keeping me busy but the work is paying off big dividends as the site is working great... Very streamlined, and neat with these news integrated Forms.
I do have a question, How can I have the date and time automatically inserted into form like we do for $bbuserinfo[username] stuff?
I am just curious as to why you need this because the date and time are posted in the thread it creates just like when a user creates a thread in the forums.
I had a need to create a poll based off the answers provided in the form. Hope this helps someone else.
Below
Code:
//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
Add
Code:
if ($checkboxanswer1_1 == '' AND $checkboxanswer1_2 == '' AND $checkboxanswer1_3 == '' AND $checkboxanswer1_4 == '' AND $checkboxanswer1_5 == '' AND $checkboxanswer1_6 == '' AND $checkboxanswer1_7 == '' AND $checkboxanswer1_8 == '')
{
$formpoll = "0";
}
else
{
$formpoll = "1";
}
$polloption[1] = "Poll Option 1";
$polloption[2] = "Poll Option 2";
$polloption[3] = "Poll Option 2";
Remove
Code:
$formforum = "1";
The above creates a poll if the cited checkboxes are checked.
I haven't tried to use this with entry fields as I was using checkboxes which worked quite well. If someone comes up with other variations for this please post. It may come in handy to others.