vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   New Posting Features - Easy Forms - Create a form or multiple forms without php or html knowledge (https://vborg.vbsupport.ru/showthread.php?t=201097)

SnowBot 02-02-2009 02:52 AM

EDIT

Got it working

nascartr 02-02-2009 03:05 AM

I have an idea that I think would be a useful feature.

Allow an email field for the user.

A member can enter their email into an optional field and if they do then they get a duplicate confirmation to the email of the submitted form.

Dax IX 02-02-2009 03:18 AM

Quote:

Originally Posted by nascartr (Post 1731528)
I have an idea that I think would be a useful feature.

Allow an email field for the user.

A member can enter their email into an optional field and if they do then they get a duplicate confirmation to the email of the submitted form.

That could open the door to spam, but if it were to be sent to the user's account email, that would be nice...

Ah...yes, if you're using it as a registration form, I guess that wouldn't work too well. :(

nascartr 02-02-2009 03:27 AM

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.

bananalive 02-02-2009 09:41 AM

Quote:

Originally Posted by brainfood (Post 1731450)
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 (Post 1731391)
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}"

:confused: :confused: 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 (Post 1731378)
whats the point of this mod ?

You can collect data in the form you want from your users.
Quote:

Originally Posted by lazyseller (Post 1730946)
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 (Post 1730713)
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 (Post 1731542)
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.

Create yesno option

Form Hook: Before Submit:
PHP Code:

if ($qo_{54} == $vbphrase[yes] && $complete && $vbulletin->userinfo['email'])
{
$formoutput preg_replace('/(\[(.*?)\])/is'''$formoutput);
vbmail($vbulletin->userinfo['email'], $threadtitle$formoutput);


Quote:

Originally Posted by Vitaly (Post 1730807)
Hi, Banana,

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:
PHP Code:

$qo_{$formbit[id]} = implode("/"$q_{$formbit[id]}); 

to
PHP Code:

$qo_{$formbit[id]} = implode(" "$q_{$formbit[id]}); 

9. Should do, haven't actually tested it

Vitaly 02-02-2009 12:06 PM

Quote:

Originally Posted by bananalive (Post 1731718)
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 (Post 1731718)
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.

lazyseller 02-02-2009 01:28 PM

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.
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

reply to thread (forum based)

bananalive 02-02-2009 01:45 PM

Quote:

Originally Posted by lazyseller (Post 1731889)
Yes you are exactly correct.

All i would have to do is a simple template edit on the reply button and we would have

reply to thread (forum based)

http://www.bananalive.co.cc/misc.php...=2&threadid=92

Uses Form Hook: Form Start:
PHP Code:

$form['where'] = $vbulletin->input->clean_gpc('g''threadid'TYPE_UNIT);
if(!
$form['where'])
{
$errormessage "Error, no threadid specified.";
eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");');



lazyseller 02-02-2009 01:53 PM

Thanks for the help.

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)

bananalive 02-02-2009 02:00 PM

Quote:

Originally Posted by lazyseller (Post 1731915)
Thanks for the help.

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') . '");');




All times are GMT. The time now is 05:39 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02426 seconds
  • Memory Usage 1,810KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_php_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete