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


PHP oxUBase::_prepareMetaDescription方法代码示例

本文整理汇总了PHP中oxUBase::_prepareMetaDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP oxUBase::_prepareMetaDescription方法的具体用法?PHP oxUBase::_prepareMetaDescription怎么用?PHP oxUBase::_prepareMetaDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在oxUBase的用法示例。


在下文中一共展示了oxUBase::_prepareMetaDescription方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _prepareMetaDescription

 /**
  * Returns current view meta data
  * If $meta 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 $meta           User defined description, description content or empty value
  * @param int    $length         Max length of result, -1 for no truncation
  * @param bool   $descriptionTag If true - performs additional duplicate cleaning
  *
  * @return string
  */
 protected function _prepareMetaDescription($meta, $length = 200, $descriptionTag = false)
 {
     if (!$meta) {
         $article = $this->getProduct();
         if ($this->getConfig()->getConfigParam('bl_perfParseLongDescinSmarty')) {
             $meta = $article->getLongDesc();
         } else {
             $meta = $article->getLongDescription()->value;
         }
         if ($meta == '') {
             $meta = $article->oxarticles__oxshortdesc->value;
         }
         $meta = $article->oxarticles__oxtitle->value . ' - ' . $meta;
     }
     return parent::_prepareMetaDescription($meta, $length, $descriptionTag);
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:27,代码来源:ArticleDetailsController.php

示例2: _prepareMetaDescription

 /**
  * Returns current view meta data
  * If $sMeta parameter comes empty, sets to it current content title
  *
  * @param string $sMeta     category path
  * @param int    $iLength   max length of result, -1 for no truncation
  * @param bool   $blDescTag if true - performs additional duplicate cleaning
  *
  * @return string
  */
 protected function _prepareMetaDescription($sMeta, $iLength = 200, $blDescTag = false)
 {
     if (!$sMeta) {
         $sMeta = $this->getContent()->oxcontents__oxtitle->value;
     }
     return parent::_prepareMetaDescription($sMeta, $iLength, $blDescTag);
 }
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:17,代码来源:ContentController.php

示例3: _prepareMetaDescription

 /**
  * Returns current view meta data
  * If $sMeta 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 $sMeta     category path
  * @param int    $iLength   max length of result, -1 for no truncation
  * @param bool   $blDescTag if true - performs additional dublicate cleaning
  *
  * @return string
  */
 protected function _prepareMetaDescription($sMeta, $iLength = 1024, $blDescTag = false)
 {
     if (!$sMeta && $this->getConfig()->getConfigParam('bl_perfLoadAktion') && ($oArt = $this->getFirstArticle())) {
         $oDescField = $oArt->getLongDescription();
         $sMeta = $oArt->oxarticles__oxtitle->value . ' - ' . $oDescField->value;
     }
     return parent::_prepareMetaDescription($sMeta, $iLength, $blDescTag);
 }
开发者ID:mibexx,项目名称:oxid_yttutorials,代码行数:19,代码来源:start.php

示例4: _prepareMetaKeyword

 /**
  * Returns current view keywords separated by comma
  *
  * @param string $keywords              Data to use as keywords
  * @param bool   $removeDuplicatedWords Remove duplicated words
  *
  * @return string
  */
 protected function _prepareMetaKeyword($keywords, $removeDuplicatedWords = true)
 {
     $keywords = '';
     if ($activeCategory = $this->getActiveCategory()) {
         $keywordsList = array();
         if ($categoryTree = $this->getCategoryTree()) {
             foreach ($categoryTree->getPath() as $category) {
                 $keywordsList[] = trim($category->oxcategories__oxtitle->value);
             }
         }
         $subCategories = $activeCategory->getSubCats();
         if (is_array($subCategories)) {
             foreach ($subCategories as $subCategory) {
                 $keywordsList[] = $subCategory->oxcategories__oxtitle->value;
             }
         }
         if (count($keywordsList) > 0) {
             $keywords = implode(", ", $keywordsList);
         }
     }
     $keywords = parent::_prepareMetaDescription($keywords, -1, $removeDuplicatedWords);
     return trim($keywords);
 }
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:31,代码来源:ArticleListController.php

示例5: _prepareMetaKeyword

 /**
  * Returns current view keywords separated by comma
  *
  * @param string $sKeywords               data to use as keywords
  * @param bool   $blRemoveDuplicatedWords remove duplicated words
  *
  * @return string
  */
 protected function _prepareMetaKeyword($sKeywords, $blRemoveDuplicatedWords = true)
 {
     $sKeywords = '';
     if ($oCategory = $this->getActiveCategory()) {
         $aKeywords = array();
         if ($oCatTree = $this->getCategoryTree()) {
             foreach ($oCatTree->getPath() as $oCat) {
                 $aKeywords[] = trim($oCat->oxcategories__oxtitle->value);
             }
         }
         if (count($aKeywords) > 0) {
             $sKeywords = implode(", ", $aKeywords);
         }
         $aSubCats = $oCategory->getSubCats();
         if (is_array($aSubCats)) {
             foreach ($aSubCats as $oSubCat) {
                 $sKeywords .= ', ' . $oSubCat->oxcategories__oxtitle->value;
             }
         }
     }
     $sKeywords = parent::_prepareMetaDescription($sKeywords, -1, $blRemoveDuplicatedWords);
     return trim($sKeywords);
 }
开发者ID:ioanok,项目名称:symfoxid,代码行数:31,代码来源:alist.php

示例6: _prepareMetaDescription

 /**
  * Returns current view meta data
  * If $sMeta 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 $sMeta     user defined description, description content or empty value
  * @param int    $iLength   max length of result, -1 for no truncation
  * @param bool   $blDescTag if true - performs additional dublicate cleaning
  *
  * @return string
  */
 protected function _prepareMetaDescription($sMeta, $iLength = 200, $blDescTag = false)
 {
     if (!$sMeta) {
         $oProduct = $this->getProduct();
         $sMeta = $oProduct->getArticleLongDesc()->value;
         $sMeta = $oProduct->oxarticles__oxtitle->value . ' - ' . $sMeta;
     }
     return parent::_prepareMetaDescription($sMeta, $iLength, $blDescTag);
 }
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:20,代码来源:details.php


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