Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 18 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
post_base | |
0.00% |
0 / 18 |
|
0.00% |
0 / 2 |
56 | |
0.00% |
0 / 1 |
set_keys | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
2 | |||
adjust_item | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
42 |
1 | <?php |
2 | /** |
3 | * |
4 | * This file is part of the phpBB Forum Software package. |
5 | * |
6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
7 | * @license GNU General Public License, version 2 (GPL-2.0) |
8 | * |
9 | * For full copyright and license information, please see |
10 | * the docs/CREDITS.txt file. |
11 | * |
12 | */ |
13 | |
14 | namespace phpbb\feed; |
15 | |
16 | /** |
17 | * Abstract class for post based feeds |
18 | */ |
19 | abstract class post_base extends attachments_base |
20 | { |
21 | protected $num_items = 'feed_limit_post'; |
22 | |
23 | /** |
24 | * {@inheritdoc} |
25 | */ |
26 | public function set_keys() |
27 | { |
28 | $this->set('title', 'post_subject'); |
29 | $this->set('title2', 'topic_title'); |
30 | |
31 | $this->set('author_id', 'user_id'); |
32 | $this->set('creator', 'username'); |
33 | $this->set('published', 'post_time'); |
34 | $this->set('updated', 'post_edit_time'); |
35 | $this->set('text', 'post_text'); |
36 | |
37 | $this->set('bitfield', 'bbcode_bitfield'); |
38 | $this->set('bbcode_uid','bbcode_uid'); |
39 | |
40 | $this->set('enable_bbcode', 'enable_bbcode'); |
41 | $this->set('enable_smilies', 'enable_smilies'); |
42 | $this->set('enable_magic_url', 'enable_magic_url'); |
43 | } |
44 | |
45 | /** |
46 | * {@inheritdoc} |
47 | */ |
48 | public function adjust_item(&$item_row, &$row) |
49 | { |
50 | $item_row['link'] = $this->helper->append_sid('viewtopic.' . $this->phpEx, "p={$row['post_id']}#p{$row['post_id']}"); |
51 | |
52 | if ($this->config['feed_item_statistics']) |
53 | { |
54 | $item_row['statistics'] = $this->user->lang['POSTED'] . ' ' . $this->user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row) |
55 | . ' ' . $this->separator_stats . ' ' . $this->user->format_date($row[$this->get('published')]) |
56 | . (($this->is_moderator_approve_forum($row['forum_id']) && (int) $row['post_visibility'] === ITEM_UNAPPROVED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_UNAPPROVED'] : '') |
57 | . (($this->is_moderator_approve_forum($row['forum_id']) && (int) $row['post_visibility'] === ITEM_DELETED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_DELETED'] : ''); |
58 | } |
59 | } |
60 | } |