當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Piwik_Archive類代碼示例

本文整理匯總了PHP中Piwik_Archive的典型用法代碼示例。如果您正苦於以下問題:PHP Piwik_Archive類的具體用法?PHP Piwik_Archive怎麽用?PHP Piwik_Archive使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Piwik_Archive類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: loadMetadata

	/**
	 * Adds metadata information to the Piwik_DataTable_Array 
	 * using the information given by the Archive
	 *
	 * @param Piwik_DataTable_Array $table
	 * @param Piwik_Archive $archive
	 */
	protected function loadMetadata(Piwik_DataTable_Array $table, $archive)
	{
		$table->metadata[$archive->getPrettyDate()] = array( 
				'timestamp' => $archive->getTimestampStartDate(),
				'site' => $archive->getSite(),
				'period' => $archive->getPeriod(),
			);
	}
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:15,代碼來源:IndexedByDate.php

示例2: advancedFactory

 /**
  * The advanced factory method is easier to use from the API than the factory
  * method above. It doesn't require an instance of Piwik_Date and works for
  * period=range. Generally speaking, anything that can be passed as period
  * and range to the API methods can directly be forwarded to this factory
  * method in order to get a suitable instance of Piwik_Period.
  * 
  * @param string $strPeriod "day", "week", "month", "year", "range"
  * @param string $strDate
  * @return Piwik_Period
  */
 public static function advancedFactory($strPeriod, $strDate)
 {
     if (Piwik_Archive::isMultiplePeriod($strDate, $strPeriod) || $strPeriod == 'range') {
         return new Piwik_Period_Range($strPeriod, $strDate);
     }
     return self::factory($strPeriod, Piwik_Date::factory($strDate));
 }
開發者ID:nnnnathann,項目名稱:piwik,代碼行數:18,代碼來源:Period.php

示例3: getByDayOfWeek

 public function getByDayOfWeek($fetch = false)
 {
     $view = $this->getGraph(__FUNCTION__, 'VisitTime.getByDayOfWeek', 'VisitTime_DayOfWeek', $limit = 7, $sort = false);
     $view->disableSort();
     if ($view instanceof Piwik_ViewDataTable_GenerateGraphHTML) {
         $view->showAllTicks();
     }
     // get query params
     $idsite = Piwik_Common::getRequestVar('idSite');
     $date = Piwik_Common::getRequestVar('date');
     $period = Piwik_Common::getRequestVar('period');
     // create a period instance
     $oSite = new Piwik_Site($idsite);
     $oPeriod = Piwik_Archive::makePeriodFromQueryParams($oSite, $period, $date);
     // set the footer message using the period start & end date
     $start = $oPeriod->getDateStart()->toString();
     $end = $oPeriod->getDateEnd()->toString();
     if ($start == $end) {
         $dateRange = $start;
     } else {
         $dateRange = $start . " – " . $end;
     }
     $view->setFooterMessage(Piwik_Translate('General_ReportGeneratedFrom', $dateRange));
     return $this->renderView($view, $fetch);
 }
開發者ID:nnnnathann,項目名稱:piwik,代碼行數:25,代碼來源:Controller.php

示例4: getDataTable

 /** Get data table from archive
  * @return Piwik_DataTable */
 public static function getDataTable($name, $idsite, $period, $date, $numeric = false)
 {
     Piwik::checkUserHasViewAccess($idsite);
     if (is_array($name)) {
         foreach ($name as &$col) {
             $col = 'SiteSearch_' . $col;
         }
     } else {
         $name = 'SiteSearch_' . $name;
     }
     if (!is_string($period) && get_class($period) != 'Piwik_Period_Range') {
         $periodMap = array('Piwik_Period_Day' => 'day', 'Piwik_Period_Week' => 'week', 'Piwik_Period_Month' => 'month', 'Piwik_Period_Year' => 'year');
         $period = $periodMap[get_class($period)];
     }
     $archive = Piwik_Archive::build($idsite, $period, $date);
     if ($numeric) {
         // numeric archives are only used for search evolution
         $dataTable = $archive->getDataTableFromNumeric($name);
         $dataTable->queueFilter('ReplaceColumnNames', array(array('SiteSearch_totalSearches' => self::HITS, 'SiteSearch_visitsWithSearches' => self::UNIQUE_HITS)));
         $dataTable->applyQueuedFilters();
     } else {
         $dataTable = $archive->getDataTable($name);
     }
     return $dataTable;
 }
開發者ID:BeezyT,項目名稱:piwik-sitesearch,代碼行數:27,代碼來源:Archive.php

示例5: getDataTable

 protected function getDataTable($idSite, $period, $date, $segment, $expanded, $idSubtable)
 {
     $dataTable = Piwik_Archive::getDataTableFromArchive('CustomVariables_valueByName', $idSite, $period, $date, $segment, $expanded, $idSubtable);
     $dataTable->filter('Sort', array(Piwik_Archive::INDEX_NB_VISITS, 'desc', $naturalSort = false, $expanded));
     $dataTable->queueFilter('ReplaceColumnNames');
     return $dataTable;
 }
開發者ID:Gninety,項目名稱:Microweber,代碼行數:7,代碼來源:API.php

示例6: __construct

    public function __construct($string, $idSites)
    {
    	$string = Piwik_Common::unsanitizeInputValue($string);
        $string = trim($string);
		if( !Piwik_Archive::isSegmentationEnabled() 
			&& !empty($string))
		{
			throw new Exception("The Super User has disabled the use of 'segments' for the anonymous user. 
									Please log in to use Segmentation in the API.");
		}
        // As a preventive measure, we restrict the filter size to a safe limit
        $string = substr($string, 0, self::SEGMENT_TRUNCATE_LIMIT);
        
        $this->string = $string;
        $this->idSites = $idSites;
        $segment = new Piwik_SegmentExpression($string);
        $this->segment = $segment;

        // parse segments
        $expressions = $segment->parseSubExpressions();
        
        // convert segments name to sql segment
        // check that user is allowed to view this segment
        // and apply a filter to the value to match if necessary (to map DB fields format)
        $cleanedExpressions = array();
        foreach($expressions as $expression)
        {
            $operand = $expression[Piwik_SegmentExpression::INDEX_OPERAND];
            $cleanedExpression = $this->getCleanedExpression($operand);
            $expression[Piwik_SegmentExpression::INDEX_OPERAND] = $cleanedExpression;
            $cleanedExpressions[] = $expression;
        }
        $segment->setSubExpressionsAfterCleanup($cleanedExpressions);
    }
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:34,代碼來源:Segment.php

示例7: getNumeric

 protected function getNumeric($idSite, $period, $date, $segment, $toFetch)
 {
     Piwik::checkUserHasViewAccess($idSite);
     $archive = Piwik_Archive::build($idSite, $period, $date, $segment);
     $dataTable = $archive->getNumeric($toFetch);
     return $dataTable;
 }
開發者ID:Gninety,項目名稱:Microweber,代碼行數:7,代碼來源:API.php

示例8: getDataTable

 protected function getDataTable($name, $idSite, $period, $date, $segment, $column = Piwik_Archive::INDEX_NB_VISITS)
 {
     Piwik::checkUserHasViewAccess($idSite);
     $archive = Piwik_Archive::build($idSite, $period, $date, $segment);
     $dataTable = $archive->getDataTable($name);
     $dataTable->queueFilter('ReplaceColumnNames');
     return $dataTable;
 }
開發者ID:neolf,項目名稱:PIWIK4MOBILE,代碼行數:8,代碼來源:API.php

示例9: __construct

 /**
  * @param Piwik_Site $oSite 
  * @param string $strPeriod eg. 'day' 'week' etc.
  * @param string $strDate A date range, eg. 'last10', 'previous5' or 'YYYY-MM-DD,YYYY-MM-DD'
  */
 function __construct($sites, $strPeriod, $strDate, Piwik_Segment $segment)
 {
     foreach ($sites as $idSite) {
         $archive = Piwik_Archive::build($idSite, $strPeriod, $strDate, $segment);
         $this->archives[$idSite] = $archive;
     }
     ksort($this->archives);
 }
開發者ID:0h546f6f78696342756e4e59,項目名稱:piwik,代碼行數:13,代碼來源:IndexedBySite.php

示例10: getDataTable

 /** Get data table from archive
  * @return Piwik_DataTable */
 public static function getDataTable($name, $idsite, $period, $date)
 {
     Piwik::checkUserHasViewAccess($idsite);
     $name = 'SiteUsers_' . $name;
     $archive = Piwik_Archive::build($idsite, $period, $date);
     $dataTable = $archive->getDataTable($name);
     return $dataTable;
 }
開發者ID:BeezyT,項目名稱:piwik-siteusers,代碼行數:10,代碼來源:Archive.php

示例11: getSearchPercentageEvolution

 /** Get evolution of search percentage
  * @return Piwik_DataTable */
 public function getSearchPercentageEvolution($idSite, $period, $date)
 {
     Piwik::checkUserHasViewAccess($idSite);
     $archive = Piwik_Archive::build($idSite, $period, $date);
     $dataTable = $archive->getDataTableFromNumeric(array('SiteSearch_visitsWithSearches', 'nb_visits'));
     $dataTable->filter('ColumnCallbackAddColumnQuotient', array('search_percentage', 'SiteSearch_visitsWithSearches', 'nb_visits', 4));
     $dataTable->filter('ColumnCallbackReplace', array('search_percentage', array($this, 'quotientToPercentageSafe')));
     return $dataTable;
 }
開發者ID:BeezyT,項目名稱:piwik-sitesearch,代碼行數:11,代碼來源:API.php

示例12: getDataTable

	protected function getDataTable($name, $idSite, $period, $date, $segment )
	{
		Piwik::checkUserHasViewAccess( $idSite );
		$archive = Piwik_Archive::build($idSite, $period, $date, $segment );
		$dataTable = $archive->getDataTable($name);
		$dataTable->filter('Sort', array('label', 'asc', true));
		$dataTable->queueFilter('ColumnCallbackReplace', array('label', 'Piwik_getTimeLabel'));
		$dataTable->queueFilter('ReplaceColumnNames');
		return $dataTable;
	}
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:10,代碼來源:API.php

示例13: getDataTable

 protected function getDataTable($name, $idSite, $period, $date)
 {
     Piwik::checkUserHasViewAccess($idSite);
     $archive = Piwik_Archive::build($idSite, $period, $date);
     $dataTable = $archive->getDataTable($name);
     $dataTable->filter('Sort', array(Piwik_Archive::INDEX_NB_VISITS));
     $dataTable->queueFilter('ReplaceColumnNames');
     $dataTable->queueFilter('Sort', array('label', 'asc', true));
     return $dataTable;
 }
開發者ID:klando,項目名稱:pgpiwik,代碼行數:10,代碼來源:API.php

示例14: __construct

 /**
  * @param Piwik_Site $oSite 
  * @param string $strPeriod eg. 'day' 'week' etc.
  * @param string $strDate A date range, eg. 'last10', 'previous5' or 'YYYY-MM-DD,YYYY-MM-DD'
  */
 function __construct($sites, $strPeriod, $strDate)
 {
     foreach ($sites as $idSite) {
         $archive = Piwik_Archive::build($idSite, $strPeriod, $strDate);
         $archive->setSite(new Piwik_Site($idSite));
         $archive->prepareArchive();
         $this->archives[$idSite] = $archive;
     }
     ksort($this->archives);
 }
開發者ID:Doluci,項目名稱:tomatocart,代碼行數:15,代碼來源:IndexedBySite.php

示例15: addWidgets

 /**
  * Adds Referer widgets
  */
 function addWidgets()
 {
     Piwik_AddWidget('Referers_Referers', 'Referers_WidgetKeywords', 'Referers', 'getKeywords');
     Piwik_AddWidget('Referers_Referers', 'Referers_WidgetExternalWebsites', 'Referers', 'getWebsites');
     Piwik_AddWidget('Referers_Referers', 'Referers_WidgetSearchEngines', 'Referers', 'getSearchEngines');
     Piwik_AddWidget('Referers_Referers', 'Referers_WidgetCampaigns', 'Referers', 'getCampaigns');
     Piwik_AddWidget('Referers_Referers', 'Referers_WidgetOverview', 'Referers', 'getRefererType');
     if (Piwik_Archive::isSegmentationEnabled()) {
         Piwik_AddWidget('SEO', 'Top Keywords for Page URL', 'Referers', 'getKeywordsForPage');
     }
 }
開發者ID:nnnnathann,項目名稱:piwik,代碼行數:14,代碼來源:Referers.php


注:本文中的Piwik_Archive類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。