mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/13645] Proper OOP for feeds
PHPBB3-13645
This commit is contained in:
@@ -1,30 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\feed;
|
||||
|
||||
/**
|
||||
* Active Topics feed
|
||||
*
|
||||
* This will give you the last {$this->num_items} topics
|
||||
* with replies made withing the last {$this->sort_days} days
|
||||
* including the last post.
|
||||
*/
|
||||
class topics_active extends \phpbb\feed\topic_base
|
||||
* Active Topics feed
|
||||
*
|
||||
* This will give you the last {$this->num_items} topics
|
||||
* with replies made withing the last {$this->sort_days} days
|
||||
* including the last post.
|
||||
*/
|
||||
class topics_active extends topic_base
|
||||
{
|
||||
var $sort_days = 7;
|
||||
protected $sort_days = 7;
|
||||
|
||||
function set_keys()
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set_keys()
|
||||
{
|
||||
parent::set_keys();
|
||||
|
||||
@@ -32,7 +35,10 @@ class topics_active extends \phpbb\feed\topic_base
|
||||
$this->set('creator', 'topic_last_poster_name');
|
||||
}
|
||||
|
||||
function get_sql()
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function get_sql()
|
||||
{
|
||||
$forum_ids_read = $this->get_readable_forums();
|
||||
if (empty($forum_ids_read))
|
||||
@@ -94,7 +100,12 @@ class topics_active extends \phpbb\feed\topic_base
|
||||
return true;
|
||||
}
|
||||
|
||||
function get_forum_ids()
|
||||
/**
|
||||
* Returns the ids of the forums not excluded from the active list
|
||||
*
|
||||
* @return int[]
|
||||
*/
|
||||
private function get_forum_ids()
|
||||
{
|
||||
static $forum_ids;
|
||||
|
||||
@@ -122,7 +133,10 @@ class topics_active extends \phpbb\feed\topic_base
|
||||
return $forum_ids;
|
||||
}
|
||||
|
||||
function adjust_item(&$item_row, &$row)
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function adjust_item(&$item_row, &$row)
|
||||
{
|
||||
parent::adjust_item($item_row, $row);
|
||||
|
||||
|
Reference in New Issue
Block a user