Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » Plug-in: zem_contact_reborn

#589 2006-10-22 14:39:25

benbruce
Plugin Author
Registered: 2006-01-13
Posts: 328
Website

Re: Plug-in: zem_contact_reborn

ruud,

ZCR = Zem_Contact_Reborn (sorry about that). To clarify, I just need the “submit” event callback.

Thanks,

– Ben

Offline

#590 2006-10-22 19:39:48

fpradignac
Plugin Author
From: France near Cognac
Registered: 2005-01-29
Posts: 359
Website

Re: Plug-in: zem_contact_reborn

Hello all,

I had the problem of sites with 2 or 5 languages, and you understand that it’s a cool thing to display the appropriate form in the appropriate language !
So I take the opportunity that Zem put language strings in a separate file to add a new parameter : trad="fr" (translation in french) in <txp:zem_contact> tag like this :
<txp:zem_contact to='mail@free.fr’ trad='fr' />
If no trad value is set, the default language is english.

I’ve just hacked a little zem_contact_reborn and add a switch() in zem_contact_gTxt with a case for each language. Plus a little modification in zem_contact() to localise the default string “name” (line 50).

I’m not a “real programmer” so if the idea is interesting, the code should be improved.

Just have a look to my french article on this hack.


françois

Offline

#591 2006-10-22 19:44:52

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Plug-in: zem_contact_reborn

Hi,

I tested this mod by François a while ago and I think it would be very nice if it could go into the plugin core!

Offline

#592 2006-10-22 20:58:46

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

François, thanks for mentioning the non-localised ‘name’ in line 50.

For multi-language support, a switch statement might work, but perhaps putting each language in a separate function is more flexible, because then you can either put them all in one language plugin (as you did) or package them separately. In the latter case its easier to share translations with others who can combine them as they wish: zem_contact_lang_fr, zem_contact_lang_nl etc.

Last edited by ruud (2006-10-22 21:02:04)

Offline

#593 2006-10-22 23:18:27

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Plug-in: zem_contact_reborn

The idea of separate language files was discussed around about page 18 of this thread but it was decided that it would be simpler for individuals to keep their own localisation rather than have several language plug-ins that would all need updating if the original were added to or altered. Just thought I’d mention that. Apart from which, Els came up with an excellent little “hack” at around about the same time.

Also, with regard to the changes in 4.0.4 mentioned earlier and whether or not people would still require this plug-in for 4.0.3, my view is that it should not be a hinderance to the progress of this plug-in provided that the appropriate versioning format is used, thus “zem_contact_reborn 4.0.4.01.txt” would be born.

Last edited by thebombsite (2006-10-22 23:23:33)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#594 2006-10-23 05:11:07

fpradignac
Plugin Author
From: France near Cognac
Registered: 2005-01-29
Posts: 359
Website

Re: Plug-in: zem_contact_reborn

The most important thing is to provide people the possibility to use several language.
The method is a toy for developpers – only ;) ;)

Last edited by fpradignac (2006-10-23 05:11:36)


françois

Offline

#595 2006-10-23 12:15:35

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

Stuart, I can’t find the hack that Els proposed. Browsed through approx. 10 pages surrounding page 18 but didn’t see it. Do you have the post number?

What I’d like to do is first start fixing bugs in the existing 4.0.3 version, without adding new features, and release that as 4.0.3.18 (which would also work in 4.0.4). That way people who don’t want to upgrade to 4.0.4 yet, can keep using the same feature set, only with less (or no) remaining bugs.

Once that is done, bump the version to 4.0.4 and add any new features there.

I’m not a big fan of versioning for the 4.0.x series (4.0 vs 4.1 is a different thing), for two reasons:
  • it increases the size of the plugin by duplicating code that is already available in newer versions of TXP.
  • it lets people keep using older TXP versions, which is not desirable, because of the security fixes that newer versions bring.

… but I’m open to suggestions ;)

Offline

#596 2006-10-23 13:18:22

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: Plug-in: zem_contact_reborn

Personally, I like the current version numbering scheme. It immediately lets you know the Txp version compatibility of the plugin (the only plugin with this “feature”).

If code bloat is a concern you could just strip the duplicative code from the plugin for each new version of Txp, then release it with a corresponding version number (e.g. 4.0.5.1). Make sure that you keep old versions available for download; if anyone complains that it doesn’t work with their old Txp install, you can always say “Didn’t you check the version number?” :-)

Offline

#597 2006-10-23 20:59:55

skoggy
Member
From: Westcoast of Sweden
Registered: 2005-03-27
Posts: 209
Website

Re: Plug-in: zem_contact_reborn

Couldn´t find anything about a problem like this in the thread (fast browsing thru the 60 pages). I´m using the txp:zem_contact_checkbox / tag on one of my forms…

The problem is that all the fields in the email-message says: no, even if they were checked in the form.

Is this a bug or have I missed something?

Offline

#598 2006-10-23 21:30:34

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Plug-in: zem_contact_reborn

Logoleptic wrote:

Personally, I like the current version numbering scheme. It immediately lets you know the Txp version compatibility of the plugin … you could just strip the duplicative code from the plugin for each new version of Txp, then release it with a corresponding version number (e.g. 4.0.5.1).

Not a bad idea.

Here’s another one: start a new thread for each version release. Sixty pages? Come on…

Offline

#599 2006-10-23 22:50:31

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

@skoggy, I use checkboxes myself and they seem to work correctly here, but I’m running modified code and there are a few bugs in the checkboxes. One of them is that it doesn’t always remember what state it is in if you need to correct an error in the form input. That’ll be fixed.

@destry, not a bad idea, otherwise we need a search option limited to a single thread.

Offline

#600 2006-10-24 13:20:30

treb0r
Member
From: Hebden Bridge, UK
Registered: 2005-09-05
Posts: 20
Website

Re: Plug-in: zem_contact_reborn

Hi All,

I posted a message about my problems here:

http://forum.textpattern.com/viewtopic.php?id=13416&p=57

I then found a conversation between stuart and alannie here:

http://forum.textpattern.com/viewtopic.php?id=13416&p=40

Which helped me to realise that my problems had something to do with the fact that I used the zem contact tag in an article, and not a form.

So I followed stuart’s advice and transferred the zem contact code to a new article form, and used the ‘Override Form’ option under ‘Advanced Options’ in the write screen to use the new form.

Hey presto, the error messages only show once, and the ‘Thank you, your message has been sent.’ message now appars as it should.

The only problem I have now, is that the message doesn’t arrive. I use this plugin for other sites living on the same box at txd and they work without problems.

Here’s the code from the new form:

<code>

<strong class=“sectiontitle”><txp:title /></strong><br />
<txp:zem_contact to=“me@mydomain.net” label=”“ >
<br />
<txp:zem_contact_text required=“yes” label=“Name” />
<br /><br />
<txp:zem_contact_email required=“yes” />
<br /><br />
<txp:zem_contact_textarea cols=“47” />
<br /><br />
<txp:zem_contact_submit />
</txp:zem_contact>
</code>

Any hints gratefully recieved!

Thanks

Last edited by treb0r (2006-10-24 13:47:15)

Offline

  1. Index
  2. » Archives
  3. » Plug-in: zem_contact_reborn

Board footer

Powered by FluxBB