Easily create forms with no HTML or PHP knowledge. Questions can be made compulsory and are checked before the form is submitted. Forms can be previewed. (You can create multiple forms)
What about have an option to include a checkbox that if the member checks it then the form data is sent as a confirmation to the email address on file for them.
I am using this form system for a fantasy sports game and the results go into a private topic. Some of the members would like confirmation of their votes since they can't view the private topic.
Thanks for the great modification. I am just starting to use it and have two questions.
Question 1:
How do I get the form results to be saved to the database? When I creating a new form I see a drop down box with the following options:
PM Form to User
Post New Thread
Post in Thread
Email Form
I do not see anything that allows me to "save to database".
I checked the tables after creating a form and using the form and the formresults tables is empty.
Question 2:
Ideally I want a user to fill out a form and submit it. When it is submitted it is posted to a thread and saved to a database. Is this possible?
Thanks!
A1. I missed the option of new form, I'll correct this in next version. In the meanwhile just create the form and then when you edit it the option t save to database will appear.
A2. Yes. Use the following code in Form Hook: Before Submit:
PHP Code:
if ($complete) { $db->query_write("INSERT INTO " . TABLE_PREFIX . "formresults (fid, userid, username, time, title, output) VALUES ('".$form[fid]."', '".$vbulletin->userinfo['userid']."', '".addslashes($vbulletin->userinfo['username'])."', ".TIMENOW.", '".addslashes($threadtitle)."', '".addslashes($formoutput)."') "); }
Quote:
Originally Posted by Pedrillo
I discover that the form is submited or not depending of the order of the variable options that I indicate in the "Thread/ PM/ Email Title: " field:
Example: It's ok with "{q_1}: {q_2}" but not submit the form if I wrote "{q_2}: {q_1}"
In other form it's ok with "{q_6} {q_5}" but not with "{q_5} {q_6}"
What's wrong?
Thank you bananlive!
I'm not sure why this is happening, but I've found a fix for next release.
Quote:
Originally Posted by trickfly
whats the point of this mod ?
You can collect data in the form you want from your users.
Quote:
Originally Posted by lazyseller
Im able to access the form via misc.php?do=form&fid=10&threadid=(dynamic) but the script is unable to figure out which thread to post in.
I left "Threadid where Post is Created:*" blank since this would need to be dynamic. Unsure where to proceed from here.
What exactly do you mean by dynamic? Do you mean if misc.php?do=form&fid=10&threadid=12345 it gets posted in thread 12345.
Quote:
Originally Posted by alduren
Thanks for this mod!!.
I have a question. In my form I have a field with this custom form output.
[IMG]{q_1}[/IMG]
When the answer is blank it shows [IMG] code because this field is not compulsory, like this
[IMG].[/IMG]
If the field is blank I don?t want to show BBcode, how could I correct this??
Form Hook: Before Submit:
PHP Code:
$formoutput = str_replace("", "", $formoutput);
Quote:
Originally Posted by nascartr
What about have an option to include a checkbox that if the member checks it then the form data is sent as a confirmation to the email address on file for them.
I am using this form system for a fantasy sports game and the results go into a private topic. Some of the members would like confirmation of their votes since they can't view the private topic.
At last, got enougth time to study latest changes in your form constructor. Thanks a lot for your work. I have some proposals, may be, youll find those useful for your 3.0 version .
1. Processing can be switched from "form parameters" to "form actions". That will spin flexibility to the next level, and will simplify / improve coding & interface for each action.
Each action can have a custom parameter & action can be added to form in the same manner, as questions. The big advantage is, that you can have several action in one time (or just skip unnecessary one). Here is actions examples:
- posting
Create Thread
PM form
Email Form
... (other types of data processing)
- customisations
Custom success message (? with JS redirect to URL)
Custom error message if no permissions to use form (? with JS redirect to URL)
Of cause, that can be done via hooks, but that method is much more complicated, than just push mouse buttons . And you are not limited to add new actions, when required. That's a kind of "advanced hooks conctructor"
(*) Don't know what is better: to keep title & template common, or make it individual for each posting action. Probably, second method is better and simplify main form editing page.
2. "Only for guest" questions.
Reason is simple: User should not care, which form to select for feedback. That's extremly significant for advertiser and payed visitors. If he is registered, then additional information is taken from profile. If not - he is asked to fill additional input fields.
Solution is trivial: add flag "only for guests" for all questions.
3. Full template language support in form templates.
AFAIK only macroses are supported now. But it would be useful to support <if> <else> and all internal forum variables in form templates. It seems, there are no serious barriers to do that. vBulletin have a powerful templates parser, that can be used. It's useful with proposal (2), when you can easily fix template output, depending on user permissions.
4. Please, check vulnerabilities issues
- What happens, if user enter macros name in text field? Are such patterns stripped (or converted to safe style) prior to process form?
5. It's better so send Emails in HTML. Вetter look, when use several actions (make post and send email)
(*) If you'll switch to "actions", it's possible to create new one "send email as HTML" . If each action has personal template, that's not a problem at all.
6. Don't know, if it's useful, but I'd enlarge default form description font to SIZE=2. And would remove "Form Description" from border.
7. It would be useful to have form active for user, but hidden from public list. No ideas, why you use 2 access settings in product options, but only sigle setting for each form. Parameter "who can view form in list" can solve it.
8. Date question format. Some prefer dd-mm-yy. May be, format type to this question?
9. Does "send email" support multiple addresses?
(*) Useful, but not critical if multiple actions are supported.
Regards,
Vitaly.
1&2. These would require alot of edits, but will probably be available in the future.
3. I've tried and failed to find easy way to allow <if> in form custom output
4. Shouldn't do, I'll check this
5. vbulletin mail system doesn't allow html or bbcode
6. You can use bbcode to do that
7. ? I don;t understand what you're saying
8. You can change that by editing form_formbit_date and:
1&2. These would require alot of edits, but will probably be available in the future.
PM me, if you need some help. I don't want to make a separate product and support it, but can invest some time/money to improve your one.
Another good option is to import-export actions in XML.
Quote:
Originally Posted by bananalive
7. ? I don;t understand what you're saying
If user have access to form, then form is listed on the main product page. But when this page is used as "contacts", it's better to hide some (liks to those can be shown on another pages).
For example, I have english contact form, rarely used. And I don't wish to show it to russian-speaking visitors, that are 99% at my site.
Originally Posted by lazyseller
Im able to access the form via misc.php?do=form&fid=10&threadid=(dynamic) but the script is unable to figure out which thread to post in.
Quote:
I left "Threadid where Post is Created:*" blank since this would need to be dynamic. Unsure where to proceed from here.
What exactly do you mean by dynamic? Do you mean if misc.php?do=form&fid=10&threadid=12345 it gets posted in thread 12345.
Yes you are exactly correct.
All i would have to do is a simple template edit on the reply button and we would have
Im getting "Parse error: syntax error, unexpected $end in /home/log/public_html/beta/misc.php(97) : eval()'d code(983) : eval()'d code on line 5
"
Attempted to fill the form out anyhow and it wasnt able to redirect or link to the right page. (broken link)
Double check you have the right php code and then try putting the code in both form hooks
PHP Code:
$form['where'] = $vbulletin->input->clean_gpc('g', 'threadid', TYPE_UNIT);
if(!$form['where'])
{
$errormessage = "Add &threadid=92 to your url to make it work.";
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
}