Textpattern CMS support forum

You are not logged in. Register | Login | Help

#201 2017-05-11 07:09:49

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,653
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Kjeld wrote #305660:

Bump… Posted this in February, but got no responses yet.

Did you miss this post ?

(IOW there are no Japanese language strings available)

Offline

#202 2017-05-11 09:29:24

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,629
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Kjeld wrote #305660:

It says zem_contact_contact instead of the actual Japanese language string…

Sorry for missing your request. Have you added Japanese strings to the plugin? Are they in your database if you, for example, query it:

select * from txp_lang where name like 'zem_contact%' and lang = 'ja-jp'

Edit: phiw13 was faster!

Last edited by Bloke (2017-05-11 09:40:57)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#203 2017-06-22 13:42:30

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,194

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

How can I add a zemerror class to the body tag? In case it can’t be done with zcr: Could it be achieved with adi_gps, i.e. is the random code “predictable” in any way so it could be used in adi_gps?

(Background info: I’ve some CSS animations on the page that I want to overrule cause they seem to avoid the page from skipping right to the zem_error section. Plus the contact form is in the middle of the page, amidst several other articles, i.e. if I stretch the form to elements at the beginning of the page, some things might stop validating or even working.)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#204 2017-06-23 10:59:17

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,629
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

uli wrote #306056:

How can I add a zemerror class to the body tag?

You might have some luck with the zemcontact.render callback. It’s called when the form is displayed to allow you to change it, but you might be able to check the status of the global $zem_contact_error in that callback and take action on other elements there?

You don’t have direct access to the DOM, but you might be able to manipulate the buffer, or (perhaps better) just drop some JavasSript on the page right there in the ZCR form that adds the class onload if there’s anything in the $zem_contact_error variable.

There’s nothing in the URL that could help you determine what the error state is.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#205 2017-06-23 14:07:26

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,245
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Is there a way to have a pull down menu with different recipients using the zcr?

At the moment all I see is

<txp:zem_contact to="recipient@example.com">

… unless of course I am missing something!


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#206 2017-06-23 14:22:51

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,194

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Bloke wrote #306064:

[…]if there’s anything in the $zem_contact_error variable. […]

So I put <txp:variable name="zem_contact_error" /> for testing on the page, inside the body class, to see what’s in there on an error, but there’s nothing new there. Am I doing it wrong?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#207 2017-06-23 14:27:21

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,194

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Yiannis, the section “User selectable recipient, without showing email address” from the plugin help might be what you’re after.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#208 2017-06-23 15:05:33

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,245
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Hi Uli,

Thanks so much! that was it!


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#209 2017-06-23 15:42:22

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,194

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

uli wrote #306066:

So I put <txp:variable name="zem_contact_error" /> for testing on the page

OK, I see that was certainly not what you meant, Stef, but tracing errors in the console window didn’t give a hint either …


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#210 2017-06-23 15:56:12

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,629
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

uli wrote #306066:

So I put <txp:variable name="zem_contact_error" /> for testing on the page

Ah, no. You’ll only be able to get to the variable from PHP. Try making a new public-side plugin from Plugin Composer and enable it:

register_callback('uli_zcr_bodyclass', 'zemcontact.render');

function uli_zcr_bodyclass($evt, $stp, $data, $atts)
{
    global $zem_contact_error;
    dmp($zem_contact_error); // Just to see what it contains

    if ($zem_contact_error) {
        echo script_js(<<<EOJS
jQuery(function() {
    jQuery('body').addClass('zemerror');
});
EOJS;
        );
    }
}

Untested, but something like that might work.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB