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


PHP Tags::get_by_frequency方法代码示例

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


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

示例1: default_options

 /**
  * function default_options
  *
  * returns defaults for the plugin
  * @return array default options array
  */
 private static function default_options()
 {
     $home_keys = array();
     $tags = Tags::get_by_frequency(50, 'entry');
     foreach ($tags as $tag) {
         $home_keys[] = Utils::htmlspecialchars(strip_tags($tag->term_display));
     }
     return array('home_desc' => Utils::htmlspecialchars(strip_tags(Options::get('tagline'))), 'home_keywords' => $home_keys, 'home_index' => true, 'home_follow' => true, 'posts_index' => true, 'posts_follow' => true, 'archives_index' => false, 'archives_follow' => true);
 }
开发者ID:habari-extras,项目名称:metaseo,代码行数:15,代码来源:metaseo.plugin.php

示例2: ajax_tags

 /**
  * Handles AJAX from /admin/tags
  * Used to search for, delete and rename tags
  */
 public function ajax_tags()
 {
     Utils::check_request_method(array('POST', 'HEAD'));
     $this->create_theme();
     $params = $_POST['query'];
     // Get a usable array with filter parameters from the odd syntax we received from the faceted search
     $fetch_params = array();
     if (isset($params)) {
         foreach ($params as $param) {
             $key = key($param);
             // Revert translation
             if ($key != 'text') {
                 $key = self::$facets[$key];
             }
             $value = current($param);
             if (array_key_exists($key, $fetch_params)) {
                 $fetch_params[$key] = Utils::single_array($fetch_params[$key]);
                 $fetch_params[$key][] = $value;
             } else {
                 $fetch_params[$key] = $value;
             }
         }
     }
     // Grab facets / params
     $search = array_key_exists('text', $fetch_params) ? $fetch_params['text'] : null;
     $min = array_key_exists('morethan', $fetch_params) ? $fetch_params['morethan'] + 1 : 0;
     $max = array_key_exists('lessthan', $fetch_params) ? $fetch_params['lessthan'] - 1 : null;
     $orderby_code = array_key_exists('orderby', $fetch_params) ? $fetch_params['orderby'] : null;
     $orderby = isset($orderby_code) ? explode('_', self::$facet_values['orderby'][$orderby_code]) : ['alphabetical', 'asc'];
     $this->theme->tags = Tags::get_by_frequency(null, null, $min, $max, $search, self::$orderby_translate[$orderby[0]], $orderby[1] == 'asc');
     // Create FormUI elements (list items) from the filtered tag list
     $this->theme->max = Tags::vocabulary()->max_count();
     $this->theme->min = Tags::vocabulary()->min_count();
     $output = '';
     if (count($this->theme->tags) > 0) {
         $listitems = $this->get_tag_listitems();
         // Get HTML from FormUI
         foreach ($listitems as $listitem) {
             $output .= $listitem->get($this->theme);
         }
     }
     $ar = new AjaxResponse();
     $ar->html('#tag_collection', $output);
     $ar->out();
 }
开发者ID:habari,项目名称:system,代码行数:49,代码来源:admintagshandler.php


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