Welcome! Log In Create A New Profile

Advanced

Dynamic Titles and descriptions - 1 installation Modification

Posted by kenrrik 
Dynamic Titles and descriptions - 1 installation Modification
May 13, 2007 01:25AM
This modification to the header.html template works only for 1 installation set.

I posted the multiple installation set on different post.

Here is the code:

<?php
$vcat = $_GET['catid'];
if($query == '' && $vcat == ''){// If is the main page use default title and description
echo "<TITLE>Default Title Goes Here</TITLE>\n";
echo '<meta name="description" content="Your default descriptions goes here.">';
} elseif ($query != '' && $vcat== '') {//If a query is made use search title and description
echo "<TITLE>". ucwords($query) ." Search Results - Modify this title!</TITLE>\n";
echo '<meta name="description" content="'.ucwords($query).' Search Results. modify to fit your needs '.ucwords($query).'.">';
} elseif ($vcat != '' && $query == ''){//If a category is selected use category title and description
$execute = mysql_query("SELECT * FROM categories WHERE category_id = '".$vcat."'"winking smiley;
$dcat = mysql_fetch_row($execute);
echo "<title>";
echo $dcat[1] . " Directory Title to Modify!</title>\n";
echo '<meta name="description" content="'. $dcat[1] .' modify please ';
echo $dcat[1];
echo " to fit your needs.\">\n";
}
?>

Let me know if it works....
Like I said before my installation is multiple so i just merge both codes.
Sorry, only registered users may post in this forum.

Click here to login