public function photoCommentsRss() { checkUnauthorizedAccess(); $photoID = getIdFromURL(); checkIntValueOfId($photoID); $photo = PhotoRepository::getPhotoByID($photoID); if ($photo == null) { redirect(\route\Route::get("errorPage")->generate()); } $photoComments = PhotoCommentRepository::getPhotoComments($photoID); $title = "Tweet"; $link = "http://localhost:8080/TwitterApp/tweet/" . $photoID; $description = "List of all comments for selected tweet."; generateCommentsRss($title, $link, $description, $photoComments); }
/** * Opens selected photo. */ public function action() { $id = getIdFromURL(); checkIntValueOfId($id); $photo = PhotoRepository::getPhotoByID($id); $comments = PhotoCommentRepository::getPhotoComments($id); if ($photo == null) { redirect(\route\Route::get("errorPage")->generate()); } $galleryID = $photo['galleryid']; $gallery = GalleryRepository::getByID($galleryID); $galleryTitle = $gallery['title']; $main = new Main(); $body = new \templates\ViewPhoto(); $body->setPhoto($photo)->setTitle($galleryTitle)->setComments($comments); echo $main->setBody($body)->setPageTitle("View Photo"); }