The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Form Hack Details »» | |||||||||||||||||||||||||
Form Hack 4.1 Features: Ever wanted an online form that a user can fill out, which when submitted gets:
Or any combination or all of the above? Well, this is the hack for you! You can use this for:
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:
This is customizable via the hook. Also:
INSTALLATION Easy - takes only a few minutes:
Done! Use this hack to make as many forms as you like! Enjoy! Updates: Version 4.0: (09/15/2006)
Version 4.1: (04/24/2008)
MAKE SURE YOU CLICK INSTALL! You will get an email when a new version is released. Abe1 with rights from Dr Erwin Loh Supporters / CoAuthors Show Your Support
|
Comments |
#1262
|
||||
|
||||
Can somebody please help with why I am getting this error when I submit the form.
Fatal error: * Please complete both the subject and message fields. Unable to proceed with save while $errors array is not empty in class vB_DataManager_PM in /includes/class_dm.php on line 763 |
#1263
|
||||
|
||||
You have to be very careful with this form as you will get data manager errors if you have multiple forms using the same variables.
My advice is to become very familiar with the form before using it. This way , you can create your own variable. Example: Instead of $question1="What is your name?"; you can write your own variable... $form_one_question1="What is your name?"; or $form_one_name="What is your name?"; Definitely not for the impatient but a great product. There are a few bugs like if you have a question: Do you have a name? If yes, please state your name. Someone can still choose no and state their name so it shows as: No My Name I have found a quick fix conditional to add to your formanswers template that works fairly well for me. Code:
<if condition="$radioanswer1other!=''">yes<else />$radioanswer1</if> So your actual code for the question assuming it is $radioquestion1 is as follows: Code:
$radioquestion1 <if condition="$radioanswer1other!=''">yes<else />$radioanswer1</if> $radioanswer1other Another thing I noticed is that HTML is not parsing in the formanswers template and any BBCode produces errors. Is there any way around this? I would like to add some styling to the form when it is posted to a thread like using Bold and Underline and possibly a hyperlink to various answers. Thanks |
#1264
|
|||
|
|||
I have installed this hack but for some reason the answers to the normal questions ($question) are not showing up on priview or when its submitted.
My PHP isn't very good at all so I was hoping someone for have a quick look for me? http://www.fileden.com/files/2007/3/...ot_working.txt Emma |
#1265
|
||||
|
||||
Part 1 and Part 2 have to be the same for your answer variables.
My suggestion is to first write down all questions and answers, then add to form. Example: $question1 = "What is the Rabbits Name?"; $explain1 = "Please enter your real name here."; In question1, you would only need to clean the answer1 (your own questions and explains dont need to be run through the vb input.) Code:
// Part 1 $vbulletin->input->clean_array_gpc('p', array( '$answer1' => TYPE_STR, )); // Part 2 $answer1 = $vbulletin->GPC['normalanswer1']; form template Code:
<tr> <td class="alt2" valign="middle"> <b>$question1</b>:<br /> $explain1</td> <td class="alt2" valign="middle" colspan="2"> <input type="text" size="30" value="$answer1" name="answer1" /></td> </tr> Code:
$question1 $answer1 |
#1266
|
|||
|
|||
Hello,
Great mod, but has this mod been updated to work with vb 3.7.3 or above? Thx |
#1267
|
|||
|
|||
Quote:
|
#1268
|
|||
|
|||
Not only dosn't it display the ansewrs its still only showing the first three questions on preview (I have added them into the html).
http://www.fileden.com/files/2007/3/...t_working2.txt I know is something I am doing wrong because I am a designer and know nothing what so ever about this kind of thing. It is a very basic form I am trying to put together. |
#1269
|
||||
|
||||
Like I stated in a previous post, its more coder-oriented and without much documentation.
The idea is to first develop your variables list (Note:You only have to use the vbulletin cleaner on a variable which will allow user input.) So if my first question was: $question1="What is your name?"; $explain1="Please enter your name here"; Neither of those have to be passed through vb input cleaner. -only the $answer1 since it takes user input. I clean everything... even radio boxes that you think would only be a Yes or No, just in case a hacker tries to manipulate any input variables. You cannot use the same variable twice or it is overwritten resulting in possible errors. So you cannot do: $question1="What is your name?"; $question1="How old are you?"; This is basic variable handling as you are redeclaring the var resulting in it being overwritten. If you are trying to use the default form as reference as you make a custom form, the script is being executed ,corrupting default variables if you are not assigning your own. So I recommend disabling the default form if you make custom. After all your variables are assigned properly within the plugin, you then edit the form template to your liking which takes basic vbulletin template handling. And also do the same with the output template (answer template) which will be the template that posts to your thread or post. Both templates have to use the same variables as you stated in the form plugin. The easiest way I have found is to write down my questions and answers on paper or in editor so that I have a basic set. Then, I go through and create the variables, place them in the order I want in the templates, and everything should work. It takes a bit of a learning curve but well worth it. Maybe someday, the Form Hack will be enhanced to set up the form from adminCP area. |
#1270
|
|||
|
|||
I dont know what you mean by "cleaning" I am new to VB and I haven't a clue about PHP but this forum is an importent part of my forum.
This is how it is set up so far: Quote:
Quote:
I a run an animal welfare forum and this form will be used for animals needing homes and to let me know details about the animal so I can put those details onto the site. |
#1271
|
||||
|
||||
Part 1 and Part 2 need to have the same variables which rely on any questions asked.
Code:
// Part 1 $vbulletin->input->clean_array_gpc('p', array( '$answer1' => TYPE_STR, '$answer2' => TYPE_STR, '$answer3' => TYPE_STR, '$answer4' => TYPE_STR, '$answer5' => TYPE_STR, '$answer6' => TYPE_STR, )); // Part 2 $answer1 = $vbulletin->GPC['answer1']; $answer2 = $vbulletin->GPC['answer2']; $answer3 = $vbulletin->GPC['answer3']; $answer4 = $vbulletin->GPC['answer4']; $answer5 = $vbulletin->GPC['answer5']; $answer6 = $vbulletin->GPC['answer6']; |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|