Beispiel #1
0
 public function achievements($userId = null)
 {
     if (empty($userId)) {
         OauthController::verifyLogged('apontador');
         $userId = Session::read('apontadorId');
     }
     $user = $this->api->getUser(array('userid' => $userId));
     $location = new Location();
     $location->load();
     $apontadorExtras = new ApontadorExtras();
     $playerProfile = $apontadorExtras->getPlayerProfile($userId);
     $title = 'Conquistas de ' . $user->getName();
     return compact('title', 'location', 'playerProfile', 'user');
 }
Beispiel #2
0
 public function review($placeId = null, $reviewId = null)
 {
     if (empty($placeId)) {
         $this->redirect('/');
     }
     if (!empty($_GET)) {
         OauthController::verifyLogged('apontador');
         $reviewData = array('place_id' => $placeId, 'rating' => $_GET['rating'], 'content' => $_GET['content']);
         $this->doReview($reviewData);
     }
     $reviews = $this->api->getReviews(array('place_id' => $placeId, 'limit' => 100));
     $thePlaceId = $placeId;
     $location = new Location();
     $location->load();
     $placeId = $thePlaceId;
     $place = $this->api->getPlace(array('placeid' => $placeId));
     if ($reviewId != null) {
         foreach ($reviews->place->reviews as $k => $review) {
             if ($review->review->id != $reviewId) {
                 unset($reviews->place->reviews[$k]);
             } else {
                 $keyReview = $k;
             }
         }
         $title = $place->getName() . ' - Avaliação de ' . $reviews->place->reviews[$keyReview]->review->created->user->name . ' (' . $reviews->place->reviews[$keyReview]->review->id . ')';
     } else {
         $title = $place->getName() . ' - Avaliações';
     }
     return compact('title', 'location', 'reviewId', 'reviews', 'place');
 }