diff options
| author | Nathan Guse <nathaniel.guse@gmail.com> | 2013-06-07 11:14:16 -0500 |
|---|---|---|
| committer | Nathan Guse <nathaniel.guse@gmail.com> | 2013-06-07 11:14:16 -0500 |
| commit | e5d02f4b0caf8dbac7acdb44b096d28660977cd2 (patch) | |
| tree | 9054e1a53a4cd9a90ee44e856f0efb3ad5d27851 /phpBB/includes/feed/post_base.php | |
| parent | 045a9ebb4052ec9a6a03235a5cdce53678d19bf2 (diff) | |
| parent | e36deed24f62f4fca0a3e82b2d58d97499ff7764 (diff) | |
| download | forums-e5d02f4b0caf8dbac7acdb44b096d28660977cd2.tar forums-e5d02f4b0caf8dbac7acdb44b096d28660977cd2.tar.gz forums-e5d02f4b0caf8dbac7acdb44b096d28660977cd2.tar.bz2 forums-e5d02f4b0caf8dbac7acdb44b096d28660977cd2.tar.xz forums-e5d02f4b0caf8dbac7acdb44b096d28660977cd2.zip | |
Merge remote-tracking branch 'remotes/nickv/ticket/11481' into develop
# By Joas Schilling
# Via Joas Schilling
* remotes/nickv/ticket/11481:
[ticket/11481] Move prepended slash from calls into function
[ticket/11481] Remove globals and use dependency injection instead
[ticket/11481] Use container for all classes and inject dependencies
[ticket/11481] Move functions from feed into helper class
[ticket/11481] Move active topics feed to own file
[ticket/11481] Move topics feed to own file
[ticket/11481] Move news feed to own file
[ticket/11481] Move forums feed to own file
[ticket/11481] Move topic feed to own file
[ticket/11481] Move forum feed to own file
[ticket/11481] Move overall feed to own file
[ticket/11481] Move feed topic base to own file
[ticket/11481] Move feed post base to own file
[ticket/11481] Move feed base to own file
[ticket/11481] Move feed factory to own file
Diffstat (limited to 'phpBB/includes/feed/post_base.php')
| -rw-r--r-- | phpBB/includes/feed/post_base.php | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/phpBB/includes/feed/post_base.php b/phpBB/includes/feed/post_base.php new file mode 100644 index 0000000000..a25ed50263 --- /dev/null +++ b/phpBB/includes/feed/post_base.php @@ -0,0 +1,57 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2013 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* Abstract class for post based feeds +* +* @package phpBB3 +*/ +abstract class phpbb_feed_post_base extends phpbb_feed_base +{ + var $num_items = 'feed_limit_post'; + + function set_keys() + { + $this->set('title', 'post_subject'); + $this->set('title2', 'topic_title'); + + $this->set('author_id', 'user_id'); + $this->set('creator', 'username'); + $this->set('published', 'post_time'); + $this->set('updated', 'post_edit_time'); + $this->set('text', 'post_text'); + + $this->set('bitfield', 'bbcode_bitfield'); + $this->set('bbcode_uid','bbcode_uid'); + + $this->set('enable_bbcode', 'enable_bbcode'); + $this->set('enable_smilies', 'enable_smilies'); + $this->set('enable_magic_url', 'enable_magic_url'); + } + + function adjust_item(&$item_row, &$row) + { + $item_row['link'] = $this->helper->append_sid('viewtopic.' . $this->phpEx, "t={$row['topic_id']}&p={$row['post_id']}#p{$row['post_id']}"); + + if ($this->config['feed_item_statistics']) + { + $item_row['statistics'] = $this->user->lang['POSTED'] . ' ' . $this->user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row) + . ' ' . $this->separator_stats . ' ' . $this->user->format_date($row[$this->get('published')]) + . (($this->is_moderator_approve_forum($row['forum_id']) && !$row['post_approved']) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_UNAPPROVED'] : ''); + } + } +} |
