コード例 #1
0
ファイル: actions.class.php プロジェクト: 42medien/spreadly
 /**
  * display monthly stats overview
  * @param sfWebRequest $request
  */
 public function executeMonthly(sfWebRequest $request)
 {
     $this->getResponse()->setSlot('js_document_ready', $this->getPartial('oldstats/js_init_visit_history.js'));
     $this->pMonth = $request->getParameter('month', date('Y-m'));
     $this->pHost = $request->getParameter('host', null);
     $this->pSortCat = $request->getParameter('sort', 'host');
     $this->pSortOrder = $request->getParameter('order', 'asc');
     $this->pPage = $request->getParameter('page', 1);
     $lQuery = '&month=' . $this->pMonth . '&host=' . $this->pHost . '&sort=' . $this->pSortCat . '&order=' . $this->pSortOrder;
     $this->pQuery = $lQuery;
     $this->lHostCount = VisitTable::countHostsForMonth($this->pMonth, $this->pHost);
     $this->lVisits = VisitTable::getMonthlyStatistics($this->pMonth, $this->pHost, $this->pPage, $this->pSortCat, $this->pSortOrder);
 }
コード例 #2
0
ファイル: actions.class.php プロジェクト: 42medien/spreadly
 /**
  * Executes advertisement action
  *
  * @param sfRequest $request A request object
  */
 public function executeAdvertisement(sfWebRequest $request)
 {
     $domain = $request->getParameter("domain", "http://spreadly.com/");
     $domain = urldecode($domain);
     $host = parse_url($domain, PHP_URL_HOST);
     $scheme = parse_url($domain, PHP_URL_SCHEME);
     $visit = VisitTable::getMonthlyStatistics(date('Y-m', strtotime("-1 month")), $host);
     $counter = 0;
     if (is_array($visit) && count($visit) > 0) {
         if (array_key_exists("pis_total", $visit[0])) {
             $counter = $visit[0]["pis_total"];
         }
     }
     $this->domain = $scheme . "://" . $host;
     $this->counter = $counter;
 }