本文整理汇总了PHP中Piwik_Site::isSiteSearchEnabledFor方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik_Site::isSiteSearchEnabledFor方法的具体用法?PHP Piwik_Site::isSiteSearchEnabledFor怎么用?PHP Piwik_Site::isSiteSearchEnabledFor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik_Site
的用法示例。
在下文中一共展示了Piwik_Site::isSiteSearchEnabledFor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setSparklinesAndNumbers
protected function setSparklinesAndNumbers($view)
{
$view->urlSparklineNbVisits = $this->getUrlSparkline('getEvolutionGraph', array('columns' => $view->displayUniqueVisitors ? array('nb_visits', 'nb_uniq_visitors') : array('nb_visits')));
$view->urlSparklineNbPageviews = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('nb_pageviews', 'nb_uniq_pageviews')));
$view->urlSparklineNbDownloads = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('nb_downloads', 'nb_uniq_downloads')));
$view->urlSparklineNbOutlinks = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('nb_outlinks', 'nb_uniq_outlinks')));
$view->urlSparklineAvgVisitDuration = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('avg_time_on_site')));
$view->urlSparklineMaxActions = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('max_actions')));
$view->urlSparklineActionsPerVisit = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('nb_actions_per_visit')));
$view->urlSparklineBounceRate = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('bounce_rate')));
$idSite = Piwik_Common::getRequestVar('idSite');
$displaySiteSearch = Piwik_Site::isSiteSearchEnabledFor($idSite);
if ($displaySiteSearch) {
$view->urlSparklineNbSearches = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('nb_searches', 'nb_keywords')));
}
$view->displaySiteSearch = $displaySiteSearch;
$dataTableVisit = self::getVisitsSummary();
$dataRow = $dataTableVisit->getRowsCount() == 0 ? new Piwik_DataTable_Row() : $dataTableVisit->getFirstRow();
$dataTableActions = Piwik_Actions_API::getInstance()->get($idSite, Piwik_Common::getRequestVar('period'), Piwik_Common::getRequestVar('date'), Piwik_Common::getRequestVar('segment', false));
$dataActionsRow = $dataTableActions->getRowsCount() == 0 ? new Piwik_DataTable_Row() : $dataTableActions->getFirstRow();
$view->nbUniqVisitors = (int) $dataRow->getColumn('nb_uniq_visitors');
$nbVisits = (int) $dataRow->getColumn('nb_visits');
$view->nbVisits = $nbVisits;
$view->nbPageviews = (int) $dataActionsRow->getColumn('nb_pageviews');
$view->nbUniquePageviews = (int) $dataActionsRow->getColumn('nb_uniq_pageviews');
$view->nbDownloads = (int) $dataActionsRow->getColumn('nb_downloads');
$view->nbUniqueDownloads = (int) $dataActionsRow->getColumn('nb_uniq_downloads');
$view->nbOutlinks = (int) $dataActionsRow->getColumn('nb_outlinks');
$view->nbUniqueOutlinks = (int) $dataActionsRow->getColumn('nb_uniq_outlinks');
$view->averageVisitDuration = $dataRow->getColumn('avg_time_on_site');
$nbBouncedVisits = $dataRow->getColumn('bounce_count');
$view->bounceRate = Piwik::getPercentageSafe($nbBouncedVisits, $nbVisits);
$view->maxActions = (int) $dataRow->getColumn('max_actions');
$view->nbActionsPerVisit = $dataRow->getColumn('nb_actions_per_visit');
if ($displaySiteSearch) {
$view->nbSearches = (int) $dataActionsRow->getColumn('nb_searches');
$view->nbKeywords = (int) $dataActionsRow->getColumn('nb_keywords');
}
// backward compatibility:
// show actions if the finer metrics are not archived
$view->showOnlyActions = false;
if ($dataActionsRow->getColumn('nb_pageviews') + $dataActionsRow->getColumn('nb_downloads') + $dataActionsRow->getColumn('nb_outlinks') == 0 && $dataRow->getColumn('nb_actions') > 0) {
$view->showOnlyActions = true;
$view->nbActions = $dataRow->getColumn('nb_actions');
$view->urlSparklineNbActions = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('nb_actions')));
}
}
示例2: __construct
function __construct($idSite)
{
$this->isSiteSearchEnabled = Piwik_Site::isSiteSearchEnabledFor($idSite);
}
示例3: isSiteSearchEnabled
protected function isSiteSearchEnabled()
{
$idSite = Piwik_Common::getRequestVar('idSite', 0, 'int');
if ($idSite == 0) {
return false;
}
return Piwik_Site::isSiteSearchEnabledFor($idSite);
}
示例4: testSetDefaultTimezoneAndCurrencyAndExcludedQueryParametersAndExcludedIps
/**
*
* @group Plugins
* @group SitesManager
*/
public function testSetDefaultTimezoneAndCurrencyAndExcludedQueryParametersAndExcludedIps()
{
// test that they return default values
$defaultTimezone = Piwik_SitesManager_API::getInstance()->getDefaultTimezone();
$this->assertEquals('UTC', $defaultTimezone);
$defaultCurrency = Piwik_SitesManager_API::getInstance()->getDefaultCurrency();
$this->assertEquals('USD', $defaultCurrency);
$excludedIps = Piwik_SitesManager_API::getInstance()->getExcludedIpsGlobal();
$this->assertEquals('', $excludedIps);
$excludedQueryParameters = Piwik_SitesManager_API::getInstance()->getExcludedQueryParametersGlobal();
$this->assertEquals('', $excludedQueryParameters);
// test that when not specified, defaults are set as expected
$idsite = Piwik_SitesManager_API::getInstance()->addSite("site1", array('http://example.org'));
$site = new Piwik_Site($idsite);
$this->assertEquals('UTC', $site->getTimezone());
$this->assertEquals('USD', $site->getCurrency());
$this->assertEquals('', $site->getExcludedQueryParameters());
$this->assertEquals('', $site->getExcludedIps());
$this->assertEquals(false, $site->isEcommerceEnabled());
// set the global timezone and get it
$newDefaultTimezone = 'UTC+5.5';
Piwik_SitesManager_API::getInstance()->setDefaultTimezone($newDefaultTimezone);
$defaultTimezone = Piwik_SitesManager_API::getInstance()->getDefaultTimezone();
$this->assertEquals($newDefaultTimezone, $defaultTimezone);
// set the default currency and get it
$newDefaultCurrency = 'EUR';
Piwik_SitesManager_API::getInstance()->setDefaultCurrency($newDefaultCurrency);
$defaultCurrency = Piwik_SitesManager_API::getInstance()->getDefaultCurrency();
$this->assertEquals($newDefaultCurrency, $defaultCurrency);
// set the global IPs to exclude and get it
$newGlobalExcludedIps = '1.1.1.*,1.1.*.*,150.1.1.1';
Piwik_SitesManager_API::getInstance()->setGlobalExcludedIps($newGlobalExcludedIps);
$globalExcludedIps = Piwik_SitesManager_API::getInstance()->getExcludedIpsGlobal();
$this->assertEquals($newGlobalExcludedIps, $globalExcludedIps);
// set the global URL query params to exclude and get it
$newGlobalExcludedQueryParameters = 'PHPSESSID,blabla, TesT';
// removed the space
$expectedGlobalExcludedQueryParameters = 'PHPSESSID,blabla,TesT';
Piwik_SitesManager_API::getInstance()->setGlobalExcludedQueryParameters($newGlobalExcludedQueryParameters);
$globalExcludedQueryParameters = Piwik_SitesManager_API::getInstance()->getExcludedQueryParametersGlobal();
$this->assertEquals($expectedGlobalExcludedQueryParameters, $globalExcludedQueryParameters);
// create a website and check that default currency and default timezone are set
// however, excluded IPs and excluded query Params are not returned
$idsite = Piwik_SitesManager_API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 0, $siteSearch = 0, $searchKeywordParameters = 'test1,test2', $searchCategoryParameters = 'test2,test1', '', '', $newDefaultTimezone);
$site = new Piwik_Site($idsite);
$this->assertEquals($newDefaultTimezone, $site->getTimezone());
$this->assertEquals(date('Y-m-d'), $site->getCreationDate()->toString());
$this->assertEquals($newDefaultCurrency, $site->getCurrency());
$this->assertEquals('', $site->getExcludedIps());
$this->assertEquals('', $site->getExcludedQueryParameters());
$this->assertEquals('test1,test2', $site->getSearchKeywordParameters());
$this->assertEquals('test2,test1', $site->getSearchCategoryParameters());
$this->assertFalse($site->isSiteSearchEnabled());
$this->assertFalse(Piwik_Site::isSiteSearchEnabledFor($idsite));
$this->assertFalse($site->isEcommerceEnabled());
$this->assertFalse(Piwik_Site::isEcommerceEnabledFor($idsite));
}