示例#1
0
 public function indexAction()
 {
     $this->_helper->layout()->setLayout('home');
     $this->view->suggestIP = $this->_helper->getLocationGeoIP->suggest();
     //check if user is locked
     $locked = $this->_helper->checkLockedUser->check();
     if ($locked == 1) {
         $this->_redirect('/' . $this->view->lang . '/auth/logout');
     }
     //if user is logged the redir to proper location, if not stand on not logged home view (index)
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $this->_redirect('/' . $this->view->lang . '/woeid/' . $this->location . '/give');
     }
     //check if request is / redir to /lang
     $langIndex = $this->getRequest()->getParam('language');
     if ($langIndex == null) {
         //add meta robots to not index the page without language param but allow follow-crawl all the rest
         //$this->view->metaRobots = 'noindex,follow';
         //force redirect with language
         $this->_redirect('/es', array('code' => 301));
     } else {
         $this->view->metaRobots = 'index,follow';
     }
     //add link rel canonical , better seo
     $this->view->canonicalUrl = 'http://' . $_SERVER['HTTP_HOST'] . '/' . $this->lang;
     $modelAd = new Model_Ad();
     $this->view->allGives = $modelAd->getAdListAllHome(1, null);
     $this->view->rankingWoeid = $modelAd->getRankingWoeid($limit = 40);
     $this->view->rankingUsers = $modelAd->getRankingUsers($limit = 80);
     //add meta description to head
     $this->view->metaDescription = $this->view->translate('nolotiro.org is a website where you can give away things you no longer want or no longer need to pick them up other people who may serve or be of much use.');
 }