Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#916 2010-12-16 15:49:50
Re: zem_contact_reborn 4.0.3.20
The character escaping comes from the txp:title tag. Most fields in Textpattern automatically escape the field data into HTML entities, and most of them allow you to get the raw output using the escape="" attribute, but not title. You can get the raw title data like this:
<txp:php>echo $thisarticle['title'];</txp:php>
I just figured this out. I hope this helps!
Last edited by johnstephens (2010-12-16 15:50:12)
Offline
#917 2010-12-16 20:00:42
- immarabi
- Member
- Registered: 2008-04-29
- Posts: 57
Re: zem_contact_reborn 4.0.3.20
Thanks John. I was thinking of doing something more complicated like editing the plugin and using the (strip_tags(str_replace)) method that it seems the textarea has in the zem_contact plugin. But this was a lot easier and it works!
Last edited by immarabi (2010-12-16 20:01:43)
Offline
#918 2010-12-19 16:28:55
- Dimitri
- Member

- From: Johannesburg
- Registered: 2010-10-31
- Posts: 129
Re: zem_contact_reborn 4.0.3.20
Hello everyone, I need help urgently
I am hoping to find a way how to upload a file with only selected extenstions (such as .doc, .pdf) to the contact form and send the email.
I went through the docs of this plugin and cant find anything.
Can anyone offer me advice or point me to the other plugin that got the ability to do that.
<txp:way_too_cool />
Offline
#919 2010-12-19 17:09:52
Re: zem_contact_reborn 4.0.3.20
@Dimitri: I think you need a plugin called sed_afu to allow people to upload files anonymously through a contact form. I’m not sure if it allows yout to discriminate based on extension or not— I’ve never used it. Hope this helps!
Offline
#920 2010-12-19 18:18:37
Re: zem_contact_reborn 4.0.3.20
sed afu allows anonymous upload to the site. It might be of help to you
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#921 2011-01-03 10:27:27
Re: zem_contact_reborn 4.0.3.20
Hi TXP-experts,
I’m new to both PHP and TXP, and I have trouble with an order form made with the ZCR plug-in. I have searched this thread for help, but failed to find a usefull solution. I hope some of You might be able to help, since I believe it’s a fairly simple thing I’m trying to do …
I’m using ZCR for an order form on a small book publisher’s website ( Site here ).
The order form consists of a list with book titles (=Article title), price (=Custom field) and a ZCR-text field with the label ‘Quantity’.
Below this list is additional ZCR-text fields with contact info and a ‘Submit’-button.
I want the list with books and prices to be dynamically updated, whenever a new article is published in the section ‘udgivelser’ (=releases), but I can’t figure out how to make the ZCR-text field with the ‘Quantity’ label update accordingly. With the code written below the book title and price are displayed correctly with the ‘Quantity’ field below them. But only one ‘Quantity’ field works at a time.
This is the code:
On the page the following grabs the ZCR form:
<txp:output_form form="bestillingsformular" />
This is the form ‘bestillingsformular’:
<div class="form">
<txp:zem_contact to="snorre@depot1.dk" copysender="1" thanks_form="tak" label="" subject="Autre > Ordrebekræftelse">
<ul class="titler">
<li><txp:article_custom section="udgivelser" limit="99" form="titelliste"></txp:article_custom>
</ul>
<ul>
<li><txp:zem_contact_text label="Navn:" required="1" break="" /></li>
<li><txp:zem_contact_text label="Adresse:" required="1" break="" /></li>
<li><txp:zem_contact_text label="Postnr.:" required="1" max="4" size="4" break="" /></li>
<li><txp:zem_contact_text label="By:" required="1" break="" /></li>
<li><txp:zem_contact_email label="Email:" required="1" break="" /></li>
<li><txp:zem_contact_submit label="Send" /></li>
</ul>
</txp:zem_contact>
</div>
And this is the form ‘titelliste’:
<p class="titel"><txp:title /></p> </li>
<li><p class="info"><txp:custom_field name="sider/pris" /></p></li>
<li>
<txp:zem_contact_text name='bog1' label="Antal:" required="0" size="2" break="" />
<txp:php>
global $zem_contact_labels;
$zem_contact_labels['bog1'] = 'Pårørende efterlyses';
</txp:php></li>
This is my first entry in TXP forum, so please forgive me, if I’m doing anything wrong here …
Kind regards,
Snorre
[edited to make code display properly —Ruud]
Last edited by Depot 1 (2011-01-03 11:33:36)
Offline
#922 2011-01-03 10:42:31
Re: zem_contact_reborn 4.0.3.20
I have used smd_query to pull in results from the textpattern database and use them to populate form fields. I assume that you have the quantity in a custom field for the article, so using smd_query should be pretty simple.
Offline
#923 2011-01-03 11:19:23
Re: zem_contact_reborn 4.0.3.20
Thanks for your reply, aslsw66!
The quantity field is used by the consumer when ordering books, so by default it’s ‘empty’.
What I need is, that for every new book in the list, a new quantity field with the book’s title as ZCR label appears.
In other words:
How do I grab the article title (=book title) and use it in the ZCR:
<txp:zem_contact_text name=‘article title’ label=“Antal:” required=“0” size=“2” break=”“ /> <txp:php> global $zem_contact_labels; $zem_contact_labels[‘article title’] = ‘article title’; </txp:php></li>
Right now the quantity field appears for every new book in the list, but only the last of them works, when submitting the order form.
Does this make sense?
Offline
#924 2011-01-03 11:34:48
Re: zem_contact_reborn 4.0.3.20
<txp:zem_contact_text name=‘bog1’ label=“Antal:” required=“0” size=“2” break=”“ />
If you do this in a list, all the quantity text inputs would get the same “name” attribute, so I’d start with dynamically using a unique name for that field:
<txp:zem_contact_text name='bog<txp:article_id />' label=...
Then the next problem to solve is translating all the bog<number> labels to the book title. You could do that at the end of the form using another article_custom list and do something like this:
<txp:article_custom section="udgivelser" limit="99">
<txp:php>
global $thisarticle, $zem_contact_labels;
$zem_contact_labels['bog'.$thisarticle['thisid']] = $thisarticle['title'];
</txp:php>
</txp:article_custom>
Last edited by ruud (2011-01-04 08:49:59)
Offline
#925 2011-01-03 12:02:42
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
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 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
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
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
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
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