Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 312 lines (229 sloc) 14.637 kb
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
1 <?php
619e67e Added phpDoc comments to the start of every PHP file, replacing the exis...
Anatoly authored
2 /**
3 * Outputs the header used by most forum pages.
4 *
e2caa53 dimkalinux Update copyright.
dimkalinux authored
5 * @copyright (C) 2008-2012 PunBB, partially based on code (C) 2008-2009 FluxBB.org
619e67e Added phpDoc comments to the start of every PHP file, replacing the exis...
Anatoly authored
6 * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
7 * @package PunBB
8 */
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
9
10
11 // Make sure no one attempts to run this script "directly"
12 if (!defined('FORUM'))
13 exit;
14
15 // Send no-cache headers
16 header('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :)
17 header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
18 header('Cache-Control: post-check=0, pre-check=0', false);
19 header('Pragma: no-cache'); // For HTTP/1.0 compability
20
21 // Send the Content-type header in case the web server is setup to send something else
22 header('Content-type: text/html; charset=utf-8');
23
24 // Load the main template
25 if (substr(FORUM_PAGE, 0, 5) == 'admin')
26 {
b501a43 dimkalinux Optimize file includes
dimkalinux authored
27 if ($forum_user['style'] != 'Oxygen' && file_exists(FORUM_ROOT.'style/'.$forum_user['style'].'/admin.tpl'))
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
28 $tpl_path = FORUM_ROOT.'style/'.$forum_user['style'].'/admin.tpl';
29 else
30 $tpl_path = FORUM_ROOT.'include/template/admin.tpl';
31 }
32 else if (FORUM_PAGE == 'help')
33 {
b501a43 dimkalinux Optimize file includes
dimkalinux authored
34 if ($forum_user['style'] != 'Oxygen' && file_exists(FORUM_ROOT.'style/'.$forum_user['style'].'/help.tpl'))
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
35 $tpl_path = FORUM_ROOT.'style/'.$forum_user['style'].'/help.tpl';
36 else
37 $tpl_path = FORUM_ROOT.'include/template/help.tpl';
38 }
39 else
40 {
b501a43 dimkalinux Optimize file includes
dimkalinux authored
41 if ($forum_user['style'] != 'Oxygen' && file_exists(FORUM_ROOT.'style/'.$forum_user['style'].'/main.tpl'))
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
42 $tpl_path = FORUM_ROOT.'style/'.$forum_user['style'].'/main.tpl';
43 else
44 $tpl_path = FORUM_ROOT.'include/template/main.tpl';
45 }
46
47 ($hook = get_hook('hd_pre_template_loaded')) ? eval($hook) : null;
48
49 $tpl_main = file_get_contents($tpl_path);
50
51 ($hook = get_hook('hd_template_loaded')) ? eval($hook) : null;
52
53 // START SUBST - <!-- forum_include "*" -->
54 while (preg_match('#<!-- ?forum_include "([^/\\\\]*?)" ?-->#', $tpl_main, $cur_include))
55 {
56 if (!file_exists(FORUM_ROOT.'include/user/'.$cur_include[1]))
e7aa4a5 dimkalinux Add <br/> to all long error() messages
dimkalinux authored
57 error('Unable to process user include &lt;!-- forum_include "'.forum_htmlencode($cur_include[1]).'" --&gt; from template main.tpl.<br/>There is no such file in folder /include/user/', __FILE__, __LINE__);
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
58
59 ob_start();
60 include FORUM_ROOT.'include/user/'.$cur_include[1];
61 $tpl_temp = ob_get_contents();
62 $tpl_main = str_replace($cur_include[0], $tpl_temp, $tpl_main);
63 ob_end_clean();
64 }
65 // END SUBST - <!-- forum_include "*" -->
66
67
68 // START SUBST - <!-- forum_local -->
5c6eee2 dimkalinux Minor fixes for HTML validator - now passed all tests
dimkalinux authored
69 $tpl_main = str_replace('<!-- forum_local -->', 'lang="'.$lang_common['lang_identifier'].'" dir="'.$lang_common['lang_direction'].'"', $tpl_main);
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
70 // END SUBST - <!-- forum_local -->
71
72
73 // START SUBST - <!-- forum_head -->
74
75 // Is this a page that we want search index spiders to index?
76 if (!defined('FORUM_ALLOW_INDEX'))
77 $forum_head['robots'] = '<meta name="ROBOTS" content="NOINDEX, FOLLOW" />';
78 else
6706f9b Removed unnecessary spaces.
SlavaK authored
79 $forum_head['descriptions'] = '<meta name="description" content="'.generate_crumbs(true).$lang_common['Title separator'].forum_htmlencode($forum_config['o_board_desc']).'" />';
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
80
81 // Should we output a MicroID? http://microid.org/
82 if (strpos(FORUM_PAGE, 'profile') === 0)
83 $forum_head['microid'] = '<meta name="microid" content="mailto+http:sha1:'.sha1(sha1('mailto:'.$user['email']).sha1(forum_link($forum_url['user'], $id))).'" />';
84
85 $forum_head['title'] = '<title>'.generate_crumbs(true).'</title>';
86
87 // Should we output feed links?
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
88 if (FORUM_PAGE == 'index')
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
89 {
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
90 $forum_head['rss'] = '<link rel="alternate" type="application/rss+xml" href="'.forum_link($forum_url['index_rss']).'" title="RSS" />';
91 $forum_head['atom'] = '<link rel="alternate" type="application/atom+xml" href="'.forum_link($forum_url['index_atom']).'" title="ATOM" />';
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
92 }
93 else if (FORUM_PAGE == 'viewforum')
94 {
4a00be3 Undid changesets [1645], [1646], [1648], [1649]. Posts RSS feed is to be...
Roman authored
95 $forum_head['rss'] = '<link rel="alternate" type="application/rss+xml" href="'.forum_link($forum_url['forum_rss'], $id).'" title="RSS" />';
96 $forum_head['atom'] = '<link rel="alternate" type="application/atom+xml" href="'.forum_link($forum_url['forum_atom'], $id).'" title="ATOM" />';
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
97 }
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
98 else if (FORUM_PAGE == 'viewtopic')
99 {
100 $forum_head['rss'] = '<link rel="alternate" type="application/rss+xml" href="'.forum_link($forum_url['topic_rss'], $id).'" title="RSS" />';
d537dde Nikolay Frantsev Fix code style: remove unneeded spaces
Shutnik authored
101 $forum_head['atom'] = '<link rel="alternate" type="application/atom+xml" href="'.forum_link($forum_url['topic_atom'], $id).'" title="ATOM" />';
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
102 }
103
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
104 // If there are other page navigation links (first, next, prev and last)
105 if (!empty($forum_page['nav']))
106 $forum_head['nav'] = implode("\n", $forum_page['nav']);
107
108 $forum_head['search'] = '<link rel="search" href="'.forum_link($forum_url['search']).'" title="'.$lang_common['Search'].'" />';
109 $forum_head['author'] = '<link rel="author" href="'.forum_link($forum_url['users']).'" title="'.$lang_common['User list'].'" />';
110
111 ob_start();
112
113 // Include stylesheets
114 require FORUM_ROOT.'style/'.$forum_user['style'].'/'.$forum_user['style'].'.php';
115
116 $head_temp = forum_trim(ob_get_contents());
117 $num_temp = 0;
118
119 foreach (explode("\n", $head_temp) as $style_temp)
120 $forum_head['style'.$num_temp++] = $style_temp;
121
122 ob_end_clean();
123
124 ($hook = get_hook('hd_head')) ? eval($hook) : null;
125
3529b83 dimkalinux Fix error with loader in header.php
dimkalinux authored
126 // Render CSS from forum_loader
127 $tmp_head = implode("\n", $forum_head).$forum_loader->render_css();
128
9fd7898 dimkalinux Implement forum_add_css
dimkalinux authored
129 $tpl_main = str_replace('<!-- forum_head -->', $tmp_head, $tpl_main);
130 unset($forum_head, $tmp_head);
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
131
132 // END SUBST - <!-- forum_head -->
133
134
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
135 // START SUBST OF COMMON ELEMENTS
136 // Setup array of general elements
137 $gen_elements = array();
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
138
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
139 // Forum page id and classes
27a71f9 Minor optimizations in header.php.
Anatoly authored
140 if (!defined('FORUM_PAGE_TYPE'))
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
141 {
27a71f9 Minor optimizations in header.php.
Anatoly authored
142 if (substr(FORUM_PAGE, 0, 5) == 'admin')
143 define('FORUM_PAGE_TYPE', 'admin-page');
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
144 else
27a71f9 Minor optimizations in header.php.
Anatoly authored
145 {
146 if (!empty($forum_page['page_post']))
147 define('FORUM_PAGE_TYPE', 'paged-page');
148 else if (!empty($forum_page['main_menu']))
149 define('FORUM_PAGE_TYPE', 'menu-page');
150 else
151 define('FORUM_PAGE_TYPE', 'basic-page');
152 }
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
153 }
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
154
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
155 $gen_elements['<!-- forum_page -->'] = 'id="brd-'.FORUM_PAGE.'" class="brd-page '.FORUM_PAGE_TYPE.'"';
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
156
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
157 // Skip link
158 $gen_elements['<!-- forum_skip -->'] = '<p id="brd-access"><a href="#brd-main">'.$lang_common['Skip to content'].'</a></p>';
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
159
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
160 // Forum Title
161 $gen_elements['<!-- forum_title -->'] = '<p id="brd-title"><a href="'.forum_link($forum_url['index']).'">'.forum_htmlencode($forum_config['o_board_title']).'</a></p>';
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
162
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
163 // Forum Description
164 $gen_elements['<!-- forum_desc -->'] = ($forum_config['o_board_desc'] != '') ? '<p id="brd-desc">'.forum_htmlencode($forum_config['o_board_desc']).'</p>' : '';
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
165
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
166 // Main Navigation
167 $gen_elements['<!-- forum_navlinks -->'] = '<ul>'."\n\t\t".generate_navlinks()."\n\t".'</ul>';
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
168
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
169 // Announcement
c568e2a Minor CSS/markup fixes for the announcement.
Anatoly authored
170 $gen_elements['<!-- forum_announcement -->'] = ($forum_config['o_announcement'] == '1' && $forum_user['g_read_board'] == '1') ? '<div id="brd-announcement" class="gen-content">'.($forum_config['o_announcement_heading'] != '' ? "\n\t".'<h1 class="hn"><span>'.$forum_config['o_announcement_heading'].'</span></h1>' : '')."\n\t".'<div class="content">'.$forum_config['o_announcement_message'].'</div>'."\n".'</div>'."\n" : '';
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
171
b6d47eb dimkalinux Add flash_messages to templates and add style for messages
dimkalinux authored
172 // Flash messages
69873f4 dimkalinux Rename $forum_flash_messenger to $forum_flash
dimkalinux authored
173 $gen_elements['<!-- forum_messages -->'] = '<div id="brd-messages" class="brd">'.$forum_flash->show(true).'</div>'."\n";
b6d47eb dimkalinux Add flash_messages to templates and add style for messages
dimkalinux authored
174
175
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
176 // Maintenance Warning
177 $gen_elements['<!-- forum_maint -->'] = ($forum_user['g_id'] == FORUM_ADMIN && $forum_config['o_maintenance'] == '1') ? '<p id="maint-alert" class="warn">'.sprintf($lang_common['Maintenance warning'], '<a href="'.forum_link($forum_url['admin_settings_maintenance']).'">'.$lang_common['Maintenance mode'].'</a>').'</p>' : '';
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
178
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
179 ($hook = get_hook('hd_gen_elements')) ? eval($hook) : null;
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
180
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
181 $tpl_main = str_replace(array_keys($gen_elements), array_values($gen_elements), $tpl_main);
182 unset($gen_elements);
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
183
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
184 // END SUBST OF COMMON ELEMENTS
185
186
187 // START SUBST VISIT ELEMENTS
188 $visit_elements = array();
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
189
190 if ($forum_user['is_guest'])
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
191 $visit_elements['<!-- forum_welcome -->'] = '<p id="welcome"><span>'.$lang_common['Not logged in'].'</span> <span>'.$lang_common['Login nag'].'</span></p>';
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
192 else
815a830 dimkalinux header.php: remove last visit from main page, because it exists in profi...
dimkalinux authored
193 $visit_elements['<!-- forum_welcome -->'] = '<p id="welcome"><span>'.sprintf($lang_common['Logged in as'], '<strong>'.forum_htmlencode($forum_user['username']).'</strong>').'</span></p>';
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
194
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
195 if ($forum_user['g_read_board'] == '1' && $forum_user['g_search'] == '1')
196 {
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
197 $visit_links = array();
198
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
199 if (!$forum_user['is_guest'])
200 $visit_links['newposts'] = '<span id="visit-new"'.(empty($visit_links) ? ' class="first-item"' : '').'><a href="'.forum_link($forum_url['search_new']).'" title="'.$lang_common['New posts title'].'">'.$lang_common['New posts'].'</a></span>';
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
201
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
202 $visit_links['recent'] = '<span id="visit-recent"'.(empty($visit_links) ? ' class="first-item"' : '').'><a href="'.forum_link($forum_url['search_recent']).'" title="'.$lang_common['Active topics title'].'">'.$lang_common['Active topics'].'</a></span>';
203 $visit_links['unanswered'] = '<span id="visit-unanswered"'.(empty($visit_links) ? ' class="first-item"' : '').'><a href="'.forum_link($forum_url['search_unanswered']).'" title="'.$lang_common['Unanswered topics title'].'">'.$lang_common['Unanswered topics'].'</a></span>';
204 }
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
205
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
206 ($hook = get_hook('hd_visit_elements')) ? eval($hook) : null;
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
207
809cbf6 dimkalinux header.php: move "hd_visit_elements" hook before visit_elements implode,...
dimkalinux authored
208 $visit_elements['<!-- forum_visit -->'] = (!empty($visit_links)) ? '<p id="visit-links" class="options">'.implode(' ', $visit_links).'</p>' : '';
209
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
210 $tpl_main = str_replace(array_keys($visit_elements), array_values($visit_elements), $tpl_main);
211 unset($visit_elements);
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
212
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
213 // END SUBST VISIT ELEMENTS
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
214
215
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
216 // START SUBST - <!-- forum_admod -->
217 $admod_links = array();
218
219 // We only need to run this query for mods/admins if there will actually be reports to look at
220 if ($forum_user['is_admmod'] && $forum_config['o_report_method'] != 1)
221 {
222 $query = array(
223 'SELECT' => 'COUNT(r.id)',
224 'FROM' => 'reports AS r',
225 'WHERE' => 'r.zapped IS NULL',
226 );
227
228 ($hook = get_hook('hd_qr_get_unread_reports_count')) ? eval($hook) : null;
229 $result_header = $forum_db->query_build($query) or error(__FILE__, __LINE__);
230
231 if ($forum_db->result($result_header))
fd8eebf dimkalinux Change #brd-admod markup from P SPAN to UL LI.
dimkalinux authored
232 $admod_links['reports'] = '<li id="reports"><a href="'.forum_link($forum_url['admin_reports']).'">'.$lang_common['New reports'].'</a></li>';
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
233 }
234
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
235 if ($forum_user['g_id'] == FORUM_ADMIN)
236 {
e80780d Moved install.php and db_update.php into the admin folder, where an admi...
Anatoly authored
237 $alert_items = array();
238
239 // Warn the admin that maintenance mode is enabled
240 if ($forum_config['o_maintenance'] == '1')
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
241 $alert_items['maintenance'] = '<p id="maint-alert" class="warn">'.$lang_common['Maintenance alert'].'</p>';
e80780d Moved install.php and db_update.php into the admin folder, where an admi...
Anatoly authored
242
aad2a74 Added a "database revision number" to the code. This feature provides a ...
Anatoly authored
243 if ($forum_config['o_check_for_updates'] == '1')
244 {
245 if ($forum_updates['fail'])
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
246 $alert_items['update_fail'] = '<p><strong>'.$lang_common['Updates'].'</strong> '.$lang_common['Updates failed'].'</p>';
247 else if (isset($forum_updates['version']) && isset($forum_updates['hotfix']))
0beaaca Improved an alert when forum detects a new version (continuing [967]).
Roman authored
248 $alert_items['update_version_hotfix'] = '<p><strong>'.$lang_common['Updates'].'</strong> '.sprintf($lang_common['Updates version n hf'], $forum_updates['version'], forum_link($forum_url['admin_extensions_hotfixes'])).'</p>';
aad2a74 Added a "database revision number" to the code. This feature provides a ...
Anatoly authored
249 else if (isset($forum_updates['version']))
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
250 $alert_items['update_version'] = '<p><strong>'.$lang_common['Updates'].'</strong> '.sprintf($lang_common['Updates version'], $forum_updates['version']).'</p>';
251 else if (isset($forum_updates['hotfix']))
5bd106d New hotfix alert improved, a little lang-files cleanup, minor format fix...
Roman authored
252 $alert_items['update_hotfix'] = '<p><strong>'.$lang_common['Updates'].'</strong> '.sprintf($lang_common['Updates hf'], forum_link($forum_url['admin_extensions_hotfixes'])).'</p>';
aad2a74 Added a "database revision number" to the code. This feature provides a ...
Anatoly authored
253 }
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
254
e80780d Moved install.php and db_update.php into the admin folder, where an admi...
Anatoly authored
255 // Warn the admin that their version of the database is newer than the version supported by the code
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
256 // NOTE: Why is it done on any page, but shown in admin section only.
a07cd8c Fixed debug oversight in header.php.
Anatoly authored
257 if ($forum_config['o_database_revision'] > FORUM_DB_REVISION)
e80780d Moved install.php and db_update.php into the admin folder, where an admi...
Anatoly authored
258 $alert_items['newer_database'] = '<p><strong>'.$lang_common['Database mismatch'].'</strong> '.$lang_common['Database mismatch alert'].'</p>';
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
259
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
260 if (!empty($alert_items))
fd8eebf dimkalinux Change #brd-admod markup from P SPAN to UL LI.
dimkalinux authored
261 $admod_links['alert'] = '<li id="alert"><a href="'.forum_link($forum_url['admin_index']).'">'.$lang_common['New alerts'].'</a></li>';
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
262
e80780d Moved install.php and db_update.php into the admin folder, where an admi...
Anatoly authored
263 ($hook = get_hook('hd_alert')) ? eval($hook) : null;
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
264 }
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
265
fd8eebf dimkalinux Change #brd-admod markup from P SPAN to UL LI.
dimkalinux authored
266 $tpl_main = str_replace('<!-- forum_admod -->', (!empty($admod_links)) ? '<ul id="brd-admod">'.implode(' ', $admod_links).'</ul>' : '', $tpl_main);
aad2a74 Added a "database revision number" to the code. This feature provides a ...
Anatoly authored
267
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
268 // END SUBST - <!-- forum_admod -->
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
269
270
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
271 // MAIN SECTION INTERFACE ELEMENT SUBSTITUTION
272 $main_elements = array();
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
273
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
274 // Top breadcrumbs
fb5a1cc dimkalinux Remove gen-content style from crumbs. Make it clear and unbordered.
dimkalinux authored
275 $main_elements['<!-- forum_crumbs_top -->'] = (FORUM_PAGE != 'index') ? '<div id="brd-crumbs-top" class="crumbs">'."\n\t".'<p>'.generate_crumbs(false).'</p>'."\n".'</div>' : '';
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
276
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
277 // Bottom breadcrumbs
fb5a1cc dimkalinux Remove gen-content style from crumbs. Make it clear and unbordered.
dimkalinux authored
278 $main_elements['<!-- forum_crumbs_end -->'] = (FORUM_PAGE != 'index') ? '<div id="brd-crumbs-end" class="crumbs">'."\n\t".'<p>'.generate_crumbs(false).'</p>'."\n".'</div>' : '';
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
279 // Main section heading
d537dde Nikolay Frantsev Fix code style: remove unneeded spaces
Shutnik authored
280 $main_elements['<!-- forum_main_title -->'] = '<h1 class="main-title">'.((isset($forum_page['main_title'])) ? $forum_page['main_title'] : forum_htmlencode(is_array($last_crumb = end($forum_page['crumbs'])) ? reset($last_crumb) : $last_crumb)).(isset($forum_page['main_head_pages']) ? ' <small>'.$forum_page['main_head_pages'].'</small>' : '').'</h1>'."\n";
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
281
282 // Top pagination and post links
283 $main_elements['<!-- forum_main_pagepost_top -->'] = (!empty($forum_page['page_post'])) ? '<div id="brd-pagepost-top" class="main-pagepost gen-content">'."\n\t".implode("\n\t", $forum_page['page_post'])."\n".'</div>' : '';
284
285 // Bottom pagination and postlink
286 $main_elements['<!-- forum_main_pagepost_end -->'] = (!empty($forum_page['page_post'])) ? '<div id="brd-pagepost-end" class="main-pagepost gen-content">'."\n\t".implode("\n\t", $forum_page['page_post'])."\n".'</div>' : '';
287
288 // Main section menu e.g. profile menu
289 $main_elements['<!-- forum_main_menu -->'] = (!empty($forum_page['main_menu'])) ? '<div class="main-menu gen-content">'."\n\t".'<ul>'."\n\t\t".implode("\n\t\t", $forum_page['main_menu'])."\n\t".'</ul>'."\n".'</div>' : '';
290
291 // Main section menu e.g. profile menu
292 if (substr(FORUM_PAGE, 0, 5) == 'admin' && FORUM_PAGE_TYPE != 'paged')
293 {
294 $main_elements['<!-- forum_admin_menu -->'] = '<div class="admin-menu gen-content">'."\n\t".'<ul>'."\n\t\t".generate_admin_menu(false)."\n\t".'</ul>'."\n".'</div>';
295
296 $forum_page['admin_sub'] = generate_admin_menu(true);
297 $main_elements['<!-- forum_admin_submenu -->'] = ($forum_page['admin_sub'] != '') ? '<div class="admin-submenu gen-content">'."\n\t".'<ul>'."\n\t\t".$forum_page['admin_sub']."\n\t".'</ul>'."\n".'</div>' : '';
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
298 }
299
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
300 ($hook = get_hook('hd_main_elements')) ? eval($hook) : null;
301
d537dde Nikolay Frantsev Fix code style: remove unneeded spaces
Shutnik authored
302 $tpl_main = str_replace(array_keys($main_elements), array_values($main_elements), $tpl_main);
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
303 unset($main_elements);
304
305 // END MAIN SECTION INTERFACE ELEMENT SUBSTITUTION
6e6f91e Fixed incorrect EOL in multiple files.
Anatoly authored
306
307
308 ($hook = get_hook('hd_end')) ? eval($hook) : null;
309
0a8534c Merged new markup (based on markup by Paul Sullivan) into main PunBB 1.3...
Anatoly authored
310 if (!defined('FORUM_HEADER'))
311 define('FORUM_HEADER', 1);
Something went wrong with that request. Please try again.