Пример #1
0
 public function indexAction()
 {
     //$this->response->setHeader('Cache-Control', 'max-age=86400');
     $this->response->setHeader('Cache-Control', 'private, max-age=0, must-revalidate');
     $this->setlogsarray('author_start');
     $isusernametrue = 0;
     if (preg_match('/\\ba-[0-9]{1,}\\b/i', $this->authorname, $match)) {
         $id = str_replace('-', '_', $match[0]);
     } else {
         $isusernametrue = 1;
         $Author = new \WH\Model\Author();
         $Author->setParam('username', $this->authorname);
         $author = $Author->getResults();
         $id = $author['author'][0]['id'];
     }
     $Author = new \WH\Model\Solr();
     $Author->setParam('ids', $id);
     $Author->setParam('fl', 'detail');
     $Author->setSolrType('detail');
     $Author->setEntityDetails();
     try {
         $author = $Author->getDetailResults();
         $this->setlogsarray('author_get_detail');
     } catch (Exception $e) {
         $author = array();
     }
     $this->view->entityid = $id;
     $this->view->entitytype = 'author';
     /* ======= Seo Update ============= */
     if ($author['title']) {
         $this->tag->setTitle('Events and Content Submitted by ' . $author['title'] . ' | ' . $this->config->application->SiteName);
     }
     $this->view->meta_description = $author['title'] . ': Check out the list of events and content that ' . $author['title'] . ' submitted.';
     $this->view->meta_keywords = $author['title'];
     $this->view->og_title = 'Events and Content Submitted by ' . $author['title'] . ' | ' . $this->config->application->SiteName;
     $this->view->og_type = 'website';
     $this->view->og_description = $author['title'] . ': Check out the list of events and content that ' . $author['title'] . ' submitted.';
     $this->view->canonical_url = $this->baseUrl . $author['url'];
     $this->view->deep_link = $author['deep_link'];
     /* ======= Seo Update ============= */
     //echo "<pre>"; print_r($author); exit;
     if ($author) {
         if ($isusernametrue == 0) {
             $this->validateRequest($author['url']);
         }
         $ids = explode('_', $id);
         $authorid = end($ids);
         $start = 0;
         $limit = 12;
         $profilepost = $this->getauthorpost($authorid, $start, $limit);
         $breadcrumbs = $this->breadcrumbs(array(ucwords(strtolower(trim($author['title']))) => ''));
         $this->view->setVars(array('authorid' => $authorid, 'author' => $author, 'start' => $limit, 'limit' => $limit, 'profilepost' => $profilepost, 'breadcrumbs' => $breadcrumbs));
     } else {
         $this->forwardtoerrorpage(404);
     }
     $this->setlogsarray('author_end');
     $this->getlogs('author', $this->baseUrl . $author['url']);
 }
Пример #2
0
 public function indexAction()
 {
     $this->response->setHeader('Cache-Control', 'max-age=86400');
     preg_match('/\\be-[0-9]{1,}\\b/i', $this->eventtitle, $match);
     $id = str_replace('-', '_', $match[0]);
     $Solr = new \WH\Model\Solr();
     $Solr->setParam('ids', $id);
     $Solr->setParam('fl', 'detail');
     $Solr->setSolrType('detail');
     $Solr->setEntityDetails();
     $this->view->entityid = $id;
     $this->view->entitytype = 'event';
     try {
         $eventdetail = $Solr->getDetailResults();
         $this->setlogsarray('event_get_detail');
     } catch (Exception $e) {
         $eventdetail = array();
     }
     if ($eventdetail) {
         $this->validateRequest($eventdetail['url']);
         /* foreach($eventdetail['images'] as $key=>$images){
         				if($images['uri']){
         					if(substr($images['uri'], 0, 4) != 'http'){
         						$eventdetail['images'][$key]['uri'] = $this->config->application->imgbaseUri.$images['uri'];
         					}
         				}
         			} */
         $eventdetail['venue']['slug'] = $this->create_slug($eventdetail['venue']['name']) . '-v-' . str_replace('_', '-', strtolower($eventdetail['venue']['id']));
         /* ======= Seo Update ============= */
         if ($eventdetail['page_title']) {
             $this->tag->setTitle($eventdetail['page_title']);
         }
         $this->view->meta_description = $eventdetail['meta_description'];
         $this->view->meta_keywords = $eventdetail['meta_keywords'];
         $this->view->og_title = $eventdetail['og_title'];
         $this->view->og_type = 'website';
         $this->view->og_description = $eventdetail['og_description'];
         if ($eventdetail['og_image'] == '/img/wh_default.png') {
             $this->view->og_image = $this->makeurl($this->baseUrl, $eventdetail['images'][0]['uri']) . '?w=500';
         } else {
             $this->view->og_image = $this->makeurl($this->baseUrl, $eventdetail['og_image']) . '?w=500';
         }
         $this->view->og_url = $this->baseUrl . $eventdetail['url'];
         $this->view->canonical_url = $this->baseUrl . $eventdetail['url'];
         $this->view->deep_link = $eventdetail['deep_link'];
         /* ======= Seo Update ============= */
         $cityshown = $this->cityshown($this->currentCity);
         $breadcrumbs = $this->breadcrumbs(array($cityshown => $this->baseUrl . '/' . $this->currentCity, 'Events' => $this->baseUrl . '/' . $this->currentCity . '/events', ucwords(strtolower(trim($eventdetail['title']))) => ''));
         $this->view->setVars(array('eventdetail' => $eventdetail, 'breadcrumbs' => $breadcrumbs));
     } else {
         $this->forwardtoerrorpage(404);
     }
     $this->setlogsarray('event_end');
     $this->getlogs('event', $this->baseUrl . $eventdetail['url']);
 }
 public function indexAction()
 {
     $this->response->setHeader('Cache-Control', 'max-age=86400');
     preg_match('/\\bs-[a-zA-Z0-9\\- ]+/i', $this->specialpagetitle, $match);
     $id = str_replace('-', '_', $match[0]);
     $this->view->entityid = $id;
     $this->view->entitytype = 'special page';
     $Solr = new \WH\Model\Solr();
     $Solr->setParam('ids', $id);
     $Solr->setParam('fl', 'detail');
     $Solr->setSolrType('detail');
     $Solr->setEntityDetails();
     try {
         $specialpagedetail = $Solr->getDetailResults();
         $this->setlogsarray('speacialpage_get_records');
     } catch (Exception $e) {
         $specialpagedetail = array();
     }
     if ($specialpagedetail) {
         $this->validateRequest($specialpagedetail['url']);
         /* ======= Seo Update ============= */
         if ($specialpagedetail['page_title']) {
             $this->tag->setTitle($specialpagedetail['page_title']);
         }
         $this->view->meta_description = $specialpagedetail['meta_description'];
         $this->view->meta_keywords = $specialpagedetail['meta_keywords'];
         $this->view->og_title = $specialpagedetail['og_title'];
         $this->view->og_type = 'website';
         $this->view->og_description = $specialpagedetail['og_description'];
         $this->view->og_image = $this->baseUrl . $specialpagedetail['og_image'];
         $this->view->og_url = $this->baseUrl . $specialpagedetail['url'];
         $this->view->canonical_url = $this->baseUrl . $specialpagedetail['url'];
         $this->view->deep_link = $specialpagedetail['deep_link'];
         /* ======= Seo Update ============= */
         foreach ($specialpagedetail['images'] as $key => $images) {
             if ($images['uri']) {
                 if (substr($images['uri'], 0, 4) != 'http') {
                     $specialpagedetail['images'][$key]['uri'] = $this->config->application->imgbaseUri . $images['uri'];
                 }
             }
         }
         $specialpagedetail['author']['slug'] = $this->create_slug($specialpagedetail['author']['name']) . '-' . $specialpagedetail['author']['id'];
         $cityshown = $this->cityshown($this->currentCity);
         $breadcrumbs = $this->breadcrumbs(array($cityshown => $this->baseUrl . '/' . $this->currentCity, ucwords(strtolower(trim($specialpagedetail['title']))) => ''));
         $this->view->setVars(array('specialpagedetail' => $specialpagedetail, 'breadcrumbs' => $breadcrumbs, 'cityshown' => $cityshown));
     } else {
         $this->forwardtoerrorpage(404);
     }
     $this->setlogsarray('speacialpage_end');
     $this->getlogs('specialpage', $this->baseUrl . $specialpagedetail['url']);
 }
Пример #4
0
 public function indexAction()
 {
     $this->response->setHeader('Cache-Control', 'max-age=86400');
     preg_match('/\\bv-[0-9]{1,}\\b/i', $this->venue, $match);
     $id = str_replace('-', '_', $match[0]);
     $Solr = new \WH\Model\Solr();
     $Solr->setParam('ids', $id);
     $Solr->setParam('fl', 'detail');
     $Solr->setSolrType('detail');
     $Solr->setEntityDetails();
     $this->view->entityid = $id;
     $this->view->entitytype = 'venue';
     try {
         $venuedetail = $Solr->getDetailResults();
         $this->setlogsarray('venue_get_detail');
     } catch (Exception $e) {
         $venuedetail = array();
     }
     if ($venuedetail) {
         $this->validateRequest($venuedetail['url']);
         $formatted_address = '';
         if (isset($venuedetail['address']) && trim($venuedetail['address']) != '') {
             $address_arr[] = $venuedetail['address'];
         }
         if (isset($venuedetail['landmark']) && trim($venuedetail['landmark']) != '') {
             $address_arr[] = $venuedetail['landmark'];
         }
         if (isset($venuedetail['locality']) && trim($venuedetail['locality']) != '') {
             $address_arr[] = $venuedetail['locality'];
         }
         if (isset($venuedetail['zonename']) && trim($venuedetail['zonename']) != '') {
             $address_arr[] = $venuedetail['zonename'];
         }
         if (isset($venuedetail['city']) && trim($venuedetail['city']) != '') {
             $address_arr[] = $venuedetail['city'];
         }
         $formatted_address = implode(', ', $address_arr);
         $venuedetail['formatted_address'] = $formatted_address;
         if ($venuedetail['website']) {
             $pos = strpos($venuedetail['website'], 'http');
             if ($pos === false) {
                 $venuedetail['website'] = 'http://' . $venuedetail['website'];
             }
         }
         $cityshown = $this->cityshown($this->currentCity);
         $breadcrumbs = $this->breadcrumbs(array($cityshown => $this->baseUrl . '/' . $this->currentCity, ucwords(strtolower(trim($venuedetail['title']))) => ''));
         /* ======= Seo Update ============= */
         if ($venuedetail['page_title']) {
             $this->tag->setTitle($venuedetail['page_title']);
         }
         $this->view->meta_description = $venuedetail['meta_description'];
         $this->view->meta_keywords = $venuedetail['meta_keywords'];
         $this->view->og_title = $venuedetail['og_title'];
         $this->view->og_type = 'website';
         $this->view->og_description = $venuedetail['og_description'];
         $this->view->og_image = $this->baseUrl . $venuedetail['og_image'];
         $this->view->og_url = $this->baseUrl . $venuedetail['url'];
         $this->view->canonical_url = $this->baseUrl . $venuedetail['url'];
         $this->view->deep_link = $venuedetail['deep_link'];
         /* ======= Seo Update ============= */
         $this->view->setVars(array('venuedetail' => $venuedetail, 'breadcrumbs' => $breadcrumbs, 'cityshown' => $cityshown));
     } else {
         $this->forwardtoerrorpage(404);
     }
     $this->setlogsarray('venue_end');
     $this->getlogs('venue', $this->baseUrl . $venuedetail['url']);
 }
Пример #5
0
 public function indexAction()
 {
     $this->response->setHeader('Cache-Control', 'max-age=86400');
     preg_match('/\\br-[0-9]{1,}\\b/i', $this->critic, $match);
     $id = str_replace('-', '_', $match[0]);
     $Solr = new \WH\Model\Solr();
     $Solr->setParam('ids', $id);
     $Solr->setParam('fl', 'detail');
     $Solr->setSolrType('detail');
     $Solr->setEntityDetails();
     $this->view->entityid = $id;
     $this->view->entitytype = 'critic';
     try {
         $criticdetail = $Solr->getDetailResults();
         $this->setlogsarray('critic_get_detail');
     } catch (Exception $e) {
         $criticdetail = array();
     }
     if ($criticdetail) {
         //echo "<pre>"; print_r($criticdetail);
         $this->validateRequest($criticdetail['url']);
         $Author = new \WH\Model\Solr();
         $Author->setParam('ids', 'a_' . $criticdetail['author_id']);
         $Author->setParam('fl', 'detail');
         $Author->setSolrType('detail');
         $Author->setEntityDetails();
         try {
             $author = $Author->getDetailResults();
             $this->setlogsarray('author_get_detail');
         } catch (Exception $e) {
             $author = array();
         }
         //print_r($author); exit;
         /* ======= Seo Update ============= */
         if ($criticdetail['page_title']) {
             $this->tag->setTitle($criticdetail['page_title']);
         }
         $this->view->meta_description = $criticdetail['meta_description'];
         $this->view->meta_keywords = $criticdetail['meta_keywords'];
         $this->view->og_title = $criticdetail['og_title'];
         $this->view->og_type = 'website';
         $this->view->og_description = $criticdetail['og_description'];
         if ($criticdetail['og_image'] == '/img/wh_default.png') {
             $this->view->og_image = $this->makeurl($this->baseUrl, $author['images'][0]['uri']) . '?w=500';
         } else {
             $this->view->og_image = $this->makeurl($this->baseUrl, $criticdetail['og_image']) . '?w=500';
         }
         $this->view->og_url = $this->baseUrl . $criticdetail['url'];
         $this->view->canonical_url = $this->baseUrl . $criticdetail['url'];
         $this->view->deep_link = $criticdetail['deep_link'];
         /* ======= Seo Update ============= */
         foreach ($criticdetail['images'] as $key => $images) {
             if ($images['uri']) {
                 if (substr($images['uri'], 0, 4) != 'http') {
                     $criticdetail['images'][$key]['uri'] = $this->config->application->imgbaseUri . $images['uri'];
                 }
             }
         }
         $rwidth = round(($criticdetail['food_rate'] + $criticdetail['service_rate'] + $criticdetail['decor_rate']) / 3, 1);
         $reviewwidth = $rwidth * 33;
         $cityshown = $this->cityshown($this->currentCity);
         $breadcrumbs = $this->breadcrumbs(array($cityshown => $this->baseUrl . '/' . $this->currentCity, ucwords(strtolower(trim($criticdetail['title']))) => ''));
         $this->view->setVars(array('author' => $author, 'criticdetail' => $criticdetail, 'breadcrumbs' => $breadcrumbs, 'reviewwidth' => $reviewwidth, 'rwidth' => $rwidth, 'cityshown' => $cityshown));
     } else {
         $this->forwardtoerrorpage(404);
     }
     $this->setlogsarray('critic_end');
     $this->getlogs('critic', $this->baseUrl . $criticdetail['url']);
 }