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 . " | Industry Grind Est. 2004®</title>";
?>



Reply With Quote

Bookmarks