Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#589 2009-03-27 03:59:43

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: zem_contact_reborn 4.0.3.20

redbot wrote:

Before I give up can I ask you to send me your amended files just to make sure I’m not doing some stupid mistake?
(And, to worsen things, I suppose I have to configure the “pearmail.php” script inserting username, password and smtp server. Which obviously I don’t know)

Happy to send you the files, though from what you say, you sound to be very close. One does have to configure pearmail.php but all one needs is ANY valid domain username, password and smtp server name, just as though you were setting up an email account in Outlook, Mac Mail or any other email client.

Email me directly through this forum giving me your email address and I will send you amended files.

Offline

#590 2009-03-27 09:50:46

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: zem_contact_reborn 4.0.3.20

Oops , I forgot files can’t be sent through the forum.
You got mail.
Thank you,

P.S. actually my major concern is with the error message I reported before which makes me think the script is looking for something which doesn’t exist on my server.

Last edited by redbot (2009-03-27 10:38:18)

Offline

#591 2009-03-28 01:46:41

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: zem_contact_reborn 4.0.3.20

I have now checked the files Joe kindly sent me and so I’m sure there were no errors on my side. But still the plugin doesn’t work and I keep getting the error message I reported before:

Fatal error: require_once() [function.require]: Failed opening required 'Mail.php' (include_path='.:/usr/share/php:/usr/share/pear') in ..../textpattern/lib/pearmail.php on line 35

which clearly seems complaining about the absence of Mail.php on my server.

Now I don’t want to spend more time on this because it’s driving me crazy. The only remaining doubt is why I achieved to send mail throught txp just setting a preference (“SMTP envelope sender address” under advanced preferences) and I need all this hacks to make zcr do the same. Maybe I’m wrong but I still think there must be a simpler way (hacking zcr only).

Thanks to everybody who tried to help me out.

Last edited by redbot (2009-03-28 01:50:30)

Offline

#592 2009-03-31 01:10:11

otti
Member
From: Australia
Registered: 2008-04-16
Posts: 75
Website

Re: zem_contact_reborn 4.0.3.20

I wonder how it can be done to display the email form again after an email was successfully sent, without reloading the page again. Is that possible?
otti

Last edited by otti (2009-03-31 01:33:29)

Offline

#593 2009-04-07 18:18:04

rathersplendid
Plugin Author
From: London
Registered: 2008-05-02
Posts: 163
Website

Re: zem_contact_reborn 4.0.3.20

Does anyone know if the errors can be displayed/positioned beneath each input that has the error instead of at the top? Alternatively, can they be positioned at the bottom?


Admin Themes Prometheus | Stung | <txp:coder/
My Portfolio | ɹǝpuɐz.com | @MrMartineau
<txp:coder /> – Convert your designs into Textpattern-based websites
jQuery Style | @jquerystyle

Offline

#594 2009-04-09 18:41:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,394
Website GitHub

Re: zem_contact_reborn 4.0.3.20

Calling all geniuses… can anyone suggest a way in which I can do the following please:

  1. When displaying the contact form for the first time, choose an item (from items stored in a txp:variable) and present this item to the user
  2. When they submit the form, it dutifully sends this piece of information to me
  3. BUT if they don’t fill out one of the required fields, the form is displayed again for corrections. The trouble is, the form chooses a different item from the txp:variable list, and I don’t want that. I want the same item to be presented to this user until they have successfully submitted the form

I can do (1) and (2) easily enough, but (3) is eluding me. So far I have tried adding the chosen item to a <txp:zem_contact_secret />. The idea being that I could test to see if this value had been set and then tell the form to not choose an item if it already exists, thus forcing the item that had already been selected. But the secret info stays server-side so I can’t get at it.

I also tried manually adding a hidden item <input type="hidden" /> inside the <txp:zem_contact> tag, but it’s not added to the array so is not POSTed with the rest of the form.

Is there any way I can set something and then test it later, perhaps using smd_if to check the value I’m passing around? It’s kind of like setting a SESSION var but only for this particular instance of the form, then destroying the var once the form has been successfully sent.

Last edited by Bloke (2009-04-09 18:42:54)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#595 2009-04-09 21:15:02

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: zem_contact_reborn 4.0.3.20

Would the variable remain unchanged if the page wasn’t reloaded? In that case, would using AJAX submission (like discussed here) help? I tried to implement this a while ago, but I just don’t understand the instructions… :(

Offline

#596 2009-04-09 21:29:29

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,394
Website GitHub

Re: zem_contact_reborn 4.0.3.20

Els wrote:

Would the variable remain unchanged if the page wasn’t reloaded?

Yes (umm, I think…) all the time the user stays on the the same contact page or keeps submitting bogus/incomplete forms, the variable needs to be the same. But as soon as they navigate away and come back to the contact page (or delete the #zcr... nonce and refresh the page) it needs to generate a fresh variable value.

The AJAX approach might work — good idea, thanks — but I also found the technique was beyond me last time I tried it.

I think I’ve just managed to get round it, but I had to write a custom callback function and hook it into ZCR’s .form API. It essentially sets up a single SESSION var that is repopulated only when there is no POSTed data. At all other times, the SESSION var remains unchanged. The rest of the callback function then just uses this value to inject the relevant markup via calls to zem_contact_select() and zem_contact_submit() etc.

It’s not pretty but it seems to work. Wish there was a non-PHP way of doing it but the fact that HTTP requests are generally stateless and ZCR only accepts pre-defined vars in its form means it’s probably the only way to go. If I manage to ever grasp the AJAX approach and it works, I’ll post back here. Ta for the hint.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#597 2009-04-09 21:40:23

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: zem_contact_reborn 4.0.3.20

Bloke wrote:

If I manage to ever grasp the AJAX approach and it works, I’ll post back here.

I’d appreciate that :) At the moment I’m using jQuery to hide the contact form on page load, but that means every time the form is submitted without filling all required fields, the form is hidden again and the visitor has to click a link to show it again…
If someone knows a way to add a line to the error messages (like ‘Please click the link below to continue filling the form’) I would also be very happy.

Offline

#598 2009-04-09 22:01:04

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,394
Website GitHub

Re: zem_contact_reborn 4.0.3.20

Els wrote:

every time the form is submitted without filling all required fields, the form is hidden again and the visitor has to click a link to show it again…

smd_if to the rescue?

<txp:smd_if field="postvar:zem_contact_nonce" operator="undefined">
   <script type="text/javascript">Put the HIDE jQuery here</script>
</txp:smd_if>

I don’t know about adding the extra line. I’m struggling with the error messages too because the “is missing” error seems to be fixed and it just so happens that one of the fields I want to make mandatory has no label, so all the visitor sees is Required field, “”, is missing. :-(

Last edited by Bloke (2009-04-09 22:01:37)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#599 2009-04-09 22:03:17

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: zem_contact_reborn 4.0.3.20

Bloke wrote:

Calling all geniuses… can anyone suggest a way in which I can do the following please:

  1. When displaying the contact form for the first time, choose an item (from items stored in a txp:variable) and present this item to the user
  2. When they submit the form, it dutifully sends this piece of information to me
  3. BUT if they don’t fill out one of the required fields, the form is displayed again for corrections. The trouble is, the form chooses a different item from the txp:variable list, and I don’t want that. I want the same item to be presented to this user until they have successfully submitted the form

Hi Stef,

Not quite sure what you mean. On what basis does the item get Chosen in 1 and why is a different one chosen in 3?

Is there anything in adi_contact_combo that would help?

Adi

Offline

#600 2009-04-09 22:09:09

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,394
Website GitHub

Re: zem_contact_reborn 4.0.3.20

gomedia wrote:

Not quite sure what you mean. On what basis does the item get Chosen in 1 and why is a different one chosen in 3?

Ever visited my current contact form? I’ve taken the plunge and I’m TXP-ising my site (finally!) because it’s going to be way easier to manage plugin downloads than the current static site. So I’m trying to emulate that page in ZCR.

The ‘favourite’ thing is chosen once — when you enter the page — and each visitor gets a different, randomly chosen question asked. Currently, if you stuff up the content or miss a field out, I use javascript to trap the error but doing that in ZCR proved trickier than I’d hoped (or perhaps I just wasn’t thinking straight). So I had to resort to doing it after submit which is where I came unstuck and had to write the callback.

Is there anything in adi_contact_combo that would help?

Hell yes :-) I’d forgotten about that gem; thanks for the reminder. The adi_contact_labels might help in my above predicament regarding the unnamed field too. Thanks!

Last edited by Bloke (2009-04-09 22:11:06)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB