<?php
/* 
	author:colin
	date:2007.03.30
*/
if (isset($HTTP_GET_VARS['products_id']))
{
	$product_info_query = tep_db_query("select pd.products_name,pd.products_description,pd.keywords from " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.language_id = '" . (int)$languages_id . "'");
	$product_info_check = tep_db_fetch_array($product_info_query);

	$metaKeywords = $product_info_check['keywords'];
	$metaDescription = $product_info_check['products_name'];
}
else
if (isset($HTTP_GET_VARS['cPath']))
{
	//Are we looking within a category?
		$metaCategoryArray = explode ("_",$cPath);
		if (strpos($cPath, '_'))
		{
			$metaCategoryArray  = array_reverse($metaCategoryArray);
		}
	
		$metaCategoryId = $metaCategoryArray[0];
	
		$cat_info_query = tep_db_query("select cd.categories_name from categories_description cd where cd.categories_id = '" . (int)$metaCategoryId . "' and cd.language_id = '" . (int)$languages_id . "'");
		$cat_info_check = tep_db_fetch_array($cat_info_query);
	
		$metaKeywords = $cat_info_check['categories_name'];
		$metaDescription = $cat_info_check['categories_name'];

}
else
{
		$metaKeywords = INDEX_TITLE;
		$metaDescription = INDEX_TITLE;
}
echo '<meta name="keywords" content="' . $metaKeywords . '">' . "\n";

?>
