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

#136 2006-01-26 22:28:47

jdykast
Member
From: Tennessee
Registered: 2004-12-30
Posts: 119
Website

Re: Plug-in: zem_contact_reborn

Stuart-
I had asked earlier about adding an error class to elements within the form. I started digging around the code a bit and worked up a quick solution (this may not be the best solution though). For the elements that I want to check for errors I added the following before the <code>return</code> line:

<pre>
if (is_array($zem_contact_error)) { $isError = “ errorElement”;
}
</pre>

Then I added <code>$isError</code> to the class attribute of the appropriate tags. This may not be the most elegant or robust solution but it seems to do the job. What says you?

Offline

#137 2006-01-27 01:45:17

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

Re: Plug-in: zem_contact_reborn

What says me is thank you. I shall pick that code up and test it out. If it’s doing the job I shall include it in the next release.

@-p- Nice suggestions. I shall look at the first one for you. As far as the language text goes, I’m not sure at the moment what will be happening to it. Someone is looking at separating it out so a more permanent solution to your problem could be sorted out at that point. In the mean time your idea of having 2 copies with different names should work as long as they don’t appear on the same page at the same time else there would certainly be validation problems with repeated “id” names. Any other problems I can’t foresee at the moment. If you want to send me an email to stuart at thebombsite dot com I can send you a renamed copy so that you can try it out.

And if anyone can explain to me how you pick up the value of a checkbox function to use within the main form function, I would be most grateful. Damn thing is doing my head in!


Stuart

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

Offline

#138 2006-01-27 04:18:33

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Plug-in: zem_contact_reborn

When I use the <txp:zem_contact_send_article> option, to mail an article to a friend, the resulting email has a text header and the article content is of-course html. Anyway to adjust it so that the hearder is HTML?

This plugin has really come along, function-wise since it was reborn. Thanks to everyone for their work.

UPDATE: found the place in code where the plugin specifies content type. Changing the content type makes the article look nice, but destroys the field information’s layout. I’ll look into it a bit more…

Last edited by mrdale (2006-01-27 04:25:05)

Offline

#139 2006-01-27 04:34:49

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

Re: Plug-in: zem_contact_reborn

If you find the answer let us know please. :)

I’ve just added the code from jdykast to allow styling for labels, inputs and textarea when an error is thrown (which also works for the “email a friend” function I should add). You can see both in action on my /test/ install. Just click the “send” button without entering anything. I’m now looking at p’s request to add a title to a copy email. Once that is out of the way I shall look into this myself though I’m now going to eat. I’m bloody starving here. :)

I shall also add some pointers for classes to the help text so that people know what they are looking for CSS-wise.

Last edited by thebombsite (2006-01-27 04:37:41)


Stuart

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

Offline

#140 2006-01-27 08:57:04

-P-
Member
From: Finland
Registered: 2005-09-10
Posts: 211

Re: Plug-in: zem_contact_reborn

<blockquote> >thebombsite wrote:

> @-p- Nice suggestions. I shall look at the first one for you. As far as the language text goes, I’m not sure at the moment what will be happening to it. Someone is looking at separating it out so a more permanent solution to your problem could be sorted out at that point. In the mean time your idea of having 2 copies with different names should work as long as they don’t appear on the same page at the same time else there would certainly be validation problems with repeated “id” names. Any other problems I can’t foresee at the moment. If you want to send me an email to stuart at thebombsite dot com I can send you a renamed copy so that you can try it out.</blockquote>

Okay, nice to hear that my thoughts were not totally irrelevant :D

Sites in question have completely separated sections with different languages. I will email you.

That different subject in senders copy, for example text “copy” was something I ran into yesterday when testing this plugin on one istallation… and I was basically sending emails to my self. Realized that the senders copy of the email can be little confusing since it doesn´t indicate anyway beeing a copy, just might make the receiver of the email feel “Wow, aint the response quick” thoug it is just the copy.
But anyway, as it it, I feel the senders copy is allready a great add on and feature. Thank you Stuart!

Offline

#141 2006-01-27 10:41:23

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

Re: Plug-in: zem_contact_reborn

P wrote:

Sites in question have completely separated sections with different languages.

Did you have a look at my temporary solution?

Offline

#142 2006-01-27 11:10:59

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

Re: Plug-in: zem_contact_reborn

@-p- Actually Els has a good solution there assuming you are working within sections. It would save having 2 copies running. If you keep a copy of the language function somewhere safe as a txt file you can simply copy/paste it back in when there is a new version release, checking for any additions first.

Talking of which, version .11 is now available from your local “711”. With a bit of prompting from jdykast I have now added a special class for labels, inputs and the textarea for when a related error is output. It all seems to be working OK. I’ve been up all night deliberately missing out inputs and putting stupid email addresses in and I haven’t found any problems. Yet! :)
Oh and if you were wondering, all this extra styling stuff works for the “Email to a friend” function as well.

Last edited by thebombsite (2006-01-27 11:18:39)


Stuart

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

Offline

#143 2006-01-27 11:19:54

dominik.osterholt
Member
Registered: 2006-01-13
Posts: 18

Re: Plug-in: zem_contact_reborn

I’m really wondering if nobody else than me is in need – or would at least appreciate the implementation of – radio buttons in this plugin. For feedback purposes, such as rating scales (from 1 to 6, e. g. very good to very bad), I think radio buttons are much more intuitive than dropdown lists. Since checkboxes allow multiple selections, they are inappropriate for this use, too.

Maybe someone has modified the code on his own?

Offline

#144 2006-01-27 11:32:31

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

Re: Plug-in: zem_contact_reborn

@Dominik – I have been considering this since you first mentioned it but I’m not sure it’s something that would be popular, nor that it should be a part of a contact form plug-in. There is a specific “ratings” plug-in already available. Have you had a look at that?


Stuart

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

Offline

#145 2006-01-27 14:24:49

dominik.osterholt
Member
Registered: 2006-01-13
Posts: 18

Re: Plug-in: zem_contact_reborn

> thebombsite wrote:

> @Dominik – I have been considering this since you first mentioned it but I’m not sure it’s something that would be popular, nor that it should be a part of a contact form plug-in. There is a specific “ratings” plug-in already available. Have you had a look at that?

Now I have. But if I understand it correctly, the tcm_rating plugin is for rating specific articles or sites, but that’s not what I’m looking for. I’m seeking for a way to let users and customers give a rating of certain services through a feedback form. So the rating should not concern the website or its articles, but the “offline” service of the company. Thus, the customers can give their feedback easily by email.

Rather, the form should look like that:

Please rate our services (1 to 6, very good to very bad):

Kindness of our employees… 1 2 3 4 5 6 [radio buttons]

… and so on.

At the moment, I’m using dropdown-lists, which works, but I really think radio buttons would perform the task better.

Offline

#146 2006-01-27 15:43:21

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Plug-in: zem_contact_reborn

Send to a friend option
Changing the content type to text/html by hacking like 169 or so, presents a nicely formatted article, but it also presents the other fields bumping up against one another. This is to be expected because these fields were output without tags of any kind. Now we’re using HTML, they’ll need <p> tags wrapped around them.

The ideal solution would be:
  1. to add a content=“html” or content=“text” attribute
  2. to look for thePHP that creates the email with fields and wrap a <p> tag around it…

Anyone game? Seems simple enough to me, but I’m not a PHPer yet.

-Dale

Offline

#147 2006-01-27 17:37:10

jdykast
Member
From: Tennessee
Registered: 2004-12-30
Posts: 119
Website

Re: Plug-in: zem_contact_reborn

Stuart-
It seems that there is a space missing from the <code>errorElement</code> class. This causes the class to go from “zemRequired” to “zemRequirederrorElement” rather than “zemRequired errorElement”. It seems that an easy way to solve this and to keep the code clean would be to add a space when <code>$isError</code> is given a value:

<pre>
$isError = “ errorElement”;
</pre>

This way the <code>return</code> lines don’t have to change. Also, I just picked those names without much thought. There may be better names for <code>$isError</code> and <code>errorElement</code> than what I used.

Offline

#148 2006-01-27 19:29:48

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

Re: Plug-in: zem_contact_reborn

Actually it was deliberate. You can’t have 3 classes within the same tag, at least as far as I am aware, so it is appended to “zemRequired” to keep it down to 2. I also kept trying to think of any errors that might be thrown that concern input data, but aren’t related to required=yes and I could only think of 2 that are to do with silly email addresses, but that’s a “required” field anyway. The only other errors are to do with things like “to field is missing” and “form expired”.

It also means that I can keep the possible “returns” to 2 options and not have to add another and increase both the code and the db load. I think I’ve got it right. I spent a few hours trying to break it. You will also notice that I haven’t done it in quite the same way that you described above, but I was quite happy with the names you chose. Saves me trying to think some up. :)


Stuart

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

Offline

#149 2006-01-27 19:53:16

-P-
Member
From: Finland
Registered: 2005-09-10
Posts: 211

Re: Plug-in: zem_contact_reborn

<blockquote> > thebombsite wrote:

> @-p- Actually Els has a good solution there assuming you are working within sections. It would save having 2 copies running. If you keep a copy of the language function somewhere safe as a txt file you can simply copy/paste it back in when there is a new version release, checking for any additions first.</blockquote>

Ok, thank you. I will test that also. Don´t know how I missed that, I though I read the whole thread thru last nite before posting…. :D

Offline

#150 2006-01-27 20:58:47

jdykast
Member
From: Tennessee
Registered: 2004-12-30
Posts: 119
Website

Re: Plug-in: zem_contact_reborn

I was unaware of the class limit. With that in mind, your method seems to work like a champ.

Offline

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

Board footer

Powered by FluxBB