Patch for functions_entries.inc.php

Discussion corner for Developers of Serendipity.
Post Reply
paddyforan
Posts: 2
Joined: Sat Jul 25, 2009 9:20 am
Location: Buffalo, NY
Contact:

Patch for functions_entries.inc.php

Post by paddyforan »

Currently, there's no way to override the URLs being assigned to categories when an entry is displayed. However, if you add two lines, this functionality is added:

line 1067:
if(!isset($entry['categories'][$k]['category_link'])){

line 1069:
}

Basically, just check to see if the link is already set before resetting it. It would be nice if all the $entry keys behaved this way, come to think of it.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Patch for functions_entries.inc.php

Post by garvinhicking »

Hi!

Can you give an example usage case, for when this can be beneficial? We don't check most of the array keys because of performance reasons, to be able to omit a view hash lookups as well as lines of code. It's not much, but to add those would need a really reason to do that...?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
paddyforan
Posts: 2
Joined: Sat Jul 25, 2009 9:20 am
Location: Buffalo, NY
Contact:

Re: Patch for functions_entries.inc.php

Post by paddyforan »

I use it because I'm doing a bit of work with a multiple-URL mapping plugin, letting you assign URLs to categories. It lets me make sure the links line up with the URL they're supposed to point at.

Really, anything that changes internal links at all would find this useful.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Patch for functions_entries.inc.php

Post by garvinhicking »

Hi!

Ok, even though I still don't really understand what you try to do, I committed your patch to trunk. :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply