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


PHP Notice::count方法代码示例

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


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

示例1: noticeCount

 static function noticeCount($id)
 {
     $keypart = sprintf('conversation:notice_count:%d', $id);
     $cnt = self::cacheGet($keypart);
     if ($cnt !== false) {
         return $cnt;
     }
     $notice = new Notice();
     $notice->conversation = $id;
     $cnt = $notice->count();
     self::cacheSet($keypart, $cnt);
     return $cnt;
 }
开发者ID:harriewang,项目名称:InnertieWebsite,代码行数:13,代码来源:Conversation.php

示例2: noticeCount

 static function noticeCount($id)
 {
     $keypart = sprintf('conversation:notice_count:%d', $id);
     $cnt = self::cacheGet($keypart);
     if ($cnt !== false) {
         return $cnt;
     }
     $notice = new Notice();
     $notice->conversation = $id;
     $notice->whereAddIn('verb', array(ActivityVerb::POST, ActivityUtils::resolveUri(ActivityVerb::POST, true)), $notice->columnType('verb'));
     $cnt = $notice->count();
     self::cacheSet($keypart, $cnt);
     return $cnt;
 }
开发者ID:phpsource,项目名称:gnu-social,代码行数:14,代码来源:Conversation.php

示例3: run

 public function run()
 {
     $this->controller->_seoTitle = '系统公告 - ' . $this->controller->_setting['site_name'];
     $model = new Notice();
     $criteria = new CDbCriteria();
     //查询条件
     $criteria->addColumnCondition(array('status' => 'Y'));
     $count = $model->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = 10;
     $pages->applyLimit($criteria);
     $lists = $model->findAll($criteria);
     $this->controller->render('index', array('lists' => $lists, 'pages' => $pages));
 }
开发者ID:github-zjh,项目名称:task,代码行数:14,代码来源:IndexAction.php

示例4: actionIndex

 /**
  * 公告列表
  *
  */
 public function actionIndex()
 {
     $model = new Notice();
     $criteria = new CDbCriteria();
     $title = trim($this->_request->getParam('title'));
     $title && ($condition .= ' AND title LIKE \'%' . $title . '%\'');
     $criteria->condition = $condition;
     $criteria->order = 't.id DESC';
     $count = $model->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = 10;
     //根据title查询
     $pageParams = $this->buildCondition($_GET, array('title'));
     $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,代码来源:NoticeController.php

示例5: showStatistics

 function showStatistics()
 {
     // XXX: WORM cache this
     $subs = new Subscription();
     $subs->subscriber = $this->profile->id;
     $subs_count = (int) $subs->count() - 1;
     $subbed = new Subscription();
     $subbed->subscribed = $this->profile->id;
     $subbed_count = (int) $subbed->count() - 1;
     $notices = new Notice();
     $notices->profile_id = $this->profile->id;
     $notice_count = (int) $notices->count();
     $this->elementStart('div', array('id' => 'entity_statistics', 'class' => 'section'));
     $this->element('h2', null, _('Statistics'));
     // Other stats...?
     $this->elementStart('dl', 'entity_member-since');
     $this->element('dt', null, _('Member since'));
     $this->element('dd', null, date('j M Y', strtotime($this->profile->created)));
     $this->elementEnd('dl');
     $this->elementStart('dl', 'entity_subscriptions');
     $this->elementStart('dt');
     $this->element('a', array('href' => common_local_url('subscriptions', array('nickname' => $this->profile->nickname))), _('Subscriptions'));
     $this->elementEnd('dt');
     $this->element('dd', null, is_int($subs_count) ? $subs_count : '0');
     $this->elementEnd('dl');
     $this->elementStart('dl', 'entity_subscribers');
     $this->elementStart('dt');
     $this->element('a', array('href' => common_local_url('subscribers', array('nickname' => $this->profile->nickname))), _('Subscribers'));
     $this->elementEnd('dt');
     $this->element('dd', 'subscribers', is_int($subbed_count) ? $subbed_count : '0');
     $this->elementEnd('dl');
     $this->elementStart('dl', 'entity_notices');
     $this->element('dt', null, _('Notices'));
     $this->element('dd', null, is_int($notice_count) ? $notice_count : '0');
     $this->elementEnd('dl');
     $this->elementEnd('div');
 }
开发者ID:Br3nda,项目名称:laconica,代码行数:37,代码来源:showstream.php

示例6: execute

 function execute($channel)
 {
     $subs = new Subscription();
     $subs->subscriber = $this->user->id;
     $subs_count = (int) $subs->count() - 1;
     $subbed = new Subscription();
     $subbed->subscribed = $this->user->id;
     $subbed_count = (int) $subbed->count() - 1;
     $notices = new Notice();
     $notices->profile_id = $this->user->id;
     $notice_count = (int) $notices->count();
     $channel->output($this->user, sprintf(_("Subscriptions: %1\$s\n" . "Subscribers: %2\$s\n" . "Notices: %3\$s"), $subs_count, $subbed_count, $notice_count));
 }
开发者ID:Br3nda,项目名称:laconica,代码行数:13,代码来源:command.php

示例7: checkDupes

 static function checkDupes($profile_id, $content)
 {
     $profile = Profile::getKV($profile_id);
     if (!$profile instanceof Profile) {
         return false;
     }
     $notice = $profile->getNotices(0, CachingNoticeStream::CACHE_WINDOW);
     if (!empty($notice)) {
         $last = 0;
         while ($notice->fetch()) {
             if (time() - strtotime($notice->created) >= common_config('site', 'dupelimit')) {
                 return true;
             } else {
                 if ($notice->content == $content) {
                     return false;
                 }
             }
         }
     }
     // If we get here, oldest item in cache window is not
     // old enough for dupe limit; do direct check against DB
     $notice = new Notice();
     $notice->profile_id = $profile_id;
     $notice->content = $content;
     $threshold = common_sql_date(time() - common_config('site', 'dupelimit'));
     $notice->whereAdd(sprintf("created > '%s'", $notice->escape($threshold)));
     $cnt = $notice->count();
     return $cnt == 0;
 }
开发者ID:a780201,项目名称:gnu-social,代码行数:29,代码来源:Notice.php

示例8: noticeCount

 function noticeCount()
 {
     $c = common_memcache();
     if (!empty($c)) {
         $cnt = $c->get(common_cache_key('profile:notice_count:' . $this->id));
         if (is_integer($cnt)) {
             return (int) $cnt;
         }
     }
     $notices = new Notice();
     $notices->profile_id = $this->id;
     $cnt = (int) $notices->count('distinct id');
     if (!empty($c)) {
         $c->set(common_cache_key('profile:notice_count:' . $this->id), $cnt);
     }
     return $cnt;
 }
开发者ID:microcosmx,项目名称:experiments,代码行数:17,代码来源:Profile.php

示例9: checkDupes

 static function checkDupes($profile_id, $content)
 {
     $profile = Profile::staticGet($profile_id);
     if (empty($profile)) {
         return false;
     }
     $notice = $profile->getNotices(0, NOTICE_CACHE_WINDOW);
     if (!empty($notice)) {
         $last = 0;
         while ($notice->fetch()) {
             if (time() - strtotime($notice->created) >= common_config('site', 'dupelimit')) {
                 return true;
             } else {
                 if ($notice->content == $content) {
                     return false;
                 }
             }
         }
     }
     # If we get here, oldest item in cache window is not
     # old enough for dupe limit; do direct check against DB
     $notice = new Notice();
     $notice->profile_id = $profile_id;
     $notice->content = $content;
     if (common_config('db', 'type') == 'pgsql') {
         $notice->whereAdd('extract(epoch from now() - created) < ' . common_config('site', 'dupelimit'));
     } else {
         $notice->whereAdd('now() - created < ' . common_config('site', 'dupelimit'));
     }
     $cnt = $notice->count();
     return $cnt == 0;
 }
开发者ID:Br3nda,项目名称:statusnet-debian,代码行数:32,代码来源:Notice.php

示例10: noticeCount

 function noticeCount()
 {
     $c = Cache::instance();
     if (!empty($c)) {
         $cnt = $c->get(Cache::key('profile:notice_count:' . $this->id));
         if (is_integer($cnt)) {
             return (int) $cnt;
         }
     }
     $notices = new Notice();
     $notices->profile_id = $this->id;
     $notices->verb = ActivityVerb::POST;
     $cnt = (int) $notices->count('distinct id');
     if (!empty($c)) {
         $c->set(Cache::key('profile:notice_count:' . $this->id), $cnt);
     }
     return $cnt;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:18,代码来源:Profile.php

示例11: getCount

 static function getCount($d)
 {
     $notice = new Notice();
     $notice->whereAdd('created BETWEEN "' . $d . ' 00:00:00" AND "' . self::incrementDay($d) . ' 00:00:00"');
     $notice->whereAdd('is_local = ' . Notice::LOCAL_PUBLIC);
     $n = $notice->count();
     return $n;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:8,代码来源:Sitemap_notice_count.php


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