当前位置: 首页>>代码示例>>PHP>>正文


PHP oxUBase::_prepareMetaKeyword方法代码示例

本文整理汇总了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;
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:28,代码来源:ArticleDetailsController.php

示例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);
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:16,代码来源:ContentController.php

示例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);
 }
开发者ID:mibexx,项目名称:oxid_yttutorials,代码行数:18,代码来源:start.php

示例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;
 }
开发者ID:ioanok,项目名称:symfoxid,代码行数:28,代码来源:details.php

示例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);
 }
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:37,代码来源:ArticleListController.php

示例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);
 }
开发者ID:ioanok,项目名称:symfoxid,代码行数:36,代码来源:alist.php


注:本文中的oxUBase::_prepareMetaKeyword方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。