Advanced Search

Results 1 to 8 of 8

Thread: title dynamic - half way there

  1. #1
    Join Date
    Apr 2006
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default title dynamic - half way there

    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.
    Last edited by gaogier; 12-07-2011 at 05:03 PM.

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,621
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by gaogier View Post
    I have created this.
    http://pastebin.com/5fFdT6n6
    it would be more efficient (and much easier to make changes) if you made an array to hold all the titles, and then just check if the key exists:
    PHP Code:
    <?php
    function checkPage($key){
    // define all your titles
       
    $titles = array(
          
    'quests'  => 'Quests'
         
    ,'randoms' => 'Random Events'
         
    ,'etc.'    => 'and so on, and so forth'
       
    );
    // check if the requested title exists
     // return it if it does
     // return default title if it does not
       
    return !empty( $titles[$key] )? 
          
    $titles[$key]: 
          
    'the Solution to all Your RuneScape Problems';
    }
    Quote Originally Posted by gaogier View Post
    I now need to get the title of the guide type showing.
    showing where?
    We Only Torture the Folks We Don't Like (You're Probably Gonna Be Okay)
    It's a Party in the CIA

  3. The Following User Says Thank You to traq For This Useful Post:

    gaogier (11-27-2011)

  4. #3
    Join Date
    Apr 2006
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Oh, that does seem easier.

    In the title of the page - Example, http://runehints.com/quests/149/All_Fired_Up You see the title is .:RuneHints:. Quests - I want that page to show .:RuneHints:. Quests - All Fired Up instead.
    I want the main page quests/ to just show up ..ts:. Quests

    Other quests to show the name of the quest, and other pages to show up the relevant titles - example, skills/ would show ..ts:. Skills but the guide http://runehints.com/skills/13/Cooking would show ..ts:. Skills - Cooking.

    All in the title of the browser.

    ..ts:. I mean .:RuneHints:.

  5. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,621
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    So, you want it to appear in the <title> element, correct? What CMS/forum software are you using?
    We Only Torture the Folks We Don't Like (You're Probably Gonna Be Okay)
    It's a Party in the CIA

  6. #5
    Join Date
    Apr 2006
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Custom made, (want the code?) using tinymce - I thought the software maybe important...

    http://pastebin.com/TK8FAZh8 - the quest.php code

  7. #6
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,621
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    I don't see anything that sets the page title in there (I'll admit that I didn't review it in its entirety). Do you know where the page title is set? Is it in a template, or stored in the database and set by a function somewhere?
    We Only Torture the Folks We Don't Like (You're Probably Gonna Be Okay)
    It's a Party in the CIA

  8. #7
    Join Date
    Apr 2006
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank you for your help, problem now resolved.

    OH, btw, I emailed you on your website from your signature

  9. #8
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,621
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    no problem! glad you got it figured out.
    replied.

    If your question has been answered, please mark your thread "resolved":
    • On your original post (post #1), click [edit], then click [go advanced].
    • In the "thread prefix" box, select "Resolved". Click [save changes].
    We Only Torture the Folks We Don't Like (You're Probably Gonna Be Okay)
    It's a Party in the CIA

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •