Mercurial > hg > vamp-website
comparison forum/Themes/default/Display.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, $txt, $scripturl, $modSettings; | |
16 | |
17 // Let them know, if their report was a success! | |
18 if ($context['report_sent']) | |
19 { | |
20 echo ' | |
21 <div class="windowbg" id="profile_success"> | |
22 ', $txt['report_sent'], ' | |
23 </div>'; | |
24 } | |
25 | |
26 // Show the anchor for the top and for the first message. If the first message is new, say so. | |
27 echo ' | |
28 <a id="top"></a> | |
29 <a id="msg', $context['first_message'], '"></a>', $context['first_new_message'] ? '<a id="new"></a>' : ''; | |
30 | |
31 // Is this topic also a poll? | |
32 if ($context['is_poll']) | |
33 { | |
34 echo ' | |
35 <div id="poll"> | |
36 <div class="cat_bar"> | |
37 <h3 class="catbg"> | |
38 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" class="icon" /> ', $txt['poll'], '</span> | |
39 </h3> | |
40 </div> | |
41 <div class="windowbg"> | |
42 <span class="topslice"><span></span></span> | |
43 <div class="content" id="poll_options"> | |
44 <h4 id="pollquestion"> | |
45 ', $context['poll']['question'], ' | |
46 </h4>'; | |
47 | |
48 // Are they not allowed to vote but allowed to view the options? | |
49 if ($context['poll']['show_results'] || !$context['allow_vote']) | |
50 { | |
51 echo ' | |
52 <dl class="options">'; | |
53 | |
54 // Show each option with its corresponding percentage bar. | |
55 foreach ($context['poll']['options'] as $option) | |
56 { | |
57 echo ' | |
58 <dt class="middletext', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt> | |
59 <dd class="middletext statsbar', $option['voted_this'] ? ' voted' : '', '">'; | |
60 | |
61 if ($context['allow_poll_view']) | |
62 echo ' | |
63 ', $option['bar_ndt'], ' | |
64 <span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>'; | |
65 | |
66 echo ' | |
67 </dd>'; | |
68 } | |
69 | |
70 echo ' | |
71 </dl>'; | |
72 | |
73 if ($context['allow_poll_view']) | |
74 echo ' | |
75 <p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>'; | |
76 } | |
77 // They are allowed to vote! Go to it! | |
78 else | |
79 { | |
80 echo ' | |
81 <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">'; | |
82 | |
83 // Show a warning if they are allowed more than one option. | |
84 if ($context['poll']['allowed_warning']) | |
85 echo ' | |
86 <p class="smallpadding">', $context['poll']['allowed_warning'], '</p>'; | |
87 | |
88 echo ' | |
89 <ul class="reset options">'; | |
90 | |
91 // Show each option with its button - a radio likely. | |
92 foreach ($context['poll']['options'] as $option) | |
93 echo ' | |
94 <li class="middletext">', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>'; | |
95 | |
96 echo ' | |
97 </ul> | |
98 <div class="submitbutton"> | |
99 <input type="submit" value="', $txt['poll_vote'], '" class="button_submit" /> | |
100 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
101 </div> | |
102 </form>'; | |
103 } | |
104 | |
105 // Is the clock ticking? | |
106 if (!empty($context['poll']['expire_time'])) | |
107 echo ' | |
108 <p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>'; | |
109 | |
110 echo ' | |
111 </div> | |
112 <span class="botslice"><span></span></span> | |
113 </div> | |
114 </div> | |
115 <div id="pollmoderation">'; | |
116 | |
117 // Build the poll moderation button array. | |
118 $poll_buttons = array( | |
119 'vote' => array('test' => 'allow_return_vote', 'text' => 'poll_return_vote', 'image' => 'poll_options.gif', 'lang' => true, 'url' => $scripturl . '?topic=' . $context['current_topic'] . '.' . $context['start']), | |
120 'results' => array('test' => 'show_view_results_button', 'text' => 'poll_results', 'image' => 'poll_results.gif', 'lang' => true, 'url' => $scripturl . '?topic=' . $context['current_topic'] . '.' . $context['start'] . ';viewresults'), | |
121 'change_vote' => array('test' => 'allow_change_vote', 'text' => 'poll_change_vote', 'image' => 'poll_change_vote.gif', 'lang' => true, 'url' => $scripturl . '?action=vote;topic=' . $context['current_topic'] . '.' . $context['start'] . ';poll=' . $context['poll']['id'] . ';' . $context['session_var'] . '=' . $context['session_id']), | |
122 'lock' => array('test' => 'allow_lock_poll', 'text' => (!$context['poll']['is_locked'] ? 'poll_lock' : 'poll_unlock'), 'image' => 'poll_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=lockvoting;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), | |
123 'edit' => array('test' => 'allow_edit_poll', 'text' => 'poll_edit', 'image' => 'poll_edit.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;topic=' . $context['current_topic'] . '.' . $context['start']), | |
124 'remove_poll' => array('test' => 'can_remove_poll', 'text' => 'poll_remove', 'image' => 'admin_remove_poll.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');"', 'url' => $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), | |
125 ); | |
126 | |
127 template_button_strip($poll_buttons); | |
128 | |
129 echo ' | |
130 </div>'; | |
131 } | |
132 | |
133 // Does this topic have some events linked to it? | |
134 if (!empty($context['linked_calendar_events'])) | |
135 { | |
136 echo ' | |
137 <div class="linked_events"> | |
138 <div class="title_bar"> | |
139 <h3 class="titlebg headerpadding">', $txt['calendar_linked_events'], '</h3> | |
140 </div> | |
141 <div class="windowbg"> | |
142 <span class="topslice"><span></span></span> | |
143 <div class="content"> | |
144 <ul class="reset">'; | |
145 | |
146 foreach ($context['linked_calendar_events'] as $event) | |
147 echo ' | |
148 <li> | |
149 ', ($event['can_edit'] ? '<a href="' . $event['modify_href'] . '"> <img src="' . $settings['images_url'] . '/icons/modify_small.gif" alt="" title="' . $txt['modify'] . '" class="edit_event" /></a> ' : ''), '<strong>', $event['title'], '</strong>: ', $event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : ''), ' | |
150 </li>'; | |
151 | |
152 echo ' | |
153 </ul> | |
154 </div> | |
155 <span class="botslice"><span></span></span> | |
156 </div> | |
157 </div>'; | |
158 } | |
159 | |
160 // Build the normal button array. | |
161 $normal_buttons = array( | |
162 'reply' => array('test' => 'can_reply', 'text' => 'reply', 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';last_msg=' . $context['topic_last_message'], 'active' => true), | |
163 'add_poll' => array('test' => 'can_add_poll', 'text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start']), | |
164 '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_topic'] : $txt['notification_enable_topic']) . '\');"', 'url' => $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), | |
165 'mark_unread' => array('test' => 'can_mark_unread', 'text' => 'mark_unread', 'image' => 'markunread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), | |
166 'send' => array('test' => 'can_send_topic', 'text' => 'send_topic', 'image' => 'sendtopic.gif', 'lang' => true, 'url' => $scripturl . '?action=emailuser;sa=sendtopic;topic=' . $context['current_topic'] . '.0'), | |
167 'print' => array('text' => 'print', 'image' => 'print.gif', 'lang' => true, 'custom' => 'rel="new_win nofollow"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'), | |
168 ); | |
169 | |
170 // Allow adding new buttons easily. | |
171 call_integration_hook('integrate_display_buttons', array(&$normal_buttons)); | |
172 | |
173 // Show the page index... "Pages: [1]". | |
174 echo ' | |
175 <div class="pagesection"> | |
176 <div class="nextlinks">', $context['previous_next'], '</div>', template_button_strip($normal_buttons, 'right'), ' | |
177 <div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' <a href="#lastPost"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div> | |
178 </div>'; | |
179 | |
180 // Show the topic information - icon, subject, etc. | |
181 echo ' | |
182 <div id="forumposts"> | |
183 <div class="cat_bar"> | |
184 <h3 class="catbg"> | |
185 <img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" /> | |
186 <span id="author">', $txt['author'], '</span> | |
187 ', $txt['topic'], ': ', $context['subject'], ' (', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ') | |
188 </h3> | |
189 </div>'; | |
190 | |
191 if (!empty($settings['display_who_viewing'])) | |
192 { | |
193 echo ' | |
194 <p id="whoisviewing" class="smalltext">'; | |
195 | |
196 // Show just numbers...? | |
197 if ($settings['display_who_viewing'] == 1) | |
198 echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members']; | |
199 // Or show the actual people viewing the topic? | |
200 else | |
201 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'] . ')'); | |
202 | |
203 // Now show how many guests are here too. | |
204 echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], ' | |
205 </p>'; | |
206 } | |
207 | |
208 echo ' | |
209 <form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return oQuickModify.bInEditMode ? oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\') : false">'; | |
210 | |
211 $ignoredMsgs = array(); | |
212 $removableMessageIDs = array(); | |
213 $alternate = false; | |
214 | |
215 // Get all the messages... | |
216 while ($message = $context['get_message']()) | |
217 { | |
218 $ignoring = false; | |
219 $alternate = !$alternate; | |
220 if ($message['can_remove']) | |
221 $removableMessageIDs[] = $message['id']; | |
222 | |
223 // Are we ignoring this message? | |
224 if (!empty($message['is_ignored'])) | |
225 { | |
226 $ignoring = true; | |
227 $ignoredMsgs[] = $message['id']; | |
228 } | |
229 | |
230 // Show the message anchor and a "new" anchor if this message is new. | |
231 if ($message['id'] != $context['first_message']) | |
232 echo ' | |
233 <a id="msg', $message['id'], '"></a>', $message['first_new'] ? '<a id="new"></a>' : ''; | |
234 | |
235 echo ' | |
236 <div class="', $message['approved'] ? ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2') : 'approvebg', '"> | |
237 <span class="topslice"><span></span></span> | |
238 <div class="post_wrapper">'; | |
239 | |
240 // Show information about the poster of this message. | |
241 echo ' | |
242 <div class="poster"> | |
243 <h4>'; | |
244 | |
245 // Show online and offline buttons? | |
246 if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) | |
247 echo ' | |
248 ', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<img src="', $message['member']['online']['image_href'], '" alt="', $message['member']['online']['text'], '" />', $context['can_send_pm'] ? '</a>' : ''; | |
249 | |
250 // Show a link to the member's profile. | |
251 echo ' | |
252 ', $message['member']['link'], ' | |
253 </h4> | |
254 <ul class="reset smalltext" id="msg_', $message['id'], '_extra_info">'; | |
255 | |
256 // Show the member's custom title, if they have one. | |
257 if (!empty($message['member']['title'])) | |
258 echo ' | |
259 <li class="title">', $message['member']['title'], '</li>'; | |
260 | |
261 // Show the member's primary group (like 'Administrator') if they have one. | |
262 if (!empty($message['member']['group'])) | |
263 echo ' | |
264 <li class="membergroup">', $message['member']['group'], '</li>'; | |
265 | |
266 // Don't show these things for guests. | |
267 if (!$message['member']['is_guest']) | |
268 { | |
269 // Show the post group if and only if they have no other group or the option is on, and they are in a post group. | |
270 if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') | |
271 echo ' | |
272 <li class="postgroup">', $message['member']['post_group'], '</li>'; | |
273 echo ' | |
274 <li class="stars">', $message['member']['group_stars'], '</li>'; | |
275 | |
276 // Show avatars, images, etc.? | |
277 if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) | |
278 echo ' | |
279 <li class="avatar"> | |
280 <a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '"> | |
281 ', $message['member']['avatar']['image'], ' | |
282 </a> | |
283 </li>'; | |
284 | |
285 // Show how many posts they have made. | |
286 if (!isset($context['disabled_fields']['posts'])) | |
287 echo ' | |
288 <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>'; | |
289 | |
290 // Is karma display enabled? Total or +/-? | |
291 if ($modSettings['karmaMode'] == '1') | |
292 echo ' | |
293 <li class="karma">', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '</li>'; | |
294 elseif ($modSettings['karmaMode'] == '2') | |
295 echo ' | |
296 <li class="karma">', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '</li>'; | |
297 | |
298 // Is this user allowed to modify this member's karma? | |
299 if ($message['member']['karma']['allow']) | |
300 echo ' | |
301 <li class="karma_allow"> | |
302 <a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.' . $context['start'], ';m=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaApplaudLabel'], '</a> | |
303 <a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';m=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a> | |
304 </li>'; | |
305 | |
306 // Show the member's gender icon? | |
307 if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '' && !isset($context['disabled_fields']['gender'])) | |
308 echo ' | |
309 <li class="gender">', $txt['gender'], ': ', $message['member']['gender']['image'], '</li>'; | |
310 | |
311 // Show their personal text? | |
312 if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '') | |
313 echo ' | |
314 <li class="blurb">', $message['member']['blurb'], '</li>'; | |
315 | |
316 // Any custom fields to show as icons? | |
317 if (!empty($message['member']['custom_fields'])) | |
318 { | |
319 $shown = false; | |
320 foreach ($message['member']['custom_fields'] as $custom) | |
321 { | |
322 if ($custom['placement'] != 1 || empty($custom['value'])) | |
323 continue; | |
324 if (empty($shown)) | |
325 { | |
326 $shown = true; | |
327 echo ' | |
328 <li class="im_icons"> | |
329 <ul>'; | |
330 } | |
331 echo ' | |
332 <li>', $custom['value'], '</li>'; | |
333 } | |
334 if ($shown) | |
335 echo ' | |
336 </ul> | |
337 </li>'; | |
338 } | |
339 | |
340 // This shows the popular messaging icons. | |
341 if ($message['member']['has_messenger'] && $message['member']['can_view_profile']) | |
342 echo ' | |
343 <li class="im_icons"> | |
344 <ul> | |
345 ', !empty($message['member']['icq']['link']) ? '<li>' . $message['member']['icq']['link'] . '</li>' : '', ' | |
346 ', !empty($message['member']['msn']['link']) ? '<li>' . $message['member']['msn']['link'] . '</li>' : '', ' | |
347 ', !empty($message['member']['aim']['link']) ? '<li>' . $message['member']['aim']['link'] . '</li>' : '', ' | |
348 ', !empty($message['member']['yim']['link']) ? '<li>' . $message['member']['yim']['link'] . '</li>' : '', ' | |
349 </ul> | |
350 </li>'; | |
351 | |
352 // Show the profile, website, email address, and personal message buttons. | |
353 if ($settings['show_profile_buttons']) | |
354 { | |
355 echo ' | |
356 <li class="profile"> | |
357 <ul>'; | |
358 // Don't show the profile button if you're not allowed to view the profile. | |
359 if ($message['member']['can_view_profile']) | |
360 echo ' | |
361 <li><a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.gif" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '" />' : $txt['view_profile']), '</a></li>'; | |
362 | |
363 // Don't show an icon if they haven't specified a website. | |
364 if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) | |
365 echo ' | |
366 <li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $message['member']['website']['title'] . '" />' : $txt['www']), '</a></li>'; | |
367 | |
368 // Don't show the email address if they want it hidden. | |
369 if (in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum'))) | |
370 echo ' | |
371 <li><a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email']), '</a></li>'; | |
372 | |
373 // Since we know this person isn't a guest, you *can* message them. | |
374 if ($context['can_send_pm']) | |
375 echo ' | |
376 <li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '" />' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>'; | |
377 | |
378 echo ' | |
379 </ul> | |
380 </li>'; | |
381 } | |
382 | |
383 // Any custom fields for standard placement? | |
384 if (!empty($message['member']['custom_fields'])) | |
385 { | |
386 foreach ($message['member']['custom_fields'] as $custom) | |
387 if (empty($custom['placement']) || empty($custom['value'])) | |
388 echo ' | |
389 <li class="custom">', $custom['title'], ': ', $custom['value'], '</li>'; | |
390 } | |
391 | |
392 // Are we showing the warning status? | |
393 if ($message['member']['can_see_warning']) | |
394 echo ' | |
395 <li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<img src="', $settings['images_url'], '/warning_', $message['member']['warning_status'], '.gif" alt="', $txt['user_warn_' . $message['member']['warning_status']], '" />', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>'; | |
396 } | |
397 // Otherwise, show the guest's email. | |
398 elseif (!empty($message['member']['email']) && in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum'))) | |
399 echo ' | |
400 <li class="email"><a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email']), '</a></li>'; | |
401 | |
402 // Done with the information about the poster... on to the post itself. | |
403 echo ' | |
404 </ul> | |
405 </div> | |
406 <div class="postarea"> | |
407 <div class="flow_hidden"> | |
408 <div class="keyinfo"> | |
409 <div class="messageicon"> | |
410 <img src="', $message['icon_url'] . '" alt=""', $message['can_modify'] ? ' id="msg_icon_' . $message['id'] . '"' : '', ' /> | |
411 </div> | |
412 <h5 id="subject_', $message['id'], '"> | |
413 <a href="', $message['href'], '" rel="nofollow">', $message['subject'], '</a> | |
414 </h5> | |
415 <div class="smalltext">« <strong>', !empty($message['counter']) ? $txt['reply_noun'] . ' #' . $message['counter'] : '', ' ', $txt['on'], ':</strong> ', $message['time'], ' »</div> | |
416 <div id="msg_', $message['id'], '_quick_mod"></div> | |
417 </div>'; | |
418 | |
419 // If this is the first post, (#0) just say when it was posted - otherwise give the reply #. | |
420 if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) | |
421 echo ' | |
422 <ul class="reset smalltext quickbuttons">'; | |
423 | |
424 // Maybe we can approve it, maybe we should? | |
425 if ($message['can_approve']) | |
426 echo ' | |
427 <li class="approve_button"><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a></li>'; | |
428 | |
429 // Can they reply? Have they turned on quick reply? | |
430 if ($context['can_quote'] && !empty($options['display_quick_reply'])) | |
431 echo ' | |
432 <li class="quote_button"><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');">', $txt['quote'], '</a></li>'; | |
433 | |
434 // So... quick reply is off, but they *can* reply? | |
435 elseif ($context['can_quote']) | |
436 echo ' | |
437 <li class="quote_button"><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '">', $txt['quote'], '</a></li>'; | |
438 | |
439 // Can the user modify the contents of this post? | |
440 if ($message['can_modify']) | |
441 echo ' | |
442 <li class="modify_button"><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '">', $txt['modify'], '</a></li>'; | |
443 | |
444 // How about... even... remove it entirely?! | |
445 if ($message['can_remove']) | |
446 echo ' | |
447 <li class="remove_button"><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_message'], '?\');">', $txt['remove'], '</a></li>'; | |
448 | |
449 // What about splitting it off the rest of the topic? | |
450 if ($context['can_split'] && !empty($context['real_num_replies'])) | |
451 echo ' | |
452 <li class="split_button"><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '">', $txt['split'], '</a></li>'; | |
453 | |
454 // Can we restore topics? | |
455 if ($context['can_restore_msg']) | |
456 echo ' | |
457 <li class="restore_button"><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['restore_message'], '</a></li>'; | |
458 | |
459 // Show a checkbox for quick moderation? | |
460 if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) | |
461 echo ' | |
462 <li class="inline_mod_check" style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>'; | |
463 | |
464 if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) | |
465 echo ' | |
466 </ul>'; | |
467 | |
468 echo ' | |
469 </div>'; | |
470 | |
471 // Ignoring this user? Hide the post. | |
472 if ($ignoring) | |
473 echo ' | |
474 <div id="msg_', $message['id'], '_ignored_prompt"> | |
475 ', $txt['ignoring_user'], ' | |
476 <a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a> | |
477 </div>'; | |
478 | |
479 // Show the post itself, finally! | |
480 echo ' | |
481 <div class="post">'; | |
482 | |
483 if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) | |
484 echo ' | |
485 <div class="approve_post"> | |
486 ', $txt['post_awaiting_approval'], ' | |
487 </div>'; | |
488 echo ' | |
489 <div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div> | |
490 </div>'; | |
491 | |
492 // Can the user modify the contents of this post? Show the modify inline image. | |
493 if ($message['can_modify']) | |
494 echo ' | |
495 <img src="', $settings['images_url'], '/icons/modify_inline.gif" alt="', $txt['modify_msg'], '" title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" style="cursor: ', ($context['browser']['is_ie5'] || $context['browser']['is_ie5.5'] ? 'hand' : 'pointer'), '; display: none;" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\')" />'; | |
496 | |
497 // Assuming there are attachments... | |
498 if (!empty($message['attachment'])) | |
499 { | |
500 echo ' | |
501 <div id="msg_', $message['id'], '_footer" class="attachments smalltext"> | |
502 <div style="overflow: ', $context['browser']['is_firefox'] ? 'visible' : 'auto', ';">'; | |
503 | |
504 $last_approved_state = 1; | |
505 foreach ($message['attachment'] as $attachment) | |
506 { | |
507 // Show a special box for unapproved attachments... | |
508 if ($attachment['is_approved'] != $last_approved_state) | |
509 { | |
510 $last_approved_state = 0; | |
511 echo ' | |
512 <fieldset> | |
513 <legend>', $txt['attach_awaiting_approve']; | |
514 | |
515 if ($context['can_approve']) | |
516 echo ' [<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]'; | |
517 | |
518 echo '</legend>'; | |
519 } | |
520 | |
521 if ($attachment['is_image']) | |
522 { | |
523 if ($attachment['thumbnail']['has_thumb']) | |
524 echo ' | |
525 <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" /></a><br />'; | |
526 else | |
527 echo ' | |
528 <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '"/><br />'; | |
529 } | |
530 echo ' | |
531 <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" /> ' . $attachment['name'] . '</a> '; | |
532 | |
533 if (!$attachment['is_approved'] && $context['can_approve']) | |
534 echo ' | |
535 [<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>] | [<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] '; | |
536 echo ' | |
537 (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />'; | |
538 } | |
539 | |
540 // If we had unapproved attachments clean up. | |
541 if ($last_approved_state == 0) | |
542 echo ' | |
543 </fieldset>'; | |
544 | |
545 echo ' | |
546 </div> | |
547 </div>'; | |
548 } | |
549 | |
550 echo ' | |
551 </div> | |
552 <div class="moderatorbar"> | |
553 <div class="smalltext modified" id="modified_', $message['id'], '">'; | |
554 | |
555 // Show "� Last Edit: Time by Person �" if this post was edited. | |
556 if ($settings['show_modify'] && !empty($message['modified']['name'])) | |
557 echo ' | |
558 « <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> »'; | |
559 | |
560 echo ' | |
561 </div> | |
562 <div class="smalltext reportlinks">'; | |
563 | |
564 // Maybe they want to report this post to the moderator(s)? | |
565 if ($context['can_report_moderator']) | |
566 echo ' | |
567 <a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a> '; | |
568 | |
569 // Can we issue a warning because of this post? Remember, we can't give guests warnings. | |
570 if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) | |
571 echo ' | |
572 <a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '"><img src="', $settings['images_url'], '/warn.gif" alt="', $txt['issue_warning_post'], '" title="', $txt['issue_warning_post'], '" /></a>'; | |
573 echo ' | |
574 <img src="', $settings['images_url'], '/ip.gif" alt="" />'; | |
575 | |
576 // Show the IP to this user for this post - because you can moderate? | |
577 if ($context['can_moderate_forum'] && !empty($message['member']['ip'])) | |
578 echo ' | |
579 <a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqWin(this.href);" class="help">(?)</a>'; | |
580 // Or, should we show it because this is you? | |
581 elseif ($message['can_see_ip']) | |
582 echo ' | |
583 <a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $message['member']['ip'], '</a>'; | |
584 // Okay, are you at least logged in? Then we can show something about why IPs are logged... | |
585 elseif (!$context['user']['is_guest']) | |
586 echo ' | |
587 <a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $txt['logged'], '</a>'; | |
588 // Otherwise, you see NOTHING! | |
589 else | |
590 echo ' | |
591 ', $txt['logged']; | |
592 | |
593 echo ' | |
594 </div>'; | |
595 | |
596 // Are there any custom profile fields for above the signature? | |
597 if (!empty($message['member']['custom_fields'])) | |
598 { | |
599 $shown = false; | |
600 foreach ($message['member']['custom_fields'] as $custom) | |
601 { | |
602 if ($custom['placement'] != 2 || empty($custom['value'])) | |
603 continue; | |
604 if (empty($shown)) | |
605 { | |
606 $shown = true; | |
607 echo ' | |
608 <div class="custom_fields_above_signature"> | |
609 <ul class="reset nolist">'; | |
610 } | |
611 echo ' | |
612 <li>', $custom['value'], '</li>'; | |
613 } | |
614 if ($shown) | |
615 echo ' | |
616 </ul> | |
617 </div>'; | |
618 } | |
619 | |
620 // Show the member's signature? | |
621 if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) | |
622 echo ' | |
623 <div class="signature" id="msg_', $message['id'], '_signature">', $message['member']['signature'], '</div>'; | |
624 | |
625 echo ' | |
626 </div> | |
627 </div> | |
628 <span class="botslice"><span></span></span> | |
629 </div> | |
630 <hr class="post_separator" />'; | |
631 } | |
632 | |
633 echo ' | |
634 </form> | |
635 </div> | |
636 <a id="lastPost"></a>'; | |
637 | |
638 // Show the page index... "Pages: [1]". | |
639 echo ' | |
640 <div class="pagesection"> | |
641 ', template_button_strip($normal_buttons, 'right'), ' | |
642 <div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' <a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div> | |
643 <div class="nextlinks_bottom">', $context['previous_next'], '</div> | |
644 </div>'; | |
645 | |
646 // Show the lower breadcrumbs. | |
647 theme_linktree(); | |
648 | |
649 $mod_buttons = array( | |
650 'move' => array('test' => 'can_move', 'text' => 'move_topic', 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'), | |
651 'delete' => array('test' => 'can_delete', 'text' => 'remove_topic', 'image' => 'admin_rem.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['are_sure_remove_topic'] . '\');"', 'url' => $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.0;' . $context['session_var'] . '=' . $context['session_id']), | |
652 'lock' => array('test' => 'can_lock', 'text' => empty($context['is_locked']) ? 'set_lock' : 'set_unlock', 'image' => 'admin_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), | |
653 'sticky' => array('test' => 'can_sticky', 'text' => empty($context['is_sticky']) ? 'set_sticky' : 'set_nonsticky', 'image' => 'admin_sticky.gif', 'lang' => true, 'url' => $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), | |
654 'merge' => array('test' => 'can_merge', 'text' => 'merge', 'image' => 'merge.gif', 'lang' => true, 'url' => $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic']), | |
655 'calendar' => array('test' => 'calendar_post', 'text' => 'calendar_link', 'image' => 'linktocal.gif', 'lang' => true, 'url' => $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0'), | |
656 ); | |
657 | |
658 // Restore topic. eh? No monkey business. | |
659 if ($context['can_restore_topic']) | |
660 $mod_buttons[] = array('text' => 'restore_topic', 'image' => '', 'lang' => true, 'url' => $scripturl . '?action=restoretopic;topics=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']); | |
661 | |
662 // Allow adding new mod buttons easily. | |
663 call_integration_hook('integrate_mod_buttons', array(&$mod_buttons)); | |
664 | |
665 echo ' | |
666 <div id="moderationbuttons">', template_button_strip($mod_buttons, 'bottom', array('id' => 'moderationbuttons_strip')), '</div>'; | |
667 | |
668 // Show the jumpto box, or actually...let Javascript do it. | |
669 echo ' | |
670 <div class="plainbox" id="display_jump_to"> </div>'; | |
671 | |
672 if ($context['can_reply'] && !empty($options['display_quick_reply'])) | |
673 { | |
674 echo ' | |
675 <a id="quickreply"></a> | |
676 <div class="tborder" id="quickreplybox"> | |
677 <div class="cat_bar"> | |
678 <h3 class="catbg"> | |
679 <span class="ie6_header floatleft"><a href="javascript:oQuickReply.swap();"> | |
680 <img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" id="quickReplyExpand" class="icon" /> | |
681 </a> | |
682 <a href="javascript:oQuickReply.swap();">', $txt['quick_reply'], '</a> | |
683 </span> | |
684 </h3> | |
685 </div> | |
686 <div id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '> | |
687 <span class="upperframe"><span></span></span> | |
688 <div class="roundframe"> | |
689 <p class="smalltext lefttext">', $txt['quick_reply_desc'], '</p> | |
690 ', $context['is_locked'] ? '<p class="alert smalltext">' . $txt['quick_reply_warning'] . '</p>' : '', | |
691 $context['oldTopicError'] ? '<p class="alert smalltext">' . sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']) . '</p>' : '', ' | |
692 ', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', ' | |
693 ', !$context['can_reply_approved'] && $context['require_verification'] ? '<br />' : '', ' | |
694 <form action="', $scripturl, '?board=', $context['current_board'], ';action=post2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;"> | |
695 <input type="hidden" name="topic" value="', $context['current_topic'], '" /> | |
696 <input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '" /> | |
697 <input type="hidden" name="icon" value="xx" /> | |
698 <input type="hidden" name="from_qr" value="1" /> | |
699 <input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" /> | |
700 <input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '" /> | |
701 <input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" /> | |
702 <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '" /> | |
703 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
704 <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />'; | |
705 | |
706 // Guests just need more. | |
707 if ($context['user']['is_guest']) | |
708 echo ' | |
709 <strong>', $txt['name'], ':</strong> <input type="text" name="guestname" value="', $context['name'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /> | |
710 <strong>', $txt['email'], ':</strong> <input type="text" name="email" value="', $context['email'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /><br />'; | |
711 | |
712 // Is visual verification enabled? | |
713 if ($context['require_verification']) | |
714 echo ' | |
715 <strong>', $txt['verification'], ':</strong>', template_control_verification($context['visual_verification_id'], 'quick_reply'), '<br />'; | |
716 | |
717 echo ' | |
718 <div class="quickReplyContent"> | |
719 <textarea cols="600" rows="7" name="message" tabindex="', $context['tabindex']++, '"></textarea> | |
720 </div> | |
721 <div class="righttext padding"> | |
722 <input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="', $context['tabindex']++, '" class="button_submit" /> | |
723 <input type="submit" name="preview" value="', $txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />'; | |
724 | |
725 if ($context['show_spellchecking']) | |
726 echo ' | |
727 <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="', $context['tabindex']++, '" class="button_submit" />'; | |
728 | |
729 echo ' | |
730 </div> | |
731 </form> | |
732 </div> | |
733 <span class="lowerframe"><span></span></span> | |
734 </div> | |
735 </div>'; | |
736 } | |
737 else | |
738 echo ' | |
739 <br class="clear" />'; | |
740 | |
741 if ($context['show_spellchecking']) | |
742 echo ' | |
743 <form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form> | |
744 <script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/spellcheck.js"></script>'; | |
745 | |
746 echo ' | |
747 <script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/topic.js"></script> | |
748 <script type="text/javascript"><!-- // --><![CDATA['; | |
749 | |
750 if (!empty($options['display_quick_reply'])) | |
751 echo ' | |
752 var oQuickReply = new QuickReply({ | |
753 bDefaultCollapsed: ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true', ', | |
754 iTopicId: ', $context['current_topic'], ', | |
755 iStart: ', $context['start'], ', | |
756 sScriptUrl: smf_scripturl, | |
757 sImagesUrl: "', $settings['images_url'], '", | |
758 sContainerId: "quickReplyOptions", | |
759 sImageId: "quickReplyExpand", | |
760 sImageCollapsed: "collapse.gif", | |
761 sImageExpanded: "expand.gif", | |
762 sJumpAnchor: "quickreply" | |
763 });'; | |
764 | |
765 if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post']) | |
766 echo ' | |
767 var oInTopicModeration = new InTopicModeration({ | |
768 sSelf: \'oInTopicModeration\', | |
769 sCheckboxContainerMask: \'in_topic_mod_check_\', | |
770 aMessageIds: [\'', implode('\', \'', $removableMessageIDs), '\'], | |
771 sSessionId: \'', $context['session_id'], '\', | |
772 sSessionVar: \'', $context['session_var'], '\', | |
773 sButtonStrip: \'moderationbuttons\', | |
774 sButtonStripDisplay: \'moderationbuttons_strip\', | |
775 bUseImageButton: false, | |
776 bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ', | |
777 sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\', | |
778 sRemoveButtonImage: \'delete_selected.gif\', | |
779 sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\', | |
780 bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ', | |
781 sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\', | |
782 sRestoreButtonImage: \'restore_selected.gif\', | |
783 sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\', | |
784 sFormId: \'quickModForm\' | |
785 });'; | |
786 | |
787 echo ' | |
788 if (\'XMLHttpRequest\' in window) | |
789 { | |
790 var oQuickModify = new QuickModify({ | |
791 sScriptUrl: smf_scripturl, | |
792 bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ', | |
793 iTopicId: ', $context['current_topic'], ', | |
794 sTemplateBodyEdit: ', JavaScriptEscape(' | |
795 <div id="quick_edit_body_container" style="width: 90%"> | |
796 <div id="error_box" style="padding: 4px;" class="error"></div> | |
797 <textarea class="editor" name="message" rows="12" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 100%; min-width: 100%' : 'width: 100%') . '; margin-bottom: 10px;" tabindex="' . $context['tabindex']++ . '">%body%</textarea><br /> | |
798 <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" /> | |
799 <input type="hidden" name="topic" value="' . $context['current_topic'] . '" /> | |
800 <input type="hidden" name="msg" value="%msg_id%" /> | |
801 <div class="righttext"> | |
802 <input type="submit" name="post" value="' . $txt['save'] . '" tabindex="' . $context['tabindex']++ . '" onclick="return oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\');" accesskey="s" class="button_submit" /> ' . ($context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" tabindex="' . $context['tabindex']++ . '" onclick="spellCheck(\'quickModForm\', \'message\');" class="button_submit" /> ' : '') . '<input type="submit" name="cancel" value="' . $txt['modify_cancel'] . '" tabindex="' . $context['tabindex']++ . '" onclick="return oQuickModify.modifyCancel();" class="button_submit" /> | |
803 </div> | |
804 </div>'), ', | |
805 sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 90%;" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />'), ', | |
806 sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ', | |
807 sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ', | |
808 sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ': %subject% (' . $txt['read'] . ' ' . $context['num_views'] . ' ' . $txt['times'] . ')'), ', | |
809 sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), ' | |
810 }); | |
811 | |
812 aJumpTo[aJumpTo.length] = new JumpTo({ | |
813 sContainerId: "display_jump_to", | |
814 sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%", | |
815 iCurBoardId: ', $context['current_board'], ', | |
816 iCurBoardChildLevel: ', $context['jump_to']['child_level'], ', | |
817 sCurBoardName: "', $context['jump_to']['board_name'], '", | |
818 sBoardChildLevelIndicator: "==", | |
819 sBoardPrefix: "=> ", | |
820 sCatSeparator: "-----------------------------", | |
821 sCatPrefix: "", | |
822 sGoButtonLabel: "', $txt['go'], '" | |
823 }); | |
824 | |
825 aIconLists[aIconLists.length] = new IconList({ | |
826 sBackReference: "aIconLists[" + aIconLists.length + "]", | |
827 sIconIdPrefix: "msg_icon_", | |
828 sScriptUrl: smf_scripturl, | |
829 bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ', | |
830 iBoardId: ', $context['current_board'], ', | |
831 iTopicId: ', $context['current_topic'], ', | |
832 sSessionId: "', $context['session_id'], '", | |
833 sSessionVar: "', $context['session_var'], '", | |
834 sLabelIconList: "', $txt['message_icon'], '", | |
835 sBoxBackground: "transparent", | |
836 sBoxBackgroundHover: "#ffffff", | |
837 iBoxBorderWidthHover: 1, | |
838 sBoxBorderColorHover: "#adadad" , | |
839 sContainerBackground: "#ffffff", | |
840 sContainerBorder: "1px solid #adadad", | |
841 sItemBorder: "1px solid #ffffff", | |
842 sItemBorderHover: "1px dotted gray", | |
843 sItemBackground: "transparent", | |
844 sItemBackgroundHover: "#e0e0f0" | |
845 }); | |
846 }'; | |
847 | |
848 if (!empty($ignoredMsgs)) | |
849 { | |
850 echo ' | |
851 var aIgnoreToggles = new Array();'; | |
852 | |
853 foreach ($ignoredMsgs as $msgid) | |
854 { | |
855 echo ' | |
856 aIgnoreToggles[', $msgid, '] = new smc_Toggle({ | |
857 bToggleEnabled: true, | |
858 bCurrentlyCollapsed: true, | |
859 aSwappableContainers: [ | |
860 \'msg_', $msgid, '_extra_info\', | |
861 \'msg_', $msgid, '\', | |
862 \'msg_', $msgid, '_footer\', | |
863 \'msg_', $msgid, '_quick_mod\', | |
864 \'modify_button_', $msgid, '\', | |
865 \'msg_', $msgid, '_signature\' | |
866 | |
867 ], | |
868 aSwapLinks: [ | |
869 { | |
870 sId: \'msg_', $msgid, '_ignored_link\', | |
871 msgExpanded: \'\', | |
872 msgCollapsed: ', JavaScriptEscape($txt['show_ignore_user_post']), ' | |
873 } | |
874 ] | |
875 });'; | |
876 } | |
877 } | |
878 | |
879 echo ' | |
880 // ]]></script>'; | |
881 } | |
882 | |
883 ?> |