Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#76 2005-12-17 03:33:22
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Plugin Request: improving zem_contact for money
Mwah. Attributes don’t like it. Okee dokee. Properly patched plugin coming in a minute…
Offline
#77 2005-12-17 08:19:59
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Plugin Request: improving zem_contact for money
Here.
- There is now “to_form” and “from_form”, which should point to forms somehow containing the email address you want to send to. (Matthew, I have a specific note to you about this, so check your email.)
- I cleaned up the plugin, put in a few pieces I could find. Some of the variables for the “zem_contact” tag I renamed, they are now: label (html legend element & fieldset), to, to_form, from, from_form, subject, form, show_input, show_error, thanks, thanks_form, redirect.
- Use Textpattern’s email sending encoding and line feed detection.
- Patched a serious security hole (I won’t say what, don’t want to give anyone any ideas in case of those still using the original plugin as-is).
- Localisation. Using variables could easily get out of hand, so I used a method I use for my plugins (a special gTxt-like function).
- If you have the form redirect, it sends a 302 (“see also”) header, as opposed to a 301 (“moved permanently”). This “redirect” attribute uses your Textpattern site url (like the tag site_url) as it’s base. Example:
redirect="monkey"would send you tohttp://your-domain.com/monkey.
I did some barely minimal testing, so there may be new bugs in there now because of all the swapping I did, or bugs still unfixed.
I don’t have the multiple addresses in there, or all of the various fixes and mods available. But, at least you guys will have a proper plugin template to work from. Anyone who just wants the code bit can copy and paste.
Offline
Re: Plugin Request: improving zem_contact for money
Well I can tell you it works though I have only tried a bog-standard type form. Nice one. :)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#79 2005-12-17 19:38:12
- alexandra
- Member

- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: Plugin Request: improving zem_contact for money
Great work mary!
Now we have a “clean” plugin to work on. I think we drive aslsw66 nuts by now….
Offline
Re: Plugin Request: improving zem_contact for money
Maybe this new version should be in its own thread? Is Mary going to release it as her own fork?
How are you using the code she posted? Its got some PHP at the top so I presume it does not replace the current zem_contact plugin code…
Offline
Re: Plugin Request: improving zem_contact for money
Yes it does but you only need to copy/paste the plug-in code itself and not that first block which relates to the help text. So from <code>function zem_contact($atts, $thing = ‘’)</code> down to the closing “}”.
Last edited by thebombsite (2005-12-17 22:36:25)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#82 2005-12-18 01:39:05
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Plugin Request: improving zem_contact for money
I found one mistake that I added. I’ve updated my file above, but in case you’ve already grabbed it, find line 166, and change it from:
<code>$headers = $sep.‘From: ‘.$from.</code> to <code>$headers = ‘From: ‘.$from.</code>
(Edit: your “from” header won’t get sent properly if this extra line feed – $sep – is at the beginner of the mail header.)
Last edited by Mary (2005-12-18 01:42:11)
Offline
Re: Plugin Request: improving zem_contact for money
<blockquote>
I think we drive aslsw66 nuts by now
</blockquote>
I think we have to appreciate aslsw66’s work here before we stick on to Mary’s version. He wasn’t a coder but I think he did pretty well to help the community out. So hats off to you aslsw66, Good job.
Mary, Thanks for taking this up and for the superb job that you are doing.
“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”
— Albert Einstein
Offline
#84 2005-12-18 07:13:41
- Niconemo
- Member

- From: Rhône-Alpes, France
- Registered: 2005-04-18
- Posts: 557
Re: Plugin Request: improving zem_contact for money
Hello ! Thank you all for all the work done :)
I’d like to beta test this new version of the plugin on a work in progress… but I just don’t know where to start.
I’ve pasted the plugin code from mary’s post (and as TheBombSite said) in place of zem_contact’s code.
Now the original form does’nt work anymore. I’ts probably normal but I can’t find, in this long thread, all the needed informations.
Is it possible to have some basic examples of working form code ? With required tags and so on…
Just a spot to sart from… ;-)
Thank you again.
Last edited by Niconemo (2005-12-18 07:15:47)
Nico
Offline
Re: Plugin Request: improving zem_contact for money
Thanks Stuart I already figured it out. Mary, thanks for the plugin edit – I was going to come back with some error feedback but your latest version fixed them (mail headers in the body of the email, “from” email in the header incorrect).
Niconemo, the easiest way to do it is this:
<code><txp:zem_contact to=“you@youremail.com” /></code> the “to” replaces the “mailto”.
I did notice an error in the “to_form” and “from_form” tags. If I specify like so:
<code><txp:zem_contact to_form=“to_form” from_form=“from_form” /></code> It does not work. “to_form” form has an email id in it, as does “from_form”.
May I suggest that Mary makes this her own plugin from now on – Niconemo is right, if the help text were updated it would be easier to follow. I have several sites running this plugin and a lot of drop down fields etc.
Question: Mary, did you manage to do something with the international characters I mentioned earlier in this thread?
Thanks for the great work Mary. This is such a useful plugin for most sites.
Edit: The to_form and from_form do work, my mistake. However, in the “From:” email header, it reads: <code>from_form@barclay.textdrive.com</code> instead of the actual email id.
Last edited by jstubbs (2005-12-18 08:21:00)
Offline
#86 2005-12-18 11:11:42
- alexandra
- Member

- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: Plugin Request: improving zem_contact for money
Before things get really mixed up, i agree with jstubbs to open up a new thread, posting marys plugin code there and work on her version. As well a version controll/tracking would be great.
Offline
#87 2005-12-18 11:19:25
- Niconemo
- Member

- From: Rhône-Alpes, France
- Registered: 2005-04-18
- Posts: 557
Re: Plugin Request: improving zem_contact for money
Thank you jstubbs :) It’s OK.
Nico
Offline
Re: Plugin Request: improving zem_contact for money
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
Re: Plugin Request: improving zem_contact for money
That’s what, a dozen threads on zem_contact ? Can some moderator/admin do some cleaning of their subject please… ?
Offline
Re: Plugin Request: improving zem_contact for money
Yea, this is getting ridiculous. Someone needs to take the lead as the official plugin developer for zem_contact, take all the mods and suggestions thus far and re-release it under his/her name.
Refresh Dallas and other Refreshing Cities.
Offline