本文整理汇总了PHP中KSSystem::getSeoTitlesConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP KSSystem::getSeoTitlesConfig方法的具体用法?PHP KSSystem::getSeoTitlesConfig怎么用?PHP KSSystem::getSeoTitlesConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KSSystem
的用法示例。
在下文中一共展示了KSSystem::getSeoTitlesConfig方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setProductMetaData
public function setProductMetaData()
{
$this->onExecuteBefore('setProductMetaData');
$document = JFactory::getDocument();
$config = KSSystem::getSeoTitlesConfig('product', 'meta');
$metatitle = null;
$metadescription = null;
$metakeywords = null;
if (empty($this->_product->metatitle)) {
$metatitle = $this->_product->title;
} else {
$metatitle = $this->_product->metatitle;
}
if (empty($this->_product->metadescription)) {
if ($config->description->flag == 1) {
if ($config->description->type == 'seo-type-mini-description') {
$metadescription = strip_tags($this->_product->introcontent);
} elseif ($config->description->type == 'seo-type-description') {
$metadescription = strip_tags($this->_product->content);
}
$metadescription = mb_substr($metadescription, 0, $config->description->symbols);
}
} else {
$metadescription = $this->_product->metadescription;
}
if (empty($this->_product->metakeywords)) {
if ($config->keywords->flag == 1) {
if ($config->keywords->type == 'seo-type-properties-and-values') {
$properties = array();
foreach ($this->_product->properties as $property) {
$values = array();
if (!empty($property->values)) {
foreach ($property->values as $value) {
if (!empty($value->title)) {
$values[] = $value->title;
}
}
if (!empty($value->title)) {
$values[] = $value->title;
}
}
if (count($values) > 0) {
$properties[] = $property->title . ' - ' . implode(',', $values);
}
}
if (count($properties) > 0) {
$metakeywords = implode(';', $properties);
}
} elseif ($config->keywords->type == 'seo-type-tag') {
$metakeywords = strip_tags($this->_product->tag);
}
}
} else {
$metakeywords = $this->_product->metakeywords;
}
if (!empty($metatitle)) {
$document->setMetaData('title', $metatitle);
}
if (!empty($metadescription)) {
$document->setMetaData('description', $metadescription);
}
if (!empty($metakeywords)) {
$document->setMetaData('keywords', $metakeywords);
}
$this->onExecuteAfter('setProductMetaData', array(&$this));
}
示例2: setCountryMetaData
/**
* KsenMartModelcatalog::setCountryMetaData()
*
* @return
*/
public function setCountryMetaData()
{
$this->onExecuteBefore('setCountryMetaData');
$document = JFactory::getDocument();
$metatitle = '';
$metadescription = '';
$metakeywords = '';
$country = $this->getCountry();
$config = KSSystem::getSeoTitlesConfig('country', 'meta');
if (empty($country->metatitle)) {
$metatitle = $country->title;
} else {
$metatitle = $country->metatitle;
}
if (empty($country->metadescription)) {
if ($config->description->flag == 1) {
if ($config->description->type == 'seo-type-mini-description') {
$metadescription = strip_tags($country->introcontent);
} elseif ($config->description->type == 'seo-type-description') {
$metadescription = strip_tags($country->content);
}
$metadescription = mb_substr($metadescription, 0, $config->description->symbols);
}
} else {
$metadescription = $country->metadescription;
}
if ($country->metakeywords == '') {
if ($config->keywords->flag == 1) {
if ($config->keywords->type == 'seo-type-title') {
$metakeywords = strip_tags($country->title);
}
}
} else {
$metakeywords = $country->metakeywords;
}
if (!empty($metatitle)) {
$document->setMetaData('title', $metatitle);
}
if (!empty($metadescription)) {
$document->setMetaData('description', $metadescription);
}
if (!empty($metakeywords)) {
$document->setMetaData('keywords', $metakeywords);
}
$this->onExecuteAfter('setCountryMetaData', array(&$this));
return true;
}