Advancedform_XH

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Advancedform_XH

Post by cmb » Fri Oct 14, 2011 2:47 pm

Hi B.,
bca wrote:eg If radiobutton1=true go to paymentpage1 OR if radiobutton2=true goto paymentpage2 else go to default Thank you page.
That could basically be done by the code I've posted first (slightly adapted to the given example):

Code: Select all

advancedform_custom_thanks_page($form_name, $fields) {
    switch ($fields['payment_type']) { // the field name of the radiobuttons
        case 'cheque': // the label of radiobutton1
            return 'paymentpage1';
            break;
        case 'pay-pal': // the label of radiobutton2
            return 'paymentpage2';
            break;
        default:
            return void; // redirects to the default Thanks page
}
 
To add the required "hook" to Advancedform_XH is quite easy for me, and it's a very flexible solution. To add an additional Thanks-Page for radiobuttons/checkboxes would be easier to use, but quite some more work for me. And it might distract users who don't need this feature.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

bca
Posts: 293
Joined: Tue Sep 15, 2009 4:49 pm

Re: Advancedform_XH

Post by bca » Fri Oct 21, 2011 12:18 pm

Hi Christoph

Just a minor point - when the form has been filled in by the user if he goes to another page on the site and comes back all the field's content has been lost.

Is it easy to make it so the fields keep the data.

B

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Advancedform_XH

Post by cmb » Fri Oct 21, 2011 1:11 pm

Hi B,
bca wrote:Is it easy to make it so the fields keep the data.
No. The problem: before submitting the form, the only software who has knowledge about the data is the browser. So it's only possible to handle this with JS, and that might be disabled. But even if it is enabled (what should usually be the case) JS has no way to store data on the user computer for security reasons. Well, it might be able to set cookie data and there's a relativly new feature called local storage, but access to cookies might as well be restricted by the browser, and the local storage might have limitations on the size of the data (probably not a real problem in this case), but it will be only available on newer browsers, and could be disabled too.

But I guess this situation is common in the www. So users should be aware that they should not leave the page before submitting the data. Perhaps you could work around this issue by displaying the form on the same page with the information the user might have to look up.

And I'm sorry about not having updated Advancedform_XH with the new hook, but I had much to do with XH 1.5 in the last weeks -- so it will take some more days.

Christoph

PS:
cmb wrote:Perhaps you could work around this issue by displaying the form on the same page with the information the user might have to look up.
Sorry -- it took quite some time to think clearly about that. The simplest solution is of course, that the user is utilising the possibilities of "modern" browsers, by just opening the other page in another tab or window! ;)
Christoph M. Becker – Plugins for CMSimple_XH

Remko

Re: Advancedform_XH

Post by Remko » Thu Oct 27, 2011 2:18 pm

Hi Christoph,

Thanks for your effort to work on Jan's Advanced Form. In the past Jan has made some specific changes to Advanced Form (and I have thanked him accordingly) but of course these specific changes are not incorporated in your new XH version. I hope you could add these changes so that I can update to cmsimple_XH. This is what is needed:

1. Sender receives a copy of the filled out form but from a noreply@ address without being able to find out to which address the mail has been delivered
2. Sender can fill in a subject which then overrules the standard subject and appears as the subject of the e-mail

I so hope you can incorporate this or otherwise tell me how to make it work like this,

Cheers
Remko

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Advancedform_XH

Post by cmb » Thu Oct 27, 2011 3:25 pm

Hi Remko,

(1) would require 1-2 additional fields in the general form editor section (upper part), (2) would require an additional field type "Subject" I guess. But I'm not quite sure, if both features are needed by many users, particularly the second one. I'll have to think about it, and perhaps other users will give their opinion about the two requested features.
Remko wrote:or otherwise tell me how to make it work like this,
I'll gladly do. Basically you have to make use of the so called hook system. I've adapted the "Contact" demo-form according to your request. <ADDED>The demo form is available as part of Advancedform_XH-1beta9 +.</ADDED><DEL>Just download the zip, unzip it, and have a look at Remko.inc, and change it according to your needs (it's a small file which is extensively commented). Than upload both files to your Advancedform_XH data folder. Then import the form "Remko" in the back-end, and change the definition in the form editor as you wish. If you already have a prepared Contact-Form, it's enough to rename Remko.inc to YOUR_FORM_NAME.inc after making the necessary changes and upload only this file to the data folder.</DEL>

Christoph
Last edited by cmb on Sun Dec 25, 2011 2:08 pm, edited 1 time in total.
Christoph M. Becker – Plugins for CMSimple_XH

Remko

Re: Advancedform_XH

Post by Remko » Thu Oct 27, 2011 7:38 pm

Hi Christoph,

Thanks for your quick help. I will have a go tomorrow. Seems like a solution..

Cheers
Remko

Remko

Re: Advancedform_XH

Post by Remko » Fri Oct 28, 2011 10:33 am

Hi Christoph,

Unfortunately back again. Have installed a clean version of CMSimple_XH on www.consen.nl (given all the write permissions etc.) and a clean version of AdvancedForm_XH.

When I call a form with {{{PLUGIN:...} a get a HTTP 500 internal server error. See http://www.consen.nl/?How_to_create_pages:An_H2_heading
What am I doing wrong? I Have reset password back to test for now.

Cheers
Remko

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Advancedform_XH

Post by cmb » Fri Oct 28, 2011 11:00 am

Hi Remko,

I just had a look at your installation. I've deactivated the XHDebug-mode (by uploading _XHdebug.txt to your downloads folder; you can delete it, if it will not be needed any more), and the following error was reported:
Fatal error: SUHOSIN - Use of eval is forbidden by configuration in /var/www/vhosts/consen.nl/httpdocs/plugins/index.php(853) : eval()'d code on line 853
I don't know, if it's possible to remove this restriction somewhere in the hosts configuration, but otherwise I'm afraid you can't run any plugin on this server, as both the new PLUGIN call and the classic CMSimple scripting use eval() to evaluate the code. :(

I've further had a look at your PHP Info at disable_functions. The forbidden call to ini_set() might be an additional problem with some other plugins.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: Advancedform_XH

Post by Holger » Fri Oct 28, 2011 11:25 am

Hi,

running SUHOSIN is a good choice at all, when it's good configured.
This board and my plugin-page is running with suhosin without problems.
cmb wrote: I don't know, if it's possible to remove this restriction somewhere in the hosts configuration,
Suhosin has an ini-file - like php.ini.

KR
Holger

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Advancedform_XH

Post by cmb » Fri Oct 28, 2011 12:06 pm

Hello Holger, hello Remko,
Holger wrote:Suhosin has an ini-file - like php.ini.
Thanks for the information. :)

So I had a further look at this issue. The setting that causes problems is suhosin.executor.disable_eval=On (could be seen in PHP info). I'm not sure, if you can change the suhosin settings generally. But as you're running Apache it should be possible to use an .htaccess file with the following:

Code: Select all

php_value suhosin.executor.disable_eval Off
And BTW: I would not recommend to post your password in the forum (better as PM only).

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply