Welcome! Log In Create A New Profile


Custom Title and Description For Directory

Posted by kenrrik 
Custom Title and Description For Directory
May 13, 2007 12:25AM
Hi Everyone,

I am working my idea using Sphider in the following way.

1 sub domain for the directory and 1 subdomain for the search working with 1 database.

I want to create custom titles, so the first area I tweek was the directory. Here is my modification for archiving this. Probably some one else could benefit from it.

Note: This work only if you are using subdomains. This goes in the header file.

On the templates -> header.html modify the head and add:

//First lets check if a category is been parsed
$vcat = $_GET['catid'];

if ($vcat == '') {//If no category id is been parsed set the default title
echo "<title>Your default title goes in here</title>\n";
echo '<meta name="description" content="Your default description goes here.">';
} else {//If a category id is been parsed lets get the title
$execute = mysql_query("SELECT * FROM categories WHERE category_id = '".$vcat."'"winking smiley;

//Now Lets build a custom title for the page
$dcat = mysql_fetch_row($execute);
echo "<title>";
echo $dcat[1] . " Directory Listings - You can modify this!</title>\n";
echo '<meta name="description" content="'. $dcat[1] .' Please - modify ';
echo $dcat[1];
echo " to fit your needs.\">\n";

I am trying to have some small density to impulse a little some SEO (search engine optimization) techniques.

After I am done with the search that is much simpler I will combine them and create one code for people using just 1 domain.

Please feel free to modify and give me some feedback... smiling smiley
Sorry, only registered users may post in this forum.

Click here to login