Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Plugin Request: improving zem_contact for money
here you go Mary :)
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
#74 2005-12-17 03:20:53
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Plugin Request: improving zem_contact for money
Okay, so your form “author-email” contains just: <txp:ext_author_email />
?
Offline
Re: Plugin Request: improving zem_contact for money
Correct.
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
#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