protected function set_body_data($page_type = 'wide') { parent::set_body_data($page_type); $photo = PhotoCollector::getRow(self::$BANNER_IMAGE); $photo_obj = (object) array( 'file' => "/photo/{$photo->category}/{$photo->name}-size-full.jpg", 'description' => $photo->description, ); $this->set_body('photo', $photo_obj); $recent_log_container; $recent_logs = LogCollector::getRecentList(4); foreach ($recent_logs as $log) { $recent_log_container[] = (object) array( 'photo' => (object) array( 'file' => "/photo/{$log->photo_category}/{$log->photo}-size-thumb.jpg", 'description' => $log->photo_description, ), 'title' => $log->title, 'link' => "/journal/{$log->alias}/", 'date' => date('F j, Y', strtotime($log->publish_date)), ); } $this->set_body('logs', $recent_log_container); $this->set_body('comments', $this->get_comments()); $this->set_body('view', 'Home'); }
protected function get_initial_introduction() { $introduction = array(); $introduction['title'] = self::$PRIMARY_INTRODUCTION_HEADER; $introduction['description'] = self::$PRIMARY_INTRODUCTION_DESCRIPTION; $image = PhotoCollector::getRow(self::$PRIMARY_INTRODUCTION_IMAGE); $introduction['image'] = $this->get_image_element($image->category, $image->name, $image->description, 'medium'); return $introduction; }
protected function get_introduction_image($id) { Loader::load('collector', 'image/PhotoCollector'); $photo_result = PhotoCollector::getRow($id); if($photo_result == null) return; $name = $photo_result->name; $category = $photo_result->category; $size = 'medium'; $height = 375; $width = 500; $description = $photo_result->description; return sprintf(self::$INTRODUCTION_IMAGE_PATTERN, $category, $name, $size, $height, $width, $description); }