Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#445 2009-04-02 23:12:38

beztak
Member
From: Czech Republic
Registered: 2005-07-21
Posts: 184
Website

Re: gbp_permanent_links

graeme wrote:

Should be fixed in version 0.14 (Compressed) – love the site design btw

Nice to here you like design. Thank you.

So frontpage is now ok, but category listing pages cannot paginate, e.g.: http://dev.ovsem.net/kategorie/software/
Links are going back to homepage. I set precedence for the 6 rule to “1”, the rest is “0”.

If you want I would send you a login/pass to this site. And as I promise I would like to give you some money for your help. I’m so happy I can launch officially this new site after resolving this.

Offline

#446 2009-04-02 23:47:03

graeme
Plugin Author
Registered: 2004-06-21
Posts: 337
Website

Re: gbp_permanent_links

beztak wrote:

So frontpage is now ok, but category listing pages cannot paginate, e.g.: http://dev.ovsem.net/kategorie/software/
Links are going back to homepage. I set precedence for the 6 rule to “1”, the rest is “0”.

Okay– i’ve recreated the v0.14 download. Please try it again – this time there is a new preference (text_and_regex_segment_scores) option which defaults to zero for backwards compatibility. Basically the text and regular expression segments have never been counted when calculating which rule to use (there was a good reason for this at the time but I can’t remember what!) – if you set it to 1 and you should be good to go.

Edit: There seems to be one last problem – which unfortunately is not as easy to fix. On the second page, the link back to page 1 is incorrect. There should be a way to fix this but I’ll have to sleep on it

Last edited by graeme (2009-04-03 00:14:59)

Offline

#447 2009-04-03 07:07:28

beztak
Member
From: Czech Republic
Registered: 2005-07-21
Posts: 184
Website

Re: gbp_permanent_links

graeme wrote:

Okay– i’ve recreated the v0.14 download. Please try it again – this time there is a new preference (text_and_regex_segment_scores) option which defaults to zero for backwards compatibility. Basically the text and regular expression segments have never been counted when calculating which rule to use (there was a good reason for this at the time but I can’t remember what!) – if you set it to 1 and you should be good to go.

It seems it’s not working. So I send you in PM login/pass to my site. Thank you in advanced.

Edit: There seems to be one last problem – which unfortunately is not as easy to fix. On the second page, the link back to page 1 is incorrect. There should be a way to fix this but I’ll have to sleep on it

I see this problem, but it’s working, so this can be resolved later ;)

Offline

#448 2009-04-03 09:43:24

graeme
Plugin Author
Registered: 2004-06-21
Posts: 337
Website

Re: gbp_permanent_links

beztak wrote:

It seems it’s not working. So I send you in PM login/pass to my site. Thank you in advanced.

Right I think it is sorted – I’ve made some small change to the plugin code on the site (I will release it later.. once I get home) and I’ve increased the precedence of your /page rule. Can you make sure it is working as expected?

Offline

#449 2009-04-04 08:12:42

beztak
Member
From: Czech Republic
Registered: 2005-07-21
Posts: 184
Website

Re: gbp_permanent_links

graeme wrote:

Right I think it is sorted – I’ve made some small change to the plugin code on the site (I will release it later.. once I get home) and I’ve increased the precedence of your /page rule. Can you make sure it is working as expected?

It’s working like a charm. Thank you very much.
Rest in PM.

Offline

#450 2009-04-05 12:26:11

hoho
Plugin Author
Registered: 2009-04-05
Posts: 11

Re: gbp_permanent_links

graeme wrote:

Should be fixed in version 0.14 (Compressed)

Greame, thanks for the plugin and for providing great support, first of all. Only a pity there is no documentation and one has to learn by trial-and-error or reading through this lengthy, unstructured thread.

Trying to configure the plugin for my site, I’ve come to some issues you might find worth your time.

1) Newlines are gone in the compressed 0.14 version making tweaking almost impossible. Or is it part of the compression? Anyway, despite having full access to server configuration, haven’t managed to install uncompressed version by any means :( so newlines in the compressed version would come in handy.

P.S. post_max_size = 8M and upload_max_filesize = 10M seem fairly enough for a 80k plugin but it always gets truncated upon upload.

2) I need an article ‘article-title’ in categories ‘cat1’ and ‘cat2’ to be accessible via URLs
example.com/article-title
example.com/cat1/article-title
example.com/cat2/article-title

This can be done with the plugin. However, I also want <txp:permlink/> to be context sensitive and preserve the category whenever possible. That is, being in a category ‘cat1’ and linking an article in ‘cat1’ I want the URL be /cat1/title. Being in a category ‘cat1’ and linking an article not in that category, I want the URL be just /title. Finaly, having selected no category and linking an article in whatever categories, I still want the URL be just /title.

I didn’t find a way to achieve this behaviour in the current implementation – it seems to be context insensitive and tries to generate always the same permanent link no matter where we are in the web tree, a contra-intuitive behaviour to me when it comes to categories.

I have tweaked the ‘category’ section in the _permlinkurl function (from line 772 of the uncompressed version) as follows

case 'category':
  if (!@$pl_c['category']) $pl_c['category'] = 1;
  $primary = 'category'. $pl_c['category'];
  $secondary = 'category'. (3-(int)$pl_c['category']);
  if ($$primary == $pretext['c']) $uri_c = $$primary;
  else if ($$secondary == $pretext['c']) $uri_c = $$secondary;
  else {
    unset($uri);
    break 2;
  }

It seems to do what I want :) – I’m no expert in PHP, just using my general hacking skills. Would it be possible to include this behaviour in the plugin, please?

3) Why is “Permanent Links” tab not available from the “Plugins” tab? It was real pain in a body part fighting the truncation and then tweaking the plugin. :)

Offline

#451 2009-04-10 13:33:21

graeme
Plugin Author
Registered: 2004-06-21
Posts: 337
Website

Re: gbp_permanent_links

hoho wrote:

1) Newlines are gone in the compressed 0.14 version making tweaking almost impossible. Or is it part of the compression? Anyway, despite having full access to server configuration, haven’t managed to install uncompressed version by any means :( so newlines in the compressed version would come in handy.

You’re right – that does make harder. From now on I’ll put out 3 versions of my plugins, standard, compressed and minified.

P.S. post_max_size = 8M and upload_max_filesize = 10M seem fairly enough for a 80k plugin but it always gets truncated upon upload.

I think this is due to how PHP handles uploads and believe wet has recently fixed this although I haven’t tested it (r3131)

2) I need an article ‘article-title’ in categories ‘cat1’ and ‘cat2’ to be accessible via URLs … I didn’t find a way to achieve this behaviour in the current implementation – it seems to be context insensitive and tries to generate always the same permanent link no matter where we are in the web tree, a contra-intuitive behaviour to me when it comes to categories. I have tweaked the ‘category’ section in the _permlinkurl function (from line 772 of the uncompressed version) as follows …

I’ve taken you code thanks. I had to add a preference option though as it could break existing rules – Set check_pretext_category_context to yes and you’ll get that functionality

3) Why is “Permanent Links” tab not available from the “Plugins” tab? It was real pain in a body part fighting the truncation and then tweaking the plugin. :)

This is because plugins aren’t loaded on the plugin page – I think the reason for this is so that if a plugin errors and kills textpattern it can always be turned off by directly visiting the plugin page

Offline

#452 2009-04-10 13:34:58

graeme
Plugin Author
Registered: 2004-06-21
Posts: 337
Website

Re: gbp_permanent_links

Oh here are the links to the new version:

Should also fix the problem driz reported here

Last edited by graeme (2009-04-10 14:46:10)

Offline

#453 2009-04-12 12:59:46

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: gbp_permanent_links

Not sure if this is a bug but its something that seems like it! Basically I have a rule for my blog section that goes like this /section/topics/category1/ this is SET to be only for the blog section and is used for looking at categories of articles. However If I go to my portfolio section and visit an article say this for example: http://driz.co.uk/portfolio/web/smplr-2007/ if you look at the breadcrumbs and check the url of the portfolio link, it will do that rule above, how is this possible? If I have set that rule to ONLY apply in the blog section, how is it effecting my urls in the portfolio section? I can only guess that the option to bind it to a section isn’t working? Thanks


~ Cameron

Offline

#454 2009-04-29 10:14:59

Agogo
Member
From: Sthlm, Sweden
Registered: 2008-11-27
Posts: 31

Re: gbp_permanent_links

Im going to have to agree with driz on his latest comment – the condition rule binding to a certain section doesnt work properly. I get the same problem with <txp:newer> – the rule is used when creating a prev link in a different section even though it shouldnt.

I dont know what input you need for bug test but the rules Im using are quite simple. Im using a high precedence with the rule that has got the condition set to only one particular section.

Im using v 0.14 without patches.

Last edited by Agogo (2009-04-29 10:17:55)

Offline

#455 2009-04-30 16:15:55

insidertravels
Member
Registered: 2009-02-26
Posts: 10

Re: gbp_permanent_links

I haven’t been able to read through all 46 pages of the thread yet. I’m having trouble getting this plugin to do what I want. I stare at my screen for so many hours sometimes, I’m probably just glossing over something obvious. The interface for the plugin is somewhat perplexing to me; it seems there are a bunch of form fields I’m not using. I tried to set up a rule, and my permlinks started behaving erratically. Or maybe not. Forgive me if this is a silly question.

How do I accomplish the following:

1) all “section” archive (list) pages -> domain.com/section-name
2) all “category“archive (list) pages -> domain.com/category-name
3) all “entry” (post) individual permlink pages -> domain.com/the-title-permlink-slug

Assume that I am the only administrator creating sections, categories, and entries, so I know to avoid conflicts by making sure all slugs are unique. My assumption is that this plugin does not check for duplications, so if that is incorrect, please let me know.

I do not want to confuse Google with multiple permlink locations for the same entry. I realize that due to the way Textpattern functions, I will be able to call up any entry using any section or category, which is fine, since I will be creating a special email-friendly section and corresponding template, so I always have a good copy of each entry ready for sending to a mailing list. But I do not want these special sections to be indexed, so none of the permlinks should be dependent on a section or category “fake directory” structure.

Offline

#456 2009-05-06 21:21:39

jens31
Plugin Author
From: munich / dtschermani
Registered: 2008-08-25
Posts: 183
Website

Re: gbp_permanent_links

hi

i also wasnt able to dig me through all of the thread (i tried a search thought, but couldnt find any similarities..)

when installing the plugin, the server keeps telling
Parse error: syntax error, unexpected $end in /url…/textpattern/lib/txplib_misc.php(570) : eval()’d code on line 1905
The above errors were caused by the plugin:gbp_permanent_links

maybe its some php restriction..?
(i’m trying to make this happen..)

Offline

Board footer

Powered by FluxBB