Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1225 2012-09-05 16:30:31
Re: zem_contact_reborn 4.0.3.20
The ID is generated based on the contents of the form and the attributes of the ZCR tag. So it’s stable as long as you don’t upgrade ZCR. Nevertheless, you shouldn’t rely on it to never change in future ZCR versions (although most likely, it won’t change then either).
Offline
#1226 2012-09-05 18:45:48
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,311
Re: zem_contact_reborn 4.0.3.20
Thanks for the super-quick reply, Ruud!
ruud wrote:
The ID is generated based on the contents of the form and the attributes of the ZCR tag.
Ah, I see: I removed some elements, and the ID changed. That required me to keep that in mind any time the form is altered. Is there a way to circumvent my scatterbrain and store the ID in a variable for re-use in the Javascript? (It probably needed to sit in the zcr form then, I assume.)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#1227 2012-09-06 07:22:02
Re: zem_contact_reborn 4.0.3.20
Ruud,
When I use <txp:zem_contact_email />, no email gets sent, but when change it to <txp:zem_contact_text /> if works just fine … I tried this on a couple of sites, and it’s the same. Any ideas what could be the cause?
EDIT: The plugin works perfectly on my localhost, so I guess it’s something to do with Dreamhost’s mail set up. Let’s see if they can help. Seems it wants the “from=” to be an email on the same domain, else it won’t accept the sender’s email address.
Last edited by husainhk (2012-09-06 08:05:03)
Offline
#1228 2012-09-06 08:56:20
Re: zem_contact_reborn 4.0.3.20
uli wrote:
Is there a way to circumvent my scatterbrain and store the ID in a variable for re-use in the Javascript? (It probably needed to sit in the zcr form then, I assume.)
If you need the ID in javascript, you can probably start from an element inside the form, track it to it’s parent form and get the ID from there (or put the form inside a div use that to find the form or perhaps, knowing how many forms you have on a page, use that to target a specific form)… but then you wouldn’t really need the ID anymore, just the reference to that object (as you would normally do with “getElementByID”)
Offline
#1229 2012-09-06 13:09:45
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,311
Re: zem_contact_reborn 4.0.3.20
ruud wrote:
as you would normally do with “getElementByID”
Thanks for your reply, Ruud. I’m afraid that would be too much for me: I don’t “normally” do it ;) I’ve not yet learnt a script language, I can alter what I find as long as it’s human readable and doesn’t expect too much prior knowledge.
But I discovered in this topic last night a jQuery calculation script that doesn’t require an ID and reads automatically into the forms contents. Thanks, photonomad, for the link, also for the update .text
-> .val
.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#1230 2012-09-09 13:15:04
Re: zem_contact_reborn 4.0.3.20
Hi Ruud,
This is the last hurdle in getting my zem_contact form and saving it’s contents to a database work as intended. I need to ensure that the email field value is unique at form submission. In phpMyAdmin, I’ve declared the ‘email’ field to be unique and the code you’ve sent works, i.e. it doesn’t populate duplicate emails. All I need is a way to show an alert after form submission if a duplicate email is used in the form, for the user’s sake, so that the zem_contact doesn’t carry out its action and the database doesn’t get populated.
Here’s the code you helped out with earlier:
<?php
global $zem_contact_values;
if( !empty( $_POST['zem_contact_submit'] ))
{
$formTitle = doSlash(trim(ps('title')));
$formFirstName = doSlash(trim(ps('first_name')));
$formLastName = doSlash(trim(ps('last_name')));
$formEmail = doSlash(trim(ps('email'))); // Need to intercept if same email is entered at zem_contact form submission, if so, don't perform zem_contact's action and population of database
$formMobile = doSlash(trim(ps('mobile')));
$formSecret = doSlash($zem_contact_values['voucher_code']);
if(!empty($formFirstName) and !empty($formEmail))
{
$result = safe_insert('voucher_codes', "timestamp=NOW(), title='$formTitle', first_name='$formFirstName', last_name='$formLastName', email='$formEmail', mobile='$formMobile', voucher_code='$formSecret'");
if (!$result) echo mysql_errno() . ": " . mysql_error();
}
}
?>
Offline
#1231 2012-09-09 14:53:00
Re: zem_contact_reborn 4.0.3.20
@husainhk:
If the code you posted gives an error message if you try to insert a duplicate email address:
replace global $zem_contact_values;
with global $zem_contact_values, $zem_contact_error;
replace if (!$result) echo mysql_errno() . ": " . mysql_error();
with if (!$result) $zem_contact_error[] = 'Email address already known or some other message";
Offline
#1232 2012-09-09 18:10:16
Re: zem_contact_reborn 4.0.3.20
@Ruud: Thanks a lot mate. Made the update and get the appropriate message when duplicate email is entered … Wow!
Offline
#1233 2012-09-10 04:06:45
Re: zem_contact_reborn 4.0.3.20
why this error all of a sudden?
Tag error: <txp:zem_contact_select label="Choose" list="A General Question,A Happy Client,Just Interested" break="" /> -> : Function split() is deprecated on line 539
Still running TxP 4.4.1 and zem_contact_reborn 4.0.3.20
I think i twas running fine last time i checked.
…. texted postive
Offline
#1234 2012-09-10 04:21:28
Re: zem_contact_reborn 4.0.3.20
garbo wrote:
I made the one swap between split() and explode() under Edit on the plug-ins page for zem_contact_reborn and the error went away. I just hope the form still works.
For people new to this, I went to the plug-ins tab and clicked on the Edit link next to zem_contact_reborn, did a search for the word ‘split’ (it only occurs once) and replaced it with the word ‘explode’. Then I saved it.
This occurs when the PHP version on your server is 5.3 and above. You can find out what version of PHP your web server is using where your Textpattern is installed by checking out the Diagnostics tab under the Admin tab.
jeez. i have been trying to find a solution for this for hours. Is there a reason why this plugin was not updated to deal with the error?
…. texted postive
Offline
#1235 2012-09-10 04:24:27
Re: zem_contact_reborn 4.0.3.20
Is it possible to have a different subject for the sender, when the copysender=“1” is used? I’d like to have something like:
Subject for the recipient: “Enquiry from Example.com”
Subject for the sender: “Autoresponse: Your Enquiry on Example.com”
Last edited by husainhk (2012-09-10 04:24:40)
Offline
#1236 2012-09-20 17:25:13
- heternova
- Member
- Registered: 2007-01-26
- Posts: 14
Re: zem_contact_reborn 4.0.3.20
Hi all, I have the following form:
<ul class="bestellung-adresse">
<li><txp:zem_contact_text break="" label="Name" /></li>
<li><txp:zem_contact_text break="" label="Vorname" /></li>
<li><txp:zem_contact_text break="" label="Adresse" /></li>
<li><txp:zem_contact_text break="" label="PLZ" /></li>
<li><txp:zem_contact_text break="" label="Ort" /></li>
<li><txp:zem_contact_email break="" label="Email" /></li>
<li><txp:zem_contact_text break="" label="Telefon" required="0" /></li>
</ul>
</div> <!-- close content-three-columns-center -->
<div id="content-one-column-cd-bestellung">
<table>
<caption>Bitte senden Sie mir folgende CD's:</caption>
<tbody>
<tr>
<td class="CD-Titel">...Ihr ergebener Paul Burkhard</td>
<td class="CD-Space"></td>
<td class="CD-Nummer">
<txp:zem_contact_text break="" name="Paul Burkhard CD" label="Stück" required="0" /></td>
</tr>
</tbody>
</table>
</fieldset>
My problem is, only the first params are sent to the email. The param <txp:zem_contact_text break=”“ name=“Paul Burkhard CD” label=“Stück” required=“0” /> is not sent. But when I test it using a normal php script for post (http://www.posttestserver.com/data/2012/09/20/04.26.57349355332) all the parameters are sent correctly. Where is the error?
Thank you!p.s.: did someone already tested textpatter/zem_contact with MailServe for Mac?
Last edited by heternova (2012-09-20 17:35:17)
Offline