Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2004-10-31 21:57:06

misterk
Member
From: Morris, MN
Registered: 2004-02-24
Posts: 77
Website

Re: [plugin] [ORPHAN] zem_redirect

Ok, so maybe I should try and play with the comment_invite function to request …/#/title#comment. Thanks!

Offline

#32 2005-02-01 05:08:08

txfrog1999
Archived Plugin Author
From: Texas
Registered: 2004-12-31
Posts: 17
Website

Re: [plugin] [ORPHAN] zem_redirect

zem – great plugin, works wonders when using your rewrite plugin on servers less than enthusiastic about giving me access to rewrite rules in the .htaccess file. I did want to mention that in one of the sites I worked on over the weekend with text pattern and your plugin, I needed to redirect to a page upon an error and not an article ID, since all articles in this case were magazine descriptions.

So, the solution was to add an attribute to your plugin: errorpage=“x”

after line 7 I added the following line:

$errorpage = (!empty($atts[“errorpage”]) ? $atts[“errorpage”] : “”);

and made the following changes to the conditional if($notfound) on line 39:

if ($notfound) { header(“HTTP/1.1 404 Not Found”); if ($errorid) { $pretext[“id”] = $errorid; $zem_redirect_lock = 1; textpattern(); exit; } else if ($errorpage) { header(“location:http://”.$canonical_host.”/”.$errorpage); exit; } else print “The requested page ‘$actual_uri’ does not exist.”; exit;
}

So upon using the plugin I now have the tag read: <txp:zem_redirect ignoredomain=1 errorpage=“404”> In this case 404 equals a custom section I created to handle all errors, but you could just as easily have put errorpage=“error.php”.

Offline

#33 2005-02-04 08:58:30

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Re: [plugin] [ORPHAN] zem_redirect

zem_redirect comflicts with the hfw_pg_* plugin used to generate paginated articles.

Last edited by Etz Haim (2005-05-18 06:35:14)

Offline

#34 2005-02-05 04:12:27

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Re: [plugin] [ORPHAN] zem_redirect

I have produced a hacked version of zem_redirect that enables it to work fine with paginated articles. The demonstration URL is now working. I’m sending the hack to zem.

PS. Once my website becomes production, this demo URL will be removed.

Update: My hack also has a condition to trim the redundant ?pg=1 suffix.

Last edited by Etz Haim (2005-02-05 04:31:19)

Offline

#35 2005-02-10 10:16:36

Vincent Grouls
Archived Plugin Author
From: Aberdeen, UK
Registered: 2005-01-31
Posts: 9
Website

Re: [plugin] [ORPHAN] zem_redirect

This is a great plug-in zem, thanks!

zem_redirect also conflicts with the ‘fla_style_switcher’ by Benoit Pepermans. In case you wish to use both, just add this to the code of zem_redirect:

FIND:
<pre><code> $actual_host = serverSet(“SERVER_NAME”); $actual_uri = urldecode(serverSet(“REQUEST_URI”)); $notfound = 0;
</code></pre>

AFTER, ADD:
<pre><code> if(gps(‘css’)) { return; }
</code></pre>

Last edited by Vincent Grouls (2005-02-10 10:17:34)

Offline

#36 2005-05-03 18:12:31

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Re: [plugin] [ORPHAN] zem_redirect

This still looks up the url_mode variable, right? Perhaps it’s time to update it to use permlink_mode.

Offline

#37 2005-06-02 18:23:40

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: [plugin] [ORPHAN] zem_redirect

Zem says >
A URL scheme like /section/year/month/day/article will work just fine for article permlinks, but /section/2004/06/01 won’t produce a list of articles for that date without an additional plugin.

» Does anyone know of a plugin that will allow this?
» Are there any plans to support this in TXP?
» I’d really like to get a link like http://example.com/events/2005/06/15/ to pass a list of date specific articles to the article form. Specifically, I’m trying to get calendar to play nice.

Last edited by mrdale (2005-06-02 18:24:40)

Offline

Board footer

Powered by FluxBB