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


PHP SEFTools::cleanDesc方法代码示例

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


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

示例1: getMetaTags

 /**
  * Get metatags.
  * If they do not exist, generate new.
  * 
  * @return array
  */
 function getMetaTags()
 {
     $sefConfig = SEFConfig::getConfig();
     // clean source of meta description
     if (!empty($this->metadesc)) {
         $cleanDesc = SEFTools::cleanDesc($this->metadesc);
     } else {
         $cleanDesc = '';
     }
     // clean source of meta keywords
     if (!empty($this->metakeySource)) {
         $cleanKeySource = SEFTools::cleanDesc($this->metakeySource);
     } else {
         $cleanKeySource = $cleanDesc;
     }
     // generate own meta description if set to by extension and global configuration
     if ($this->params->get('meta_desc', '1') && ($sefConfig->metadata_auto == _COM_SEF_META_GEN_ALWAYS || $sefConfig->metadata_auto == _COM_SEF_META_GEN_EMPTY && strlen($this->origmetadesc) == 0)) {
         // get generation params
         $maxLen = $this->params->get('desc_len', '250');
         // generate description
         $this->metatags['metadesc'] = SEFTools::clipDesc($cleanDesc, $maxLen);
     } else {
         $this->metatags['metadesc'] = $this->origmetadesc;
     }
     // generate own meta keywords if set to by extension and global configuration
     if ($this->params->get('meta_keys', '1') && ($sefConfig->metadata_auto == _COM_SEF_META_GEN_ALWAYS || $sefConfig->metadata_auto == _COM_SEF_META_GEN_EMPTY && strlen($this->origmetakey) == 0)) {
         // get generation params
         $minLen = $this->params->get('keys_minlen', '3');
         $count = $this->params->get('keys_count', '8');
         $blacklist = $this->params->get('blacklist', null);
         // generate keywords
         $this->metatags['metakey'] = SEFTools::generateKeywords($cleanKeySource, $blacklist, $count, $minLen);
     } else {
         $this->metatags['metakey'] = $this->origmetakey;
     }
     return $this->metatags;
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:43,代码来源:sef.ext.php

示例2: getMetaTags

 function getMetaTags()
 {
     $metatags = array();
     if (!empty($this->metadesc)) {
         $cleanDesc = SEFTools::cleanDesc($this->metadesc);
     }
     if ($this->params->get('meta_desc', '1') && isset($cleanDesc)) {
         $maxLen = $this->params->get('desc_len', '250');
         $metatags['metadesc'] = SEFTools::clipDesc($cleanDesc, $maxLen);
     }
     if ($this->params->get('meta_keys', '1') && isset($cleanDesc)) {
         $minLen = $this->params->get('keys_minlen', '3');
         $count = $this->params->get('keys_count', '15');
         $blacklist = $this->params->get('blacklist', null);
         $metatags['metakey'] = SEFTools::generateKeywords($cleanDesc, $blacklist, $count, $minLen);
     }
     return $metatags;
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:18,代码来源:sef.ext.php


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