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)

bananalive 04-01-2011 11:12 AM

1 Attachment(s)
Quote:

Originally Posted by wolfey (Post 2179366)
I am trying to post a form that will allow me to collect inventory information

I was trying to use the grid option, that looked like the only one to get mutliple model#'s and qty.

I used the Columns for qty and the rows for the models
1 problem is..it looks like you can only have 10 rows, because the results duplicate from the first 10, if you only answer 10 or less and dont display if you enter more.

would this be the best type of question for collecting this info?
If so I would like to only display the models or columns with answers

There is an error in the code (a missing underscore), fixed in attached product file, so you can have as many rows as you want for grids now.

bananalive 04-01-2011 11:26 AM

Quote:

Originally Posted by ScratchMang (Post 2179544)
I'm with Ixian,

Fantastic addon Indeed!

I'm no coder by any means, I fumble my way around pre-existing stuff and can edit as per directions when required, and would love to see the ability to take the info submitted on a form and place it into a calendar event.

Any chance of getting it added in as a feature, or possibly a bit more explanation (Or a sample snippit) of just how to get information from a form into a calendar event?

ScratchMang

Possibly in future it will be added.

To create calendar events you would have to use vbulletin calendar datamanager and easy form hooks.

bananalive 04-01-2011 01:19 PM

Quote:

Originally Posted by hoochblues (Post 2179151)
Any suggestions on how I might create a field on the form that is a dropdown list of users on the forum?

Or even better, a box in which to enter usernames similar to that in Tournaments & Ladders? Where they are validated against the user base?

I wouldn't suggest a dropdown list as it would be very big.

Create a custom question, with the following php code:

PHP Code:

$answer '<script type="text/javascript" src="clientscript/vbulletin_ajax_suggest.js?v={vb:raw vboptions.simpleversion}"></script>'."\r\n";
$answer .= '    <script type="text/javascript"><!--'."\r\n";
$answer .= '        function setAjax()';
$answer .= '        {';
$answer .= '            if (document.getElementById(\'userfield\'))';
$answer .= '            {';
$answer .= '                snc = new vB_AJAX_NameSuggest(\'snc\', \'userfield_txt\', \'userfield\');';
$answer .= '                snc.allow_multiple = false;';
$answer .= '            }';
$answer .= '        }'."\r\n";
$answer .= '    --></script>'."\r\n";
$answer .= '<div id="userfield" class="popupmenu nomouseover noclick nohovermenu">                    <input class="primary full textbox popupctrl" name="'.$formbit['id'].'" id="userfield_txt" tabindex="1" autocomplete="off" value="'.$formbit['value'].'" />                </div>'

Then: Edit Form -> Form PHP Hooks -> Form Hook: Form Start:

PHP Code:

$vbulletin->templatecache['shell_blank'] = str_replace('<body>','<body  onload="setAjax()">'$vbulletin->templatecache['shell_blank']); 


bananalive 04-01-2011 01:21 PM

Quote:

Originally Posted by kinhell (Post 2178828)
Really good mod.

Is there a way to link to just 1 form I have created and not show all the menu items above it etc? just call the form into a page I have for recruitment?

Disable access to 'Forms List' in vBulletin Options for non-administrators and that is all they will see in navbar.

bananalive 04-01-2011 01:23 PM

Quote:

Originally Posted by ascroft (Post 2177769)
Hi

Yes I have that in the form hook - well 'prefix' at the end as that is the way the reference is set up in the custom question. All forums that will be in the array use the same set of thread prefixes. Its more the forum it gets submitted to is the issue - or is that refreshed by the threadids being forced to refresh? (even though in this case they look the same to the user) If the user has to click preview to refresh this, is there a way to force them to preview?

The form in question can be triggered from http://www.shackchat.co.nz/listings/...?53-PW_Dunedin - user TEST997 spider if this helped at all. (even though I might select PW_Lower Hutt City it gets posted to PW_Dunedin - which is the default forum in the form body itself)

Thank you.

Have you got added any plugins in the AdminCP using any of the Easy Forms hooks, they may be causing a conflict.

If you make prefix compulsory then it should only accept valid prefixes and won't submit with an incorrect prefix.

ascroft 04-02-2011 06:37 PM

Hi there - to launch the form from the correct forums I have a plugin that uses:

if (in_array($forumid, array(53,65)))
{
header( 'Location:/listings/misc.php?do=form&fid=8' ) ;

}


These are the same forums as the code in the custom question is using in the form itself i.e.

$answer = "<select name=\"$formbit[id]\" id=\"q_" . $formbit[id] . "\">";
foreach ($vbulletin->forumcache AS $forumid => $forum)
{
if (!in_array($forumid, array(53,65)))
{
continue;
}
if ($qo['forumid']==$forumid)
{
$forum['selected'] = ' selected="selected"';
}
$answer .= "<option value=\"$forumid\"$forum[selected]>$forum[title]</option>";
}
$answer .= "</select>";



Quote:

Originally Posted by bananalive (Post 2179763)
Have you got added any plugins in the AdminCP using any of the Easy Forms hooks, they may be causing a conflict.

If you make prefix compulsory then it should only accept valid prefixes and won't submit with an incorrect prefix.


Za4a Tuner 04-03-2011 08:29 AM

Hello to evryone,
does anyone have a german translation of this mod?

I installed this mod in my testforum ... and would likly use it in the liveboard.

Toto03411 04-03-2011 03:41 PM

I have a question about installation, when you say to upload the files to the forum root, you do mean the main folder where all the other folders (images, includes, archive, ect) are? That won't replace my current folders, right? Sorry for the probably obvious question, I'm pretty new to mods and want to make sure I don't loose my other files :)

Za4a Tuner 04-03-2011 05:02 PM

Quote:

Originally Posted by Toto03411 (Post 2180440)
I have a question about installation, when you say to upload the files to the forum root, you do mean the main folder where all the other folders (images, includes, archive, ect) are?

correct!
Quote:

Originally Posted by Toto03411 (Post 2180440)
That won't replace my current folders, right?

no, if there are two same named files, your ftp-client should ask you what to do.
Take the folder "includes" and upload it to the "forum-root" -> all the files will put into the "includes-folder" on your server

Toto03411 04-04-2011 01:34 PM

Thanks so much :) Installed and working great, exactly what I needed! Perchance is there a way to change the name of the forms tab? So instead of saying 'Forms' it says something else?

Za4a Tuner 04-04-2011 07:09 PM

Go to your acp and Search for the phrase "form" and change it to what you would have to

woffie 04-05-2011 09:56 AM

Any idea when the IE issue is going to be resolved?

Za4a Tuner 04-05-2011 08:58 PM

Hello bananalive,
at first many thanks for this great AddOn!

I translatet it into german (language-file), but there are some hardcoded textareas. Will you clean this up to "full phrased"? This would be really great!
If it's ok for you, i would help to do this (create phrases und insert them into the addon instead of hardcoded text).

kr Chris

StonePilot 04-06-2011 05:44 PM

I must be missing something, I just installed with 4.1.2 and i don't have a clue where to go to create a new form. It's just a blank page at misc.php?do=form on my site. I assume permissions issue or maybe something with the custom template?

can I get the direct url to create a form perhaps?

secretphotonerd 04-06-2011 06:05 PM

I tried installing this on version 4.1.0 and it causes major problems with the template. I have this installed on another forum (4.0.5) and it runs just fine, so I don't believe that it is user error. Am I missing something else?

Za4a Tuner 04-06-2011 07:11 PM

Quote:

Originally Posted by StonePilot (Post 2181598)
It's just a blank page at misc.php?do=form on my site. I

try
http://www.your-domain.com/misc.php?do=forms

Kr Chris

Kenjiwing 04-07-2011 11:57 AM

I need to switch my forums to a new host.. Im going to rebuild the forums there because Im having issues..

Is there anyway to export a form or do I need to rebuild it?

bananalive 04-07-2011 02:20 PM

Quote:

Originally Posted by ascroft (Post 2180183)
Hi there - to launch the form from the correct forums I have a plugin that uses:

if (in_array($forumid, array(53,65)))
{
header( 'Location:/listings/misc.php?do=form&fid=8' ) ;

}


These are the same forums as the code in the custom question is using in the form itself i.e.

$answer = "<select name=\"$formbit[id]\" id=\"q_" . $formbit[id] . "\">";
foreach ($vbulletin->forumcache AS $forumid => $forum)
{
if (!in_array($forumid, array(53,65)))
{
continue;
}
if ($qo['forumid']==$forumid)
{
$forum['selected'] = ' selected="selected"';
}
$answer .= "<option value=\"$forumid\"$forum[selected]>$forum[title]</option>";
}
$answer .= "</select>";

Try creating a copy of the form, and test that - just to double check that there isn't something happening with tthis fid.

bananalive 04-07-2011 02:22 PM

Quote:

Originally Posted by Kenjiwing (Post 2181939)
I need to switch my forums to a new host.. Im going to rebuild the forums there because Im having issues..

Is there anyway to export a form or do I need to rebuild it?

Yes, there is a link to export each form, on the forms list.

The form results will not be copied across.

bananalive 04-07-2011 02:27 PM

Quote:

Originally Posted by secretphotonerd (Post 2181603)
I tried installing this on version 4.1.0 and it causes major problems with the template. I have this installed on another forum (4.0.5) and it runs just fine, so I don't believe that it is user error. Am I missing something else?

It works fine for me on vB v4.1.x - what template is not displaying properly? Or do you have a screenshot?

bananalive 04-07-2011 02:32 PM

Quote:

Originally Posted by woffie (Post 2181052)
Any idea when the IE issue is going to be resolved?

I'm not sure how to fix the problem, it works for all other browsers - I can only suggest using a browser other than IE.

hoochblues 04-07-2011 05:58 PM

Quote:

Originally Posted by bananalive (Post 2179759)
I wouldn't suggest a dropdown list as it would be very big.

Create a custom question, with the following php code:

PHP Code:

$answer '<script type="text/javascript" src="clientscript/vbulletin_ajax_suggest.js?v={vb:raw vboptions.simpleversion}"></script>'."\r\n";
$answer .= '    <script type="text/javascript"><!--'."\r\n";
$answer .= '        function setAjax()';
$answer .= '        {';
$answer .= '            if (document.getElementById(\'userfield\'))';
$answer .= '            {';
$answer .= '                snc = new vB_AJAX_NameSuggest(\'snc\', \'userfield_txt\', \'userfield\');';
$answer .= '                snc.allow_multiple = false;';
$answer .= '            }';
$answer .= '        }'."\r\n";
$answer .= '    --></script>'."\r\n";
$answer .= '<div id="userfield" class="popupmenu nomouseover noclick nohovermenu">                    <input class="primary full textbox popupctrl" name="'.$formbit['id'].'" id="userfield_txt" tabindex="1" autocomplete="off" value="'.$formbit['value'].'" />                </div>'

Then: Edit Form -> Form PHP Hooks -> Form Hook: Form Start:

PHP Code:

$vbulletin->templatecache['shell_blank'] = str_replace('<body>','<body  onload="setAjax()">'$vbulletin->templatecache['shell_blank']); 


This looks pretty good. The only problem I found was it allows me to enter the name of a user that doesn't exist. But I think it is almot there.

Za4a Tuner 04-07-2011 08:15 PM

1 Attachment(s)
Hello,
i get some problems with grid-questions!

If i create a grid-question, the output doesn't work, if a individuell output-style is used!
I'll attach three screenshots to show what i mean.

screen 1: Settings Output-Styling
screen 2: Preview of the grid )submitting would cause the same "array"-effect
screen 3: Preview with a standard outputstyling

vB-version: 4.1.2 Suite
php-version: 5.3.5
mysql: 5.1.51
easyform: 4.2.6

ascroft 04-08-2011 08:08 AM

Hi there - tried that.

I removed the variables for the form (as they don't change when you copy) - anyway this shows the forum ID of what I selected in the drop down but it posted in to the default forum. (65 is the ID of the other forum) Its like it doesn't actually update it prior to submission.

Property Wanted - Dunedin - Copy

Property Wanted - Dunedin - Copy
What are you seeking?

Test001

What location are you interested in?

65

Please select the property category

W9025

Seeking contact from

Real Estate Agents
Private Owners

Particular suburb being sought (if any)

-

Style of property wanted

Bungalow

Construction preferred

Brick

How old can the property be

-

No. of bedrooms wanted

Two

No. of living rooms wanted

Two

No. of bathrooms wanted

Two

Other Features being sought

Garage/Off Street Parking
Near public transport
Heat pump or similar
Fully insulated

Looking to rentHave references available

-

Other details if looking to rent

-

Looking to buyApprox. $ you are looking to spend

-

Other commentsOther comments on the property wanted

-

Add any attachments

Quote:

Originally Posted by bananalive (Post 2181984)
Try creating a copy of the form, and test that - just to double check that there isn't something happening with tthis fid.


bananalive 04-08-2011 09:59 AM

Quote:

Originally Posted by ascroft (Post 2182232)
Hi there - tried that.

I removed the variables for the form (as they don't change when you copy) - anyway this shows the forum ID of what I selected in the drop down but it posted in to the default forum. (65 is the ID of the other forum) Its like it doesn't actually update it prior to submission.

...

Try this...

AdminCP -> Plugins & Products -> Add New Plugin

Hook Location
Code:

newthread_post_complete
Title
Code:

Move Thread created by easy forms
PHP Code
PHP Code:

if ($fid == 43)
{
$forumid $q['forumid'];
$dataman =& datamanager_init('Thread'$vbulletinERRTYPE_ARRAY'threadpost'); 
$dataman->set_existing($threadinfo);  
$dataman->setr('forumid'$forumid);  
$dataman->pre_save(); 
if (
count($dataman->errors) > 0

    foreach (
$errors as $error)
    {
        
$errorss .= $error"<br />";
    }
    
$errormessage "Form failed to submit. The following error(s) occured: <br /> ".$errorss;
    eval(
standard_error($errormessage));

else 

$dataman->save();  
$foruminfo fetch_foruminfo($forumid);
$threadinfo fetch_threadinfo($newpost['threadid']);
mark_thread_read($threadinfo$foruminfo$vbulletin->userinfo['userid'], TIMENOW);    
}


Plugin is active
Code:

Yes

Change 43 to appropriate form id.

bananalive 04-08-2011 10:05 AM

Quote:

Originally Posted by Za4a Tuner (Post 2182082)
Hello,
i get some problems with grid-questions!

If i create a grid-question, the output doesn't work, if a individuell output-style is used!
I'll attach three screenshots to show what i mean.

screen 1: Settings Output-Styling
screen 2: Preview of the grid )submitting would cause the same "array"-effect
screen 3: Preview with a standard outputstyling

vB-version: 4.1.2 Suite
php-version: 5.3.5
mysql: 5.1.51
easyform: 4.2.6

I'll have a look into this...

bananalive 04-08-2011 10:15 AM

Quote:

Originally Posted by hoochblues (Post 2182043)
This looks pretty good. The only problem I found was it allows me to enter the name of a user that doesn't exist. But I think it is almot there.

For the username check...

Form Hook: Before Submit:
PHP Code:

$checkuser $vbulletin->db->query_first("SELECT userid FROM " TABLE_PREFIX "user WHERE username = '".$vbulletin->db->escape_string($q['username'])."' ");
if (!
$checkuser['userid']&&$q['username'])
{
$preview true;
$complete false;
$inputerror[344] = '<font color="red">Invalid Username</font>';
$incompleteqs[] = $qn['username'];


Change 344 to the question hash

and make sure the Username Suggest question has Reference Name of:
Code:

username

Za4a Tuner 04-08-2011 12:55 PM

i figured out a nother problem with the grid-questions:
If i use a comma for a "item", i'll brake the line and put all the text after the comma as a new "radiobutton"

e.g.:
when the text for the "Grid Rows" (4 rows) is like:
ok
yes
maybe
no, but next year


the question will shown as 5 rows:
ok
yes
maybe
no
but next year

ascroft 04-08-2011 08:35 PM

Thank you very much. Nice solution. All good now. I can now finalise my other bits and pieces on the site and get ready to launch. :-)

Mark

QUOTE=bananalive;2182257]Try this...

AdminCP -> Plugins & Products -> Add New Plugin

Hook Location
Code:

newthread_post_complete
Title
Code:

Move Thread created by easy forms
PHP Code
PHP Code:

if ($fid == 43)
{
$forumid $q['forumid'];
$dataman =& datamanager_init('Thread'$vbulletinERRTYPE_ARRAY'threadpost'); 
$dataman->set_existing($threadinfo);  
$dataman->setr('forumid'$forumid);  
$dataman->pre_save(); 
if (
count($dataman->errors) > 0

    foreach (
$errors as $error)
    {
        
$errorss .= $error"<br />";
    }
    
$errormessage "Form failed to submit. The following error(s) occured: <br /> ".$errorss;
    eval(
standard_error($errormessage));

else 

$dataman->save();  
$foruminfo fetch_foruminfo($forumid);
$threadinfo fetch_threadinfo($newpost['threadid']);
mark_thread_read($threadinfo$foruminfo$vbulletin->userinfo['userid'], TIMENOW);    
}


Plugin is active
Code:

Yes

Change 43 to appropriate form id.[/QUOTE]

bananalive 04-09-2011 10:44 AM

1 Attachment(s)
Quote:

Originally Posted by Za4a Tuner (Post 2182297)
i figured out a nother problem with the grid-questions:
If i use a comma for a "item", i'll brake the line and put all the text after the comma as a new "radiobutton"

e.g.:
when the text for the "Grid Rows" (4 rows) is like:
ok
yes
maybe
no, but next year


the question will shown as 5 rows:
ok
yes
maybe
no
but next year

Fixed in attached file

bananalive 04-09-2011 10:48 AM

Quote:

Originally Posted by Za4a Tuner (Post 2182082)
Hello,
i get some problems with grid-questions!

If i create a grid-question, the output doesn't work, if a individuell output-style is used!
I'll attach three screenshots to show what i mean.

screen 1: Settings Output-Styling
screen 2: Preview of the grid )submitting would cause the same "array"-effect
screen 3: Preview with a standard outputstyling

vB-version: 4.1.2 Suite
php-version: 5.3.5
mysql: 5.1.51
easyform: 4.2.6

Use
HTML Code:

{qn_1}:[list]{q_1}[/list]

Za4a Tuner 04-09-2011 10:56 AM

Hy Dom,
thanks for your support!

*install 4.2.7* ;)

VanHuek 04-10-2011 09:36 AM

I am wondering are you able to integrate this into a thread?

VanHuek 04-10-2011 11:47 AM

Also:

http://www.yoursite.com/forums/showthread.php?p=$newpost[postid]#post$newpost[postid]

Does not work for the auto direct when a new thread is made?

Or it would be http://cn-knights.org/forums/showthread.php?p=$newpost[postid]#post$newpost[postid]

Any help?

NPGamers.Net 04-10-2011 02:30 PM

How do you change the name "Forms" in the NAV BAR ?

I know you would go to Plugin Manager in AdminCP and then process_template_complete and i see the line - $template_hook['navbar_quick_links_menu_pos4'] .= '<li><a href="misc.php?'.$session['sessionurl_q'].'do=forms">'.$vbphrase['forms'].'</a></li>';

But instead of using a <a href="">FORMS</a> some $vbphrase junk was used taking it past my ability to change the name of the nav bar button.
how can i convert it to a simple link / name or what?

Za4a Tuner 04-10-2011 05:14 PM

Quote:

Originally Posted by NPGamers.Net (Post 2182996)
How do you change the name "Forms" in the NAV BAR ?

Go to your acp (languages) and Search for the phrase "forms" and change it to what you would have to

NPGamers.Net 04-11-2011 12:57 AM

Quote:

Originally Posted by Za4a Tuner (Post 2183063)
Go to your acp (languages) and Search for the phrase "forms" and change it to what you would have to

Worked Great thanks!

wolfey 04-11-2011 10:54 AM

Quote:

Originally Posted by bananalive (Post 2179731)
There is an error in the code (a missing underscore), fixed in attached product file, so you can have as many rows as you want for grids now.

Excellent..Thank you

1 last thing for the grid questions...how do I make it not output the Grid Row entry for one that isnt selected

bananalive 04-11-2011 12:10 PM

Quote:

Originally Posted by VanHuek (Post 2182949)
Also:

http://www.yoursite.com/forums/showthread.php?p=$newpost[postid]#post$newpost[postid]

Does not work for the auto direct when a new thread is made?

Or it would be http://cn-knights.org/forums/showthread.php?p=$newpost[postid]#post$newpost[postid]

Any help?

Use your own site url, so...

http://cn-knights.org/showthread.php?p=$newpost[postid]#post$newpost[postid]

bananalive 04-11-2011 12:14 PM

Quote:

Originally Posted by NPGamers.Net (Post 2182996)
How do you change the name "Forms" in the NAV BAR ?

I know you would go to Plugin Manager in AdminCP and then process_template_complete and i see the line - $template_hook['navbar_quick_links_menu_pos4'] .= '<li><a href="misc.php?'.$session['sessionurl_q'].'do=forms">'.$vbphrase['forms'].'</a></li>';

But instead of using a <a href="">FORMS</a> some $vbphrase junk was used taking it past my ability to change the name of the nav bar button.
how can i convert it to a simple link / name or what?

PHP Code:

$template_hook['navbar_quick_links_menu_pos4'] .= '<li><a href="misc.php?'.$session['sessionurl_q'].'do=forms">Your Text Here!!!</a></li>'

Or...

Quote:

Originally Posted by Za4a Tuner (Post 2183063)
Go to your AdminCP (languages) and Search for the phrase "forms" and change it to what you would have to



All times are GMT. The time now is 09:06 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.02834 seconds
  • Memory Usage 1,923KB
  • 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_code_printable
  • (1)bbcode_html_printable
  • (8)bbcode_php_printable
  • (26)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