I have created this.
http://pastebin.com/5fFdT6n6
I now need to get the title of the guide type showing.
Example, http://runehints.com/quests/149/All_Fired_Up - the title should be .:RuneHints:. Quests - All Fired Up
http://runehints.com/quests/114/Another_Slice_of_H.A.M. would be .:RuneHints:. Quests - Another Slice of H.A.M.
title dynamic - half way there
Moderator: General Moderators
Re: title dynamic - half way there
Have you tried exploding $_SERVER['REQUEST_URI'] and then removing the underscores with str_replace?
-
gaogier
- Forum Contributor
- Posts: 391
- Joined: Wed Mar 02, 2005 1:02 pm
- Location: Portsmouth, UK
- Contact:
Re: title dynamic - half way there
Sorry, I am a novice at php, I am proud I managed the first step.
I am googling what you said
I am googling what you said
Re: title dynamic - half way there
$_SERVER['REQUEST_URI'] will contain a string like /quests/149/Whatever
Use explode() with / as a delimiter to break apart the string into an array. The last element in the array will be your quest name. Finally, you can use str_replace() to replace the underscores with spaces, and there's your page title.
Use explode() with / as a delimiter to break apart the string into an array. The last element in the array will be your quest name. Finally, you can use str_replace() to replace the underscores with spaces, and there's your page title.
-
gaogier
- Forum Contributor
- Posts: 391
- Joined: Wed Mar 02, 2005 1:02 pm
- Location: Portsmouth, UK
- Contact:
Re: title dynamic - half way there
Do you have an example, I am trying to find one online but not sure
Re: title dynamic - half way there
Try something like this:
Code: Select all
$uri = $_SERVER['REQUEST_URI'];
$parts = explode("/", $uri);
$title = $parts[count($parts) - 1];
$title = str_replace("_", " ", $title);-
gaogier
- Forum Contributor
- Posts: 391
- Joined: Wed Mar 02, 2005 1:02 pm
- Location: Portsmouth, UK
- Contact:
Re: title dynamic - half way there
Thanks for your help. Problem resolved 
Re: title dynamic - half way there
Some other functions to be aware of: