[ Index ] |
PHP Cross Reference of phpBB-3.3.14-deutsch |
[Summary view] [Print] [Text view]
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 /** 15 */ 16 17 /** 18 * @ignore 19 */ 20 define('IN_PHPBB', true); 21 $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; 22 $phpEx = substr(strrchr(__FILE__, '.'), 1); 23 include($phpbb_root_path . 'common.' . $phpEx); 24 include($phpbb_root_path . 'includes/functions_display.' . $phpEx); 25 26 // Start session management 27 $user->session_begin(); 28 $auth->acl($user->data); 29 $user->setup('viewforum'); 30 31 // Mark notifications read 32 if (($mark_notification = $request->variable('mark_notification', 0))) 33 { 34 if ($user->data['user_id'] == ANONYMOUS) 35 { 36 if ($request->is_ajax()) 37 { 38 trigger_error('LOGIN_REQUIRED'); 39 } 40 login_box('', $user->lang['LOGIN_REQUIRED']); 41 } 42 43 if (check_link_hash($request->variable('hash', ''), 'mark_notification_read')) 44 { 45 /* @var $phpbb_notifications \phpbb\notification\manager */ 46 $phpbb_notifications = $phpbb_container->get('notification_manager'); 47 48 $notification = $phpbb_notifications->load_notifications('notification.method.board', array( 49 'notification_id' => $mark_notification, 50 )); 51 52 if (isset($notification['notifications'][$mark_notification])) 53 { 54 $notification = $notification['notifications'][$mark_notification]; 55 56 $notification->mark_read(); 57 58 /** 59 * You can use this event to perform additional tasks or redirect user elsewhere. 60 * 61 * @event core.index_mark_notification_after 62 * @var int mark_notification Notification ID 63 * @var \phpbb\notification\type\type_interface notification Notification instance 64 * @since 3.2.6-RC1 65 */ 66 $vars = array('mark_notification', 'notification'); 67 extract($phpbb_dispatcher->trigger_event('core.index_mark_notification_after', compact($vars))); 68 69 if ($request->is_ajax()) 70 { 71 $json_response = new \phpbb\json_response(); 72 $json_response->send(array( 73 'success' => true, 74 )); 75 } 76 77 if (($redirect = $request->variable('redirect', ''))) 78 { 79 redirect(append_sid($phpbb_root_path . $redirect)); 80 } 81 82 redirect($notification->get_redirect_url()); 83 } 84 } 85 } 86 87 display_forums('', $config['load_moderators']); 88 89 $order_legend = ($config['legend_sort_groupname']) ? 'group_name' : 'group_legend'; 90 // Grab group details for legend display 91 if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) 92 { 93 $sql = 'SELECT group_id, group_name, group_colour, group_type, group_legend 94 FROM ' . GROUPS_TABLE . ' 95 WHERE group_legend > 0 96 ORDER BY ' . $order_legend . ' ASC'; 97 } 98 else 99 { 100 $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, g.group_legend 101 FROM ' . GROUPS_TABLE . ' g 102 LEFT JOIN ' . USER_GROUP_TABLE . ' ug 103 ON ( 104 g.group_id = ug.group_id 105 AND ug.user_id = ' . $user->data['user_id'] . ' 106 AND ug.user_pending = 0 107 ) 108 WHERE g.group_legend > 0 109 AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ') 110 ORDER BY g.' . $order_legend . ' ASC'; 111 } 112 $result = $db->sql_query($sql); 113 114 /** @var \phpbb\group\helper $group_helper */ 115 $group_helper = $phpbb_container->get('group_helper'); 116 117 $legend = array(); 118 while ($row = $db->sql_fetchrow($result)) 119 { 120 $colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : ''; 121 $group_name = $group_helper->get_name($row['group_name']); 122 123 if ($row['group_name'] == 'BOTS' || ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile'))) 124 { 125 $legend[] = '<span' . $colour_text . '>' . $group_name . '</span>'; 126 } 127 else 128 { 129 $legend[] = '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . $group_name . '</a>'; 130 } 131 } 132 $db->sql_freeresult($result); 133 134 $legend = implode($user->lang['COMMA_SEPARATOR'], $legend); 135 136 // Generate birthday list if required ... 137 $show_birthdays = ($config['load_birthdays'] && $config['allow_birthdays'] && $auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')); 138 139 $birthdays = $birthday_list = array(); 140 if ($show_birthdays) 141 { 142 $time = $user->create_datetime(); 143 $now = phpbb_gmgetdate($time->getTimestamp() + $time->getOffset()); 144 145 // Display birthdays of 29th february on 28th february in non-leap-years 146 $leap_year_birthdays = ''; 147 if ($now['mday'] == 28 && $now['mon'] == 2 && !$time->format('L')) 148 { 149 $leap_year_birthdays = " OR u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', 29, 2)) . "%'"; 150 } 151 152 $sql_ary = array( 153 'SELECT' => 'u.user_id, u.username, u.user_colour, u.user_birthday', 154 'FROM' => array( 155 USERS_TABLE => 'u', 156 ), 157 'LEFT_JOIN' => array( 158 array( 159 'FROM' => array(BANLIST_TABLE => 'b'), 160 'ON' => 'u.user_id = b.ban_userid', 161 ), 162 ), 163 'WHERE' => "(b.ban_id IS NULL OR b.ban_exclude = 1) 164 AND (u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%' $leap_year_birthdays) 165 AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')', 166 ); 167 168 /** 169 * Event to modify the SQL query to get birthdays data 170 * 171 * @event core.index_modify_birthdays_sql 172 * @var array now The assoc array with the 'now' local timestamp data 173 * @var array sql_ary The SQL array to get the birthdays data 174 * @var object time The user related Datetime object 175 * @since 3.1.7-RC1 176 */ 177 $vars = array('now', 'sql_ary', 'time'); 178 extract($phpbb_dispatcher->trigger_event('core.index_modify_birthdays_sql', compact($vars))); 179 180 $sql = $db->sql_build_query('SELECT', $sql_ary); 181 $result = $db->sql_query($sql); 182 $rows = $db->sql_fetchrowset($result); 183 $db->sql_freeresult($result); 184 185 foreach ($rows as $row) 186 { 187 $birthday_username = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']); 188 $birthday_year = (int) substr($row['user_birthday'], -4); 189 $birthday_age = ($birthday_year) ? max(0, $now['year'] - $birthday_year) : ''; 190 191 $birthdays[] = array( 192 'USERNAME' => $birthday_username, 193 'AGE' => $birthday_age, 194 ); 195 196 // For 3.0 compatibility 197 $birthday_list[] = $birthday_username . (($birthday_age) ? " ({$birthday_age})" : ''); 198 } 199 200 /** 201 * Event to modify the birthdays list 202 * 203 * @event core.index_modify_birthdays_list 204 * @var array birthdays Array with the users birthdays data 205 * @var array rows Array with the birthdays SQL query result 206 * @since 3.1.7-RC1 207 */ 208 $vars = array('birthdays', 'rows'); 209 extract($phpbb_dispatcher->trigger_event('core.index_modify_birthdays_list', compact($vars))); 210 211 $template->assign_block_vars_array('birthdays', $birthdays); 212 } 213 214 $controller_helper = $phpbb_container->get('controller.helper'); 215 // Assign index specific vars 216 $template->assign_vars(array( 217 'TOTAL_POSTS' => $user->lang('TOTAL_POSTS_COUNT', (int) $config['num_posts']), 218 'TOTAL_TOPICS' => $user->lang('TOTAL_TOPICS', (int) $config['num_topics']), 219 'TOTAL_USERS' => $user->lang('TOTAL_USERS', (int) $config['num_users']), 220 'NEWEST_USER' => $user->lang('NEWEST_USER', get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])), 221 222 'LEGEND' => $legend, 223 'BIRTHDAY_LIST' => (empty($birthday_list)) ? '' : implode($user->lang['COMMA_SEPARATOR'], $birthday_list), 224 225 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'), 226 'U_SEND_PASSWORD' => ($config['email_enable'] && $config['allow_password_reset']) ? $controller_helper->route('phpbb_ucp_forgot_password_controller') : '', 227 'S_DISPLAY_BIRTHDAY_LIST' => $show_birthdays, 228 'S_INDEX' => true, 229 230 'U_CANONICAL' => generate_board_url() . '/', 231 '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()) : '', 232 '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) : '') 233 ); 234 235 $page_title = ($config['board_index_text'] !== '') ? $config['board_index_text'] : $user->lang['INDEX']; 236 237 /** 238 * You can use this event to modify the page title and load data for the index 239 * 240 * @event core.index_modify_page_title 241 * @var string page_title Title of the index page 242 * @since 3.1.0-a1 243 */ 244 $vars = array('page_title'); 245 extract($phpbb_dispatcher->trigger_event('core.index_modify_page_title', compact($vars))); 246 247 // Output page 248 page_header($page_title, true); 249 250 $template->set_filenames(array( 251 'body' => 'index_body.html') 252 ); 253 254 page_footer();
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Mon Nov 25 19:05:08 2024 | Cross-referenced by PHPXref 0.7.1 |