Results 1 to 2 of 2

Thread: Dynamic Titles on CMS Website

  1. #1
    Join Date
    Jul 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb Dynamic Titles on CMS Website

    I have a website that has the ability to have dynamic titling but I've run into a roadblock. The code below works well if I just do if($page=='articles/view

    The problem comes in when I try to include other areas that would benefit from a dynamic title like blogs, user profiles, question & answer, etc. Basically anything with a subject, title or username. Any input on this would be much appreciated.

    This is implemented using a chunk object.

    <?php
    global $page, $pmi_DID, $AID;
    $d = db();
    if ($page == 'articles/view' 'blogs/view' 'homepages/view') {
    $d->query("SELECT subject FROM articles WHERE DID='$pmi_DID' AND AID='$AID'");
    $row = $d->fetch();
    $title = $row['subject'] ['title'] '[fname] [lname]'];
    }
    else {
    $title = "Film + Media + Publishing + Music + Technology + Entertainment ";
    }
    print "<title>" . $title . "&nbsp|&nbsp;Industry Grind Est. 2004&reg</title>";
    ?>

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Try this:
    PHP Code:
    <?php
    global $page$pmi_DID$AID;
    $d db();
    if (
    $page == 'articles/view' || $page == 'blogs/view' || $page == 'homepages/view') {
    $d->query("SELECT subject FROM articles WHERE DID='$pmi_DID' AND AID='$AID'");
    $row $d->fetch();
    $title $row['subject'] ['title''[fname] [lname]'];
    }
    else {
    $title "Film + Media + Publishing + Music + Technology + Entertainment ";
    }
    print 
    "<title>" $title "&nbsp|&nbsp;Industry Grind Est. 2004&reg</title>";
    ?>
    Jeremy | jfein.net

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
  •