[ Index ]

PHP Cross Reference of phpBB-3.1.12-deutsch

title

Body

[close]

/phpbb/feed/ -> forums.php (source)

   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  * 'All Forums' feed
  18  *
  19  * This will give you a list of all postable forums where feeds are enabled
  20  * including forum description, topic stats and post stats
  21  */
  22  class forums extends \phpbb\feed\base
  23  {
  24      var $num_items    = 0;
  25  
  26  	function set_keys()
  27      {
  28          $this->set('title',        'forum_name');
  29          $this->set('text',        'forum_desc');
  30          $this->set('bitfield',    'forum_desc_bitfield');
  31          $this->set('bbcode_uid','forum_desc_uid');
  32          $this->set('updated',    'forum_last_post_time');
  33          $this->set('options',    'forum_desc_options');
  34      }
  35  
  36  	function get_sql()
  37      {
  38          $in_fid_ary = array_diff($this->get_readable_forums(), $this->get_excluded_forums());
  39          if (empty($in_fid_ary))
  40          {
  41              return false;
  42          }
  43  
  44          // Build SQL Query
  45          $this->sql = array(
  46              'SELECT'    => 'f.forum_id, f.left_id, f.forum_name, f.forum_last_post_time,
  47                              f.forum_desc, f.forum_desc_bitfield, f.forum_desc_uid, f.forum_desc_options,
  48                              f.forum_topics_approved, f.forum_posts_approved',
  49              'FROM'        => array(FORUMS_TABLE => 'f'),
  50              'WHERE'        => 'f.forum_type = ' . FORUM_POST . '
  51                              AND ' . $this->db->sql_in_set('f.forum_id', $in_fid_ary),
  52              'ORDER_BY'    => 'f.left_id ASC',
  53          );
  54  
  55          return true;
  56      }
  57  
  58  	function adjust_item(&$item_row, &$row)
  59      {
  60          $item_row['link'] = $this->helper->append_sid('viewforum.' . $this->phpEx, 'f=' . $row['forum_id']);
  61  
  62          if ($this->config['feed_item_statistics'])
  63          {
  64              $item_row['statistics'] = $this->user->lang('TOTAL_TOPICS', (int) $row['forum_topics_approved'])
  65                  . ' ' . $this->separator_stats . ' ' . $this->user->lang('TOTAL_POSTS_COUNT', (int) $row['forum_posts_approved']);
  66          }
  67      }
  68  }


Generated: Thu Jan 11 00:25:41 2018 Cross-referenced by PHPXref 0.7.1