© Сделано на LiveStreet
Дизайн - ©2009 MODx RED Group

<head>
<title>[!seo? &type=`title` !]</title>
<meta name="keywords" content="[!seo? &type=`keywords` !]" />
<meta name="description" content="[!seo? &type=`description` !]" />
<?php
$id = ereg_replace("/\D/", "", $_GET['p']);
if ($id == "") {
switch ($type) {
case "title": return "[*seo_title*] :: [(site_name)]"; break;
case "keywords": return "[*seo_keywords*]"; break;
case "description": return "[*seo_description*]"; break;
}
}
$seo_tags = $modx->db->getRow($modx->db->query("
select c.pagetitle,
(select value from `modx_catalog_tmplvar_contentvalues` where contentid = c.id and tmplvarid = 17) as 'seo_title',
(select value from `modx_catalog_tmplvar_contentvalues` where contentid = c.id and tmplvarid = 15) as 'seo_keywords',
(select value from `modx_catalog_tmplvar_contentvalues` where contentid = c.id and tmplvarid = 16) as 'seo_description'
from `modx_catalog` c
where c.id = '".$id."'"));
switch ($type) {
case "title": return $seo_tags['seo_title'] == "" ? $seo_tags['pagetitle']." :: [(site_name)]" : $seo_tags['seo_title']." :: [(site_name)]"; break;
case "keywords": return $seo_tags['seo_keywords']; break;
case "description": return $seo_tags['seo_description']; break;
}
?>if ($_GET['p'] != "") {
$check = $modx->db->getRow($modx->db->query("select count(*) as 'cnt' from `modx_catalog` where id = '".ereg_replace("/\D/", "", $_GET['p'])."'"));
if ($check['cnt'] == 0) {
$modx->sendErrorPage();
}
}