1 | <?php |
||
2 | /** |
||
3 | * Simple Machines Forum (SMF) |
||
4 | * |
||
5 | * @package SMF |
||
6 | * @author Simple Machines https://www.simplemachines.org |
||
7 | * @copyright 2022 Simple Machines and individual contributors |
||
8 | * @license https://www.simplemachines.org/about/smf/license.php BSD |
||
9 | * |
||
10 | * @version 2.1.2 |
||
11 | */ |
||
12 | |||
13 | /** |
||
14 | * The main messageindex. |
||
15 | */ |
||
16 | function template_main() |
||
17 | { |
||
18 | global $context, $settings, $options, $scripturl, $modSettings, $txt; |
||
19 | |||
20 | echo '<div id="display_head" class="information"> |
||
21 | <h2 class="display_title">', $context['name'], '</h2>'; |
||
22 | |||
23 | if (isset($context['description']) && $context['description'] != '') |
||
24 | echo ' |
||
25 | <p>', $context['description'], '</p>'; |
||
26 | |||
27 | if (!empty($context['moderators'])) |
||
28 | echo ' |
||
29 | <p>', count($context['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $context['link_moderators']), '.</p>'; |
||
30 | |||
31 | if (!empty($settings['display_who_viewing'])) |
||
32 | { |
||
33 | echo ' |
||
34 | <p>'; |
||
35 | |||
36 | // Show just numbers...? |
||
37 | if ($settings['display_who_viewing'] == 1) |
||
38 | echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members']; |
||
39 | // Or show the actual people viewing the topic? |
||
40 | else |
||
41 | echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); |
||
42 | |||
43 | // Now show how many guests are here too. |
||
44 | echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board'], ' |
||
45 | </p>'; |
||
46 | } |
||
47 | |||
48 | echo ' |
||
49 | </div>'; |
||
50 | |||
51 | if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0)) |
||
52 | { |
||
53 | echo ' |
||
54 | <div id="board_', $context['current_board'], '_childboards" class="boardindex_table main_container"> |
||
55 | <div class="cat_bar"> |
||
56 | <h3 class="catbg">', $txt['sub_boards'], '</h3> |
||
57 | </div>'; |
||
58 | |||
59 | foreach ($context['boards'] as $board) |
||
60 | { |
||
61 | echo ' |
||
62 | <div id="board_', $board['id'], '" class="up_contain ', (!empty($board['css_class']) ? $board['css_class'] : ''), '"> |
||
63 | <div class="board_icon"> |
||
64 | ', function_exists('template_bi_' . $board['type'] . '_icon') ? call_user_func('template_bi_' . $board['type'] . '_icon', $board) : template_bi_board_icon($board), ' |
||
0 ignored issues
–
show
|
|||
65 | </div> |
||
66 | <div class="info"> |
||
67 | ', function_exists('template_bi_' . $board['type'] . '_info') ? call_user_func('template_bi_' . $board['type'] . '_info', $board) : template_bi_board_info($board), ' |
||
0 ignored issues
–
show
Are you sure the usage of
template_bi_board_info($board) is correct as it seems to always return null .
This check looks for function or method calls that always return null and whose return value is used. class A
{
function getObject()
{
return null;
}
}
$a = new A();
if ($a->getObject()) {
The method The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
Loading history...
|
|||
68 | </div><!-- .info -->'; |
||
69 | |||
70 | // Show some basic information about the number of posts, etc. |
||
71 | echo ' |
||
72 | <div class="board_stats"> |
||
73 | ', function_exists('template_bi_' . $board['type'] . '_stats') ? call_user_func('template_bi_' . $board['type'] . '_stats', $board) : template_bi_board_stats($board), ' |
||
0 ignored issues
–
show
Are you sure the usage of
template_bi_board_stats($board) is correct as it seems to always return null .
This check looks for function or method calls that always return null and whose return value is used. class A
{
function getObject()
{
return null;
}
}
$a = new A();
if ($a->getObject()) {
The method The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
Loading history...
|
|||
74 | </div>'; |
||
75 | |||
76 | // Show the last post if there is one. |
||
77 | echo ' |
||
78 | <div class="lastpost"> |
||
79 | ', function_exists('template_bi_' . $board['type'] . '_lastpost') ? call_user_func('template_bi_' . $board['type'] . '_lastpost', $board) : template_bi_board_lastpost($board), ' |
||
0 ignored issues
–
show
Are you sure the usage of
template_bi_board_lastpost($board) is correct as it seems to always return null .
This check looks for function or method calls that always return null and whose return value is used. class A
{
function getObject()
{
return null;
}
}
$a = new A();
if ($a->getObject()) {
The method The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
Loading history...
|
|||
80 | </div>'; |
||
81 | |||
82 | // Won't somebody think of the children! |
||
83 | if (function_exists('template_bi_' . $board['type'] . '_children')) |
||
84 | call_user_func('template_bi_' . $board['type'] . '_children', $board); |
||
85 | else |
||
86 | template_bi_board_children($board); |
||
87 | |||
88 | echo ' |
||
89 | </div><!-- #board_[id] -->'; |
||
90 | } |
||
91 | |||
92 | echo ' |
||
93 | </div><!-- #board_[current_board]_childboards -->'; |
||
94 | } |
||
95 | |||
96 | // Let them know why their message became unapproved. |
||
97 | if ($context['becomesUnapproved']) |
||
98 | echo ' |
||
99 | <div class="noticebox"> |
||
100 | ', $txt['post_becomes_unapproved'], ' |
||
101 | </div>'; |
||
102 | |||
103 | // If this person can approve items and we have some awaiting approval tell them. |
||
104 | if (!empty($context['unapproved_posts_message'])) |
||
105 | echo ' |
||
106 | <div class="noticebox"> |
||
107 | ', $context['unapproved_posts_message'], ' |
||
108 | </div>'; |
||
109 | |||
110 | if (!$context['no_topic_listing']) |
||
111 | { |
||
112 | echo ' |
||
113 | <div class="pagesection"> |
||
114 | ', $context['menu_separator'], ' |
||
115 | <div class="pagelinks floatleft"> |
||
116 | <a href="#bot" class="button">', $txt['go_down'], '</a> |
||
117 | ', $context['page_index'], ' |
||
118 | </div> |
||
119 | ', template_button_strip($context['normal_buttons'], 'right'); |
||
120 | |||
121 | // Mobile action buttons (top) |
||
122 | if (!empty($context['normal_buttons'])) |
||
123 | echo ' |
||
124 | <div class="mobile_buttons floatright"> |
||
125 | <a class="button mobile_act">', $txt['mobile_action'], '</a> |
||
126 | </div>'; |
||
127 | |||
128 | echo ' |
||
129 | </div>'; |
||
130 | |||
131 | // If Quick Moderation is enabled start the form. |
||
132 | if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
||
133 | echo ' |
||
134 | <form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">'; |
||
135 | |||
136 | echo ' |
||
137 | <div id="messageindex">'; |
||
138 | |||
139 | echo ' |
||
140 | <div class="title_bar" id="topic_header">'; |
||
141 | |||
142 | // Are there actually any topics to show? |
||
143 | if (!empty($context['topics'])) |
||
144 | { |
||
145 | echo ' |
||
146 | <div class="board_icon"></div> |
||
147 | <div class="info">', $context['topics_headers']['subject'], ' / ', $context['topics_headers']['starter'], '</div> |
||
148 | <div class="board_stats centertext">', $context['topics_headers']['replies'], ' / ', $context['topics_headers']['views'], '</div> |
||
149 | <div class="lastpost">', $context['topics_headers']['last_post'], '</div>'; |
||
150 | |||
151 | // Show a "select all" box for quick moderation? |
||
152 | if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) |
||
153 | echo ' |
||
154 | <div class="moderation"> |
||
155 | <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');"> |
||
156 | </div>'; |
||
157 | |||
158 | // If it's on in "image" mode, don't show anything but the column. |
||
159 | elseif (!empty($context['can_quick_mod'])) |
||
160 | echo ' |
||
161 | <div class="moderation"></div>'; |
||
162 | } |
||
163 | |||
164 | // No topics... just say, "sorry bub". |
||
165 | else |
||
166 | echo ' |
||
167 | <h3 class="titlebg">', $txt['topic_alert_none'], '</h3>'; |
||
168 | |||
169 | echo ' |
||
170 | </div><!-- #topic_header -->'; |
||
171 | |||
172 | // Contain the topic list |
||
173 | echo ' |
||
174 | <div id="topic_container">'; |
||
175 | |||
176 | foreach ($context['topics'] as $topic) |
||
177 | { |
||
178 | echo ' |
||
179 | <div class="', $topic['css_class'], '"> |
||
180 | <div class="board_icon"> |
||
181 | <img src="', $topic['first_post']['icon_url'], '" alt=""> |
||
182 | ', $topic['is_posted_in'] ? '<span class="main_icons profile_sm"></span>' : '', ' |
||
183 | </div> |
||
184 | <div class="info', !empty($context['can_quick_mod']) ? '' : ' info_block', '"> |
||
185 | <div ', (!empty($topic['quick_mod']['modify']) ? 'id="topic_' . $topic['first_post']['id'] . '" ondblclick="oQuickModifyTopic.modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\');"' : ''), '>'; |
||
186 | |||
187 | // Now we handle the icons |
||
188 | echo ' |
||
189 | <div class="icons floatright">'; |
||
190 | |||
191 | if ($topic['is_watched']) |
||
192 | echo ' |
||
193 | <span class="main_icons watch" title="', $txt['watching_this_topic'], '"></span>'; |
||
194 | |||
195 | if ($topic['is_locked']) |
||
196 | echo ' |
||
197 | <span class="main_icons lock"></span>'; |
||
198 | |||
199 | if ($topic['is_sticky']) |
||
200 | echo ' |
||
201 | <span class="main_icons sticky"></span>'; |
||
202 | |||
203 | if ($topic['is_redirect']) |
||
204 | echo ' |
||
205 | <span class="main_icons move"></span>'; |
||
206 | |||
207 | if ($topic['is_poll']) |
||
208 | echo ' |
||
209 | <span class="main_icons poll"></span>'; |
||
210 | |||
211 | echo ' |
||
212 | </div>'; |
||
213 | |||
214 | echo ' |
||
215 | <div class="message_index_title"> |
||
216 | ', $topic['new'] && $context['user']['is_logged'] ? '<a href="' . $topic['new_href'] . '" id="newicon' . $topic['first_post']['id'] . '" class="new_posts">' . $txt['new'] . '</a>' : '', ' |
||
217 | <span class="preview', $topic['is_sticky'] ? ' bold_text' : '', '" title="', $topic[(empty($modSettings['message_index_preview_first']) ? 'last_post' : 'first_post')]['preview'], '"> |
||
218 | <span id="msg_', $topic['first_post']['id'], '">', $topic['first_post']['link'], (!$topic['approved'] ? ' <em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span> |
||
219 | </span> |
||
220 | </div> |
||
221 | <p class="floatleft"> |
||
222 | ', $txt['started_by'], ' ', $topic['first_post']['member']['link'], ' |
||
223 | </p> |
||
224 | ', !empty($topic['pages']) ? '<span id="pages' . $topic['first_post']['id'] . '" class="topic_pages">' . $topic['pages'] . '</span>' : '', ' |
||
225 | </div><!-- #topic_[first_post][id] --> |
||
226 | </div><!-- .info --> |
||
227 | <div class="board_stats centertext"> |
||
228 | <p>', $txt['replies'], ': ', $topic['replies'], '<br>', $txt['views'], ': ', $topic['views'], '</p> |
||
229 | </div> |
||
230 | <div class="lastpost"> |
||
231 | <p>', sprintf($txt['last_post_topic'], '<a href="' . $topic['last_post']['href'] . '">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), '</p> |
||
232 | </div>'; |
||
233 | |||
234 | // Show the quick moderation options? |
||
235 | if (!empty($context['can_quick_mod'])) |
||
236 | { |
||
237 | echo ' |
||
238 | <div class="moderation">'; |
||
239 | |||
240 | if ($options['display_quick_mod'] == 1) |
||
241 | echo ' |
||
242 | <input type="checkbox" name="topics[]" value="', $topic['id'], '">'; |
||
243 | else |
||
244 | { |
||
245 | // Check permissions on each and show only the ones they are allowed to use. |
||
246 | if ($topic['quick_mod']['remove']) |
||
247 | echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="main_icons delete" title="', $txt['remove_topic'], '"></span></a>'; |
||
248 | |||
249 | if ($topic['quick_mod']['lock']) |
||
250 | echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="main_icons lock" title="', $topic['is_locked'] ? $txt['set_unlock'] : $txt['set_lock'], '"></span></a>'; |
||
251 | |||
252 | if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) |
||
253 | echo '<br>'; |
||
254 | |||
255 | if ($topic['quick_mod']['sticky']) |
||
256 | echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" class="you_sure"><span class="main_icons sticky" title="', $topic['is_sticky'] ? $txt['set_nonsticky'] : $txt['set_sticky'], '"></span></a>'; |
||
257 | |||
258 | if ($topic['quick_mod']['move']) |
||
259 | echo '<a href="', $scripturl, '?action=movetopic;current_board=', $context['current_board'], ';board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><span class="main_icons move" title="', $txt['move_topic'], '"></span></a>'; |
||
260 | } |
||
261 | echo ' |
||
262 | </div><!-- .moderation -->'; |
||
263 | } |
||
264 | echo ' |
||
265 | </div><!-- $topic[css_class] -->'; |
||
266 | } |
||
267 | echo ' |
||
268 | </div><!-- #topic_container -->'; |
||
269 | |||
270 | if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) |
||
271 | { |
||
272 | echo ' |
||
273 | <div class="righttext" id="quick_actions"> |
||
274 | <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '> |
||
275 | <option value="">--------</option>'; |
||
276 | |||
277 | foreach ($context['qmod_actions'] as $qmod_action) |
||
278 | if ($context['can_' . $qmod_action]) |
||
279 | echo ' |
||
280 | <option value="' . $qmod_action . '">' . $txt['quick_mod_' . $qmod_action] . '</option>'; |
||
281 | |||
282 | echo ' |
||
283 | </select>'; |
||
284 | |||
285 | // Show a list of boards they can move the topic to. |
||
286 | if ($context['can_move']) |
||
287 | echo ' |
||
288 | <span id="quick_mod_jump_to"></span>'; |
||
289 | |||
290 | echo ' |
||
291 | <input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' && confirm(\'', $txt['quickmod_confirm'], '\');" class="button qaction"> |
||
292 | </div><!-- #quick_actions -->'; |
||
293 | } |
||
294 | |||
295 | echo ' |
||
296 | </div><!-- #messageindex -->'; |
||
297 | |||
298 | // Finish off the form - again. |
||
299 | if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) |
||
300 | echo ' |
||
301 | <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"> |
||
302 | </form>'; |
||
303 | |||
304 | echo ' |
||
305 | <div class="pagesection"> |
||
306 | ', template_button_strip($context['normal_buttons'], 'right'), ' |
||
307 | ', $context['menu_separator'], ' |
||
308 | <div class="pagelinks floatleft"> |
||
309 | <a href="#main_content_section" class="button" id="bot">', $txt['go_up'], '</a> |
||
310 | ', $context['page_index'], ' |
||
311 | </div>'; |
||
312 | |||
313 | // Mobile action buttons (bottom) |
||
314 | if (!empty($context['normal_buttons'])) |
||
315 | echo ' |
||
316 | <div class="mobile_buttons floatright"> |
||
317 | <a class="button mobile_act">', $txt['mobile_action'], '</a> |
||
318 | </div>'; |
||
319 | |||
320 | echo ' |
||
321 | </div>'; |
||
322 | } |
||
323 | |||
324 | // Show breadcrumbs at the bottom too. |
||
325 | theme_linktree(); |
||
326 | |||
327 | if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) |
||
328 | echo ' |
||
329 | <script> |
||
330 | if (typeof(window.XMLHttpRequest) != "undefined") |
||
331 | aJumpTo[aJumpTo.length] = new JumpTo({ |
||
332 | sContainerId: "quick_mod_jump_to", |
||
333 | sClassName: "qaction", |
||
334 | sJumpToTemplate: "%dropdown_list%", |
||
335 | iCurBoardId: ', $context['current_board'], ', |
||
336 | iCurBoardChildLevel: ', $context['jump_to']['child_level'], ', |
||
337 | sCurBoardName: "', $context['jump_to']['board_name'], '", |
||
338 | sBoardChildLevelIndicator: "==", |
||
339 | sBoardPrefix: "=> ", |
||
340 | sCatSeparator: "-----------------------------", |
||
341 | sCatPrefix: "", |
||
342 | bNoRedirect: true, |
||
343 | bDisabled: true, |
||
344 | sCustomName: "move_to" |
||
345 | }); |
||
346 | </script>'; |
||
347 | |||
348 | // Javascript for inline editing. |
||
349 | echo ' |
||
350 | <script> |
||
351 | var oQuickModifyTopic = new QuickModifyTopic({ |
||
352 | aHidePrefixes: Array("lockicon", "stickyicon", "pages", "newicon"), |
||
353 | bMouseOnDiv: false, |
||
354 | }); |
||
355 | </script>'; |
||
356 | |||
357 | template_topic_legend(); |
||
358 | |||
359 | // Lets pop the... |
||
360 | echo ' |
||
361 | <div id="mobile_action" class="popup_container"> |
||
362 | <div class="popup_window description"> |
||
363 | <div class="popup_heading">', $txt['mobile_action'], ' |
||
364 | <a href="javascript:void(0);" class="main_icons hide_popup"></a> |
||
365 | </div> |
||
366 | ', template_button_strip($context['normal_buttons']), ' |
||
367 | </div> |
||
368 | </div>'; |
||
369 | } |
||
370 | |||
371 | /** |
||
372 | * Outputs the board icon for a standard board. |
||
373 | * |
||
374 | * @param array $board Current board information. |
||
375 | */ |
||
376 | function template_bi_board_icon($board) |
||
377 | { |
||
378 | global $context, $scripturl; |
||
379 | |||
380 | echo ' |
||
381 | <a href="', ($context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '" class="board_', $board['board_class'], '"', !empty($board['board_tooltip']) ? ' title="' . $board['board_tooltip'] . '"' : '', '></a>'; |
||
382 | } |
||
383 | |||
384 | /** |
||
385 | * Outputs the board icon for a redirect. |
||
386 | * |
||
387 | * @param array $board Current board information. |
||
388 | */ |
||
389 | function template_bi_redirect_icon($board) |
||
390 | { |
||
391 | global $context, $scripturl; |
||
392 | |||
393 | echo ' |
||
394 | <a href="', $board['href'], '" class="board_', $board['board_class'], '"', !empty($board['board_tooltip']) ? ' title="' . $board['board_tooltip'] . '"' : '', '></a>'; |
||
395 | } |
||
396 | |||
397 | /** |
||
398 | * Outputs the board info for a standard board or redirect. |
||
399 | * |
||
400 | * @param array $board Current board information. |
||
401 | */ |
||
402 | function template_bi_board_info($board) |
||
403 | { |
||
404 | global $context, $scripturl, $txt; |
||
405 | |||
406 | echo ' |
||
407 | <a class="subject mobile_subject" href="', $board['href'], '" id="b', $board['id'], '"> |
||
408 | ', $board['name'], ' |
||
409 | </a>'; |
||
410 | |||
411 | // Has it outstanding posts for approval? |
||
412 | if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) |
||
413 | echo ' |
||
414 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link amt">!</a>'; |
||
415 | |||
416 | echo ' |
||
417 | <div class="board_description">', $board['description'], '</div>'; |
||
418 | |||
419 | // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.) |
||
420 | if (!empty($board['moderators']) || !empty($board['moderator_groups'])) |
||
421 | echo ' |
||
422 | <p class="moderators">', count($board['link_moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>'; |
||
423 | } |
||
424 | |||
425 | /** |
||
426 | * Outputs the board stats for a standard board. |
||
427 | * |
||
428 | * @param array $board Current board information. |
||
429 | */ |
||
430 | function template_bi_board_stats($board) |
||
431 | { |
||
432 | global $txt; |
||
433 | |||
434 | echo ' |
||
435 | <p> |
||
436 | ', $txt['posts'], ': ', comma_format($board['posts']), '<br>', $txt['board_topics'], ': ', comma_format($board['topics']), ' |
||
437 | </p>'; |
||
438 | } |
||
439 | |||
440 | /** |
||
441 | * Outputs the board stats for a redirect. |
||
442 | * |
||
443 | * @param array $board Current board information. |
||
444 | */ |
||
445 | function template_bi_redirect_stats($board) |
||
446 | { |
||
447 | global $txt; |
||
448 | |||
449 | echo ' |
||
450 | <p> |
||
451 | ', $txt['redirects'], ': ', comma_format($board['posts']), ' |
||
452 | </p>'; |
||
453 | } |
||
454 | |||
455 | /** |
||
456 | * Outputs the board lastposts for a standard board or a redirect. |
||
457 | * When on a mobile device, this may be hidden if no last post exists. |
||
458 | * |
||
459 | * @param array $board Current board information. |
||
460 | */ |
||
461 | function template_bi_board_lastpost($board) |
||
462 | { |
||
463 | if (!empty($board['last_post']['id'])) |
||
464 | echo ' |
||
465 | <p>', $board['last_post']['last_post_message'], '</p>'; |
||
466 | } |
||
467 | |||
468 | /** |
||
469 | * Outputs the board children for a standard board. |
||
470 | * |
||
471 | * @param array $board Current board information. |
||
472 | */ |
||
473 | function template_bi_board_children($board) |
||
474 | { |
||
475 | global $txt, $scripturl, $context; |
||
476 | |||
477 | // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...) |
||
478 | if (!empty($board['children'])) |
||
479 | { |
||
480 | // Sort the links into an array with new boards bold so it can be imploded. |
||
481 | $children = array(); |
||
482 | /* Each child in each board's children has: |
||
483 | id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */ |
||
484 | foreach ($board['children'] as $child) |
||
485 | { |
||
486 | if (!$child['is_redirect']) |
||
487 | $child['link'] = '' . ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')" class="new_posts">' . $txt['new'] . '</a> ' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
||
488 | else |
||
489 | $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>'; |
||
490 | |||
491 | // Has it posts awaiting approval? |
||
492 | if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics'])) |
||
493 | $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link amt">!</a>'; |
||
494 | |||
495 | $children[] = $child['new'] ? '<span class="strong">' . $child['link'] . '</span>' : '<span>' . $child['link'] . '</span>'; |
||
496 | } |
||
497 | |||
498 | echo ' |
||
499 | <div id="board_', $board['id'], '_children" class="children"> |
||
500 | <p><strong id="child_list_', $board['id'], '">', $txt['sub_boards'], '</strong>', implode(' ', $children), '</p> |
||
501 | </div>'; |
||
502 | } |
||
503 | } |
||
504 | |||
505 | /** |
||
506 | * Shows a legend for topic icons. |
||
507 | */ |
||
508 | function template_topic_legend() |
||
509 | { |
||
510 | global $context, $settings, $txt, $modSettings; |
||
511 | |||
512 | echo ' |
||
513 | <div class="tborder" id="topic_icons"> |
||
514 | <div class="information"> |
||
515 | <p id="message_index_jump_to"></p>'; |
||
516 | |||
517 | if (empty($context['no_topic_listing'])) |
||
518 | echo ' |
||
519 | <p class="floatleft">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? ' |
||
520 | <span class="main_icons profile_sm"></span> ' . $txt['participation_caption'] . '<br>' : '', ' |
||
521 | ' . ($modSettings['pollMode'] == '1' ? '<span class="main_icons poll"></span> ' . $txt['poll'] . '<br>' : '') . ' |
||
522 | <span class="main_icons move"></span> ' . $txt['moved_topic'] . '<br> |
||
523 | </p> |
||
524 | <p> |
||
525 | <span class="main_icons lock"></span> ' . $txt['locked_topic'] . '<br> |
||
526 | <span class="main_icons sticky"></span> ' . $txt['sticky_topic'] . '<br> |
||
527 | <span class="main_icons watch"></span> ' . $txt['watching_topic'] . '<br> |
||
528 | </p>'; |
||
529 | |||
530 | if (!empty($context['jump_to'])) |
||
531 | echo ' |
||
532 | <script> |
||
533 | if (typeof(window.XMLHttpRequest) != "undefined") |
||
534 | aJumpTo[aJumpTo.length] = new JumpTo({ |
||
535 | sContainerId: "message_index_jump_to", |
||
536 | sJumpToTemplate: "<label class=\"smalltext jump_to\" for=\"%select_id%\">', $context['jump_to']['label'], '<" + "/label> %dropdown_list%", |
||
537 | iCurBoardId: ', $context['current_board'], ', |
||
538 | iCurBoardChildLevel: ', $context['jump_to']['child_level'], ', |
||
539 | sCurBoardName: "', $context['jump_to']['board_name'], '", |
||
540 | sBoardChildLevelIndicator: "==", |
||
541 | sBoardPrefix: "=> ", |
||
542 | sCatSeparator: "-----------------------------", |
||
543 | sCatPrefix: "", |
||
544 | sGoButtonLabel: "', $txt['quick_mod_go'], '" |
||
545 | }); |
||
546 | </script>'; |
||
547 | |||
548 | echo ' |
||
549 | </div><!-- .information --> |
||
550 | </div><!-- #topic_icons -->'; |
||
551 | } |
||
552 | |||
553 | ?> |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.