mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 12:28:52 +00:00
* phpbb/develop: (704 commits) [ticket/11630] Improvements to the PHP lint pre-commit hook [feature/auth-refactor] Move auth providers to separate directory [ticket/11619] Use HTTP/1.0 because of lack of chunked-encoding handling. [ticket/11619] Some tests for get_remote_file(). [ticket/11617] Remove spaces and tabs from empty lines [ticket/11617] Missing U_ACTION in acp_captcha.php [feature/auth-refactor] Fix code style issue [feature/auth-refactor] Fix comment grammar [feature/auth-refactor] Fix the actual cause of test failures [ticket/10838] Fix URL for wiki and remove irrelevant line [ticket/10838] Remove php 5.4 and builtin server references [ticket/10838] Fix missing data [ticket/10838] separate database used mentioned in unit tests [ticket/11585] Make $auth_admin class property [feature/auth-refactor] A possible fix for the functional test failures [ticket/11566] Subsilver template error displayed after table headers [ticket/11566] Remove extra pair of brackets from conditional statement [ticket/11566] Check that guest doesn't have reporting permission by default [ticket/11566] Add captcha to report post template in subsilver [ticket/11566] Use the new constant CONFIRM_REPORT for captcha init ... Conflicts: phpBB/docs/sphinx.sample.conf phpBB/feed.php phpBB/styles/prosilver/template/search_results.html phpBB/styles/prosilver/template/viewforum_body.html
72 lines
1.8 KiB
PHP
72 lines
1.8 KiB
PHP
<?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;
|
|
}
|
|
|
|
/**
|
|
* 'All Forums' feed
|
|
*
|
|
* This will give you a list of all postable forums where feeds are enabled
|
|
* including forum description, topic stats and post stats
|
|
*
|
|
* @package phpBB3
|
|
*/
|
|
class phpbb_feed_forums extends phpbb_feed_base
|
|
{
|
|
var $num_items = 0;
|
|
|
|
function set_keys()
|
|
{
|
|
$this->set('title', 'forum_name');
|
|
$this->set('text', 'forum_desc');
|
|
$this->set('bitfield', 'forum_desc_bitfield');
|
|
$this->set('bbcode_uid','forum_desc_uid');
|
|
$this->set('updated', 'forum_last_post_time');
|
|
$this->set('options', 'forum_desc_options');
|
|
}
|
|
|
|
function get_sql()
|
|
{
|
|
$in_fid_ary = array_diff($this->get_readable_forums(), $this->get_excluded_forums());
|
|
if (empty($in_fid_ary))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
// Build SQL Query
|
|
$this->sql = array(
|
|
'SELECT' => 'f.forum_id, f.left_id, f.forum_name, f.forum_last_post_time,
|
|
f.forum_desc, f.forum_desc_bitfield, f.forum_desc_uid, f.forum_desc_options,
|
|
f.forum_topics_approved, f.forum_posts_approved',
|
|
'FROM' => array(FORUMS_TABLE => 'f'),
|
|
'WHERE' => 'f.forum_type = ' . FORUM_POST . '
|
|
AND ' . $this->db->sql_in_set('f.forum_id', $in_fid_ary),
|
|
'ORDER_BY' => 'f.left_id ASC',
|
|
);
|
|
|
|
return true;
|
|
}
|
|
|
|
function adjust_item(&$item_row, &$row)
|
|
{
|
|
$item_row['link'] = $this->helper->append_sid('viewforum.' . $this->phpEx, 'f=' . $row['forum_id']);
|
|
|
|
if ($this->config['feed_item_statistics'])
|
|
{
|
|
$item_row['statistics'] = $this->user->lang('TOTAL_TOPICS', (int) $row['forum_topics_approved'])
|
|
. ' ' . $this->separator_stats . ' ' . $this->user->lang('TOTAL_POSTS_COUNT', (int) $row['forum_posts_approved']);
|
|
}
|
|
}
|
|
}
|