Textpattern Forum

You are not logged in. Register | Login | Help

#41 2010-12-14 19:21:01

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,388
Website

Re: Redirect Pro

Thanks for posting Jakob! Not a bad idea at all. If we all just start posting usage examples and issues we encountered (and hopefully solutions), then maybe this thread can become sort of a support thread.


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

#42 2010-12-14 23:24:13

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 1,899
Website

Re: Redirect Pro

May I find out more by asking questions?

For example: I’m using tru_tags on the site in question and have lovely www.mysite.com/tags/tag-name clean urls for the tags section … that is until I activate zem_redirect (the version 1.2.1 neko posted above). Then it shows me the clean url for a brief moment before updating it to http://www.mysite.com/tags/?section=tags&t=tag-name. It only needs the plugin to be activated as there is no zem_direct tag in the tags page template (the zem_redirect tag mentioned above is in an entirely different page template).

Is there a way of making zem_redirect less aggressive in its interception? Or perhaps an alternative way of achieving what I posted earlier?


TXP Builders – finely-crafted code, design and txp

Offline

#43 2010-12-15 14:45:25

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 1,899
Website

Re: Redirect Pro

I think I have two possible solutions to the above. It seems to rest with tru_tags use of the url parameter &section=tags rather than &s=tags.

One solution is to edit zem_redirect and add unset($get['section']); to the following around line 75 so that it reads:

		# other unknown query parameters might be used by plugins
		$get = gpsa(array_keys($_GET));
		if (!$get) $get = array();
		unset($get['id']);
		unset($get['s']);
		unset($get['section']);
		unset($get['c']);

The other solution is to edit the function tru_tags_clean_url_handler in the tru_tags plugin around lines 494 and 497 replacing the GET['section'] and POST['section'] with GET['s'] and POST['s']. The respective section of code then reads:

		if (count($_POST) > 0) {
			$_POST['s'] = $tru_tags_prefs[TAG_SECTION]->value;
			$_POST[$tru_tags_prefs[PARM_NAME]->value] = $tag;
		} else {
			$_GET['s'] = $tru_tags_prefs[TAG_SECTION]->value;
			$_GET[$tru_tags_prefs[PARM_NAME]->value] = $tag;
		}

I’m not sure if there is a particular reason why tru_tags uses ?section= rather than ?s=. Maybe its root lies in an earlier version of txp. I’ll continue to watch what happens and report back if it goes up in smoke!

BBTW: both solutions together are not necessary.

Last edited by jakob (2010-12-15 22:13:27)


TXP Builders – finely-crafted code, design and txp

Offline

#44 2010-12-15 20:43:19

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,388
Website

Re: Redirect Pro

Thanks again! A couple of years ago I had exactly the same problem, and the only way to solve it back then was to stop using Redirect Pro… At the moment I’m not using the ‘tag’ section anymore, so the problem is gone. But I’m sure it will help others.

Or perhaps an alternative way of achieving what I posted earlier?

Don’t know. It’s exactly how I’ve been handling this.


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

Board footer

Powered by FluxBB