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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
overall.php
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 * Board wide feed (aka overall feed)
18 *
19 * This will give you the newest {$this->num_items} posts
20 * from the whole board.
21 */
22 class overall extends \phpbb\feed\post_base
23 {
24 function get_sql()
25 {
26 $forum_ids = array_diff($this->get_readable_forums(), $this->get_excluded_forums(), $this->get_passworded_forums());
27 if (empty($forum_ids))
28 {
29 return false;
30 }
31
32 // Determine topics with recent activity
33 $sql = 'SELECT topic_id, topic_last_post_time
34 FROM ' . TOPICS_TABLE . '
35 WHERE topic_moved_id = 0
36 AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $forum_ids) . '
37 ORDER BY topic_last_post_time DESC, topic_last_post_id DESC';
38 $result = $this->db->sql_query_limit($sql, $this->num_items);
39
40 $topic_ids = array();
41 $min_post_time = 0;
42 while ($row = $this->db->sql_fetchrow())
43 {
44 $topic_ids[] = (int) $row['topic_id'];
45
46 $min_post_time = (int) $row['topic_last_post_time'];
47 }
48 $this->db->sql_freeresult($result);
49
50 if (empty($topic_ids))
51 {
52 return false;
53 }
54
55 // Get the actual data
56 $this->sql = array(
57 'SELECT' => 'f.forum_id, f.forum_name, ' .
58 'p.post_id, p.topic_id, p.post_time, p.post_edit_time, p.post_visibility, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, ' .
59 'u.username, u.user_id',
60 'FROM' => array(
61 USERS_TABLE => 'u',
62 POSTS_TABLE => 'p',
63 ),
64 'LEFT_JOIN' => array(
65 array(
66 'FROM' => array(FORUMS_TABLE => 'f'),
67 'ON' => 'f.forum_id = p.forum_id',
68 ),
69 ),
70 'WHERE' => $this->db->sql_in_set('p.topic_id', $topic_ids) . '
71 AND ' . $this->content_visibility->get_forums_visibility_sql('post', $forum_ids, 'p.') . '
72 AND p.post_time >= ' . $min_post_time . '
73 AND u.user_id = p.poster_id',
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