Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#241 2007-09-07 08:52:46
- marios
- Archived Plugin Author

- Registered: 2005-03-12
- Posts: 1,253
Re: gbp_permanent_links
guiguibonbon wrote:
marios try clearing out
_textpattern_end ()around line 654
function _textpattern_end ()
{
while (@ob_end_flush());
}
@giugiubonbon, I rather prefer, not to monkey around in the plugin, and leave that to Graeme. The function seems to be called somewhere twice, and also the plugin is almost at it’s maximum size, so add a couple of lines, and the helper functions at the bottom will be truncated, once you resave.
regards, marios
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline
#242 2007-09-07 12:24:31
- marios
- Archived Plugin Author

- Registered: 2005-03-12
- Posts: 1,253
Re: gbp_permanent_links
marios wrote:
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.
Graeme, my appologies for wasting your time. Turns out, it was a problem with one of my own plugins, not to check variable content
of $pretext[‘pg’] and thispage[‘pg’], so I got negative numbers in the query string for the offset value.
Uuhh, at least this is working now.
regards, marios
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline
#243 2007-09-11 10:43:10
- diniscorreia
- Member

- From: Lisbon, Portugal
- Registered: 2007-07-18
- Posts: 19
Re: gbp_permanent_links
Great plugin! Saved my life.
Is it possible to redirect the root url to something else?
Say, when someone get to the homepage, being redirected to /pt/, for example.
Thanks!
Offline
#244 2007-09-17 16:29:17
Re: gbp_permanent_links
hey graeme, on the latest version, i’m not getting any help page. all the info i get there is:
<div id=“permlink_help”>
gbp_permanent_links.
Provides custom, user defined, permanent links rules.
</div>
am i missing something, or is that all there is to it?
~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~
Offline
#245 2007-10-11 00:05:31
Re: gbp_permanent_links
Great plugin, thanks!
I’ve got pretty much everything working using section/category/title/.
For example: http://raymond.kw-wu.com/weddings/michelle-james/1/
However, I get the same format URL for the ‘Portraits’ link on the top navbar, even after using :
<txp:gbp_disable_permlinks><txp:section_list sections=“Weddings,Portraits” active_class=“selected” break=” / “ /></txp:gbp_disable_permlinks>
The URL is: http://raymond.kw-wu.com/portraits/michelle-james/
How can I prevent from the ‘michelle-james’ bit from appearing?
Cheers,
loz
Offline
#246 2007-10-11 21:03:47
Re: gbp_permanent_links
Can someone give an example of using regular expressions in this plugin?
Thanks,
Shige
Offline
#247 2007-10-11 21:09:04
Re: gbp_permanent_links
typeshige wrote:
Can someone give an example of using regular expressions in this plugin?
shige, based on the questions you’ve asked me in that other thread i feel a bit responsible now ;)
here’s a regexp i’m using:
section//(fw|ss)([0-9]{2})//(mens|womens|accessories)//([a-z]{2,11})///([a-zA-Z0-9]{6,12})//
Offline
#248 2007-10-12 15:45:59
Re: gbp_permanent_links
Thank you very much!! This is very insightful!
sthmtc wrote:
typeshige wrote:
Can someone give an example of using regular expressions in this plugin?
shige, based on the questions you’ve asked me in that other thread i feel a bit responsible now ;)
here’s a regexp i’m using:
section//(fw|ss)([0-9]{2})//(mens|womens|accessories)//([a-z]{2,11})///([a-zA-Z0-9]{6,12})//
Offline
#249 2007-10-14 02:53:44
Re: gbp_permanent_links
Thanks for the clue, sthmtc.
I feel dumb, but I’m still not getting how to use RegEx in this plugin. Can anyone spare the time to do an real-world example of regex usage? I use regex all the time, just somehow I’m not seeing how it would be useful, although I feel its going to be the key to doing what I want to do in my new project…… :(
Thanks alot.
Offline
#250 2007-10-22 10:28:19
Re: gbp_permanent_links
A quick post to save people a headache.
For some reason I was getting 500 server errors without having changed anything in the plugin. After much looking and experimenting I found the culprit: Having txp in debug mode made the custom permalinks not work. No clue why, though.
~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~
Offline
#251 2007-10-25 23:50:22
Re: gbp_permanent_links
How efficient is using this plugin when I have a lot of links to redirect?
I have a site where I want to do this:
Create a sections called:
a_1_i
a_2_i
a_2_ii
b_1_iv
etc
and have the plug in redirect:
a/1/i -> a_1_i
b/1/iv -> b_1_iv
To do this, I’d make a lot of rules (one for each section).
Will this slow the site down by a lot of these rules (say 50 or so)?
If so, is there a better way to do this?
My goal is to simulate sub sections and sub sub sections without resorting to using categories.
Thanks.
Offline
#252 2007-10-25 23:55:02
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: gbp_permanent_links
Yup, it will slow it down quite a bit. Could you tell us a bit more about what you are to achieve? What’s different in each section?
Offline
#253 2007-10-26 16:36:00
Re: gbp_permanent_links
Hmmm.. I was afraid of that.
I have a new major site that has a main page with news for the entire organization.
This organization has 4 divisions (say A, B, C and D)
When you go to these divisions, you just see news for that division. Nothing special yet.
But, each of these divisions is has an ‘About’, ‘Funding’, ‘Annual Report’ section.
Inside the Annual Report section for example, you need to organize it by year. Then by year, you need to subdivide by team (one of the divisions has more than 10 teams inside). Then you need to have the project name itself which can be the article title.
So you’ll have A/Report/2007/ABC/Project1/Title
The problem is “Report” in this case is very different between the divisons, so I didn’t want to make it variations of the same page template (but I could if necessary)
However, once inside the right page, Year, Team, Project, Title are just parameters. Is there a way to do convert the example URL to A/Report/?year=2007&team=ABC&project=Project1&Title=title or something?
I hope I explained my situation clearly.
Thanks,
Shige
guiguibonbon wrote:
Yup, it will slow it down quite a bit. Could you tell us a bit more about what you are to achieve? What’s different in each section?
Offline
#254 2007-10-26 16:47:37
Re: gbp_permanent_links
Is a more elegant solution to setup a regex like sthmtc did?
/(^division_1$|^division_2$)//funding//[0-9]{4}//[a-z]{2,11})//
with the names for the parts as follows:
/division/funding/year/team
Then just break down the URL parts inside the target page like:
$division = $pretext[“permlink_regex_division”]; /* for the permlink rule regex I called “division” */
$year = $pretext[“permlink_regex_year”];
etc.
So if I use this method, I’ll reduce the number of rules by a lot, but I may still end up with like up to 10 regex permlinks rules like this. Will this be ok in terms of performance?
guiguibonbon wrote:
Yup, it will slow it down quite a bit. Could you tell us a bit more about what you are to achieve? What’s different in each section?
Offline
#255 2007-11-01 16:41:46
Re: gbp_permanent_links
I don’t know when and why (I suppose it was when I updated to the new gbp_admin_library 0.4.581 or maybe when I updated to TxP 4.0.5) but there is something that isn’t worked as it used to work and as I expect it to work.
I’m using this plug-in for the most simple and common task for this plug-in: simulate a “subsection” by creating an URL made by section/category/title.
In fact, I’m not even doing it for achieve a “subsection” but my main goal is some SEO optimization, by having the category as a possible keyword.
BTW: I’m doing this for just one section on my site.
Well, so, after that intro, here is my problem (that I didn’t have before, a few months ago):
- I expect that any hit to an /section/title URL will be redirected to /section/category/title.
That is how it used to work.
But today, I have found that both URLs are working.
So, I’m afraid to be penalized for duplicated content. In fact, both URLs are listed in Google search results page.
Now, I remember (and must admit), that I have recreated the rules few months ago (after the upgrade). But I’m looking at them and every rule seems to make sense.
So, the question is: how do you achieve this basic task? (I’m sure I’m not the only one doing this trick with this plug-in).
Any help and suggestion will be appreciated.
Offline