mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/11481] Move feed post base to own file
PHPBB3-11481
This commit is contained in:
parent
2916ddc38c
commit
06a51b09f1
2 changed files with 59 additions and 43 deletions
|
@ -335,49 +335,6 @@ function feed_generate_content($content, $uid, $bitfield, $options)
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Abstract class for post based feeds
|
|
||||||
*
|
|
||||||
* @package phpBB3
|
|
||||||
*/
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
global $phpEx, $config, $user;
|
|
||||||
|
|
||||||
$item_row['link'] = feed_append_sid('/viewtopic.' . $phpEx, "t={$row['topic_id']}&p={$row['post_id']}#p{$row['post_id']}");
|
|
||||||
|
|
||||||
if ($config['feed_item_statistics'])
|
|
||||||
{
|
|
||||||
$item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row)
|
|
||||||
. ' ' . $this->separator_stats . ' ' . $user->format_date($row[$this->get('published')])
|
|
||||||
. (($this->is_moderator_approve_forum($row['forum_id']) && !$row['post_approved']) ? ' ' . $this->separator_stats . ' ' . $user->lang['POST_UNAPPROVED'] : '');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract class for topic based feeds
|
* Abstract class for topic based feeds
|
||||||
*
|
*
|
||||||
|
|
59
phpBB/includes/feed/post_base.php
Normal file
59
phpBB/includes/feed/post_base.php
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
<?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)
|
||||||
|
{
|
||||||
|
global $phpEx, $config, $user;
|
||||||
|
|
||||||
|
$item_row['link'] = feed_append_sid('/viewtopic.' . $phpEx, "t={$row['topic_id']}&p={$row['post_id']}#p{$row['post_id']}");
|
||||||
|
|
||||||
|
if ($config['feed_item_statistics'])
|
||||||
|
{
|
||||||
|
$item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row)
|
||||||
|
. ' ' . $this->separator_stats . ' ' . $user->format_date($row[$this->get('published')])
|
||||||
|
. (($this->is_moderator_approve_forum($row['forum_id']) && !$row['post_approved']) ? ' ' . $this->separator_stats . ' ' . $user->lang['POST_UNAPPROVED'] : '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue