You are here:  » Modified Meta Tags?

Support Forum



Modified Meta Tags?

Submitted by ANDREWCX on Tue, 2008-07-29 12:40 in

Hi,

How can I include the contents of a file in the meta title for products?

Specifically, I would like to modify the following:

$header["title"] = "".htmlentities($q,ENT_QUOTES,$config_charset)." Cashback ".htmlentities($q,ENT_QUOTES,$config_charset)." Rewards ".htmlentities($q,ENT_QUOTES,$config_charset)." Coupons Charity ".htmlentities($product["products"][0]["description"],ENT_QUOTES,$config_charset)." @ RewardsDB.com" ;

to include the contents of meta/".database_safe($q).".php before " Cashback" in the above.

Thanks

Submitted by support on Tue, 2008-07-29 15:00

Hi Andrew,

If the files in /meta do not contain anything other than the text you wish to include then I would name them simply as the query you want them to apply to, rather than using the .php extension. Try this;

$filename = "meta/".$q;
if (file_exists($filename))
{
  $fp = fopen($filename,"r");
  $prefix = fread($fp,1024);
  fclose($fp);
}
else
{
  $prefix = "";
}
$header["title"] = "".htmlentities($q,ENT_QUOTES,$config_charset)." ".$prefix." Cashback ".htmlentities($q,ENT_QUOTES,$config_charset)." Rewards ".htmlentities($q,ENT_QUOTES,$config_charset)." Coupons Charity ".htmlentities($product["products"][0]["description"],ENT_QUOTES,$config_charset)." @ RewardsDB.com" ;

Cheers,
David.