Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#925 2011-01-03 12:02:42

Depot 1
Member
From: Copenhagen
Registered: 2011-01-03
Posts: 24
Website

Re: zem_contact_reborn 4.0.3.20

Thanks a lot Ruud!
I think I’m getting there … But due to lack of knowledge, I still have problems …
Now the fields work – I receive the information from all ‘quantity fields’. However in the email it says ‘Quantity: 1’ instead of ‘Article title: 1’. In other words the email uses the ‘ZCR_contact_text label’ instead of the ‘ZCR_contact_labels label’.

This is the code:

<txp:zem_contact_text name=‘bog<txp:article_id />’ label=“Quantity:” required=“0” size=“2” break=”“ />

<txp:article_custom section=“udgivelser” limit=“99”>
<txp:php> global $zem_contact_labels; <txp:php>$zem_contact_labels[‘bog’.$article_id’] = $article_title;
</txp:php>
</txp:article_custom>

Any ideas? -Thanks!

Last edited by Depot 1 (2011-01-03 12:11:35)

Offline

#926 2011-01-03 15:48:26

Depot 1
Member
From: Copenhagen
Registered: 2011-01-03
Posts: 24
Website

Re: zem_contact_reborn 4.0.3.20

I’ve been playing around for quite a bit now without luck, so I’ll try to rephrase my question:
Due to Ruud’s tip using <txp:article_id /> to make unique “name” attributes dynamically, one text field with the ‘Quantity label’ appears after each article_title in the order form. (Site is here )
However when the form is submitted the email result is ‘Quantity: (number)’ for each ordered item. Which off course makes it a bit difficult to figure out, exactly what item the consumer ordered…
So:
Is it possible to change the label in the email dynamically according to the <txp:article_id /> used for the “name” attribute?

(I’ve tried simply putting label=’<txp:title />’ but instead of ‘Pårørende efterlyses’ (which is the title) it says ‘Pårørende&#160;Efterlyses’. And besides it’s better to use the ‘Quantity’-label here and the title as a heading)

Any help is highly appreciated!

Offline

#927 2011-01-03 17:01:02

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

Re: zem_contact_reborn 4.0.3.20

See my previous post. I’ve edited the last code block, which previously was just pseudo-code and now it’s code that just might work (it should, I just didn’t test it).

Offline

#928 2011-01-04 08:31:24

Depot 1
Member
From: Copenhagen
Registered: 2011-01-03
Posts: 24
Website

Re: zem_contact_reborn 4.0.3.20

I really appreciate your help!
I could’nt make it work with the new code, but after some trial and error and divine intervention this code worked out perfectly:

<txp:php>
    global $zem_contact_labels;
    $zem_contact_labels['bog'.$thisarticle['thisid']] = $thisarticle['title'];
</txp:php>

I’m not exactly sure how this differs from the code you wrote, but it’s working, so I’m happy!

Again; thanks for helping me out!

[edit to display code properly —Ruud]

Last edited by ruud (2011-01-04 08:47:31)

Offline

#929 2011-01-04 08:51:17

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

Re: zem_contact_reborn 4.0.3.20

Your code doesn’t work either, at least not what you posted here ;)
The problem in my code was that I forgot to declare $zem_contact_labels global. You did that, but didn’t declare $thisarticle global (same mistake, different variable). Code fixed in my earlier post.

Offline

#930 2011-01-05 17:44:56

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Re: zem_contact_reborn 4.0.3.20

Hi TXPers,

I am tidying a page with multiple zem_contact forms and have noticed this div per form (I understand it’s anti spam):

<div style="visibility: hidden"><input type="text" value="" name="phone" id="phone" /><br />
<input type="text" value="" name="mail" id="mail" /></div>

Is there a way to not state IDs (perhaps only classes) or to make the IDs unique?

I’ve looked at the plugin help, this forum, the web, but failed to find the answer.

I would like the page to validate (for reliable jQuery and other goodness).

Thanks lots in advance for any comments, cheers, -Alan

PS: I have not touched the source, but I found this in the source for zem_contact_reborn 4.0.3.20

n.'<input type="hidden" name="zem_contact_nonce" value="'.$zem_contact_nonce.'" />'.
n.'<input type="hidden" name="zem_contact_form_id" value="'.$zem_contact_form_id.'" />'.

At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

#931 2011-01-05 18:19:39

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: zem_contact_reborn 4.0.3.20

That looks like code generated by pap_contact_cleaner, not zem_contact_reborn. I made my own honeypot plugin because the inline visiblity: hidden style leaves a huge space in the layout that you can’t override in the external stylesheet.

Offline

#932 2011-01-05 18:21:35

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Re: zem_contact_reborn 4.0.3.20

Ah, so it is, thanks very much John.

Cheers, -Alan


At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

#933 2011-01-06 17:09:32

phuture303
Member
Registered: 2008-09-14
Posts: 127

Re: zem_contact_reborn 4.0.3.20

Hi, a question for you people who have an idea how to work with sql-queries and stuff…

I’m working on a website for a local movie theatre. There are many live articles in the section “movies”, having a radiobutton-controlled custom-field called “reservation” with the two buttons “yes” or “no”.

The people can do a reservation: For this I have an article with a reservation form (made with zem_contact_reborn) where the visitors put their names, contact information, date and count of seats etc., and actually, they have to type in the name of the movie manually for which they ask for reservation. Like this, they can ask for seats for LOTR or the Muppets Christmas Story although these movies are not shown :-)

My idea is now to replace this txp:zem_contact_text-field with an txp:zem_contact_select field where all movie titles are listed which are a) live AND b) have the custom-field “reservation” pointing to “yes”. The list would then contain about the 7-14 movie titles per week (and they change every week, so it has to be automated) for which a reservation is feasible.

Is this possible? I have NO idea about doing queries from the database… Maybe there’s a solution for dummies like me :-)

TXP Version 4.0.7, glz_custom_fields 1.1.3, PHP: 5.2.13, MySQL 4.1.22
(And yes, these are all very outdated, but i experienced many problems while updating (even to 4.0.8), and THIS systems actually works like charme. I hope to have more time soon for solving the problems)

Thanks a lot!
David

Offline

#934 2011-01-06 17:31:50

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: zem_contact_reborn 4.0.3.20

How about something like this:

<txp:zem_contact_select
	label="Select a Reservation"
	list=',<txp:article break="," section="movies" reservation="yes" wraptag=""><txp:title/></txp:article>' />

Offline

#935 2011-01-06 17:48:19

phuture303
Member
Registered: 2008-09-14
Posts: 127

Re: zem_contact_reborn 4.0.3.20

Hi John,

that was fast – and perfect! Didn’t know that i could do this like that… I had to use article_custom instead of article (the reservation form is in another section, with txp:article the list stayed empty. But this works perfectly for me (with my German translation ;-)

<txp:zem_contact_select
	label="Film"
	list='*,<txp:article_custom break="," section="filme" wraptag="" limit="99" time="any" sort="title asc" kartenreservierung="ja"><txp:title/></txp:article_custom>' />

(Works on a 4.0.8-install (yes, i’ll try to update in small steps :-)

Thanks a lot, that’s simple and great!
David

PS: There’s still one question!

I have a movie title called “Die Jönsson-Bande & der Cornflakes-Raub” – the “&” is shown as raw html (&amp;) in the dropdown – is there a possibility to show the ampersand in “clean”?

Last edited by phuture303 (2011-01-06 17:54:15)

Offline

#936 2011-01-06 18:54:06

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

Re: zem_contact_reborn 4.0.3.20

David, replace <txp:title /> with

<txp:php>global $thisarticle; echo str_replace('&amp;', '&', $thisarticle['title']);</txp:php>

Last edited by ruud (2011-01-08 19:35:10)

Offline

Board footer

Powered by FluxBB