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


PHP WikiFactory::getCountOfWikisWithVar方法代码示例

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


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

示例1: getCountWikisForReview

 /**
  * Get number of all wikis queued for WDAC review
  * @return int $iCount
  */
 public function getCountWikisForReview()
 {
     wfProfileIn(__METHOD__);
     $iCount = WikiFactory::getCountOfWikisWithVar($this->byFounderVarId, 'bool', '=', true);
     wfProfileOut(__METHOD__);
     return $iCount;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:11,代码来源:WDACReviewHelper.class.php

示例2: execute

 function execute()
 {
     global $wgOut, $wgUser, $wgRequest, $wgTitle;
     $gVar = $wgRequest->getText('var');
     $gVal = $wgRequest->getVal('val', 'true');
     $gLikeVal = $wgRequest->getVal('likeValue', 'true');
     $gTypeVal = $wgRequest->getVal('searchType', 'bool');
     $wgOut->SetPageTitle(wfMsg('whereisextension'));
     $wgOut->setRobotpolicy('noindex,nofollow');
     if (!$wgUser->isAllowed('WhereIsExtension')) {
         $this->displayRestrictionError();
         return;
     }
     $this->values = array(0 => array('true', true, '='), 1 => array('false', false, '='), 2 => array('not empty', '', '!='));
     $tagName = $wgRequest->getVal('wikiSelectTagName', null);
     $tagWikis = $wgRequest->getArray('wikiSelected');
     $tagResultInfo = '';
     if ($wgRequest->wasPosted() && !empty($tagName) && count($tagWikis)) {
         $tagResultInfo = $this->tagSelectedWikis($tagName, $tagWikis);
     }
     $formData['vars'] = $this->getListOfVars($gVar == '');
     $formData['vals'] = $this->values;
     $formData['selectedVal'] = $gVal;
     $formData['likeValue'] = $gLikeVal;
     $formData['searchType'] = $gTypeVal;
     $formData['selectedGroup'] = $gVar == '' ? 27 : '';
     //default group: extensions (or all groups when looking for variable, rt#16953)
     $formData['groups'] = WikiFactory::getGroups();
     $formData['actionURL'] = $wgTitle->getFullURL();
     // by default, we don't need a paginator
     $sPaginator = '';
     if (!empty($gVar)) {
         $formData['selectedVar'] = $gVar;
         // assume an empty result
         $formData['count'] = 0;
         $formData['wikis'] = array();
         if (isset($this->values[$gVal][1]) && isset($this->values[$gVal][2])) {
             // check how many wikis meet the conditions
             $formData['count'] = WikiFactory::getCountOfWikisWithVar($gVar, $gTypeVal, $this->values[$gVal][2], $this->values[$gVal][1], $gLikeVal);
             // if there are any, get the list and create a Paginator
             if (0 < $formData['count']) {
                 // determine the offset (from the requested page)
                 $iPage = $wgRequest->getVal('page', 1);
                 $iOffset = ($iPage - 1) * self::ITEMS_PER_PAGE;
                 // the list
                 $formData['wikis'] = WikiFactory::getListOfWikisWithVar($gVar, $gTypeVal, $this->values[$gVal][2], $this->values[$gVal][1], $gLikeVal, $iOffset, self::ITEMS_PER_PAGE);
                 // the Paginator, if we need more than one page
                 if (self::ITEMS_PER_PAGE < $formData['count']) {
                     $oPaginator = Paginator::newFromArray(array_fill(0, $formData['count'], ''), self::ITEMS_PER_PAGE, 5);
                     $oPaginator->setActivePage($iPage - 1);
                     $sPager = $oPaginator->getBarHTML(sprintf('%s?var=%s&val=%s&likeValue=%s&searchType=%s&page=%%s', $wgTitle->getFullURL(), $gVar, $gVal, $gLikeVal, $gTypeVal));
                 }
             }
         }
     }
     $oTmpl = new EasyTemplate(dirname(__FILE__) . '/templates/');
     $oTmpl->set_vars(array('formData' => $formData, 'tagResultInfo' => $tagResultInfo, 'sPager' => $sPager));
     $wgOut->addHTML($oTmpl->render('list'));
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:59,代码来源:SpecialWhereIsExtension_body.php

示例3: getCuratedContentStats

 /**
  * Return number of communities
  * and number of communities with curated content wg variable set to not falsy value.
  *
  * @responseParam integer totalCommunities
  * @responseParam integer communitiesWithCuratedContent
  */
 public function getCuratedContentStats()
 {
     $data = $this->sendSelfRequest('getWikiaStats')->getData();
     $this->getResponse()->setFormat(WikiaResponse::FORMAT_JSON);
     $communitiesWithCuratedContent = WikiFactory::getCountOfWikisWithVar(CuratedContentController::CURATED_CONTENT_WG_VAR_ID_PROD, "full", "LIKE", null, "true");
     $this->setVal('item', intval($communitiesWithCuratedContent));
     $this->setVal('min', ['value' => 0]);
     $this->setVal('max', ['value' => $data['communities']]);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:16,代码来源:WikiaStatsController.class.php


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