Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1345 2013-11-12 20:24:51

brunodario
Member
From: Belo Horizonte, Brasil
Registered: 2007-09-19
Posts: 75

Re: zem_contact_reborn 4.0.3.20

ruud wrote:


Are you using a <txp:zem_contact_email /> tag in that form? That’s required to make this work.

Shame on me… i was using text field instead. Thx Ruud!

And thanks Bloke, it’s great to know someone is taking a look at such an usefull plugin, i run Zem_contact on almost every Textpattern powered website.

Offline

#1346 2013-11-14 10:22:15

txpdevcoder
Member
Registered: 2012-06-07
Posts: 58

Re: zem_contact_reborn 4.0.3.20

rudd and zainul.dss and bloke

I am getting the same error using re-direct with Textpattern version: 4.5.5 (r5575) and PHP version: 5.4.13. There is definately something wrong with the redirect function. I have a site running TXP 4.5.4 on the same server, same PHP version and the redirect works (i do briefly see a click here if the page does not redirect message, but it does redirect by itself).

The problem It does not navigate away, it submits the form and I receive the email but the page gets stuck at something like contact#zcr4db0e083f882975fe55b30ff3bcf78fb instead of going off to the contact thank you page.

Ruud – I tried changing the line you suggested but i get an error:

Parse error: syntax error, unexpected ';' in /textpattern/lib/txplib_misc.php(812) : eval()'d code on line 242

is there really no other way to change that line?

$uri = hu.ltrim($redirect,'/');

Could it be that recent updates in Textpattern 4.5.5 have broken this? I am not completly certain of that as i have seen this error on older versions of textpattern. I think the culprit might be the PHP version.

Last edited by txpdevcoder (2013-11-14 10:26:31)

Offline

#1347 2013-11-14 11:10:01

txpdevcoder
Member
Registered: 2012-06-07
Posts: 58

Re: zem_contact_reborn 4.0.3.20

I have got a little further. It seems this line:

if (empty($_SERVER['FCGI_ROLE']) and empty($_ENV['FCGI_ROLE']))

No longer flies with current PHP. It was evaluating to false making zem_contact fall back to the old school http meta refresh. I got around it by removing that line and the if statement so it does not need to do this test. I just left it with the PHP redirect and took the HTML one out.

this makes it navigate to the thank you page but for some reason it is still not stripping away #zcr4db0e083f882975fe55b30ff3bcf78fb from the end.

Any ideas?

Offline

#1348 2013-11-14 11:14:27

txpdevcoder
Member
Registered: 2012-06-07
Posts: 58

Re: zem_contact_reborn 4.0.3.20

My redirect now looks like this:

if (mail($to, $subject, $msg, $headers,"-f ".$from))
{
	$_POST = array();

	if ($copysender and $zem_contact_from)
	{
		mail(zem_contact_strip($zem_contact_from), $subject, $msg, $headers,"-f ".$from);
	}
	if ($redirect)
	{
		while (@ob_end_clean());
		$uri = hu.ltrim($redirect,'/');
		//$uri = $redirect;
		//$uri = hu.preg_replace('/#.*/', '', rtrim(ltrim($redirect,'/'));
		txp_status_header('303 See Other');
		header('Location: '.$uri);
		header('Connection: close');
		header('Content-Length: 0');
	}
	else
	{
		return '<div class="zemThanks" id="zcr'.$zem_contact_form_id.'">' .
			($thanks_form ? fetch_form($thanks_form) : $thanks) .
			'</div>';
	}
}

Last edited by txpdevcoder (2013-11-14 11:15:43)

Offline

#1349 2013-11-16 12:19: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.20

The fragment identifier (#zrc…) is used only client-side (the browser). It’s not sent in HTTP requests. You cannot get rid of it.

Offline

#1350 2013-11-16 20:27:12

txpdevcoder
Member
Registered: 2012-06-07
Posts: 58

Re: zem_contact_reborn 4.0.3.20

Ok, but the old redirect worked without it being appended to the end of the redirected URL. How can that be if you say it cant be stripped away when the redirect happens?

Im confused :)

Offline

#1351 2013-11-17 17:34:38

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

Try adding “#” to the redirect URL.
The difference you describe is probably the difference between a server-side redirect and a redirect via HTML.

Offline

#1352 2013-11-19 12:40:49

kevinpotts
Member
From: Ghost Coast
Registered: 2004-12-07
Posts: 370

Re: zem_contact_reborn 4.0.3.20

Hey everyone. Just while brunodario mentioned it and it’s fresh in my mind, I have a modified version of this plugin which I had to put together for my own use one day. It contains the following changes:

Following up on this. Seems like these changes are a long time coming and the community could benefit.


Kevin
(graphicpush)

Offline

#1353 2013-11-19 12:54:02

txpdevcoder
Member
Registered: 2012-06-07
Posts: 58

Re: zem_contact_reborn 4.0.3.20

brunodario wrote:

I’ve recently had to change all forms on a website due to anti-spoofing rules. I had to add the “from” field to match an email from the same domain.

Not sure if this is related to what your trying to achieve but a long time ago i had issues with my server not sending the email out due to anti-spam rules on the server. I fixed it by changing around line 235 to read:

mail(zem_contact_strip($zem_contact_from), $subject, $msg, $headers,"-f ".$from);

the crucial bit was adding “-f “ which properly sets the “from” part of the email header. Without this, my server was blackholing the email into the servers local mail box because without that the email header was getting stamped as coming from the server admin account by default which is not allowed to send emails directly from the server as a security feature.

Hope that helps.

Last edited by txpdevcoder (2013-11-19 12:55:18)

Offline

#1354 2013-11-19 18:45: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

kevinpotts wrote:

Following up on this. Seems like these changes are a long time coming and the community could benefit.

Yes, they are. If I don’t manage to release an update before the end of they year, I’ll hand over plugin maintanance to Stef (assuming he won’t mind). Perhaps setting a deadline will help.

Offline

#1355 2013-11-21 19:57:51

hilaryaq
Plugin Author
Registered: 2006-08-20
Posts: 335
Website

Re: zem_contact_reborn 4.0.3.20

Hi all, there’s another updated version of the html5 friendly zem_contact_reborn, you can download from my web site here

Really excited about this update as it allows autofocus and autocomplete for the first time thanks to Stef.. I’d be more than happy to maintain the plugin going forward if it needs to be looked after.. I’ll be developing it for my own use anyway and I’m very into the backwards compatibility feature of Modernizr etc so that it stays a full and usable solution.. anyway download away anyone that needs it! :)


…………………
I <3 txp
…………………

Offline

#1356 2013-11-21 19:59:33

hilaryaq
Plugin Author
Registered: 2006-08-20
Posts: 335
Website

Re: zem_contact_reborn 4.0.3.20

I’m also interested in updating the help file with the plugin, while the blog post does give thorough instructions a full released update can incorporate all the blog content/help natively would be better..


…………………
I <3 txp
…………………

Offline

Board footer

Powered by FluxBB