Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

topics.php

Zuletzt modifiziert: 09.10.2024, 12:52 - Dateigröße: 2.38 KiB


 01  <?php
 02  /**
 03  *
 04  * This file is part of the phpBB Forum Software package.
 05  *
 06  * @copyright (c) phpBB Limited <https://www.phpbb.com>
 07  * @license GNU General Public License, version 2 (GPL-2.0)
 08  *
 09  * For full copyright and license information, please see
 10  * the docs/CREDITS.txt file.
 11  *
 12  */
 13   
 14  namespace phpbb\feed;
 15   
 16  /**
 17  * New Topics feed
 18  *
 19  * This will give you the last {$this->num_items} created topics
 20  * including the first post.
 21  */
 22  class topics extends \phpbb\feed\topic_base
 23  {
 24      function get_sql()
 25      {
 26          $forum_ids_read = $this->get_readable_forums();
 27          if (empty($forum_ids_read))
 28          {
 29              return false;
 30          }
 31   
 32          $in_fid_ary = array_diff($forum_ids_read, $this->get_excluded_forums(), $this->get_passworded_forums());
 33          if (empty($in_fid_ary))
 34          {
 35              return false;
 36          }
 37   
 38          // We really have to get the post ids first!
 39          $sql = 'SELECT topic_first_post_id, topic_time
 40              FROM ' . TOPICS_TABLE . '
 41              WHERE  topic_moved_id = 0
 42                  AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $in_fid_ary) . '
 43              ORDER BY topic_time DESC';
 44          $result = $this->db->sql_query_limit($sql, $this->num_items);
 45   
 46          $post_ids = array();
 47          while ($row = $this->db->sql_fetchrow($result))
 48          {
 49              $post_ids[] = (int) $row['topic_first_post_id'];
 50          }
 51          $this->db->sql_freeresult($result);
 52   
 53          if (empty($post_ids))
 54          {
 55              return false;
 56          }
 57   
 58          $this->sql = array(
 59              'SELECT'    => 'f.forum_id, f.forum_name,
 60                              t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_views, t.topic_time, t.topic_last_post_time,
 61                              p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, t.topic_visibility',
 62              'FROM'        => array(
 63                  TOPICS_TABLE    => 't',
 64                  POSTS_TABLE        => 'p',
 65              ),
 66              'LEFT_JOIN'    => array(
 67                  array(
 68                      'FROM'    => array(FORUMS_TABLE => 'f'),
 69                      'ON'    => 'p.forum_id = f.forum_id',
 70                  ),
 71              ),
 72              'WHERE'        => 'p.topic_id = t.topic_id
 73                              AND ' . $this->db->sql_in_set('p.post_id', $post_ids),
 74              'ORDER_BY'    => 'p.post_time DESC, p.post_id DESC',
 75          );
 76   
 77          return true;
 78      }
 79   
 80      function adjust_item(&$item_row, &$row)
 81      {
 82          parent::adjust_item($item_row, $row);
 83   
 84          $item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title'];
 85      }
 86  }
 87