Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#205 2005-06-28 20:46:10

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

What I did was: I took your code, pasted it into zem’s plugin template, compiled it, inserted the variable into admin_config and installed my plugin.

That didn’t have any result. Permlink just remained at section/title.

I have to say I did it in a hurry, so I might have made a mistake.

Offline

#206 2005-06-29 15:45:52

rob_roy
Archived Plugin Author
Registered: 2005-02-28
Posts: 18

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Weird. I’m not sure what could be going on. The above function will default to section/title if there is no category assigned to the article, but it should work. I haven’t looked at the recent updates that moved admin_config variables into the db, so I don’t know if that’s changed anything.

My (messy) way to debug would be to go into the plugin and change
<code>return hu.”$section/{$category}{$url_title}”;</code>
to something like
<code>return “DEBUG”;</code>
just so I could see if the plugin was being successfully called. If it is, then after that change is made, feed permlinks would return something like “href=DEBUG” instead of anything useful. Obviously, you wouldn’t want to leave them that way, but then at least you’d be able to see that permlink was successfully calling and_permlinkurl. If and_permlinkurl is successfully being called, then I’ve flubbed up the code somewhere in it.

Last edited by rob_roy (2005-06-29 15:46:56)

Offline

#207 2005-07-01 02:47:03

ubernostrum
Member
From: Lawrence, KS
Registered: 2004-05-05
Posts: 238
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Just updated to rev463 and now the following errors show up whenever sgb_url_handler is enabled:

Notice: Undefined index: PATH_INFO in /var/www/txprc3/textpattern/lib/txplib_misc.php(379) : eval()’d code on line 78
Notice: Undefined index: section_category in /var/www/txprc3/textpattern/lib/txplib_misc.php(379) : eval()’d code on line 136
Notice: Undefined index: section_title in /var/www/txprc3/textpattern/lib/txplib_misc.php(379) : eval()’d code on line 136

Do I have something misconfigured?

Last edited by ubernostrum (2005-07-01 02:47:23)


You cooin’ with my bird?

Offline

#208 2005-07-01 13:52:35

sungodbiff
Archived Plugin Author
Registered: 2004-03-23
Posts: 57
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

ubernostrum -

They aren’t errors :) they’re notices. R463 changed the way errors, warnings and notices are displayed, it’s a simple fix, I’ll post an update once I update my install to 463.

Edit: Okie, dokie, it’s been updated on my site and the first post of this thread.

- sgb

Last edited by sungodbiff (2005-07-01 14:13:51)

Offline

#209 2005-07-01 14:13:13

sungodbiff
Archived Plugin Author
Registered: 2004-03-23
Posts: 57
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

andreas & rob_roy -

&#60;txp:sgb_url_handler_permlink&#62; write URLs in whichever scheme you’ve defined in the config.

(If I’m understanding your questions correctly:)
The problem with RSS/Atom feeds is that they’re coded to use TxP’s built-in permlinkurl function which is based only on TxP’s Permlink Mode. So in order to use the plugin you’d need to go into textpattern/publish/rss.php and change references to <code>permlinkurl()</code> to <code>sgb_url_handler_permlinkurl()</code> — I think, I haven’t tested this though.

- sgb

Offline

#210 2005-07-01 16:17:55

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

I have a test install of 463 at dev.patetech.info/textpattern/ with production status set to production_debug and permlink mode set to /year/month/day/title. I just installed sgb_url_handler (0.1.8.4) and sgb_error_documents (0.1.2.2).

On the main index, http://dev.patetech.info/textpattern/, I am getting

  • Notice: Undefined index: PATH_INFO in /home/_/txplib_misc.php(379) : eval()’d code on line 79

On the entry page, http://dev.patetech.info/textpattern/2005/06/25/first-post, I get

  • Notice: Undefined index: PATH_INFO in /home/_/txplib_misc.php(379) : eval()’d code on line 79
  • Notice: Undefined variable: section in /home/_/txplib_misc.php(379) : eval()’d code on line 225
  • Notice: Undefined variable: category in /home/_/txplib_misc.php(379) : eval()’d code on line 225

Maybe this will help with further development.

Offline

#211 2005-07-01 16:51:27

sungodbiff
Archived Plugin Author
Registered: 2004-03-23
Posts: 57
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

michaelkpate -

Hmm, I’ve got my site set to debug and I can’t get it to output any errors/warnings/notices. If you don’t mind, can you add the following code to sgb_url_handler:

Insert <code> $section = null; $category = null;</code> after <code>function sgb_url_handler_match_url($url, $config) {</code>.

Change (line 79) <code>} else if ($_SERVER[‘PATH_INFO’]) {</code> to <code>} else if (isset($_SERVER[‘PATH_INFO’])) {</code>.

Thanks,

- sgb

Offline

#212 2005-07-01 17:20:41

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

I made the changes and as you can see the errors went away. Cool!

Now if only it would display the article and not the 404. But I know that is a completely different issue.

Offline

#213 2005-07-03 14:31:51

sungodbiff
Archived Plugin Author
Registered: 2004-03-23
Posts: 57
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

michaelkpate -

Add a scheme to the schemes list: <code>$schemes[‘date_title’] = ‘/&#37;year&#37;/&#37;month&#37;/&#37;day&#37;/&#37;title&#37;’;</code> in the config function.

That should be part of the default distro (section_date_title is), I’ll add it in a later revision.

- sgb

Last edited by sungodbiff (2005-07-03 14:33:37)

Offline

#214 2005-07-03 17:40:36

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

SGB,

You are fantastic. It works great.

I also added one for a blogger style url.

<code>$schemes[‘month_title’] = ‘/%year%/%month%/%title%’;</code>

Last edited by michaelkpate (2005-07-03 17:41:09)

Offline

#215 2005-07-03 19:15:55

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

SGB, I’m going to go out on a limb here and ask a newbie question.

I want to add the categories: Colophon, Contact and Services under the About section. How do I use this plugin so I can link to:

mywebsite.com/About/Colophon

Do I need something specific on the page itself also?

Sorry to waste your time, I must be overlooking something as when I try I just see the homepage (like when you access a URL that doesnt exist).

Offline

#216 2005-07-04 20:53:12

jonhicks
Member
From: Oxfordshire UK
Registered: 2004-03-22
Posts: 256
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

I think I’m missing something here. I’ve uploaded both plugins, but the url_handler is outputting errors to the site itself, with this new fangled production status thing:

Notice: Undefined index: PATH_INFO in /usr/home/hicksde/public_html/textpattern/lib/txplib_misc.php(379) : eval()’d code on line 79
Notice: Undefined index: id in /usr/home/hicksde/public_html/textpattern/lib/txplib_misc.php(379) : eval()’d code on line 360
Notice: Undefined index: category2 in /usr/home/hicksde/public_html/textpattern/lib/txplib_misc.php(379) : eval()’d code on line 368

Disabling the plugin stops the errors


Cheers,
Jon VC#9

Offline

Board footer

Powered by FluxBB