Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1069 2011-09-14 04:03:40

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 595
Website

Re: zem_contact_reborn 4.0.3.20

Are there any plans in baking a contact form directly into core?

“But then there is the chance that it will be obsolete soon, and difficult to maintain.” ;-)

Offline

#1070 2011-09-14 04:10:29

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,094
Website Mastodon

Re: zem_contact_reborn 4.0.3.20

maruchan wrote:

bq. Are there any plans in baking a contact form directly into core?

“But then there is the chance that it will be obsolete soon, and difficult to maintain.” ;-)

Core is soon to be obsolete? news to me ;-)


…. texted postive

Offline

#1071 2011-09-14 15:45:54

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 153
Website

Re: zem_contact_reborn 4.0.3.20

uhm, some funny behaviour of ZCR here: i need to use a select/dropdown of countries in a form, and when i use more than ~ 50 countries, i run into a 500 error … is my server’s php configuration to blame, or is there a limitation built into ZCR?

best, -f

Offline

#1072 2011-09-14 17:13:03

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

Rimfya wrote:

Any chance of this plugin getting an update for HTML5?

Yes, new version approaching completion.

Offline

#1073 2011-09-14 17:13:56

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

funtoosh wrote:

uhm, some funny behaviour of ZCR here: i need to use a select/dropdown of countries in a form, and when i use more than ~ 50 countries, i run into a 500 error … is my server’s php configuration to blame, or is there a limitation built into ZCR?

Look at the error logs of your webserver. They should provide you with a more detailed error message. Could be a memory limit that you’re hitting.

Offline

#1074 2011-09-14 23:57:12

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: zem_contact_reborn 4.0.3.20

ruud wrote:

Rimfya wrote:

Any chance of this plugin getting an update for HTML5?

Yes, new version approaching completion.

WooHoo

Offline

#1075 2011-09-17 12:45:10

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 153
Website

Re: zem_contact_reborn 4.0.3.20

Ruud, sounds like a good suggestion, thx.
(Probably not a good idea to use a full 235 countries pulldown anyway, usability-wise.)

Offline

#1076 2011-09-19 16:11:48

M_i
Member
Registered: 2006-03-05
Posts: 122

Re: zem_contact_reborn 4.0.3.20

Hi,

First of all, many thanks for this wonderful plugin! I’ve been using it for years, and can’t imagine building a textpattern site without it.

I’m now working on a form with a number of checkboxes. In order to make it easier to sort the emails resulting from this form, I’m looking for a way to use the checkboxes as input for the subject line of the email: I’d like the boxes that are checked to be listed in the subject.

So for example, a form like this:

[x] blue
[ ] yellow
[x] red

would be sent with the subject blue red.

And as a further complication, I’m using custom fields to determine the labels for the checkboxes:

<txp:if_custom_field name="custom1"><txp:asy_wondertag><txp:zem_contact_checkbox label="<txp:custom_field name="custom1" />" required="0" /></txp:asy_wondertag><br /></txp:if_custom_field>
<txp:if_custom_field name="custom2"><txp:asy_wondertag><txp:zem_contact_checkbox label="<txp:custom_field name="custom2" />" required="0" /></txp:asy_wondertag><br /></txp:if_custom_field>

Any help would be much appreciated!

iris

Last edited by M_i (2011-09-19 16:30:05)

Offline

#1077 2011-09-19 17:20: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

Iris, assuming you have a recent version of TXP installed (recommended for security reasons), you don’t need asy_wondertag. And because the custom names can vary, it’s easier to also specify the name for each field:

<txp:if_custom_field name="custom1">
  <txp:zem_contact_checkbox name="custom1" label='<txp:custom_field name="custom1" />' required="0" /><br />
</txp:if_custom_field>
<txp:if_custom_field name="custom2">
  <txp:zem_contact_checkbox name="custom2" label='<txp:custom_field name="custom2" />' required="0" /><br />
</txp:if_custom_field>

You can then use a subject_form (attribute in the zem_contact tag) containing:

<txp:php>
global $zem_contact_values, $zem_contact_labels;

# list of checkboxes that are checked. Starts out empty.
$checked = array();

# loop through first 9 custom fields by name.
for ($i=0; $i < 10; $i++) 
{
  # check if the checkbox for this custom field exists and if it was checked by the user.
  if (isset($zem_contact_values['custom'.$i]) and $zem_contact_values['custom'.$i] == gTxt('yes'))
  {
    # if so, add the label of this checkbox to the list.
    $checked[] = $zem_contact_labels['custom'.$i]; 
  }
}

# check if the user checked 1 or more checkboxes.
if ($checked) 
{
  # if so, the subject is the list of labels for those checkboxes, separated by a space.
  echo implode(' ', $checked);
}
else  
{
  # otherwise default to this subject.
  echo 'default subject in case no checkbox was checked';
}
</txp:php>

Not tested, but should work with up to 9 custom fields ;)

Offline

#1078 2011-09-19 18:55:04

M_i
Member
Registered: 2006-03-05
Posts: 122

Re: zem_contact_reborn 4.0.3.20

Hi ruud,

Thank you very much for your quick reply! It works like a charm! You are brilliant!

As for the asy_wondertag – I’m using 4.4.1 and I can’t get this to work without it. When I take the asy_wondertags out, the checkboxes still appear in the form, but they disappear from the email and the subject reverts to the default.

Thanks again,
iris

Offline

#1079 2011-09-19 19:22:46

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

Re: zem_contact_reborn 4.0.3.20

@M_i: Are you using single quotes on the tag attributes that contain tags, like in ruud’s example?

<txp:zem_contact_checkbox name="custom1" label='<txp:custom_field name="custom1" />' required="0" />

Offline

#1080 2011-09-19 19:29:58

M_i
Member
Registered: 2006-03-05
Posts: 122

Re: zem_contact_reborn 4.0.3.20

johnstephens wrote:

@M_i: Are you using single quotes on the tag attributes that contain tags, like in ruud’s example?

Ah, you’re very right – that’s it! Old habits and all… thank you very much!

Offline

Board footer

Powered by FluxBB