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)

bananalive 03-07-2009 01:50 PM

Quote:

Originally Posted by dknelson (Post 1762470)
As you can see, it is posting the threadID for location instead of the actual state. I am not using custom output. Is the only way to correct this to use custom output with $qo

Not that i can think of.

$qo won't work as it's custom question.

You could use custom output and some extra code in form hook before submit to do it. 9you would use $state in custom output)

Form hook: before submit
PHP Code:

$threadinfo fetch_threadinfo($q[8]);
$state $threadinfo[title]; 

Replacing 8 with appropriate question hash

Edit: this won't work the hook is after the form output is done.

nascartr 03-07-2009 02:19 PM

I don't suppose there's anyway to embed this into a post is there? I always post a topic for my fantasy game each week with the link to vote but it's be nice to have the form inside of the post so a user wouldn't have to click twice.

I have a link in the navbar to the form so it's no big deal but thought it'd be neat to be able to embed in somehow into a post.

I'm sure I can do it with iframes but the my header would take up a bit of space in the frame.

bananalive 03-07-2009 02:29 PM

Quote:

Originally Posted by nascartr (Post 1762511)
I don't suppose there's anyway to embed this into a post is there? I always post a topic for my fantasy game each week with the link to vote but it's be nice to have the form inside of the post so a user wouldn't have to click twice.

I have a link in the navbar to the form so it's no big deal but thought it'd be neat to be able to embed in somehow into a post.

I'm sure I can do it with iframes but the my header would take up a bit of space in the frame.

no.

dknelson 03-07-2009 02:36 PM

Quote:

Originally Posted by bananalive (Post 1762491)
Not that i can think of.

$qo won't work as it's custom question.

You could use custom output and some extra code in form hook before submit to do it. 9you would use $state in custom output)

Form hook: before submit
PHP Code:

$threadinfo fetch_threadinfo($q[8]);
$state $threadinfo[title]; 

Replacing 8 with appropriate question hash

Edit: this won't work the hook is after the form output is done.

OK...thanks. No big deal, I'll figure out another way to work around it or just create a custom output and not even output that answer. It will be in the states thread anyway so that should be obvious. Thanks for all your help on this. I think this is about the best supported mod I have ever seen here. Nominating for MOTM.

dknelson 03-07-2009 05:52 PM

OK...I started trying to get the URLs to post as live links. Here is my custom output:

Quote:

$qn[599] $q[599]
$qn[600] $q[600]
$qn[601] $q[601]
$qn[603] <if condition"$q[603]">$q[603]</if>
$qn[604] $qo[604]
$qn[605] $qo[605]
$qn[788] $qo[788]
$qn[607] $q[607]
$qn[789] $qo[789]
$qn[609] $q[609]
The posted result though shows the entire conditional instead of just the URL.

bananalive 03-07-2009 08:35 PM

Quote:

Originally Posted by dknelson (Post 1762652)
OK...I started trying to get the URLs to post as live links. Here is my custom output:



The posted result though shows the entire conditional instead of just the URL.

Can you post the custom output in [php] https://vborg.vbsupport.ru/external/2009/03/39.gif tags so that I can see the unparsed code

hobbybox 03-07-2009 09:34 PM

REgular users form posts are going into moderation Que - I have checked this thread and I have made sure that 'follow Moderation: YES' and the forum the posts are going into are allowed for that so im not sure what the problem can be....any help

cookiepants 03-08-2009 02:20 AM

Thanks so much for this mod! I've looked through as much as I can but can't find an answer to my question.

I installed this mod, then made sure admins could edit the forms. I point here:
/misc.php?do=forms

I can see everything except where it says "questions" there is nothing -- no box for code, nothing. Just the word "questions" and a save button.

Any help is appreciated.

Megan

cookiepants 03-08-2009 02:35 AM

Never mind. I just saw the drop down field. Easier than I expected!!! THANK you so much!!!

Nutmeg

cookiepants 03-08-2009 05:19 AM

Here's a real question. I'd like to remove the "POLL:" text in the title of the forum where the forms are posted. Is that possible?

I'd also like to automatically close the threads posted using the forms, as soon as they submit the form, is that possible?

Thanks so much!

Nutmeg

bananalive 03-08-2009 06:50 PM

1 Attachment(s)
Quote:

Originally Posted by cookiepants (Post 1763012)
Here's a real question. I'd like to remove the "POLL:" text in the title of the forum where the forms are posted. Is that possible?

I'd also like to automatically close the threads posted using the forms, as soon as they submit the form, is that possible?

Thanks so much!

Nutmeg

'Poll:' is from vbulletin as thread is a poll.

Import attached file and add to form hook: before submit

PHP Code:

$closed true


bananalive 03-08-2009 06:51 PM

1 Attachment(s)
Quote:

Originally Posted by hobbybox (Post 1762789)
REgular users form posts are going into moderation Que - I have checked this thread and I have made sure that 'follow Moderation: YES' and the forum the posts are going into are allowed for that so im not sure what the problem can be....any help

Try attached file

cookiepants 03-08-2009 07:11 PM

Quote:

Originally Posted by bananalive (Post 1763376)
'Poll:' is from vbulletin as thread is a poll.

Import attached file and add to form hook: before submit

PHP Code:

$closed true


Wow thanks!

I think this is my favorite mod ever. Thank you so much!

Vitaly 03-08-2009 08:07 PM

I'm in process of creating forms and collecting a long list of notices :)

For now, 3 small qwestions:

1. How to define date field value in template? My template looks like this:
---------
Пользователь: {username}
URL: http://forum.dev.rcdesign.ru/member.php?u={userid}

$qn[5]: $q[5]
$qn[6]: $q[6]
$qn[7]: $q[7]
$qn[8]: $q[8]
---------

All other fields are ok, but date returns "Array" instead. Tryed this one "$q[8][day].$q[8][month].$q[8][year]" - doesn't help too. Form is used to send email.

2. How to get user email for registered users? Didn't found variable.

3. Which $ variable to use instead of {username} and {userid}?

bananalive 03-08-2009 08:30 PM

Quote:

Originally Posted by Vitaly (Post 1763436)
I'm in process of creating forms and collecting a long list of notices :)

For now, 3 small qwestions:

1. How to define date field value in template? My template looks like this:
---------
Пользователь: {username}
URL: http://forum.dev.rcdesign.ru/member.php?u={userid}

$qn[5]: $q[5]
$qn[6]: $q[6]
$qn[7]: $q[7]
$qn[8]: $q[8]
---------

All other fields are ok, but date returns "Array" instead. Tryed this one "$q[8][day].$q[8][month].$q[8][year]" - doesn't help too. Form is used to send email.

2. How to get user email for registered users? Didn't found variable.

3. Which $ variable to use instead of {username} and {userid}?

1. $qo[8]
2. {email}
3. either {username}, {userid} or $thisuser[username], $thisuser[userid]

Vitaly 03-08-2009 08:37 PM

Thanks.

What's the difference between $q[x] and $qo[x]? Is there any logic, or "qo" is reserved for date?

ahmedipa 03-08-2009 08:45 PM

thank you so much

bananalive 03-08-2009 08:53 PM

Quote:

Originally Posted by Vitaly (Post 1763457)
Thanks.

What's the difference between $q[x] and $qo[x]? Is there any logic, or "qo" is reserved for date?

$q is how it is submitted, ie. as an array for date or as a number for dropdown select, whilst $qo is output or the text, ie. imploded date array, number converted into text, etc.

Vitaly 03-08-2009 09:21 PM

Ah... thanks... now i see, that have to use $qo[x] in template for safety.

One more problem with Date field. Got email with value, but it looks like this:

1[crap]13[crap]1976

"& #92 ;" - HTML code. It was instead of \

PS. If that's a bug, but not my mistake, please wait a couple of days, until i make complete buglist

skYfIrE 03-08-2009 09:34 PM

Thanks for the mod :)

Darkne55 03-09-2009 12:31 AM

Hello bananalive,

I've already asked, so if you answered and I missed it I apologize. I was wondering, would it be possible when someone fills out a form and submits it to have the program place that person into a different user group?

Love your mod,

Darkne55

Vitaly 03-09-2009 08:08 AM

I'd like to use main forms page as general place of feedback.

Forms are grouped by categories. It there now a proper way to define categories order? I've found ordering only for forms, but not categories.

J3rico 03-09-2009 01:33 PM

Hi, thanks for this great mod !!
I'm sorry for my noob level, but, where i can find the Form Hook: Form Start: for limit access to users who have at least 10 posts?
thanks in advance

bananalive 03-09-2009 01:45 PM

Quote:

Originally Posted by J3rico (Post 1764001)
Hi, thanks for this great mod !!
I'm sorry for my noob level, but, where i can find the Form Hook: Form Start: for limit access to users who have at least 10 posts?
thanks in advance

'Edit Form'

bananalive 03-09-2009 01:46 PM

Quote:

Originally Posted by Vitaly (Post 1763843)
I'd like to use main forms page as general place of feedback.

Forms are grouped by categories. It there now a proper way to define categories order? I've found ordering only for forms, but not categories.

Nope.

J3rico 03-09-2009 02:02 PM

Quote:

Originally Posted by bananalive (Post 1764010)
'Edit Form'

many thank's, i had not seen :up: .

bananalive 03-09-2009 02:02 PM

Quote:

Originally Posted by Darkne55 (Post 1763613)
Hello bananalive,

I've already asked, so if you answered and I missed it I apologize. I was wondering, would it be possible when someone fills out a form and submits it to have the program place that person into a different user group?

Love your mod,

Darkne55

I'm reluctant to post this code, all I can say is be very very careful.

Form Hook: Before Submit

PHP Code:

if ($complete
{
$userinfo $vbulletin->userinfo;
$user['usergroupid'] = 4;
if (empty(
$user['usergroupid']))
{
$user['usergroupid'] = 2// sanity check
}

$getusergroupid iif($userinfo['displaygroupid'] != $userinfo['usergroupid'], $userinfo['displaygroupid'], $user['usergroupid']);

$user_usergroup =& $vbulletin->usergroupcache["$user[usergroupid]"];
$display_usergroup =& $vbulletin->usergroupcache["$getusergroupid"];

// init user data manager
$userdata =& datamanager_init('User'$vbulletinERRTYPE_STANDARD);
$userdata->set_existing($userinfo);
$userdata->set('usergroupid'$user['usergroupid']);
$userdata->set_usertitle(
$user['customtitle'] ? $user['usertitle'] : '',
false,
$display_usergroup,
(
$user_usergroup['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canusecustomtitle']) ? true false,
(
$user_usergroup['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cancontrolpanel']) ? true false
);

require_once(
DIR '/includes/functions_ranks.php');
if (
$user['userid'] == $vbulletin->userinfo['userid'])
{
$vbulletin->userinfo['usergroupid'] = $user['usergroupid'];
$vbulletin->userinfo['displaygroupid'] = $user['usergroupid'];
}

$userdata->save();




bananalive 03-09-2009 02:06 PM

Quote:

Originally Posted by Vitaly (Post 1763493)
Ah... thanks... now i see, that have to use $qo[x] in template for safety.

One more problem with Date field. Got email with value, but it looks like this:

1[crap]13[crap]1976

"& #92 ;" - HTML code. It was instead of \

PS. If that's a bug, but not my mistake, please wait a couple of days, until i make complete buglist

Have you tried just putting '\' in the box. It seems to work for me.

Vitaly 03-09-2009 03:31 PM

Tryed this template:

----------
Пользователь: $thisuser[username]
URL: http://forum.dev.rcdesign.ru/member.php?u=$thisuser[userid]
email: $thisuser[email]

$qn[5]: $qo[5]
$qn[6]: $qo[6]
$qn[7]: $qo[7]
$qn[8]: $qo[8] (Месяц.День.Год) \\\\\
----------

1. Preview (HTML) is ok
2. In email (text) last \\\\\ are ok, but date separator is in HTML format, not correct. In my email program i see "& # 92;"

PS. By the way, it's better to use date format string from VB options (not from language one). That will solve problem for european format (day first, then months, then year)

dazed12 03-09-2009 04:17 PM

is anyone else's forms being moderated when posted as a thread to forum? id really like to have it where it does not moderate apps. members are starting to copy and paste info from posted app and make an additional thread so it is not moderated at that time.

any fix to form?

Vitaly 03-09-2009 04:59 PM

For some form, i need to implement such functionality:

1. Add 1 UINT parameter to form URL, when form is addressed
2. Disable form, if no parameter given
3. Send whis parameter in custom template via email (it will bу used to compose URL, such as "baselink/xxx/"."parameter")

That should be hidden from user interface.

What's the proper way to do that?

Vitaly 03-09-2009 06:32 PM

Almost finished testing Easy-Forms as "feedback system". Here is list of comments, applyed to such use-case.

1. No option to "disable preview button".

Preview is good for forum posts, but very bad for feedback emails. User should not see, if additional information generated.

Possible solution - one more form option.

2. "Add field" has only basic fields set.

Almost any field have to be edited twice. Once - created. Second - to edit additional parameters.

Not critical. Just unconvenient.

3. Date separator is sent as HTML code in text emails

And date format is hardcoded. It's better to use format string from VB options (not from language preferences).

4. Form description is not "templateable" (no conditions, no variables)

Not convenient, when you wish to automatically generate helper lins, for example, based on user id, and so on.

It would be good to have the same power there, as in form template. With the same variables, just without questions.

(*) Don't know, if the same needed for field descriptions. For now - not, in my case.

5. Additional Notice would be sweet for page with forms list.

(shown as standard VB notice at the top)

Possible solution - one more product setting.

6. When form is hidden from list, it's good to hide "Forms" link from navbar path.

Imagine, that you have multiple forms, used for contacts, forum posts and so on. When user fill "hidden" form for forum post, he will see link to contacts page (forms list) in navbar. That's confusing.

Dont's know, what is better:

- separate option
- hide if form is not listed
- hide if preview button disabled

7. When user fill form, navbar shows text "Viewing form: FormName"

"Viewing form:" - absulutely unnecesary and confusing. Looks like strange debug message.

8. I'd show asterisks (*) for compulsory question with red color.

Can do so with template edit, but think, that would be useful for all as general template.

9. Email has wrong return-path.

If someone write me email via contacts (forms list) page, I expect reply back, but not to forum administrator's email :)

Possible solution:

- add "email" field and use it automatically in return-path, if filled. Also automatic check can be done, that email conforms to standard.
- if no such field used (or empty) - try to take from member profile

- can be done by hooks, but not convenient (and i don't know how now :) )

10. Captcha takes the whole row and have unnecessary border (group separator with name)

Is is possible to

- move captcha to right column, as other fields
- remove border
?

=================================================

More general things:

1. Form IDs and fields IDs are absolute and fixed.

That can cause huge problems, if you wish to export form to another site. If those IDs are already reserver to another form, information can be destroyed.

Possible solution:
- address form by text tag.
- numerate field in form namespace and allow duplicated field IDs, if those used for different forms.
- It would be also good to call form not by id, but by tag (as option). For example: misc.php?do=form&ftag=myformname

2. Mass import/export

It's normal practice to develop forms on debug site and then setup those on production. Function "export all" and "import all" would be convenient. At least for backups.

====================================

That's all for interface. Will review code a bit later.

alduren 03-10-2009 04:30 PM

I have various post icons in my forum.

It´s possible to select the post icon that you want to show in your new thread before form submitted??

bananalive 03-10-2009 04:48 PM

1 Attachment(s)
Quote:

Originally Posted by alduren (Post 1765024)
I have various post icons in my forum.

It?s possible to select the post icon that you want to show in your new thread before form submitted??

  1. Import attached file
  2. add following to Form Hook: Before Submit
    PHP Code:

    $iconid 3

    where 3 is the post icon id

bananalive 03-10-2009 05:13 PM

1 Attachment(s)
Quote:

Originally Posted by Vitaly (Post 1764189)
For some form, i need to implement such functionality:

1. Add 1 UINT parameter to form URL, when form is addressed
2. Disable form, if no parameter given
3. Send whis parameter in custom template via email (it will bу used to compose URL, such as "baselink/xxx/"."parameter")

That should be hidden from user interface.

What's the proper way to do that?

Import attached file.

form Hook: Form start
PHP Code:

$hiddenfield1 $vbulletin->input->clean_gpc('g''param'TYPE_UINT);
if (empty(
$hiddenfield1))
    {
        
$errormessage "Error, this form needs a parameter.";
           eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");');
    } 

form Hook: Before Submit
PHP Code:

$hiddenfield1 $vbulletin->input->clean_gpc('p''hiddenfield1'TYPE_UINT);
$formoutput str_replace('{param}'"$hiddenfield1"$formoutput); 

Then you can use {param} in custom output.

Vitaly 03-10-2009 06:36 PM

Quote:

Originally Posted by bananalive (Post 1765050)
...Then you can use {param} in custom output.

Thanks for details.

alduren 03-10-2009 10:22 PM

Quote:

Originally Posted by bananalive (Post 1765034)
  1. Import attached file
  2. add following to Form Hook: Before Submit
    PHP Code:

    $iconid 3

    where 3 is the post icon id

Worked like a charm. Thanks again!!!

Trek 03-10-2009 10:29 PM

Ok, I'm finally redoing my old form and I have to say... this really is easy! Nice work!

I've found one bug though (no idea if it's been reported already or not, too much to sort through in this thread.)

Anyway, if you don't end your form question with a ? it will automatically add a : to the end of your sentence, even if you don't want it. ;) Not a big deal, but a little annoying to assume what I want. ;)

Anyway, excellent work!

SnowBot 03-11-2009 04:21 AM

Hi

Great Mod

Have you got any example .xml form files so that people can see all the features?

lazyseller 03-11-2009 05:01 AM

It be nice if someone could come up with some a form pack. Im not volunteering!


All times are GMT. The time now is 07:58 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.02044 seconds
  • Memory Usage 1,888KB
  • 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
  • (9)bbcode_php_printable
  • (19)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