comparison forum/Themes/default/MessageIndex.template.php @ 76:e3e11437ecea website

Add forum code
author Chris Cannam
date Sun, 07 Jul 2013 11:25:48 +0200
parents
children
comparison
equal deleted inserted replaced
75:72f59aa7e503 76:e3e11437ecea
1 <?php
2 /**
3 * Simple Machines Forum (SMF)
4 *
5 * @package SMF
6 * @author Simple Machines
7 * @copyright 2011 Simple Machines
8 * @license http://www.simplemachines.org/about/smf/license.php BSD
9 *
10 * @version 2.0
11 */
12
13 function template_main()
14 {
15 global $context, $settings, $options, $scripturl, $modSettings, $txt;
16
17 echo '
18 <a id="top"></a>';
19
20 if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0))
21 {
22 echo '
23 <div class="tborder childboards" id="board_', $context['current_board'], '_childboards">
24 <div class="cat_bar">
25 <h3 class="catbg">', $txt['parent_boards'], '</h3>
26 </div>
27 <div class="table_frame">
28 <table class="table_list">
29 <tbody id="board_', $context['current_board'], '_children" class="content">';
30
31 foreach ($context['boards'] as $board)
32 {
33 echo '
34 <tr id="board_', $board['id'], '" class="windowbg2">
35 <td class="icon windowbg"', !empty($board['children']) ? ' rowspan="2"' : '', '>
36 <a href="', ($board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '">';
37
38 // If the board or children is new, show an indicator.
39 if ($board['new'] || $board['children_new'])
40 echo '
41 <img src="', $settings['images_url'], '/' .$context['theme_variant_url'], 'on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
42 // Is it a redirection board?
43 elseif ($board['is_redirect'])
44 echo '
45 <img src="', $settings['images_url'], '/' .$context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
46 // No new posts at all! The agony!!
47 else
48 echo '
49 <img src="', $settings['images_url'], '/' .$context['theme_variant_url'], 'off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';
50
51 echo '
52 </a>
53 </td>
54 <td class="info">
55 <a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';
56
57 // Has it outstanding posts for approval?
58 if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
59 echo '
60 <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">(!)</a>';
61
62 echo '
63
64 <p>', $board['description'] , '</p>';
65
66 // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
67 if (!empty($board['moderators']))
68 echo '
69 <p class="moderators">', count($board['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';
70
71 // Show some basic information about the number of posts, etc.
72 echo '
73 </td>
74 <td class="stats windowbg">
75 <p>', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' <br />
76 ', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '
77 </p>
78 </td>
79 <td class="lastpost">';
80
81 /* The board's and children's 'last_post's have:
82 time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
83 link, href, subject, start (where they should go for the first unread post.),
84 and member. (which has id, name, link, href, username in it.) */
85 if (!empty($board['last_post']['id']))
86 echo '
87 <p><strong>', $txt['last_post'], '</strong> ', $txt['by'], ' ', $board['last_post']['member']['link'], '<br />
88 ', $txt['in'], ' ', $board['last_post']['link'], '<br />
89 ', $txt['on'], ' ', $board['last_post']['time'],'
90 </p>';
91
92 echo '
93 </td>
94 </tr>';
95
96 // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
97 if (!empty($board['children']))
98 {
99 // Sort the links into an array with new boards bold so it can be imploded.
100 $children = array();
101 /* Each child in each board's children has:
102 id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
103 foreach ($board['children'] as $child)
104 {
105 if (!$child['is_redirect'])
106 $child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="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'] . ($child['new'] ? '</a> <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']) . ')"><img src="' . $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />' : '') . '</a>';
107 else
108 $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';
109
110 // Has it posts awaiting approval?
111 if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
112 $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">(!)</a>';
113
114 $children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
115 }
116 echo '
117 <tr id="board_', $board['id'], '_children"><td colspan="3" class="children windowbg"><strong>', $txt['parent_boards'], '</strong>: ', implode(', ', $children), '</td></tr>';
118 }
119 }
120 echo '
121 </tbody>
122 </table>
123 </div>
124 </div>';
125 }
126
127 if (!empty($options['show_board_desc']) && $context['description'] != '')
128 echo '
129 <p class="description_board">', $context['description'], '</p>';
130
131 // Create the button set...
132 $normal_buttons = array(
133 'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
134 'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
135 'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
136 'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
137 );
138
139 // They can only mark read if they are logged in and it's enabled!
140 if (!$context['user']['is_logged'] || !$settings['show_mark_read'])
141 unset($normal_buttons['markread']);
142
143 // Allow adding new buttons easily.
144 call_integration_hook('integrate_messageindex_buttons', array(&$normal_buttons));
145
146 if (!$context['no_topic_listing'])
147 {
148 echo '
149 <div class="pagesection">
150 <div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#bot"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div>
151 ', template_button_strip($normal_buttons, 'right'), '
152 </div>';
153
154 // If Quick Moderation is enabled start the form.
155 if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics']))
156 echo '
157 <form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">';
158
159 echo '
160 <div class="tborder topic_table" id="messageindex">
161 <table class="table_grid" cellspacing="0">
162 <thead>
163 <tr class="catbg">';
164
165 // Are there actually any topics to show?
166 if (!empty($context['topics']))
167 {
168 echo '
169 <th scope="col" class="first_th" width="8%" colspan="2">&nbsp;</th>
170 <th scope="col" class="lefttext"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['subject'], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> / <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['started_by'], $context['sort_by'] == 'starter' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>
171 <th scope="col" width="14%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> / <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['views'], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>';
172 // Show a "select all" box for quick moderation?
173 if (empty($context['can_quick_mod']))
174 echo '
175 <th scope="col" class="lefttext last_th" width="22%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>';
176 else
177 echo '
178 <th scope="col" class="lefttext" width="22%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>';
179
180 // Show a "select all" box for quick moderation?
181 if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1)
182 echo '
183 <th scope="col" class="last_th" width="24"><input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check" /></th>';
184
185 // If it's on in "image" mode, don't show anything but the column.
186 elseif (!empty($context['can_quick_mod']))
187 echo '
188 <th class="last_th" width="4%">&nbsp;</th>';
189 }
190 // No topics.... just say, "sorry bub".
191 else
192 echo '
193 <th scope="col" class="first_th" width="8%">&nbsp;</th>
194 <th colspan="3"><strong>', $txt['msg_alert_none'], '</strong></th>
195 <th scope="col" class="last_th" width="8%">&nbsp;</th>';
196
197 echo '
198 </tr>
199 </thead>
200 <tbody>';
201
202 if (!empty($settings['display_who_viewing']))
203 {
204 echo '
205 <tr class="windowbg2 whos_viewing">
206 <td colspan="', !empty($context['can_quick_mod']) ? '6' : '5', '" class="smalltext">';
207 if ($settings['display_who_viewing'] == 1)
208 echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members'];
209 else
210 echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) or $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
211 echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board'], '
212 </td>
213 </tr>';
214 }
215
216 // If this person can approve items and we have some awaiting approval tell them.
217 if (!empty($context['unapproved_posts_message']))
218 {
219 echo '
220 <tr class="windowbg2">
221 <td colspan="', !empty($context['can_quick_mod']) ? '6' : '5', '">
222 <span class="alert">!</span> ', $context['unapproved_posts_message'], '
223 </td>
224 </tr>';
225 }
226
227 foreach ($context['topics'] as $topic)
228 {
229 // Is this topic pending approval, or does it have any posts pending approval?
230 if ($context['can_approve_posts'] && $topic['unapproved_posts'])
231 $color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg';
232 // We start with locked and sticky topics.
233 elseif ($topic['is_sticky'] && $topic['is_locked'])
234 $color_class = 'stickybg locked_sticky';
235 // Sticky topics should get a different color, too.
236 elseif ($topic['is_sticky'])
237 $color_class = 'stickybg';
238 // Locked topics get special treatment as well.
239 elseif ($topic['is_locked'])
240 $color_class = 'lockedbg';
241 // Last, but not least: regular topics.
242 else
243 $color_class = 'windowbg';
244
245 // Some columns require a different shade of the color class.
246 $alternate_class = $color_class . '2';
247
248 echo '
249 <tr>
250 <td class="icon1 ', $color_class, '">
251 <img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
252 </td>
253 <td class="icon2 ', $color_class, '">
254 <img src="', $topic['first_post']['icon_url'], '" alt="" />
255 </td>
256 <td class="subject ', $alternate_class, '">
257 <div ', (!empty($topic['quick_mod']['modify']) ? 'id="topic_' . $topic['first_post']['id'] . '" onmouseout="mouse_on_div = 0;" onmouseover="mouse_on_div = 1;" ondblclick="modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\');"' : ''), '>
258 ', $topic['is_sticky'] ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', $topic['is_sticky'] ? '</strong>' : '';
259
260 // Is this topic new? (assuming they are logged in!)
261 if ($topic['new'] && $context['user']['is_logged'])
262 echo '
263 <a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';
264
265 echo '
266 <p>', $txt['started_by'], ' ', $topic['first_post']['member']['link'], '
267 <small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>
268 </p>
269 </div>
270 </td>
271 <td class="stats ', $color_class, '">
272 ', $topic['replies'], ' ', $txt['replies'], '
273 <br />
274 ', $topic['views'], ' ', $txt['views'], '
275 </td>
276 <td class="lastpost ', $alternate_class, '">
277 <a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt['last_post'], '" title="', $txt['last_post'], '" /></a>
278 ', $topic['last_post']['time'], '<br />
279 ', $txt['by'], ' ', $topic['last_post']['member']['link'], '
280 </td>';
281
282 // Show the quick moderation options?
283 if (!empty($context['can_quick_mod']))
284 {
285 echo '
286 <td class="moderation ', $color_class, '" align="center">';
287 if ($options['display_quick_mod'] == 1)
288 echo '
289 <input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check" />';
290 else
291 {
292 // Check permissions on each and show only the ones they are allowed to use.
293 if ($topic['quick_mod']['remove'])
294 echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=remove;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_remove.gif" width="16" alt="', $txt['remove_topic'], '" title="', $txt['remove_topic'], '" /></a>';
295
296 if ($topic['quick_mod']['lock'])
297 echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=lock;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_lock.gif" width="16" alt="', $txt['set_lock'], '" title="', $txt['set_lock'], '" /></a>';
298
299 if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
300 echo '<br />';
301
302 if ($topic['quick_mod']['sticky'])
303 echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=sticky;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_sticky.gif" width="16" alt="', $txt['set_sticky'], '" title="', $txt['set_sticky'], '" /></a>';
304
305 if ($topic['quick_mod']['move'])
306 echo '<a href="', $scripturl, '?action=movetopic;board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><img src="', $settings['images_url'], '/icons/quick_move.gif" width="16" alt="', $txt['move_topic'], '" title="', $txt['move_topic'], '" /></a>';
307 }
308 echo '
309 </td>';
310 }
311 echo '
312 </tr>';
313 }
314
315 if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
316 {
317 echo '
318 <tr class="titlebg">
319 <td colspan="6" align="right">
320 <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
321 <option value="">--------</option>', $context['can_remove'] ? '
322 <option value="remove">' . $txt['quick_mod_remove'] . '</option>' : '', $context['can_lock'] ? '
323 <option value="lock">' . $txt['quick_mod_lock'] . '</option>' : '', $context['can_sticky'] ? '
324 <option value="sticky">' . $txt['quick_mod_sticky'] . '</option>' : '', $context['can_move'] ? '
325 <option value="move">' . $txt['quick_mod_move'] . ': </option>' : '', $context['can_merge'] ? '
326 <option value="merge">' . $txt['quick_mod_merge'] . '</option>' : '', $context['can_restore'] ? '
327 <option value="restore">' . $txt['quick_mod_restore'] . '</option>' : '', $context['can_approve'] ? '
328 <option value="approve">' . $txt['quick_mod_approve'] . '</option>' : '', $context['user']['is_logged'] ? '
329 <option value="markread">' . $txt['quick_mod_markread'] . '</option>' : '', '
330 </select>';
331
332 // Show a list of boards they can move the topic to.
333 if ($context['can_move'])
334 {
335 echo '
336 <select class="qaction" id="moveItTo" name="move_to" disabled="disabled">';
337
338 foreach ($context['move_to_boards'] as $category)
339 {
340 echo '
341 <optgroup label="', $category['name'], '">';
342 foreach ($category['boards'] as $board)
343 echo '
344 <option value="', $board['id'], '"', $board['selected'] ? ' selected="selected"' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
345 echo '
346 </optgroup>';
347 }
348 echo '
349 </select>';
350 }
351
352 echo '
353 <input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' &amp;&amp; confirm(\'', $txt['quickmod_confirm'], '\');" class="button_submit qaction" />
354 </td>
355 </tr>';
356 }
357
358 echo '
359 </tbody>
360 </table>
361 </div>
362 <a id="bot"></a>';
363
364 // Finish off the form - again.
365 if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics']))
366 echo '
367 <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
368 </form>';
369
370 echo '
371 <div class="pagesection">
372 ', template_button_strip($normal_buttons, 'right'), '
373 <div class="pagelinks">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
374 </div>';
375 }
376
377 // Show breadcrumbs at the bottom too.
378 theme_linktree();
379
380 echo '
381 <div class="tborder" id="topic_icons">
382 <div class="description">
383 <p class="floatright" id="message_index_jump_to">&nbsp;</p>';
384
385 if (!$context['no_topic_listing'])
386 echo '
387 <p class="floatleft smalltext">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? '
388 <img src="' . $settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' . $txt['participation_caption'] . '<br />' : '', '
389 <img src="' . $settings['images_url'] . '/topic/normal_post.gif" alt="" align="middle" /> ' . $txt['normal_topic'] . '<br />
390 <img src="' . $settings['images_url'] . '/topic/hot_post.gif" alt="" align="middle" /> ' . sprintf($txt['hot_topics'], $modSettings['hotTopicPosts']) . '<br />
391 <img src="' . $settings['images_url'] . '/topic/veryhot_post.gif" alt="" align="middle" /> ' . sprintf($txt['very_hot_topics'], $modSettings['hotTopicVeryPosts']) . '
392 </p>
393 <p class="smalltext">
394 <img src="' . $settings['images_url'] . '/icons/quick_lock.gif" alt="" align="middle" /> ' . $txt['locked_topic'] . '<br />' . ($modSettings['enableStickyTopics'] == '1' ? '
395 <img src="' . $settings['images_url'] . '/icons/quick_sticky.gif" alt="" align="middle" /> ' . $txt['sticky_topic'] . '<br />' : '') . ($modSettings['pollMode'] == '1' ? '
396 <img src="' . $settings['images_url'] . '/topic/normal_poll.gif" alt="" align="middle" /> ' . $txt['poll'] : '') . '
397 </p>';
398
399 echo '
400 <script type="text/javascript"><!-- // --><![CDATA[
401 if (typeof(window.XMLHttpRequest) != "undefined")
402 aJumpTo[aJumpTo.length] = new JumpTo({
403 sContainerId: "message_index_jump_to",
404 sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
405 iCurBoardId: ', $context['current_board'], ',
406 iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
407 sCurBoardName: "', $context['jump_to']['board_name'], '",
408 sBoardChildLevelIndicator: "==",
409 sBoardPrefix: "=> ",
410 sCatSeparator: "-----------------------------",
411 sCatPrefix: "",
412 sGoButtonLabel: "', $txt['quick_mod_go'], '"
413 });
414 // ]]></script>
415 <br class="clear" />
416 </div>
417 </div>';
418
419 // Javascript for inline editing.
420 echo '
421 <script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/topic.js"></script>
422 <script type="text/javascript"><!-- // --><![CDATA[
423
424 // Hide certain bits during topic edit.
425 hide_prefixes.push("lockicon", "stickyicon", "pages", "newicon");
426
427 // Use it to detect when we\'ve stopped editing.
428 document.onclick = modify_topic_click;
429
430 var mouse_on_div;
431 function modify_topic_click()
432 {
433 if (in_edit_mode == 1 && mouse_on_div == 0)
434 modify_topic_save("', $context['session_id'], '", "', $context['session_var'], '");
435 }
436
437 function modify_topic_keypress(oEvent)
438 {
439 if (typeof(oEvent.keyCode) != "undefined" && oEvent.keyCode == 13)
440 {
441 modify_topic_save("', $context['session_id'], '", "', $context['session_var'], '");
442 if (typeof(oEvent.preventDefault) == "undefined")
443 oEvent.returnValue = false;
444 else
445 oEvent.preventDefault();
446 }
447 }
448
449 // For templating, shown when an inline edit is made.
450 function modify_topic_show_edit(subject)
451 {
452 // Just template the subject.
453 setInnerHTML(cur_subject_div, \'<input type="text" name="subject" value="\' + subject + \'" size="60" style="width: 95%;" maxlength="80" onkeypress="modify_topic_keypress(event)" class="input_text" /><input type="hidden" name="topic" value="\' + cur_topic_id + \'" /><input type="hidden" name="msg" value="\' + cur_msg_id.substr(4) + \'" />\');
454 }
455
456 // And the reverse for hiding it.
457 function modify_topic_hide_edit(subject)
458 {
459 // Re-template the subject!
460 setInnerHTML(cur_subject_div, \'<a href="', $scripturl, '?topic=\' + cur_topic_id + \'.0">\' + subject + \'<\' +\'/a>\');
461 }
462
463 // ]]></script>';
464 }
465
466 ?>