Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-05-25 21:47:25

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

smd_redirect (unofficial)

I have an unofficial release of smd_redirect installed. It’s worked fine creating redirects. It’s been many moons since creating a long list of redirects, so I deleted quite a few. After logging back into the admin side a couple days later, I was surprised to find all the redirects listed again. So, I tried deleting them again from the Redirects Extension panel and I notice that even though they delete one by one using the button, there’s a persistent “Deleting…” text just above the list. I wait. I wait. I wait. It doesn’t go away. So I click away from the panel, come back, and all the redirects are listed again.

Bloke, I know you’re busy, and this plugin was never officially released. So I’m wondering if I should just start using arc_redirect? Seriously, no pressure!

While I’m at it — in case you do decide to fix ‘er up and release it officially — arc_redirect has a rather nice display for redirect records created. It looks a little more harmonious to the admin UI. Maybe there are some markup ideas to borrow there.

Offline

#2 2015-05-25 22:06:46

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: smd_redirect (unofficial)

Oh, just remembered… One thing I did have trouble with recently when creating a redirect was saying everything in /old section is now in /new section.

I thought I had done that once using that syntax exactly and it worked, but this time it didn’t work.

However, when I used this, it did work:

(.*)/old(.*)
{$1}/new{$2}

I point this out because I don’t think arc_redirect allows wild card handling like that. So unless arc_redirect does work by using the first method — bulk redirects form old to new sections (I haven’t tested that plugin yet) — then I would be in a pickle, or need to resort to .htaccess, but that’s a step back, in a sense.

Just to point it out.

Offline

#3 2015-05-31 22:57:19

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

Re: smd_redirect (unofficial)

Destry wrote #291062:

I deleted quite a few. After logging back into the admin side a couple days later, I was surprised to find all the redirects listed again.

Apologies for the shoddiness of the code. There’s one or two places where the JavaScript code falls apart. One such situation is when adding or deleting a series of redirects without first refreshing the page. It looks like it’s doing it, but if you refresh, all but the first one reappears. The “solution” (ahem) is to refresh the page between edits. It was on my ToDo list to fix, but since I figured that nobody used the plugin, its priority dropped.

I can look into it for you. Nudge me in a few days if you haven’t heard anything.

arc_redirect has a rather nice display for redirect records created. It looks a little more harmonious to the admin UI. Maybe there are some markup ideas to borrow there.

I’ll be sure to check that out, thanks for the heads-up. The markup is pretty ropey in smd_redirect as it was just kind of thrown together in an evening as a proof of concept. No excuse, really.


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

#4 2015-06-11 09:27:43

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

Re: smd_redirect (unofficial)

I’ve fixed the bugs you mentioned. If you’re comfortable copying and pasting the code from Github or have the Plugin Composer available to install the .php file, cool. If you want me to send you a compiled version, just holler.


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

#5 2015-06-24 09:56:38

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: smd_redirect (unofficial)

Thanks, Stef!

Offline

#6 2015-06-24 10:17:29

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: smd_redirect (unofficial)

I made a php file from the Github version (same name), uploaded it via composer. The plugin then is noted as, Edited? “Yes”. Only thing out of the ordinary are the UI labels and buttons in the Extensions panel are geeky, for example:

smd_redir_control_panel
smd_redir_btn_new

Offline

#7 2015-06-24 10:28:31

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

Re: smd_redirect (unofficial)

Destry wrote #291944:

The plugin then is noted as, Edited? “Yes”.

Yup.

Only thing out of the ordinary are the UI labels and buttons in the Extensions panel are geeky, for example:

The Textpack didn’t get installed. Probably a Plugin Composer setting (you can choose to run lifecycle events or not, from the Settings page).

Another method is to copy the Textpack strings out of the plugin’s .php file, visit Admin->Preferences->Languages (or Admin->Languages if on 4.6+), paste the strings into the box and upload them.


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

#8 2015-06-24 10:56:01

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: smd_redirect (unofficial)

This is a 4.5.7 site.
I don’t see that setting you mention in Composer’s “options” list. Maybe I have an outdated version.
I combed through the file a couple times but don’t really know what to look for with textpacks. That term isn’t found, anyway.

There’s no hurry on this, Stef. When you get a chance to compile the plugin, next week, or whenever, that might be easier for dopes like me.

Offline

#9 2015-06-24 11:12:08

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

Re: smd_redirect (unofficial)

Destry wrote #291946:

I don’t see that setting you mention in Composer’s “options” list. Maybe I have an outdated version.

Latest public version is 1.0.6. Under the Setup link you should have a preference setting labelled Perform lifecycle actions on with four checkboxes. But, thinking about it now, it won’t work for Textpacks unless the plugin explicitly has such an action (like Adi’s plugins do) so don’t sweat it. I need to get smarter at Textpack integration, both in my plugins and the Composer.

I combed through the file a couple times but don’t really know what to look for with textpacks. That term isn’t found, anyway.

Ahem, sorry. I forgot to export them into the plugin. Oops. Try downloading it again from Github and you’ll see a section near the top that starts:

$plugin['textpack'] = <<<EOT
#@smd_redir
...

Copy the line that reads ‘#@smd_redir’ and all the lines below that begin with smd_redir* and paste them in the box at the bottom of the Languages panel, then hit the button to install them. Apologies for the schoolboy error.


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

#10 2015-06-24 15:51:15

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: smd_redirect (unofficial)

Got it. Thanks.

Offline

#11 2016-07-01 12:27:11

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: smd_redirect (unofficial)

Probably not the time to talk about bugs on unofficial plugins, but…

I created an redirect that’s not actually needed now, but there’s seemingly no way to delete redirects I’ve created. Also the presentation is quite out of kilter with Hive.

txp 4.6 beta
mysql 5.7.13
php 7.0.7

Offline

Board footer

Powered by FluxBB