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 |
index.php
001 <?php
002 /**
003 *
004 * This file is part of the phpBB Forum Software package.
005 *
006 * @copyright (c) phpBB Limited <https://www.phpbb.com>
007 * @license GNU General Public License, version 2 (GPL-2.0)
008 *
009 * For full copyright and license information, please see
010 * the docs/CREDITS.txt file.
011 *
012 */
013
014 /**
015 */
016
017 /**
018 * @ignore
019 */
020 define('IN_PHPBB', true);
021 $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
022 $phpEx = substr(strrchr(__FILE__, '.'), 1);
023 include($phpbb_root_path . 'common.' . $phpEx);
024 include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
025
026 // Start session management
027 $user->session_begin();
028 $auth->acl($user->data);
029 $user->setup('viewforum');
030
031 // Mark notifications read
032 if (($mark_notification = $request->variable('mark_notification', 0)))
033 {
034 if ($user->data['user_id'] == ANONYMOUS)
035 {
036 if ($request->is_ajax())
037 {
038 trigger_error('LOGIN_REQUIRED');
039 }
040 login_box('', $user->lang['LOGIN_REQUIRED']);
041 }
042
043 if (check_link_hash($request->variable('hash', ''), 'mark_notification_read'))
044 {
045 $phpbb_notifications = $phpbb_container->get('notification_manager');
046
047 $notification = $phpbb_notifications->load_notifications(array(
048 'notification_id' => $mark_notification,
049 ));
050
051 if (isset($notification['notifications'][$mark_notification]))
052 {
053 $notification = $notification['notifications'][$mark_notification];
054
055 $notification->mark_read();
056
057 if ($request->is_ajax())
058 {
059 $json_response = new \phpbb\json_response();
060 $json_response->send(array(
061 'success' => true,
062 ));
063 }
064
065 if (($redirect = $request->variable('redirect', '')))
066 {
067 redirect(append_sid($phpbb_root_path . $redirect));
068 }
069
070 redirect($notification->get_redirect_url());
071 }
072 }
073 }
074
075 display_forums('', $config['load_moderators']);
076
077 $order_legend = ($config['legend_sort_groupname']) ? 'group_name' : 'group_legend';
078 // Grab group details for legend display
079 if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
080 {
081 $sql = 'SELECT group_id, group_name, group_colour, group_type, group_legend
082 FROM ' . GROUPS_TABLE . '
083 WHERE group_legend > 0
084 ORDER BY ' . $order_legend . ' ASC';
085 }
086 else
087 {
088 $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, g.group_legend
089 FROM ' . GROUPS_TABLE . ' g
090 LEFT JOIN ' . USER_GROUP_TABLE . ' ug
091 ON (
092 g.group_id = ug.group_id
093 AND ug.user_id = ' . $user->data['user_id'] . '
094 AND ug.user_pending = 0
095 )
096 WHERE g.group_legend > 0
097 AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')
098 ORDER BY g.' . $order_legend . ' ASC';
099 }
100 $result = $db->sql_query($sql);
101
102 $legend = array();
103 while ($row = $db->sql_fetchrow($result))
104 {
105 $colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';
106 $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
107
108 if ($row['group_name'] == 'BOTS' || ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')))
109 {
110 $legend[] = '<span' . $colour_text . '>' . $group_name . '</span>';
111 }
112 else
113 {
114 $legend[] = '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . $group_name . '</a>';
115 }
116 }
117 $db->sql_freeresult($result);
118
119 $legend = implode($user->lang['COMMA_SEPARATOR'], $legend);
120
121 // Generate birthday list if required ...
122 $birthday_list = array();
123 if ($config['load_birthdays'] && $config['allow_birthdays'] && $auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel'))
124 {
125 $time = $user->create_datetime();
126 $now = phpbb_gmgetdate($time->getTimestamp() + $time->getOffset());
127
128 // Display birthdays of 29th february on 28th february in non-leap-years
129 $leap_year_birthdays = '';
130 if ($now['mday'] == 28 && $now['mon'] == 2 && !$time->format('L'))
131 {
132 $leap_year_birthdays = " OR u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', 29, 2)) . "%'";
133 }
134
135 $sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_birthday
136 FROM ' . USERS_TABLE . ' u
137 LEFT JOIN ' . BANLIST_TABLE . " b ON (u.user_id = b.ban_userid)
138 WHERE (b.ban_id IS NULL
139 OR b.ban_exclude = 1)
140 AND (u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%' $leap_year_birthdays)
141 AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
142 $result = $db->sql_query($sql);
143
144 while ($row = $db->sql_fetchrow($result))
145 {
146 $birthday_username = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
147 $birthday_year = (int) substr($row['user_birthday'], -4);
148 $birthday_age = ($birthday_year) ? max(0, $now['year'] - $birthday_year) : '';
149
150 $template->assign_block_vars('birthdays', array(
151 'USERNAME' => $birthday_username,
152 'AGE' => $birthday_age,
153 ));
154
155 // For 3.0 compatibility
156 if ($age = (int) substr($row['user_birthday'], -4))
157 {
158 $birthday_list[] = $birthday_username . (($birthday_year) ? ' (' . $birthday_age . ')' : '');
159 }
160 }
161 $db->sql_freeresult($result);
162 }
163
164 // Assign index specific vars
165 $template->assign_vars(array(
166 'TOTAL_POSTS' => $user->lang('TOTAL_POSTS_COUNT', (int) $config['num_posts']),
167 'TOTAL_TOPICS' => $user->lang('TOTAL_TOPICS', (int) $config['num_topics']),
168 'TOTAL_USERS' => $user->lang('TOTAL_USERS', (int) $config['num_users']),
169 'NEWEST_USER' => $user->lang('NEWEST_USER', get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
170
171 'LEGEND' => $legend,
172 'BIRTHDAY_LIST' => (empty($birthday_list)) ? '' : implode($user->lang['COMMA_SEPARATOR'], $birthday_list),
173
174 'FORUM_IMG' => $user->img('forum_read', 'NO_UNREAD_POSTS'),
175 'FORUM_UNREAD_IMG' => $user->img('forum_unread', 'UNREAD_POSTS'),
176 'FORUM_LOCKED_IMG' => $user->img('forum_read_locked', 'NO_UNREAD_POSTS_LOCKED'),
177 'FORUM_UNREAD_LOCKED_IMG' => $user->img('forum_unread_locked', 'UNREAD_POSTS_LOCKED'),
178
179 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
180 'U_SEND_PASSWORD' => ($config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') : '',
181 'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false,
182 'S_INDEX' => true,
183
184 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums&mark_time=' . time()) : '',
185 'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '')
186 );
187
188 $page_title = $user->lang['INDEX'];
189
190 /**
191 * You can use this event to modify the page title and load data for the index
192 *
193 * @event core.index_modify_page_title
194 * @var string page_title Title of the index page
195 * @since 3.1.0-a1
196 */
197 $vars = array('page_title');
198 extract($phpbb_dispatcher->trigger_event('core.index_modify_page_title', compact($vars)));
199
200 // Output page
201 page_header($page_title, true);
202
203 $template->set_filenames(array(
204 'body' => 'index_body.html')
205 );
206
207 page_footer();
208