/** * fetch_data(). * Prepare the content and save in $this->cfg['content']. */ function fetch_data() { global $user_info; $this->posts = null; $this->topics = null; $this->isRead = null; if (empty($this->cfg['config']['settings']['recentboards'])) { $this->cfg['config']['settings']['recentboards'] = null; } $this->posts = ssi_recentPosts($this->cfg['config']['settings']['numrecent'], null, $this->cfg['config']['settings']['recentboards'], ''); if (!empty($this->posts)) { foreach ($this->posts as $post) { $this->topics[] = $post['topic']; $this->isRead[$post['topic']] = empty($post['is_new']) ? false : true; } $isRead[$user_info['id']] = $this->isRead; return array($this->topics, $isRead, $this->posts); } else { $this->visible = false; } }
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_recentTopics($num_recent = 8, $exclude_boards = null, $include_boards = null, $output_method = 'echo'); ?></code> <h3>Result</h3> <div class="ssi_result"><?php ssi_recentTopics(); flush(); ?> </div> </div> <div class="ssi_preview" id="ssi_recentPosts"> <h2>Recent Posts Function</h2> <h3>Code</h3> <div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_recentPosts(); ?></code> <h3>Result</h3> <div class="ssi_result"><?php ssi_recentPosts(); flush(); ?> </div> </div> <div class="ssi_preview" id="ssi_recentPoll"> <h2>Recent Poll Function</h2> <h3>Code</h3> <div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_recentPoll(); ?></code> <h3>Result</h3> <div class="ssi_result"><?php ssi_recentPoll(); flush(); ?> </div>
/** * Short description * * Long description * * @param * @return */ protected function show_recentPosts() { try { $this->loadSSI(); } catch (Exception $e) { throw new \Exception($e->getMessage()); } $this->include_boards = unserialize($this->include_boards); $this->exclude_boards = unserialize($this->exclude_boards); if ('echo' == $this->output_method) { ob_start(); ssi_recentPosts($this->num_recent, $this->exclude_boards, $this->include_boards, $this->output_method, $this->limit_body); $this->data = ob_get_contents(); ob_end_clean(); } else { $this->data = ssi_recentPosts($this->num_recent, $this->exclude_boards, $this->include_boards, $this->output_method, $this->limit_body); } }