Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#913 2010-12-05 15:09:51

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

Strange, because internally, ZCR doesn’t really use the “CC:” mailheader. It simply sends two separate emails, both using the “To:” header.

Offline

#914 2010-12-05 15:14:05

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

Re: zem_contact_reborn 4.0.3.20

I think my identification of the cc. and main emails was a red herring — the main email was going to a Google Apps email address and the cc to a normal Gmail address. I think it was that distinction that was allowing servers in-built mail process to cause problems for one and not for the other.


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

#915 2010-12-16 14:53:15

immarabi
Member
Registered: 2008-04-29
Posts: 57

Re: zem_contact_reborn 4.0.3.20

I found a creative use for the <txp:zem_contact_secret /> tag. A user types in their email to request the price of an item and clicks “Request Quote” which sends the email to their own address and it includes the price (which is a custom field) using the contact_secret tag.

So my question is, how do I escape html characters in the contact_secret tag?

The quotes in the <txp:title /> tag turn into the computer version of a quote. Here is the code

<txp:zem_contact_secret label="Price Quote">
    The piece of art you requested, <txp:title />, is quoted at $<txp:custom_field name="Price" />. 
  </txp:zem_contact_secret>

So the email would read like this: Price Quote: The piece of art you requested, &#34;Cuba&#34;, is quoted at $900.

Last edited by immarabi (2010-12-16 15:11:14)

Offline

#916 2010-12-16 15:49:50

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

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

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

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

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,012
Website GitHub Mastodon Twitter

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

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

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

aslsw66
Member
From: Canberra, Australia
Registered: 2004-08-04
Posts: 342
Website

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

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

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

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

<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

Board footer

Powered by FluxBB