Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#226 2007-08-21 15:54:15
- marios
- Archived Plugin Author

- Registered: 2005-03-12
- Posts: 1,253
Re: gbp_permanent_links
Dear Graeme,
I am also having trouble with a redirectbehavior as rloaderro describes.
I have a section of topics, with a permlink rule of section/category/custom_field
that uses it’s on template and is restricted to that section only.
Now when I get from a section/category/customfield directly to an article_frontpage, the custom_field request URI part get’s appended to the article frontpage URL.
(Doesn’t happen, when going from another section)
Feels almost, as if some variable content doesn’t get emptied out before another rule applies.
However, I also have two other rules, one that applies to that section with a different template, and one that does not.
Is it a bug, may be I’m just using a wrong rule combination?
(I am using it together with mlp on a 4.0.5 install, if that helps, and sql version is 5.0.19)
UPDATE: I am also getting an error notice, when using regular expressions:
Notice: unserialize() [function.unserialize]: Error at offset 172 of 191 bytes in /Users/www/Sites/dev_sundrivedesign2/textpattern/lib/txplib_misc.php(534) : eval()'d code on line 1676
Thanks again for all this terriffic work, I appreciate it.
It says then: Not a Number (NaN) in the regexp component display field.
( Thanks again for all this terrific work, I really apreciate it )
regards, marios
Last edited by marios (2007-08-23 08:29:35)
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline
#227 2007-08-21 18:50:35
- diuk
- Member
- Registered: 2007-08-21
- Posts: 15
Re: gbp_permanent_links
There seems to be a problem with txp 4.0.5, I am not able to turn on debugging, trying to do so results in a blank page.
I think there is a htaccess trick to get section/category/article type urls, anyone has any ideas on how to set this up with mod_rewrite? Thanks in advance.
Regards,
D
Last edited by diuk (2007-08-21 18:50:58)
Offline
#228 2007-08-23 01:43:35
Re: gbp_permanent_links
First off — what a sexy plugin. But I’m having a few issues.
I have three rules set up:
“news” – section/date/title/ – precedence: 200 – Only for the News section
“resources” – section/category/title – precedence: 200 – Only for the Resources section
“global” – section/title – precedence: 100 – Works site wide.
All the links are formed right, but when I click on them they all give me the same error:
Not Found
The requested URL /news/2007/08/18/news-item-1/ was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Any suggestions? I’m sure there is something small I’m overlooking.
PHP: 4.7
Txp: 4.0.5
gbp_admin_library: 0.4.581
gbp_permanent_links: 0.11.617
Thanks for the help.
Offline
#229 2007-08-28 03:48:34
- diuk
- Member
- Registered: 2007-08-21
- Posts: 15
Re: gbp_permanent_links
BIIIINGO!!!!!!
I got it, I’m answering my own question: in preferences, turn “join_pretext_to_pagelinks” to “no, that way the category url name won’t get appended to the permalink. Now I can take nap.
Regards,
D
Offline
#230 2007-08-28 09:37:15
Re: gbp_permanent_links
Likewise, as diuk, if figured out my issue too. Turns out i didn’t have the right permissions set to my .htaccess file.
Offline
#231 2007-08-29 23:19:37
Re: gbp_permanent_links
Zanza wrote:
had to quickly revert to 0.11.566, because my url ‘name.htm’ in the url title got converted to ‘namehtm’.
I had the same problem, and while trying to hunt down its source, I found it’s connected with replacing the original urlencode() function in building the permling URL (rev 0.11.566 and earlier) with the sanitizeForUrl() somewhere down the road to 0.11.617. The latter function, found in Textpattern’s lib/txplib_misc.php, removes dots from the string.
So far, my quick-and-dirty hack (wouldn’t call it solution) is to modify the library function by adding \. to the character classes in the last two regexps, lines 641 and 643 in the file in Textpattern 4.0.5 distro.
A better solution is needed – graeme, please, could you help? I can’t see any reason why dots should be banned from URLs.
Premek
“So, where is the patch?”
((former nick pbrada))
Offline
#232 2007-08-29 23:31:12
Re: gbp_permanent_links
tinyfly wrote:
Can I use this plugin to simulate nested sections in the URL? I’m having a hard time wrapping my head around this. What I would like is for my url to be:
domain.com/section/section/for landing pages.
graeme wrote:
Currently no. But I’m looking it to supporting this in the future.
I cast my vote for this feature – for over two years now, I wish Textpattern could handle sites with basically unlimited depth of nested (sub)sections since I use it on a couple of sites with fairly rich structure. If gbp_permanent_links could help to fake this functionality through sections or categories (which can be nested ad libitum) or whatever, I’d be really happy.
Premek
PS: Graeme, thanks for this plugin, it really rocks.
“So, where is the patch?”
((former nick pbrada))
Offline
#233 2007-08-30 00:01:01
Re: gbp_permanent_links
tinyfly wrote:
Can I use this plugin to simulate nested sections in the URL? I’m having a hard time wrapping my head around this. What I would like is for my url to be:
domain.com/section/section/for landing pages.
graeme wrote:
Currently no. But I’m looking it to supporting this in the future.
Ok, this solves my problem: It’s insolvable :-)
Textpattern projects: Maxvoltar, Made by Elephant, Twunch
Offline
#234 2007-09-05 13:48:28
- jmk
- Member
- Registered: 2006-09-04
- Posts: 49
Re: gbp_permanent_links
what a really nice and well coded plugin! thank you
Offline
#235 2007-09-06 14:13:12
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: gbp_permanent_links
Found a cute little bug :
break;
case 'id':
if ($rs = safe_row('ID', 'textpattern', "`ID` = '$uri_c' $context_str...
should be
break;
case 'id':
if ($rs = safe_row('ID, Posted', 'textpattern', "`ID` = '$uri_c' $context_str...
Feature request : allow to set what status you’d like to be searched for, per rule. (sticky, live, draft,…). Perhaps as a radio-list?
Offline
#236 2007-09-06 14:48:21
Re: gbp_permanent_links
Hi guiguibonbon,
what does that little cute fix do?
Last edited by maniqui (2007-09-06 14:50:40)
Offline
#237 2007-09-06 14:49:44
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: gbp_permanent_links
at the moment, it generates an error when you’re on a page whose permlink contains an article id, because $rs['Posted'] is called a few lines further.
Note : it may well be that I actually deleted the posted myself by accident previously. Unlikely though, but should be checked. Checked : it’s a bug.
Last edited by guiguibonbon (2007-09-06 15:34:54)
Offline
#238 2007-09-06 19:20:16
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: gbp_permanent_links
And another bug :
if (is_numeric(@$pretext['id'])) {
$a = safe_row('*, unix_timestamp(Posted) as uPosted', 'textpattern', 'ID='.intval($pretext['id']).' and Status = 4');
populateArticleData($a);
}
should be :
if (is_numeric(@$pretext['id'])) {
$a = safe_row('*, unix_timestamp(Posted) as uPosted', 'textpattern', 'ID='.intval($pretext['id']).' and Status >= 4');
populateArticleData($a);
}
Otherwise sticky articles don’t show up, but don’t generate 404 either. Seems to have been inspired by this strange phenomena.
And if that little feature request of mine three posts above would be implemented, the end of that query should be adapted accordingly.
Last edited by guiguibonbon (2007-09-06 19:21:00)
Offline
#239 2007-09-06 21:31:51
- marios
- Archived Plugin Author

- Registered: 2005-03-12
- Posts: 1,253
Re: gbp_permanent_links
Unfortunatelly, I am having some trouble again.
It turns out that the plugin will break pagination with article_lists, allthough all the rules I have defined are only applied to sections that are not paginated and are restricted to other sections.
It took me quite some time, to figure out, what exactly is going on.
With the default older newer tags, that are used on the template, the page only paginates until page 2,
Any numPages Value greater then two returns a 404, allthough I have a Total of 4 Pages.
A possible suspicion : The total pagenumber count from the textpattern_end function isn’t right.
But why does the plugin influence a section, that is totally isolated from the rules, that I have set up?
Also:
- Around line 600 the plugin calls the txp_die function, which unfortunately is no longer available in taghandlers as of version (4.0.5)
regards, marios
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline
#240 2007-09-06 21:52:08
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: gbp_permanent_links
marios try clearing out _textpattern_end () around line 654
function _textpattern_end ()
{
while (@ob_end_flush());
}
Last edited by guiguibonbon (2007-09-06 21:52:18)
Offline