private function info($id)
 {
     $results = array();
     if ($id == null) {
         $results = SearchKeywords::getKeywords($this->url);
     } else {
         $ga = new gapi(config::ga_email, config::ga_password);
         $start = date('Y-m-d', strtotime('-1 day'));
         $end = date('Y-m-d', strtotime('-1 day'));
         $ga->requestReportData($id, array('keyword'), array('visits'), '-visits', null, $start, $end);
         foreach ($ga->getResults() as $r) {
             $results[1][] = $r->getKeyword();
             $results[2][] = $r->getVisits();
         }
     }
     for ($j = 0; $j < count($results[1]); ++$j) {
         if ($results[1][$j] != "(not set)") {
             $this->keys[] = array("keyword" => $results[1][$j], "visits" => $results[2][$j], "pos" => $this->keywordPosition($results[1][$j]));
         }
     }
 }
Exemplo n.º 2
0
        }
    }
    $smarty->assign('jobs', $job->GetJobs(0, $categ, 0, 0, 0));
} else {
    $keywords = trim($keywords);
    $smarty->assign('jobs', $job->Search($keywords, $url_query, $start_page));
}
// if user hit enter after entering a search query, we know this causes a
// synchronous HTTP redirect, so apply a different template
if ($is_home) {
    $template = 'home.tpl';
}
if (!empty($requestKeywords)) {
    // save recorded keywords, if available
    if ($_SESSION['search_keywords']) {
        $search = new SearchKeywords($_SESSION['search_keywords']);
        $search->Save();
        unset($_SESSION['search_keywords']);
    }
    $smarty->assign('keywords', stripslashes(htmlentities($requestKeywords, ENT_QUOTES, 'UTF-8')));
    $template = 'search.tpl';
} else {
    if ($id != '' && !strstr($id, '|')) {
        $smarty->assign('keywords', stripslashes(htmlentities($id, ENT_QUOTES, 'UTF-8')));
        $template = 'search.tpl';
    } else {
        $smarty->assign('keywords', stripslashes($keywords));
        $template = 'posts-loop.tpl';
    }
}
if (isset($_SESSION['search_pagination'])) {