/** * @param array $topic_data * @return array */ private function _get_post_data(array $topic_data) { if ($this->settings['display_preview']) { $post_data = $this->forum->get_post_data($this->settings['display_preview']); } else { $post_data = array_fill_keys(array_keys($topic_data), array(array('post_text' => '', 'bbcode_uid' => '', 'bbcode_bitfield' => ''))); } return $post_data; }
/** * @return array */ private function _get_posts_data() { $range_info = $this->date_range->get($this->settings['date_range']); $allowed_forums = $this->_get_allowed_forums(); $post_ids = array_filter(explode(',', $this->settings['post_ids'])); $sql_array = $this->forum_data->query()->fetch_forum($allowed_forums)->fetch_topic_type($this->settings['topic_type'])->fetch_date_range($range_info['start'], $range_info['stop'])->build()->get_sql_array(); $sql_array['SELECT'] = ''; $sql_array['WHERE'] .= ' AND p.topic_id = t.topic_id AND p.post_attachment <> 0'; if ($this->settings['first_only']) { $sql_array['WHERE'] .= " AND p.post_id = t.topic_first_post_id"; } return $this->forum_data->get_post_data(false, $post_ids, $this->settings['limit'], 0, $sql_array); }