當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。