Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#61 2007-03-09 22:46:13

frodriguez
Member
From: Tampa, FL
Registered: 2007-03-09
Posts: 11
Website

Re: zem_contact_reborn 4.0.3.19 (old version)

LOL, damn dude, somehow I did get an older version I thought I had the latest, geeze disregard these posts then.
What is the link or the page where I can get the most recent and future releases? Again sorry for wasting your time.
I just installed textpattern last night and went to the resources, did a search for your plugin and that is probably how I ended up getting an older version (0.6).

Last edited by frodriguez (2007-03-09 22:49:32)

Offline

#62 2007-03-09 22:54:13

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.19 (old version)

Have a look at the first post in this topic ;)

zem_contact 0.6 is the most recent version of that plugin… it’s just a different plugin than ZCR.
zem_contact_reborn is based on zem_contact, (hence the name).

Last edited by ruud (2007-03-09 22:56:50)

Offline

#63 2007-03-09 22:55:57

frodriguez
Member
From: Tampa, FL
Registered: 2007-03-09
Posts: 11
Website

Re: zem_contact_reborn 4.0.3.19 (old version)

Yes yes, I am just starting to have this epiphany, I traced back my steps and realized all this, oh man….
Latest version works and covers the issues/concerns I had posted, regardless, thank you very much for all your help.

Yes it trully is reborn, good stuff!! LOL

So cool that you can modify the text now and stuff for the error messages without having to go into the core code!

Last edited by frodriguez (2007-03-09 23:36:55)

Offline

#64 2007-03-10 02:42:38

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: zem_contact_reborn 4.0.3.19 (old version)

Ruud,
That’s twice in one day!!! I was thinking about the comment form… UGh. Thx for responding anyhow… I feel silly.


Offline

#65 2007-03-11 07:19:08

frodriguez
Member
From: Tampa, FL
Registered: 2007-03-09
Posts: 11
Website

Re: zem_contact_reborn 4.0.3.19 (old version)

I was trying to use the send article feature (which runs great BTW) I noticed that when I clicked on a section link the email wouldn’t include the first article that came up.

My scenario is that the first article in each section acts as a mach landing page, and each section loads the “send article” link. I am just starting to get aquainted with the textpattern library, but I came up with a form that does the trick. I thought I would post it here in case someone else had the same scenario. I just load this form before the send article tags and I am good to go.

I used the $s variable here but read in one of the files it was depricated wasn’t sure if I was to use $pretext but $s still looked valid.

<txp:php>
global $s;

if ( !empty($s) ) {

	$rs = safe_row("*, unix_timestamp(Posted) as uPosted", "textpattern", "Section=" . doQuote( doSlash($s) ) . " limit 1");

	if ( !empty($rs) ) {

		populateArticleData($rs);
	}
} // No else since $thisarticle arrray is populated when ID is present
</txp:php>

Offline

#66 2007-03-11 22:57:36

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

Re: zem_contact_reborn 4.0.3.19 (old version)

Great plugin, stupid question: I can’t make the email field optional in 4.0.3.19. No matter what I put in the zem_contact_email field, e.g. required="0", required="no", etc it is always tagged with zemRequired in the code.

My form goes something like this:

<txp:zem_contact to="my@address.com" label="Contact us" thanks_form="contact_thanks" >
<p>Some blurb.</p>
<txp:zem_contact_select list=",Choose,A,Topic,Here,If,You,Like" required="0" label="Topic" />
<txp:zem_contact_text label="Name" required="0" />
<txp:zem_contact_email required="0" />
<txp:zem_contact_textarea label="Comments" required="1" cols="45" />
<txp:zem_contact_submit label="Send" />
</txp:zem_contact>

Am I being stupid and missing something?


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

#67 2007-03-11 23:55:24

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.19 (old version)

Stef, I’m asking myself the same question. I know how I can fix it. I just don’t know why it’s not working as it is now. It’s the intval in the zem_contact_lAtts function that seems to cause this problem. If you remove that entire line, the problem is solved… but why?

I know that it has something to do with the fact that $atts[‘required’] is an integer at that point, while it is a string in other cases, but that shouldn’t be a problem. And the funny thing is that doing intval(0) or intval(“0”) gives the same result, yet somehow assinging that back to $atts[‘required’] turns it into a 1.

Any PHP experts here that can shed a light on this?

Last edited by ruud (2007-03-12 00:01:08)

Offline

#68 2007-03-12 06:12:45

frodriguez
Member
From: Tampa, FL
Registered: 2007-03-09
Posts: 11
Website

Re: zem_contact_reborn 4.0.3.19 (old version)

I am no pro, but this is what I found.

The problem is comparing an int value to a string value. When the zem_contact_email() function runs, it calls the function zem_contact_lAtts() which makes the $required variable an int. When zem_contact_email() calls zem_contact_text() and passes the attribute array, that function also calls zem_contact_lAtts(), which then runs through this loop

foreach(array('button', 'copysender', 'checked', 'required', 'send_article', 'show_input', 'show_error') as $key)
    {
        if (isset($atts[$key]))
        {
            if ($atts[$key] == 'yes') $atts[$key] = 1;
            elseif ($atts[$key] == 'no') $atts[$key] = 0;
            else $atts[$key] = intval($atts[$key]);
        }
    }

When it hits the $atts['required'] var, it is an interger value of 0 being compared to a string value of 'yes', 
this makes the first If statement execute which changes it to a 1.

To correct this problem I changed that code above to this

foreach(array('button', 'copysender', 'checked', 'required', 'send_article', 'show_input', 'show_error') as $key)
    {
        if (isset($atts[$key]))
        {
            if ($atts[$key] === 'yes') $atts[$key] = 1;
            elseif ($atts[$key] === 'no') $atts[$key] = 0;
            else $atts[$key] = intval($atts[$key]);
        }
    } 

So when that comparison is made it must be of type string and must contain the value specified, 
being that the $atts['required'] value no longer meets these requirements it takes the last else clause and 
stays as 0 (or whatever it has been set to).

I tested this with the form code that was posted here and only comments came up as required, which 
is what I think Bloke is what you were looking for.

Offline

#69 2007-03-12 08:25:34

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.19 (old version)

Federico, thank you very much. This will be fixed in the next version.

Offline

#70 2007-03-12 14:02:07

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

Re: zem_contact_reborn 4.0.3.19 (old version)

frodriguez wrote:

I tested this with the form code that was posted here and only comments came up as required, which
is what I think Bloke is what you were looking for.

Genius. So simple when it’s pointed out… many thanks.


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

#71 2007-03-12 23:32:10

frodriguez
Member
From: Tampa, FL
Registered: 2007-03-09
Posts: 11
Website

Re: zem_contact_reborn 4.0.3.19 (old version)

No problem guys, glad I could help.

Offline

#72 2007-03-13 08:53:46

lee
Member
From: Normandy, France
Registered: 2004-06-17
Posts: 831

Re: zem_contact_reborn 4.0.3.19 (old version)

Is it possible to have a link with parameters, like ?topic=Spain, open a new page with a form on and to have the topic field pre filled by the link parameter value? Or is this wish full thinking! Thanks, Lee.

Offline

Board footer

Powered by FluxBB