Welcome to Geeklog Friday, December 15 2017 @ 04:44 pm EST


Status: offline

alb3rt

Forum User
Chatty
Registered: 30/10/2006
Posts: 47
Location:Mexico City
I like to change the URL for the articles, for example www.site/section/subsection/article (I use rewrite with apache), but I need to add a few lines in lib-story.php, for example:

PHP Formatted Code
        $customUrl = custom_STORY_LINK($story->DisplayElements('tid'));


And my function creates the URL that I want.

This work very well, but the problem is when I upgrade a new version, I always need to change lib-story.php again, I would like to use only lib-custom.php, but I can't get the "ID story" for the "home".

If I could get the ID for each story in lib-custom.php, I could add my customURL in CUSTOM_templateSetVars ()

Any ideas?


Thanks!


D Web Studio - www.d-webstudio.net

Status: offline

beewee

Forum User
Full Member
Registered: 05/08/2003
Posts: 969
Location:The Netherlands, where else?
But the url in the search function will still be the old one, am I correct? So you have to change something there as well.

Since the stories are part of the core code, you'll need to edit your changes with every update. If you make a readme file it's only a few minutes work, right?
Dutch Geeklog sites about camping/hiking: www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/2002
Posts: 13073
Location:Stuttgart, Germany
Not sure if this would work, but I would look into abusing/reusing Geeklog's url rewrite class for that. That way, every other place in Geeklog, e.g. the search, would automatically be using your new URLs.

bye, Dirk

Status: offline

alb3rt

Forum User
Chatty
Registered: 30/10/2006
Posts: 47
Location:Mexico City
Yeah, in search function shows the old url, It's other problem. Anyway I'll try with the rewrite class as said Dirk.

Quote by: beewee

But the url in the search function will still be the old one, am I correct? So you have to change something there as well.

Since the stories are part of the core code, you'll need to edit your changes with every update. If you make a readme file it's only a few minutes work, right?


D Web Studio - www.d-webstudio.net

All times are EST. The time is now 04:44 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content