Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#865 2010-09-17 14:54:55

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

Re: zem_contact_reborn 4.0.3.20

Enor wrote:

Also for #2 yes adding a space works

Where did I say that??

So would need a way to allow commas in without the form wanting to break the prices (where it sees a comma) onto new lines.

New try:

<txp:zem_contact_select label="Project Budget" delimiter=";" list=";under £2000;£2,000 - £5,000;£5,000 - £10,000;£10,000 - £20,000;over £20,000" />

Offline

#866 2010-09-17 14:57:33

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

Re: zem_contact_reborn 4.0.3.20

Enor wrote:

when I tried your solution for #1 it removed Name (and input field) from the form when I refreshed the page:

This is what I have now:

<txp:zem_contact_text label="Name required=“0” />

You forgot the closing quotes here: label="Name

Offline

#867 2010-09-17 15:30:51

Enor
Member
From: London, UK
Registered: 2010-09-02
Posts: 26

Re: zem_contact_reborn 4.0.3.20

Hi Els

I tried that and it worked:

<txp:zem_contact_text label=“Name” required=“0” /> <txp:zem_contact_email />
<txp:zem_contact_text label=“Telephone” required=“0” />
<txp:zem_contact_text label=“Company” />
<txp:zem_contact_select label=“Project Type” list=”,Web Design and Development,Website redesign,Outsourced Front End Development,Email Marketing,Other” />
<txp:zem_contact_select label=“Project Budget” list=”,under £2000 £2000 – £5000” />
<txp:zem_contact_textarea label=“Brief Description” />
<txp:zem_contact_submit label=“Send Enquiry” />

But when I refresh my page, I get at the top some Textpattern error messages:

Tag error: <txp:zem_contact_text label=“Name” required=“0” /> -> Textpattern Warning: Attribute values must be quoted on line 984
Tag error: <txp:zem_contact_text label=“Telephone” required=“0” /> -> Textpattern Warning: Attribute values must be quoted on line 984

Offline

#868 2010-09-17 15:39:23

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,311

Re: zem_contact_reborn 4.0.3.20

I can’t see a quote error, aside from using curly quotes, maybe? Please, post blocks of code with a preceding bc.. (note the space after the dots) so we can better judge quotation errors.

Last edited by uli (2010-09-17 15:40:46)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#869 2010-09-17 15:55:21

Enor
Member
From: London, UK
Registered: 2010-09-02
Posts: 26

Re: zem_contact_reborn 4.0.3.20

Hi Uli

Found out what the issue was, I copied and pasted the example to use – #3. Add label=”“ in the <txp:zem_contact> tag – which was posted earlier, but I then had a closer look and noticed that the quotes needed to be manually typed in.

Error gone now :)

By the way do you know how to achieve this display for my drop down options:

> under £2000
> £2,000 – £5,000
> £5,000 – £10,000
> £10,000 – £20,000
> over £20,000

I posted it already. Is there a way to escape the comma as I need it for my pricing.

Offline

#870 2010-09-17 16:46:04

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

Enor, read the response that Els gave you, because that question was already answered.

Offline

#871 2010-09-17 17:22:30

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

Re: zem_contact_reborn 4.0.3.20

Enor wrote:

I posted it already.

I answered it already. Twice ;)

Offline

#872 2010-09-18 21:47:36

Enor
Member
From: London, UK
Registered: 2010-09-02
Posts: 26

Re: zem_contact_reborn 4.0.3.20

Thanks guys :) Got it working now.

Offline

#873 2010-09-19 12:18:51

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

Re: zem_contact_reborn 4.0.3.20

Hello, I am trying to alter the plugin so that it works in Webfaction, which doesn’t allow the mail() function. I have taken the advice of a few posts such as this one but I don’t think it works for version 4.2.0

I have successfully used PHP mailer for the txplib_misc.php to send emails from textpattern. I am trying to use it to send mail from ZCR. This is what I have so far:

1) added include_once('/textpattern/lib/custom/class.phpmailer.php'); to the first function in ZCR
2) and I have made modifications similar to this forum post http://forum.webfaction.com/viewtopic.php?pid=18518#p18518

However this is the error that I get: Fatal error: Class ‘PHPMailer’ not found in pathto/textpattern/lib/txplib_misc.php(594) : eval()’d code on line 231

I would really love some help trying to get this to work. Thanks, so much.

Last edited by immarabi (2010-09-19 20:58:48)

Offline

#874 2010-09-19 13:22:32

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

immarabi wrote:

1) added include_once('/textpattern/lib/custom/class.phpmailer.php'); to the first function in ZCR

Is that path correct or should it be this instead:

/path/to/textpattern/lib/custom/class.phpmailer.php

Offline

#875 2010-09-19 19:51:17

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

Re: zem_contact_reborn 4.0.3.20

Ok, you are right about that. Looks like everything is working now. Since this is my first time editing a plugin by myself, can you just look this over for me and recommend some changes if you think of any. Thank you very much!

I removed this:

if (mail($to, $subject, $msg, $headers))
        {
            $_POST = array();

            if ($copysender and $zem_contact_from)
            {
                mail(zem_contact_strip($zem_contact_from), $subject, $msg, $headers);
            }

and this after it: 
     else
            {
                return '<div class="zemThanks" id="zcr'.$zem_contact_form_id.'">' .
                    ($thanks_form ? fetch_form($thanks_form) : $thanks) .
                    '</div>';
            }
        }

        else
        {
            $out .= graf(zem_contact_gTxt('mail_sorry'));
        }




And I replaced it with this: 
  $mail             = new PHPMailer();
        $mail->IsSMTP(); // telling the class to use SMTP
        $mail->Host       = "hostxxxx:25"; // Webfaction SMTP Server
        $mail->SMTPAuth = true;     // turn on SMTP authentication
        $mail->Username = "usernamexxxx";  // Your Webfaction mailbox user
        $mail->Password = "passwordxxxx"; // Mailbox password
        $mail->From       = $zem_contact_from;
        $mail->FromName   = $zem_contact_from;
        $mail->Subject    = $subject;
        $mail->MsgHTML($msg);
        $mail->AddAddress($to);
        if(!$mail->Send()) {
        echo "<!-- Nasty error : " . $mail->ErrorInfo ." -->\n"; // Debug
            $out .= graf(zem_contact_gTxt('mail_sorry'));
        } else {
        echo "<!-- Email Sended -->\n";
return '<div class="zemThanks" id="zcr'.$zem_contact_form_id.'">' .
                    ($thanks_form ? fetch_form($thanks_form) : $thanks) .
                    '</div>';
        }
        // end SMTP mod

Last edited by immarabi (2010-09-19 19:57:06)

Offline

#876 2010-09-19 20:13:08

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

Add $_POST = array(); just above the ‘return’ statement.
You’ve removed copysender and redirect functionality, which is fine if you don’t need it.
You may also lose some headers that ZCR normally adds, like Content-Type (which sets the charset to UTF-8, while PHPmailser uses iso-8859-1 by default!) and the header that adds the IPnr of the sender.
Also, the $subject you’re using is already encoded. Because PHPMailer does the same, you risk having it encoded twice, which won’t notice until you use characters in your subject that need encoding.

Offline

Board footer

Powered by FluxBB