echoln("
"); $eventInfo = $this->getEventInfo(isset($_GET['photo'])); $size = $this->getRequestSize(); $photo = $this->getRequestPhoto($eventInfo['photocount']); $start = $this->getRequestStart($eventInfo['photocount']); if( $photo == null && !isset($_GET['photo']) ) { $this->showEventInfo($eventInfo); } if( $size == "thumb" ) { $this->echoln("All pictures on one page in big size.
"); } $buttons = $this->getButtons($eventInfo['photocount'], $size, $photo, $start); $this->echoln($buttons); $photoResult = $this->getPhotos($size, $photo, $start); $this->showPhotos($photoResult, $size); $this->echoln($buttons); } private function getRequestSize() { if( isset($_GET['size']) && in_array($_GET['size'], array("thumb", "normal", "big")) ) { return $_GET['size']; }else { return "thumb"; } } private function getRequestPhoto($photocount) { if( isset($_GET['photo']) && is_numeric($_GET['photo']) && $_GET['photo'] >= 1 && $_GET['photo'] <= $photocount ) { return $_GET['photo']; }else { return null; } } private function getRequestStart($photocount) { if( isset($_GET['start']) && is_numeric($_GET['start']) && $_GET['start'] >= 1 && $_GET['start'] <= $photocount ) { return $_GET['start']; }else { return 1; } } private function getEventInfo($minimal = false) { $queryBuilder = new QueryBuilder($this->getDbMySQL(), "book"); $queryBuilder->addField("book.photocount", "photocount"); if( !$minimal ) { $queryBuilder->addField("book.title", "title"); $queryBuilder->addField("book.comment", "comment"); $queryBuilder->addField("event.title", "eventtitle"); $queryBuilder->addField("event.topic", "eventtopic"); $queryBuilder->addField("event.projectname", "projectname"); $queryBuilder->addField("event.location", "location"); $queryBuilder->addField("event.datestart", "datestart"); $queryBuilder->addField("event.dateend", "dateend"); $queryBuilder->addField("event.eventtype", "eventtype"); $queryBuilder->addField("event.area", "eventarea"); $queryBuilder->addField("event.eventrating", "eventrating"); $queryBuilder->addField("event.eventcode", "eventcode"); $queryBuilder->addField("organiser1.bodyname", "organiser1"); $queryBuilder->addField("organiser2.bodyname", "organiser2"); $queryBuilder->addField("event.bodycode2", "bodycode2"); $queryBuilder->addField("user.name", "owner"); $queryBuilder->addField("userlocal.bodyname", "ownerlocal"); $queryBuilder->addInnerJoin("event", "eventcode", "book.eventcode"); $queryBuilder->addLeftJoin("ab_bodies", "bodycode", "event.bodycode", "organiser1"); $queryBuilder->addLeftJoin("ab_bodies", "bodycode", "event.bodycode2", "organiser2"); $queryBuilder->addInnerJoin("user", "uid", "book.uid"); $queryBuilder->addLeftJoin("ab_bodies", "bodycode", "user.bodycode", "userlocal"); } $queryBuilder->addWhereEquals("book.id", $_GET['book']); $result = $this->getDbMySQL()->select($queryBuilder->toQuery()); if( $result->numRows() == 1 ) { $event = $result->fetchAssoc(); if( $minimal || $event['organiser1'] == "" || $event['organiser1'] == "XXX" ) { $event['organiser2'] = null; } return $event; }else { return null; } } private function showEventInfo($eventInfo) { $this->echoln(""); $title = $this->getPhotoTitle($row); $this->echoln(""); $this->echoln(""); $this->echoln(""); $this->echoln(" | "); if( $r % MAX_PHOTO_THUMB_COLS == 0 ) { $this->echoln(""); if( $r % MAX_PHOTO_THUMB_COLS == 0 ) { $this->echoln(""); } $r++; } $this->echoln(" |