本文整理汇总了PHP中oxUBase::_prepareMetaKeyword方法的典型用法代码示例。如果您正苦于以下问题:PHP oxUBase::_prepareMetaKeyword方法的具体用法?PHP oxUBase::_prepareMetaKeyword怎么用?PHP oxUBase::_prepareMetaKeyword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oxUBase
的用法示例。
在下文中一共展示了oxUBase::_prepareMetaKeyword方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareMetaKeyword
/**
* Returns current view keywords seperated by comma
* If $keywords parameter comes empty, sets to it article title and description.
* It happens if current view has no meta data defined in oxcontent table
*
* @param string $keywords User defined keywords, keywords content or empty value
* @param bool $removeDuplicatedWords Remove duplicated words
*
* @return string
*/
protected function _prepareMetaKeyword($keywords, $removeDuplicatedWords = true)
{
if (!$keywords) {
$article = $this->getProduct();
$keywords = trim($this->getTitle());
if ($categoryTree = $this->getCategoryTree()) {
foreach ($categoryTree->getPath() as $category) {
$keywords .= ", " . trim($category->oxcategories__oxtitle->value);
}
}
// Adding search keys info
if ($searchKeys = trim($article->oxarticles__oxsearchkeys->value)) {
$keywords .= ", " . $searchKeys;
}
$keywords = parent::_prepareMetaKeyword($keywords, $removeDuplicatedWords);
}
return $keywords;
}
示例2: _prepareMetaKeyword
/**
* Returns current view keywords seperated by comma
* If $sKeywords parameter comes empty, sets to it current content title
*
* @param string $sKeywords data to use as keywords
* @param bool $blRemoveDuplicatedWords remove duplicated words
*
* @return string
*/
protected function _prepareMetaKeyword($sKeywords, $blRemoveDuplicatedWords = true)
{
if (!$sKeywords) {
$sKeywords = $this->getContent()->oxcontents__oxtitle->value;
}
return parent::_prepareMetaKeyword($sKeywords, $blRemoveDuplicatedWords);
}
示例3: _prepareMetaKeyword
/**
* Returns current view keywords seperated by comma
* If $sKeywords parameter comes empty, sets to it article title and description.
* It happens if current view has no meta data defined in oxcontent table
*
* @param string $sKeywords data to use as keywords
* @param bool $blRemoveDuplicatedWords remove dublicated words
*
* @return string
*/
protected function _prepareMetaKeyword($sKeywords, $blRemoveDuplicatedWords = true)
{
if (!$sKeywords && $this->getConfig()->getConfigParam('bl_perfLoadAktion') && ($oArt = $this->getFirstArticle())) {
$oDescField = $oArt->getLongDescription();
$sKeywords = $oDescField->value;
}
return parent::_prepareMetaKeyword($sKeywords, $blRemoveDuplicatedWords);
}
示例4: _prepareMetaKeyword
/**
* Returns current view keywords seperated by comma
* If $sKeywords parameter comes empty, sets to it article title and description.
* It happens if current view has no meta data defined in oxcontent table
*
* @param string $sKeywords user defined keywords, keywords content or empty value
* @param bool $blRemoveDuplicatedWords remove dublicated words
*
* @return string
*/
protected function _prepareMetaKeyword($sKeywords, $blRemoveDuplicatedWords = true)
{
if (!$sKeywords) {
$oProduct = $this->getProduct();
$sKeywords = trim($this->getTitle());
if ($oCatTree = $this->getCategoryTree()) {
foreach ($oCatTree->getPath() as $oCat) {
$sKeywords .= ", " . trim($oCat->oxcategories__oxtitle->value);
}
}
//adding search keys info
if ($sSearchKeys = trim($oProduct->oxarticles__oxsearchkeys->value)) {
$sKeywords .= ", " . $sSearchKeys;
}
$sKeywords = parent::_prepareMetaKeyword($sKeywords, $blRemoveDuplicatedWords);
}
return $sKeywords;
}
示例5: _collectMetaKeyword
/**
* Creates a string of keyword filtered by the function prepareMetaDescription and without any duplicates
* additional the admin defined strings are removed
*
* @param string $keywords category path
*
* @return string
*/
protected function _collectMetaKeyword($keywords)
{
$maxTextLength = 60;
$text = '';
if (count($articleList = $this->getArticleList())) {
$stringModifier = getStr();
foreach ($articleList as $article) {
/** @var oxArticle $article */
$description = $stringModifier->strip_tags(trim($stringModifier->strtolower($article->getLongDescription()->value)));
//removing dots from string (they are not cleaned up during general string cleanup)
$description = $stringModifier->preg_replace("/\\./", " ", $description);
if ($stringModifier->strlen($description) > $maxTextLength) {
$midText = $stringModifier->substr($description, 0, $maxTextLength);
$description = $stringModifier->substr($midText, 0, $stringModifier->strlen($midText) - $stringModifier->strpos(strrev($midText), ' '));
}
if ($text) {
$text .= ', ';
}
$text .= $description;
}
}
if (!$keywords) {
$keywords = $this->_getCatPathString();
}
if ($keywords) {
$text = "{$keywords}, {$text}";
}
return parent::_prepareMetaKeyword($text);
}
示例6: _collectMetaKeyword
/**
* Creates a string of keyword filtered by the function prepareMetaDescription and without any duplicates
* additional the admin defined strings are removed
*
* @param string $sKeywords category path
*
* @return string
*/
protected function _collectMetaKeyword($sKeywords)
{
$iMaxTextLength = 60;
$sText = '';
if (count($aArticleList = $this->getArticleList())) {
$oStr = getStr();
foreach ($aArticleList as $oProduct) {
$sDesc = $oStr->strip_tags(trim($oStr->strtolower($oProduct->getLongDescription()->value)));
//removing dots from string (they are not cleaned up during general string cleanup)
$sDesc = $oStr->preg_replace("/\\./", " ", $sDesc);
if ($oStr->strlen($sDesc) > $iMaxTextLength) {
$sMidText = $oStr->substr($sDesc, 0, $iMaxTextLength);
$sDesc = $oStr->substr($sMidText, 0, $oStr->strlen($sMidText) - $oStr->strpos(strrev($sMidText), ' '));
}
if ($sText) {
$sText .= ', ';
}
$sText .= $sDesc;
}
}
if (!$sKeywords) {
$sKeywords = $this->_getCatPathString();
}
if ($sKeywords) {
$sText = "{$sKeywords}, {$sText}";
}
return parent::_prepareMetaKeyword($sText);
}