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.
To do this open the product-form.xml in a text editor. Find
Code:
<template name="form" templatetype="template"
Look through the code that follows, it is the actual template that sets up the structure of the form. This is the area in which the html code will be for the drop down menu and the radio buttons.
This template returns the questions and answers from the form. You will need to remove the variables in this template that correspond to the drop down menu and the radio buttons.
Now find
Code:
// Part 1
Remove the lines that correspond to the drop down menu and the radio button that you have removed from the templates. Proceed down the page a bit to
Code:
// Part 2
Again, remove the lines that correspond to the drop down menu and radio buttons.
The next part is optional, but I recommend that you do this -> continue down the page until you find where the radio button variables and drop down menu are set with values. Remove these from the file. No sense in code existing in the file if it is not being used.
Ok some times its the ; or the , that you deleted that you miss. So I need help with this if anybody can direct me.
Quote:
// 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.
////////////////////////////////////////////////////////////////////////////////////////////////////
////// 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.
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//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,9))) 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 = "recruitment";
// 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 = "4";
//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 = "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 = "3";
$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 = "1";
////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error, besides the quotes around the whole title)
////////////////////////////////////////////////////////////////////////////////////////////////////
$formtitle = "GFC R.A.C 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 = "$formtitle";
////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////
$formpurpose = "If you are interested in joining the Global Fortress Community you must read & follow the instructions below";
////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "Fill in your Game user name(s).";
////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "Do you own & use a microphone? We require all new recruits to use Ventrilo www.ventrilo.com & you will need a microphone for this. Check out the Ventrilo Server Info on the front of the website. r IP and setup info. With out a microphone you will not be recruited.";
// 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)
////////////////////////////////////////////////////////////////////////////////////////////////////
$normalquestion2 = "Fill in your xfire user name.";
//$radioquestion2 = "Do you have xFire Installed(recommended).
//www.xfire.com";
// The following choices must NOT have quotation marks
//$radiochoice2a = "Yes";
//$radiochoice2b = "No";
////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "";
$normalquestion3 = "Make sure you get your steam ID / BF2 PID / BF2142 PID / In Game user Name";
// 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 = "How long have you been playing?";
$explain1 = "Please list how long you have been playing the game which you are applying";
//QUESTION 2 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
$question2 = "How old are you?";
$explain2 = "Please enter your age here.";
//QUESTION 3 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
$question3 = "Have you been in any clans?";
$explain3 = "Please enter your Clan names that you have been associated with.";
////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "Are you presently in a another Clan?";
// The following choices must NOT have quotation marks
$dropdownchoice1a = "No";
$dropdownchoice1b = "Yes";
//$dropdownchoice1c = "Yes but with another Game";
////////////////////////////////////////////////////////////////////////////////////////////////////
//CHECK BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////
//$checkboxquestion1 = "Which game are you applying for.";
// The following choices must NOT have quotation marks
//$checkboxchoice1_1 = "Counter-Strike : Source";
//$checkboxchoice1_2 = "Battlefield 2142";
//$checkboxchoice1_3 = "Other then listed Above";
////////////////////////////////////////////////////////////////////////////////////////////////////
//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 tell us why you want to join Global Fortress Community.";
$longexplain1 = "Please be as detailed as possible.";
////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "In order to keep GFC gaming servers, voice server, fourms etc running we require donations by members. Are you willing to donate a small ($5) monthly amount to help with these costs? Please write down any additional information that you want to add that might help us recruit you.";
$vbtextexplain = "";
////////////////////////////////////////////////////////////////////////////////////////////////
////// END OF CUSTOMIZATION ////////////////////////////////////////////////////////////////////
///// DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING!!! ////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
We are a gaming clan so this is a recruitment form any suggestion would be great.
In the code below. how would I go about sending a post to 2 different forums?
Code:
$formforumid = "13";
I am trying to get this to post to both a regular section of the forums and to a private section.
Has anyone been able to come up with a solution to have this post in two different forums? I'm in the same boat... I need this form to go to a public section so that the user can comment, but then I need to have that same form be posted to a private section where membership can comment and discuss w/o the user being able to read the comments etc...