vb.org Archive

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

sopier 05-04-2010 07:10 PM

Now, this is another questions... How if I want to attach images as one of the fields in the forms? What should I do?

mokonzi 05-05-2010 08:09 PM

Awesome mod, improved so much from the 3.8 verison I used to use.

A couple of things, when using Yes/No answers, it records in the vote format the language...

i.e:

Yes: 25%
Ja: 25%
No: 25%
Neine: 25%

Would it be possible for it to not record the language variations? Or have an option to do?

Another nice feature would be having the number who agreed with a poll option when you hover over the poll bar... i.e. 25% translates to 15 who agreed with it...

riskofficer 05-06-2010 04:50 AM

bananalive, could you please code Results Editing option? I'll try to explain what I mean. Hmm. The button "Edit" near the button "Delete" in Form Results near each Result. When you press Edit the button leads us to the Form with predefined answers from the Editing answer. Like Editing threads. Thank you!

jdj 05-06-2010 10:15 AM

I've got the 4.0.9 version of this mod installed. Looks great, so congratulations; I'm just playing around with it trying to work out how to use it (I'm not a developer). Just noticed there's a grammatical error in there: Easy to fix in phrases, even I know how to do this, but you might want to change in next release.

In the phrase "Please Note: Questions proceeded by an asterisk (*) are compulsory" the word proceeded needs to be replaced by the word preceded.

Alisa Lindsay 05-08-2010 11:03 PM

Good Evening...

I noticed this thread is a tad old, so hope I get a response...

I installed the mod on my test board. It is great and when I work out the kinks, it'll be marvelous.

I run an RPG and need to use the forms to create a character's bio/profile so it's a rather long form with different sections. I'd like to divide the sections with the horizontal rule line (I have the custom BB Code installed)...

However, so far, I've been unable to make this work...It's possible it's setting on the actual forum I've missed although I've gone through them all twice....

Any hints, suggestions, ideas, letters, hate mail? *grins*

Thanks and Regards,

Alisa

drainpan 05-09-2010 02:08 AM

Lets say I have an "Age" field in my form that ranges from 12-99.

How would I go about making it so if they choose and number below 16 they would either instantly be directed or once submitted be directed to a custom error page of my design to tell then they are not old enough?

I would really like to do this on my clan application form to weed out the youngsters.

Thank you in advance...

zeroality 05-09-2010 07:37 PM

Great mod, just wish there was a readme file with instructions. I had to figure it all out on the fly.

Can forms be posted as a thread instead of having to be linked via misc.php?etc

jdj 05-10-2010 09:22 AM

Quote:

Originally Posted by Alisa Lindsay (Post 2033930)
Good Evening...

I noticed this thread is a tad old, so hope I get a response...

I installed the mod on my test board. It is great and when I work out the kinks, it'll be marvelous.

I run an RPG and need to use the forms to create a character's bio/profile so it's a rather long form with different sections. I'd like to divide the sections with the horizontal rule line (I have the custom BB Code installed)...

However, so far, I've been unable to make this work...It's possible it's setting on the actual forum I've missed although I've gone through them all twice....

Any hints, suggestions, ideas, letters, hate mail? *grins*

Thanks and Regards,

Alisa

I'm also interested in using this to create a character's bio/profile and I'm also learning to use it. One thing though...because I'm not a developer, to me the acronym RPG stands for "rocket propelled grenade". So if in the course of my own explorations I find something that might help you I may not know because I do not understand the jargon. :D

JJ

heyzeus909 05-10-2010 06:59 PM

In a specific forum, I would like to have the "Post New Thread" button link to the Easy Form I have created. This would force the first post of any new threads in that forum to have to fill out the Easy Form questionnaire.

Is this possible? What would the template edits be?

Could this be implemented through vb Options in later releases of this fine hack?

Thanks.

drainpan 05-11-2010 01:31 AM

no more support for this?

Veer 05-11-2010 08:20 AM

What is the change log for new v4.0.9 ???

bananalive 05-11-2010 08:39 PM

Quote:

Originally Posted by Veer (Post 2035020)
What is the change log for new v4.0.9 ???

Can't remember, just upgrade to v4.1.0

bananalive 05-11-2010 08:51 PM

Quote:

Originally Posted by heyzeus909 (Post 2034678)
In a specific forum, I would like to have the "Post New Thread" button link to the Easy Form I have created. This would force the first post of any new threads in that forum to have to fill out the Easy Form questionnaire.

Is this possible? What would the template edits be?

Could this be implemented through vb Options in later releases of this fine hack?


Thanks.

It's really easy just using one plugin:

Title : can be what you want

Hook Location : newthread_form_complete

Plugin PHP Code:

PHP Code:

if (in_array($forumid, array(1,2,3)))

header'Location: http://www.your-site.com/forum/misc.php?do=form&fid=1' ) ; 



bananalive 05-11-2010 08:52 PM

Quote:

Originally Posted by zeroality (Post 2034240)
Can forms be posted as a thread instead of having to be linked via misc.php?etc

Nope

bananalive 05-11-2010 08:53 PM

Quote:

Originally Posted by Alisa Lindsay (Post 2033930)
Good Evening...

I noticed this thread is a tad old, so hope I get a response...

I installed the mod on my test board. It is great and when I work out the kinks, it'll be marvelous.

I run an RPG and need to use the forms to create a character's bio/profile so it's a rather long form with different sections. I'd like to divide the sections with the horizontal rule line (I have the custom BB Code installed)...

However, so far, I've been unable to make this work...It's possible it's setting on the actual forum I've missed although I've gone through them all twice....

Any hints, suggestions, ideas, letters, hate mail? *grins*

Thanks and Regards,

Alisa

Have you tried custom output?

bananalive 05-11-2010 08:53 PM

Quote:

Originally Posted by jdj (Post 2032498)
I've got the 4.0.9 version of this mod installed. Looks great, so congratulations; I'm just playing around with it trying to work out how to use it (I'm not a developer). Just noticed there's a grammatical error in there: Easy to fix in phrases, even I know how to do this, but you might want to change in next release.

In the phrase "Please Note: Questions proceeded by an asterisk (*) are compulsory" the word proceeded needs to be replaced by the word preceded.

As the stars are at the end don't they proceed the question not precede it?

bananalive 05-11-2010 08:54 PM

Quote:

Originally Posted by riskofficer (Post 2032440)
bananalive, could you please code Results Editing option? I'll try to explain what I mean. Hmm. The button "Edit" near the button "Delete" in Form Results near each Result. When you press Edit the button leads us to the Form with predefined answers from the Editing answer. Like Editing threads. Thank you!

Added in v4.1.0

bananalive 05-11-2010 08:58 PM

1 Attachment(s)
Quote:

Originally Posted by mokonzi (Post 2032287)
Awesome mod, improved so much from the 3.8 verison I used to use.

A couple of things, when using Yes/No answers, it records in the vote format the language...

i.e:

Yes: 25%
Ja: 25%
No: 25%
Neine: 25%

Would it be possible for it to not record the language variations? Or have an option to do?

Another nice feature would be having the number who agreed with a poll option when you hover over the poll bar... i.e. 25% translates to 15 who agreed with it...

Fixed language issue.

Number 'voted' should show, but there was line missing :eek: fixed in attached file for you.

bananalive 05-11-2010 08:59 PM

Quote:

Originally Posted by sopier (Post 2031772)
Now, this is another questions... How if I want to attach images as one of the fields in the forms? What should I do?

Added option to allow bbcode for checkbox and radio buttons - so use [img] bbcode

riskofficer 05-13-2010 01:02 PM

Quote:

Originally Posted by bananalive (Post 2035379)
Added in v4.1.0

Thank you! One more thing about edit is something like "Usergroups Allowed to Edit Form Results". For example I'd like to leave this option (Edit Result) only for person whos answered (starter) and admins/moderators. BTW the option to delete results is in need of permissions too, I haven't found them.

XLCR GODFATHER 05-13-2010 02:24 PM

Quote:

Originally Posted by riskofficer (Post 2036339)
Thank you! One more thing about edit is something like "Usergroups Allowed to Edit Form Results". For example I'd like to leave this option (Edit Result) only for person whos answered (starter) and admins/moderators. BTW the option to delete results is in need of permissions too, I haven't found them.

I fully agree where leaving the delete option available makes it too easy for accidental click and should be a permission setting.

ThorstenA 05-13-2010 03:23 PM

Suggestion: Change phrase
Quote:

Error, you have exceeded limit for number of times this form can be submitted.
to
Quote:

Error, you have exceeded limit for number of times this form can be submitted.
Edit your submitted form.
Or better:
If a user has exceeded the limit for number of times he can submit the form, redirect him immediately to the edit form.

ThorstenA 05-13-2010 03:43 PM

Bugs:
  • I can not edit my own entry if the maximum number of entries is limited to one.
  • After I delete my entry (have no entries any more), I can not vote again because "I exceeded the limit"

ThorstenA 05-13-2010 05:16 PM

Quote:

Originally Posted by ThorstenA (Post 2036458)
Bugs:
  • I can not edit my own entry if the maximum number of entries is limited to one.

Solution for at least going to the edit form

1. Replace in plugin Easy Forms Part 1
Code:

    if ($form[submitlimitperuser] >= 1)
to
Code:

    if (!$formresult && $form[submitlimitperuser] >= 1)



2.
In same plugin in the area after
Code:

if ($_POST['do'] == 'postform')
replace
Code:

                if ($count >= $form[submitlimitperuser])
to
Code:

                if ($count > $form[submitlimitperuser])

ThorstenA 05-13-2010 05:38 PM

Bug: Poll displays free text entries

Solution: Replace in plugin Easy Forms Part 3 short after
Code:

if ($_REQUEST['do'] == 'formresults_poll')
{

the code
Code:

        $formbits = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "formbits WHERE fid = $fid AND type != 7 ORDER BY displayorder ASC");
to
Code:

        $formbits = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "formbits WHERE fid = $fid AND type NOT IN (1,6,7,8,9) ORDER BY displayorder ASC");

ThorstenA 05-13-2010 06:24 PM

Quote:

Originally Posted by ThorstenA (Post 2036458)
Bugs:
  • After I delete my entry (have no entries any more), I can not vote again because "I exceeded the limit"

Temporary, not really working solution
(This messes lots of things up in your database as userid 123 will have an effect on userid 12345). It is better to get the userids from a simple SELECT query of forumresults table.

Replace in plugin Easy Forms Part 2
Code:

if ($_REQUEST['do'] == 'deleteformresult')
{
        $caneditform = unserialize($vbulletin->options['caneditform']);
        if ($caneditform && !is_member_of($vbulletin->userinfo, $caneditform))
        {
                print_no_permission();
        }
        $id = $vbulletin->input->clean_gpc('g', 'id', TYPE_UINT);
        $fid = $vbulletin->input->clean_gpc('g', 'fid', TYPE_UINT);
        $db->query_write("DELETE FROM " . TABLE_PREFIX . "formresults WHERE id=$id");
        $db->query_write("UPDATE " . TABLE_PREFIX . "forms SET userids = REPLACE(userids,\"," . $vbulletin->userinfo[userid] . "\",\"\")  WHERE fid=$fid");
        $vbulletin->url = "misc.php?do=forms";       
        eval(print_standard_redirect('redirect_deleteq'));
}

to
Code:

if ($_REQUEST['do'] == 'deleteformresult')
{
        $caneditform = unserialize($vbulletin->options['caneditform']);
        if ($caneditform && !is_member_of($vbulletin->userinfo, $caneditform))
        {
                print_no_permission();
        }
        $id = $vbulletin->input->clean_gpc('g', 'id', TYPE_UINT);
        $fid = $vbulletin->input->clean_gpc('g', 'fid', TYPE_UINT);
        $db->query_write("DELETE FROM " . TABLE_PREFIX . "formresults WHERE id=$id");
        $db->query_write("UPDATE " . TABLE_PREFIX . "forms SET userids = REPLACE(userids,\"," . $vbulletin->userinfo[userid] . "\",\"\")  WHERE fid=$fid");
        $vbulletin->url = "misc.php?do=forms";       
        eval(print_standard_redirect('redirect_deleteq'));
}


ThorstenA 05-13-2010 06:35 PM

To have my users automatically redirect to the form results page where they can edit their entries if they exceeded their maximum entries, I use this code in plugin Easy Forums Part 1
Code:

    if (!$formresult && $form[submitlimitperuser] >= 1)
    {
        $userids = $form[userids];
        $userid = $vbulletin->userinfo[userid];
        $count = substr_count(",$userids,", ",$userid,");
        if ($count >= $form[submitlimitperuser])
        {
        $vbulletin->url = "misc.php?do=formresults&fid=" . $fid;
        eval(print_standard_redirect('redirect_deleteq'));

            //$errormessage = "Error, you have exceeded limit for number of times this form can be submitted.";
            //eval(standard_error($errormessage));

        }
    }

I use this product as a review type. For each form a user can only have one entry. As I only have one entry to be displayed on this page anyway, I am redirecting my user to the edit page directly. For doing that I need the id of the formresults table:
Code:

    $id = $db->query_first("SELECT id FROM " . TABLE_PREFIX . "formresults WHERE fid = '$fid' AND userid = " . $vbulletin->userinfo[userid] . "");
        $vbulletin->url = "misc.php?do=editformresult&id=" . $id[id] . "&fid=" . $fid;
        eval(print_standard_redirect('redirect_deleteq'));


ThorstenA 05-13-2010 06:42 PM

This is about the database "review" model where users are allowed to give an entry once (limit: 1).

Users are allowed to see the poll results from all users. However, for Privacy Reasons users can only see their own entries on form results table:

In plugin Easy Forms Part 3 replace
Code:

        $formresults = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "formresults WHERE fid = '$fid' $search AND userid=" . $vbulletin->userinfo[userid] . " ORDER BY time DESC");
to
Code:

        $formresults = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "formresults WHERE fid = '$fid' $search AND userid=" . $vbulletin->userinfo[userid] . " ORDER BY time DESC");

ThorstenA 05-13-2010 08:36 PM

After user has completed the entry successfully, he is redirected to the statistic page:

Replace in plugin Easy Forms Part 1
Code:

    if ($complete && $show['editing'])
    {
        $sdata = serialize($qo);
        $db->query_write("
            UPDATE " . TABLE_PREFIX . "formresults
            SET
                title = '".$db->escape_string($threadtitle)."',
                output = '".$db->escape_string($formoutput)."',
                sdata = '".$db->escape_string($sdata)."'
            WHERE
                fid = '".$fid."' AND
                id = '".$show['edit_id']."'
        ");
        $errormessage = "Form Result was successfully updated.";
        $vbulletin->url = $vbulletin->options['bburl'] . "/misc.php?do=formresults&fid=$fid";
        eval(print_standard_redirect($errormessage, false, true));
    }

to
Code:

            if ($complete && $show['editing'])
    {
        $sdata = serialize($qo);
        $db->query_write("
            UPDATE " . TABLE_PREFIX . "formresults
            SET
                title = '".$db->escape_string($threadtitle)."',
                output = '".$db->escape_string($formoutput)."',
                sdata = '".$db->escape_string($sdata)."'
            WHERE
                fid = '".$fid."' AND
                id = '".$show['edit_id']."'
        ");
        $errormessage = "Form Result was successfully updated.";
        $vbulletin->url = $vbulletin->options['bburl'] . "/misc.php?do=formresults_poll&fid=$fid";
        eval(print_standard_redirect($errormessage, false, true));
    }


ThorstenA 05-13-2010 09:23 PM

I love this product! Therefore I took some time to look into it and I have some suggestions for its database structure
  • Rename row time to dateline (as they do in the other vbulletin tables)
  • Remove username from table formresults and fetch username by querying user table.
    ("... FROM formresults, user WHERE formresults.userid=user.userid ...")
  • Remove userids from table forms and get this information from table forumresults. This is needed for limit users entries for a question. It is very hard to maintain duplicate (redundant) information. You have all these infos when querying forumresults table
    ("SELECT count(userid) AS usercount FROM forumresults WHERE fid=$fid AND userid=" . $vbulletin->userinfo[userid] ."")
  • Remove redirect from table forms. It is redundant to redirecturl.

ThorstenA 05-13-2010 09:58 PM

Some suggestions for coding:
  • Put code that is used throughout all actions (do=whatever) on top of each plugin. Example:
    Code:

    $fid = $vbulletin->input->clean_gpc('p', 'fid', TYPE_UINT);
    or, have each action its own plugin
  • I'd love to have the program creating a database table for each form. That would be very great. You then can make a review type out of it just with adding a database key so that there can only be one entry for one userid. Querying this data would be far more easy, though.

ThorstenA 05-13-2010 10:02 PM

Security issue. A user may delete other users results by entering their formresults id.

In plugin Easy Forms Part 2 replace
Code:

if ($_REQUEST['do'] == 'deleteformresult')
{
    $caneditform = unserialize($vbulletin->options['caneditform']);
    if ($caneditform && !is_member_of($vbulletin->userinfo, $caneditform))
    {
        print_no_permission();
    }
    $id = $vbulletin->input->clean_gpc('g', 'id', TYPE_UINT);
    $fid = $vbulletin->input->clean_gpc('g', 'fid', TYPE_UINT);
    $db->query_write("DELETE FROM " . TABLE_PREFIX . "formresults WHERE id=$id");

to
Code:

if ($_REQUEST['do'] == 'deleteformresult')
{
    $caneditform = unserialize($vbulletin->options['caneditform']);
    if ($caneditform && !is_member_of($vbulletin->userinfo, $caneditform))
    {
        print_no_permission();
    }
    $id = $vbulletin->input->clean_gpc('g', 'id', TYPE_UINT);
    $db->query_write("DELETE FROM " . TABLE_PREFIX . "formresults WHERE id=$id and userid=" . $vbulletin->userinfo[userid] . "");

The $fid seems to be not needed and therefore does not need to be included in the url.

riskofficer 05-14-2010 04:22 AM

Quote:

Originally Posted by ThorstenA (Post 2036517)
Bug: Poll displays free text entries

I think solution could be as I already wrote (it is more flexible than hardcoded question types restrictions):
Quote:

Originally Posted by riskofficer (Post 2030249)
I don't use "Forum Result Poll" but may be this suggestion will be interesting: not pre-given text answers can't be "pollable", for example, when you ask users -- "what do you think about my mod" -- it can be one million different answers and in Poll Results they will show nothing interesting. But when you ask -- "how many times you have been to USA" for example, -- answers can repeat from one to another, and in Poll Results you can see interesting graphs. When you ask something and answers pre-given in check boxes, for example, Poll Results will be greate. That is why check box near question in Edit Form about Pollable or not question will be greate idea, as I think.

Sorry my English.

Like we already have checkbox about required this question or not.

riskofficer 05-14-2010 07:38 PM

1 Attachment(s)
I have prepared some suggestions about Form's "first page". May be they could be interesting (see attached picture).

riskofficer 05-15-2010 05:13 PM

1 Attachment(s)
Edit Bug (please see attached picture)

bananalive 05-16-2010 01:17 PM

Quote:

Originally Posted by riskofficer (Post 2037466)
Edit Bug (please see attached picture)

Fixed in v4.1.1

bananalive 05-16-2010 01:19 PM

Quote:

Originally Posted by ThorstenA (Post 2036517)
Bug: Poll displays free text entries

In v4.1.1 added option to hide question types

bananalive 05-16-2010 01:20 PM

Quote:

Originally Posted by ThorstenA (Post 2036458)
Bugs:
  1. I can not edit my own entry if the maximum number of entries is limited to one.

fixed in v4.1.1

bananalive 05-16-2010 01:21 PM

Quote:

Originally Posted by XLCR GODFATHER (Post 2036402)
I fully agree where leaving the delete option available makes it too easy for accidental click and should be a permission setting.

Fixed in v4.1.1
Added javascript popup to confirm the user wants to delete form result. Also added extras permissions for form results.

bananalive 05-16-2010 01:22 PM

Quote:

Originally Posted by riskofficer (Post 2036339)
Thank you! One more thing about edit is something like "Usergroups Allowed to Edit Form Results". For example I'd like to leave this option (Edit Result) only for person whos answered (starter) and admins/moderators. BTW the option to delete results is in need of permissions too, I haven't found them.

Added in v4.1.1


All times are GMT. The time now is 10:13 PM.

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.02309 seconds
  • Memory Usage 1,887KB
  • 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
  • (19)bbcode_code_printable
  • (1)bbcode_php_printable
  • (22)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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