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


All times are GMT. The time now is 02:21 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.02307 seconds
  • Memory Usage 1,800KB
  • 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
  • (5)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (5)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