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


PHP Tag::count方法代码示例

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


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

示例1: admin

 private function admin()
 {
     $today = strtotime('today');
     $month = strtotime('first day of this month');
     $last30 = strtotime('-30 days');
     // Users statistics
     $users['today'] = number_format(User::whereGt('reg_date', $today)->count());
     $users['month'] = number_format(User::whereGt('reg_date', $month)->count());
     $users['last30'] = number_format(User::whereGt('reg_date', $last30)->count());
     $users['total'] = number_format(User::count());
     View::set('users', $users);
     // Playlists statistics
     $playlists['today'] = number_format(Playlist::whereGt('date', $today)->count());
     $playlists['month'] = number_format(Playlist::whereGt('date', $month)->count());
     $playlists['last30'] = number_format(Playlist::whereGt('date', $last30)->count());
     $playlists['total'] = number_format(Playlist::count());
     View::set('playlists', $playlists);
     // Tracks statistics
     $tracks = number_format(Track::count());
     View::set('tracks', $tracks);
     // Tags statistics
     $tags = number_format(Tag::count());
     View::set('tags', $tags);
     // Comments statistics
     $comments = number_format(Comment::count());
     View::set('comments', $comments);
     // Likes
     $likes = number_format(PlaylistLike::count());
     View::set('likes', $likes);
     // Reports
     $reports = number_format(Report::count());
     View::set('reports', $reports);
     View::show('admin/admin');
 }
开发者ID:nytr0gen,项目名称:plur-music-explorer,代码行数:34,代码来源:admin.php

示例2: run

 public function run()
 {
     $model = new Tag();
     //条件
     $criteria = new CDbCriteria();
     $tag_name = trim(Yii::app()->request->getParam('tag_name'));
     $tag_name && $criteria->addSearchCondition('tag_name', $tag_name);
     $criteria->order = 't.id ASC';
     $count = $model->count($criteria);
     //分页
     $pages = new CPagination($count);
     $pages->pageSize = 20;
     $pages->applyLimit($criteria);
     //查询
     $result = $model->findAll($criteria);
     $this->controller->render('index', array('model' => $model, 'datalist' => $result, 'pagebar' => $pages));
 }
开发者ID:jerrylsxu,项目名称:yiifcms,代码行数:17,代码来源:IndexAction.php

示例3: actionIndex

 /**
  * 标签管理
  *
  */
 public function actionIndex()
 {
     $model = new Tag();
     $criteria = new CDbCriteria();
     $condition = '1';
     $tagName = $this->_request->getParam('tagName');
     $tagName && ($condition .= ' AND tag_name LIKE \'%' . $tagName . '%\'');
     $criteria->condition = $condition;
     $criteria->order = 't.id DESC';
     $count = $model->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = 13;
     $pageParams = $this->buildCondition($_GET, array('tagName'));
     $pages->params = is_array($pageParams) ? $pageParams : array();
     $criteria->limit = $pages->pageSize;
     $criteria->offset = $pages->currentPage * $pages->pageSize;
     $result = $model->findAll($criteria);
     $this->render('index', array('datalist' => $result, 'pagebar' => $pages));
 }
开发者ID:github-zjh,项目名称:task,代码行数:23,代码来源:TagController.php

示例4: get_index

 /**
  * Show general application stats
  * /administration
  *
  * @return View
  */
 public function get_index()
 {
     $issues = Project\Issue::count_issues();
     return $this->layout->with('active', 'dashboard')->nest('content', 'administration.index', array('users' => User::where('deleted', '=', 0)->count(), 'active_projects' => Project::where('status', '=', 1)->count(), 'archived_projects' => Project::where('status', '=', 0)->count(), 'issues' => $issues, 'tags' => Tag::count()));
 }
开发者ID:eliasyanni,项目名称:bugs,代码行数:11,代码来源:administration.php

示例5: tags

 /**
  * tags
  *
  * This returns tags to the user, in a pretty xml document with the information
  *
  * @param    array    $tags    (description here...)
  * @return    string    return xml
  */
 public static function tags($tags)
 {
     if (count($tags) > self::$limit or self::$offset > 0) {
         $tags = array_splice($tags, self::$offset, self::$limit);
     }
     $string = '';
     foreach ($tags as $tag_id) {
         $tag = new Tag($tag_id);
         $counts = $tag->count();
         $string .= "<tag id=\"{$tag_id}\">\n" . "\t<name><![CDATA[{$tag->name}]]></name>\n" . "\t<albums>" . intval($counts['album']) . "</albums>\n" . "\t<artists>" . intval($counts['artist']) . "</artists>\n" . "\t<songs>" . intval($counts['song']) . "</songs>\n" . "\t<videos>" . intval($counts['video']) . "</videos>\n" . "\t<playlists>" . intval($counts['playlist']) . "</playlists>\n" . "\t<stream>" . intval($counts['live_stream']) . "</stream>\n" . "</tag>\n";
     }
     // end foreach
     $final = self::_header() . $string . self::_footer();
     return $final;
 }
开发者ID:cheese1,项目名称:ampache,代码行数:23,代码来源:xml_data.class.php

示例6: run

 public function run()
 {
     if (Tag::count() == 0) {
         $this->generate();
     }
 }
开发者ID:kcsamita,项目名称:laravelsnippets,代码行数:6,代码来源:TagSeeder.php

示例7: addGenres

 public static function addGenres($xml, $tags)
 {
     $xgenres = $xml->addChild('genres');
     foreach ($tags as $tag) {
         $otag = new Tag($tag['id']);
         $xgenre = $xgenres->addChild('genre', htmlspecialchars($otag->name));
         $counts = $otag->count('', $GLOBALS['user']->id);
         $xgenre->addAttribute("songCount", $counts['song']);
         $xgenre->addAttribute("albumCount", $counts['album']);
     }
 }
开发者ID:bl00m,项目名称:ampache,代码行数:11,代码来源:subsonic_xml_data.class.php


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