| @@ 51-61 (lines=11) @@ | ||
| 48 | $recentPosts = $postRepository->getActivePosts(3); |
|
| 49 | ||
| 50 | $recent_post_array = array(); |
|
| 51 | foreach($recentPosts as $postResult) |
|
| 52 | { |
|
| 53 | $post = new stdclass(); |
|
| 54 | $post->title = $postResult['title']; |
|
| 55 | $post->url = Loader::getRootUrl('blog') . "{$postResult['category']}/{$postResult['path']}/"; |
|
| 56 | $post->category = ucwords(str_replace('-', ' ', $postResult['category'])); |
|
| 57 | $post->thumb = Content::instance('FetchFirstPhoto', $postResult['body'])->activate(); |
|
| 58 | $post->body = Content::instance('SmartTrim', $postResult['body'])->activate(($post->thumb !== '') ? self::$POST_LENGTH_SHORT : self::$POST_LENGTH_LONG); |
|
| 59 | ||
| 60 | $recent_post_array[] = $post; |
|
| 61 | } |
|
| 62 | return $recent_post_array; |
|
| 63 | } |
|
| 64 | ||
| @@ 201-211 (lines=11) @@ | ||
| 198 | ||
| 199 | $post_array = array(); |
|
| 200 | ||
| 201 | foreach($post_result as $post_row) |
|
| 202 | { |
|
| 203 | $post = new stdclass(); |
|
| 204 | $post->title = $post_row['title']; |
|
| 205 | $post->url = Loader::getRootUrl('blog') . "{$post_row['category']}/{$post_row['path']}/"; |
|
| 206 | $post->category = ucwords(str_replace('-', ' ', $post_row['category'])); |
|
| 207 | $post->thumb = Content::instance('FetchFirstPhoto', $post_row['body'])->activate(); |
|
| 208 | $post->body = Content::instance('SmartTrim', $post_row['body'])->activate(($post->thumb !== '') ? self::$POST_LENGTH_SHORT : self::$POST_LENGTH_LONG); |
|
| 209 | ||
| 210 | $post_array[] = $post; |
|
| 211 | } |
|
| 212 | ||
| 213 | return $post_array; |
|
| 214 | } |
|