Mercurial > hg > vamp-website
comparison forum/Themes/classic/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 // Version: 1.1.12; Display | |
3 | |
4 function template_main() | |
5 { | |
6 global $context, $settings, $options, $txt, $scripturl, $modSettings; | |
7 | |
8 // Show the anchor for the top and for the first message. If the first message is new, say so. | |
9 echo ' | |
10 <a name="top"></a> | |
11 <a name="msg', $context['first_message'], '"></a>', $context['first_new_message'] ? '<a name="new"></a>' : ''; | |
12 | |
13 // Show the linktree as well as the "Who's Viewing" information. | |
14 echo ' | |
15 <table width="100%" cellpadding="3" cellspacing="0"> | |
16 <tr> | |
17 <td valign="bottom">', theme_linktree(), '</td>'; | |
18 if (!empty($settings['display_who_viewing'])) | |
19 { | |
20 echo ' | |
21 <td align="center" class="smalltext">'; | |
22 | |
23 // Show just numbers...? | |
24 if ($settings['display_who_viewing'] == 1) | |
25 echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt[19]; | |
26 // Or show the actual people viewing the topic? | |
27 else | |
28 echo empty($context['view_members_list']) ? '0 ' . $txt[19] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); | |
29 | |
30 // Now show how many guests are here too. | |
31 echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '</td>'; | |
32 } | |
33 | |
34 // Show the previous/next links. | |
35 echo ' | |
36 <td valign="bottom" align="right" class="smalltext"> | |
37 <span class="nav">', $context['previous_next'], '</span> | |
38 </td> | |
39 </tr> | |
40 </table>'; | |
41 | |
42 // Show the page index... "Pages: [1]". | |
43 echo ' | |
44 <table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="border-bottom: 0;"> | |
45 <tr> | |
46 <td align="left" class="catbg" width="100%" height="35"> | |
47 <table cellpadding="3" cellspacing="0" width="100%"> | |
48 <tr> | |
49 <td> | |
50 <b>', $txt[139], ':</b> ', $context['page_index']; | |
51 | |
52 // Show a "go down" link? | |
53 if (!empty($modSettings['topbottomEnable'])) | |
54 echo $context['menu_separator'], '<a href="#bot">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/go_down.gif" alt="' . $txt['topbottom5'] . '" border="0" align="top" />' : $txt['topbottom5'], '</a>'; | |
55 | |
56 echo ' | |
57 </td> | |
58 <td align="right" style="font-size: smaller;">', theme_show_main_buttons(), '</td> | |
59 </tr> | |
60 </table> | |
61 </td> | |
62 </tr> | |
63 </table>'; | |
64 | |
65 // Is this topic also a poll? | |
66 if ($context['is_poll']) | |
67 { | |
68 echo ' | |
69 <table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="border-bottom: 0;"> | |
70 <tr class="titlebg"> | |
71 <td colspan="2" valign="middle" align="left" style="padding-left: 6px;"> | |
72 <img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="top" /> ', $txt['smf43'], ' | |
73 </td> | |
74 </tr> | |
75 <tr class="windowbg"> | |
76 <td width="5%" valign="top"><b>', $txt['smf21'], ':</b></td> | |
77 <td> | |
78 ', $context['poll']['question']; | |
79 | |
80 // Are they not allowed to vote but allowed to view the options? | |
81 if ($context['poll']['show_results'] || !$context['allow_vote']) | |
82 { | |
83 echo ' | |
84 <table> | |
85 <tr> | |
86 <td style="padding-top: 2ex;"> | |
87 <table border="0" cellpadding="0" cellspacing="0">'; | |
88 | |
89 // Show each option with its corresponding percentage bar. | |
90 foreach ($context['poll']['options'] as $option) | |
91 echo ' | |
92 <tr> | |
93 <td', $option['voted_this'] ? ' style="font-weight: bold;"' : '', '>', $option['option'], '</td>', $context['allow_poll_view'] ? ' | |
94 <td width="7"> </td> | |
95 <td nowrap="nowrap">' . $option['bar'] . $option['votes'] . ' (' . $option['percent'] . '%)</td>' : '', ' | |
96 </tr>'; | |
97 | |
98 echo ' | |
99 </table> | |
100 </td> | |
101 <td valign="bottom" style="padding-left: 15px;">'; | |
102 | |
103 // If they are allowed to revote - show them a link! | |
104 if ($context['allow_change_vote']) | |
105 echo ' | |
106 <a href="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], ';sesc=', $context['session_id'], '">', $txt['poll_change_vote'], '</a><br />'; | |
107 | |
108 // If we're viewing the results... maybe we want to go back and vote? | |
109 if ($context['poll']['show_results'] && $context['allow_vote']) | |
110 echo ' | |
111 <a href="', $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], '">', $txt['poll_return_vote'], '</a><br />'; | |
112 | |
113 // If they're allowed to lock the poll, show a link! | |
114 if ($context['poll']['lock']) | |
115 echo ' | |
116 <a href="', $scripturl, '?action=lockVoting;topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', !$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b'], '</a><br />'; | |
117 | |
118 // If they're allowed to edit the poll... guess what... show a link! | |
119 if ($context['poll']['edit']) | |
120 echo ' | |
121 <a href="', $scripturl, '?action=editpoll;topic=', $context['current_topic'], '.', $context['start'], '">', $txt['smf39'], '</a>'; | |
122 | |
123 echo ' | |
124 </td> | |
125 </tr>', $context['allow_poll_view'] ? ' | |
126 <tr> | |
127 <td colspan="2"><b>' . $txt['smf24'] . ': ' . $context['poll']['total_votes'] . '</b></td> | |
128 </tr>' : '', ' | |
129 </table><br />'; | |
130 } | |
131 // They are allowed to vote! Go to it! | |
132 else | |
133 { | |
134 echo ' | |
135 <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '" style="margin: 0px;"> | |
136 <table> | |
137 <tr> | |
138 <td colspan="2">'; | |
139 | |
140 // Show a warning if they are allowed more than one option. | |
141 if ($context['poll']['allowed_warning']) | |
142 echo ' | |
143 ', $context['poll']['allowed_warning'], ' | |
144 </td> | |
145 </tr><tr> | |
146 <td>'; | |
147 | |
148 // Show each option with its button - a radio likely. | |
149 foreach ($context['poll']['options'] as $option) | |
150 echo ' | |
151 <label for="', $option['id'], '">', $option['vote_button'], ' ', $option['option'], '</label><br />'; | |
152 | |
153 echo ' | |
154 </td> | |
155 <td valign="bottom" style="padding-left: 15px;">'; | |
156 | |
157 // Allowed to view the results? (without voting!) | |
158 if ($context['allow_poll_view']) | |
159 echo ' | |
160 <a href="', $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], ';viewResults">', $txt['smf29'], '</a><br />'; | |
161 | |
162 // Show a link for locking the poll as well... | |
163 if ($context['poll']['lock']) | |
164 echo ' | |
165 <a href="', $scripturl, '?action=lockVoting;topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', (!$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b']), '</a><br />'; | |
166 | |
167 // Want to edit it? Click right here...... | |
168 if ($context['poll']['edit']) | |
169 echo ' | |
170 <a href="', $scripturl, '?action=editpoll;topic=', $context['current_topic'], '.', $context['start'], '">', $txt['smf39'], '</a>'; | |
171 | |
172 echo ' | |
173 </td> | |
174 </tr><tr> | |
175 <td colspan="2"><input type="submit" value="', $txt['smf23'], '" /></td> | |
176 </tr> | |
177 </table> | |
178 <input type="hidden" name="sc" value="', $context['session_id'], '" /> | |
179 </form>'; | |
180 } | |
181 | |
182 echo ' | |
183 </td> | |
184 </tr> | |
185 </table>'; | |
186 } | |
187 | |
188 // Does this topic have some events linked to it? | |
189 if (!empty($context['linked_calendar_events'])) | |
190 { | |
191 echo ' | |
192 <table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder"> | |
193 <tr class="titlebg"> | |
194 <td colspan="2" valign="middle" align="left" style="padding-left: 6px;"> | |
195 ', $txt['calendar_linked_events'], ' | |
196 </td> | |
197 </tr> | |
198 <tr class="windowbg"> | |
199 <td width="5%" valign="top"> | |
200 <ul>'; | |
201 foreach ($context['linked_calendar_events'] as $event) | |
202 { | |
203 echo ' | |
204 <li> | |
205 <b>', ($event['can_edit'] ? '<a href="' . $event['modify_href'] . '" style="color: red;">*</a> ' : ''), $event['title'], '</b>: ', $event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : ''); | |
206 echo ' | |
207 </li>'; | |
208 } | |
209 echo ' | |
210 </ul> | |
211 </td> | |
212 </tr> | |
213 </table>'; | |
214 } | |
215 | |
216 // Show the topic information - icon, subject, etc. | |
217 echo ' | |
218 <table cellpadding="3" cellspacing="0" border="0" width="100%" align="center" class="tborder" style="border-bottom: 0;"> | |
219 <tr class="titlebg"> | |
220 <td valign="middle" align="left" width="15%" style="padding-left: 6px;"> | |
221 <img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" alt="" /> | |
222 ', $txt[29], ' | |
223 </td> | |
224 <td valign="middle" align="left" width="85%" style="padding-left: 6px;" id="top_subject"> | |
225 ', $txt[118], ': ', $context['subject'], ' (', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ') | |
226 </td> | |
227 </tr> | |
228 </table>'; | |
229 | |
230 //if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post']) | |
231 echo ' | |
232 <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 in_edit_mode == 1 ? modify_save(\'' . $context['session_id'] . '\') : confirm(\'' . $txt['quickmod_confirm'] . '\');">'; | |
233 | |
234 echo ' | |
235 <table cellpadding="0" cellspacing="0" border="0" width="100%" class="bordercolor">'; | |
236 | |
237 // Get all the messages... | |
238 while ($message = $context['get_message']()) | |
239 { | |
240 echo ' | |
241 <tr><td style="padding: 1px 1px 0 1px;">'; | |
242 | |
243 // Show the message anchor and a "new" anchor if this message is new. | |
244 if ($message['id'] != $context['first_message']) | |
245 echo ' | |
246 <a name="msg', $message['id'], '"></a>', $message['first_new'] ? '<a name="new"></a>' : ''; | |
247 | |
248 echo ' | |
249 <table cellpadding="3" cellspacing="0" border="0" width="100%"> | |
250 <tr><td class="', $message['alternate'] == 0 ? 'windowbg' : 'windowbg2', '">'; | |
251 | |
252 // Show information about the poster of this message. | |
253 echo ' | |
254 <table width="100%" cellpadding="5" cellspacing="0"> | |
255 <tr> | |
256 <td valign="top" width="15%" rowspan="2"> | |
257 <b>', $message['member']['link'], '</b><br /> | |
258 <span class="smalltext">'; | |
259 | |
260 // Show the member's custom title, if they have one. | |
261 if (isset($message['member']['title']) && $message['member']['title'] != '') | |
262 echo ' | |
263 ', $message['member']['title'], '<br />'; | |
264 | |
265 // Show the member's primary group (like 'Administrator') if they have one. | |
266 if (isset($message['member']['group']) && $message['member']['group'] != '') | |
267 echo ' | |
268 ', $message['member']['group'], '<br />'; | |
269 | |
270 // Don't show these things for guests. | |
271 if (!$message['member']['is_guest']) | |
272 { | |
273 // 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. | |
274 if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') | |
275 echo ' | |
276 ', $message['member']['post_group'], '<br />'; | |
277 echo ' | |
278 ', $message['member']['group_stars'], '<br />'; | |
279 | |
280 // Is karma display enabled? Total or +/-? | |
281 if ($modSettings['karmaMode'] == '1') | |
282 echo ' | |
283 <br /> | |
284 ', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '<br />'; | |
285 elseif ($modSettings['karmaMode'] == '2') | |
286 echo ' | |
287 <br /> | |
288 ', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '<br />'; | |
289 | |
290 // Is this user allowed to modify this member's karma? | |
291 if ($message['member']['karma']['allow']) | |
292 echo ' | |
293 <a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.' . $context['start'], ';m=', $message['id'], ';sesc=', $context['session_id'], '">', $modSettings['karmaApplaudLabel'], '</a> | |
294 <a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';m=', $message['id'], ';sesc=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a><br />'; | |
295 | |
296 // Show online and offline buttons? | |
297 if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) | |
298 echo ' | |
299 ', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $message['member']['online']['image_href'] . '" alt="' . $message['member']['online']['text'] . '" border="0" align="middle" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '<br /><br />'; | |
300 | |
301 // Show the member's gender icon? | |
302 if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '') | |
303 echo ' | |
304 ', $txt[231], ': ', $message['member']['gender']['image'], '<br />'; | |
305 | |
306 // Show how many posts they have made. | |
307 echo ' | |
308 ', $txt[26], ': ', $message['member']['posts'], '<br /> | |
309 <br />'; | |
310 | |
311 // Show avatars, images, etc.? | |
312 if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) | |
313 echo ' | |
314 ', $message['member']['avatar']['image'], '<br />'; | |
315 | |
316 // Show their personal text? | |
317 if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '') | |
318 echo ' | |
319 ', $message['member']['blurb'], '<br /> | |
320 <br />'; | |
321 | |
322 // This shows the popular messaging icons. | |
323 echo ' | |
324 ', $message['member']['icq']['link'], ' | |
325 ', $message['member']['msn']['link'], ' | |
326 ', $message['member']['yim']['link'], ' | |
327 ', $message['member']['aim']['link'], '<br />'; | |
328 | |
329 // Show the profile, website, email address, and personal message buttons. | |
330 if ($settings['show_profile_buttons']) | |
331 { | |
332 // Don't show the profile button if you're not allowed to view the profile. | |
333 if ($message['member']['can_view_profile']) | |
334 echo ' | |
335 <a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.gif" alt="' . $txt[27] . '" title="' . $txt[27] . '" border="0" />' : $txt[27]), '</a>'; | |
336 | |
337 // Don't show an icon if they haven't specified a website. | |
338 if ($message['member']['website']['url'] != '') | |
339 echo ' | |
340 <a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $txt[515] . '" border="0" />' : $txt[515]), '</a>'; | |
341 | |
342 // Don't show the email address if they want it hidden. | |
343 if (empty($message['member']['hide_email'])) | |
344 echo ' | |
345 <a href="mailto:', $message['member']['email'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[69] . '" title="' . $txt[69] . '" border="0" />' : $txt[69]), '</a>'; | |
346 | |
347 // Since we know this person isn't a guest, you *can* message them. | |
348 if ($context['can_send_pm']) | |
349 echo ' | |
350 <a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['label'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . $message['member']['online']['label'] . '" border="0" />' : $message['member']['online']['label'], '</a>'; | |
351 } | |
352 } | |
353 // Otherwise, show the guest's email. | |
354 elseif (empty($message['member']['hide_email'])) | |
355 echo ' | |
356 <br /> | |
357 <br /> | |
358 <a href="mailto:', $message['member']['email'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[69] . '" title="' . $txt[69] . '" border="0" />' : $txt[69]), '</a>'; | |
359 | |
360 // Done with the information about the poster... on to the post itself. | |
361 echo ' | |
362 </span> | |
363 </td> | |
364 <td valign="top" width="85%" height="100%"> | |
365 <table width="100%" border="0"><tr> | |
366 <td align="left" valign="middle"><a href="', $message['href'], '"><img src="', $message['icon_url'] . '" alt="" border="0" /></a></td> | |
367 <td align="left" valign="middle"> | |
368 <div style="font-weight: bold;" id="subject_', $message['id'], '"> | |
369 <a href="', $message['href'], '">', $message['subject'], '</a> | |
370 </div>'; | |
371 | |
372 // If this is the first post, (#0) just say when it was posted - otherwise give the reply #. | |
373 echo ' | |
374 <span class="smalltext">« <b>', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' »</span></td> | |
375 <td align="right" valign="bottom" height="20" nowrap="nowrap" style="font-size: smaller;">'; | |
376 | |
377 // Can they reply? Have they turned on quick reply? | |
378 if ($context['can_reply'] && !empty($options['display_quick_reply'])) | |
379 echo ' | |
380 <a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '" onclick="doQuote(', $message['id'], ', \'', $context['session_id'], '\'); return false;">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>'; | |
381 // So... quick reply is off, but they *can* reply? | |
382 elseif ($context['can_reply']) | |
383 echo ' | |
384 <a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>'; | |
385 | |
386 // Can the user modify the contents of this post? | |
387 if ($message['can_modify']) | |
388 echo ' | |
389 <a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/modify.gif" alt="' . $txt[66] . '" border="0" />' : $txt[17]), '</a>'; | |
390 | |
391 // How about... even... remove it entirely?! | |
392 if ($message['can_remove']) | |
393 echo ' | |
394 <a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt[154], '?\');">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/delete.gif" alt="' . $txt[121] . '" border="0" />' : $txt[31]), '</a>'; | |
395 | |
396 // What about splitting it off the rest of the topic? | |
397 if ($context['can_split']) | |
398 echo ' | |
399 <a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/split.gif" alt="' . $txt['smf251'] . '" border="0" />' : $txt['smf251']), '</a>'; | |
400 | |
401 // Show a checkbox for quick moderation? | |
402 if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) | |
403 echo ' | |
404 <input type="checkbox" name="msgs[]" value="', $message['id'], '" class="check" />'; | |
405 | |
406 // Show the post itself, finally! | |
407 echo ' | |
408 </td> | |
409 </tr></table> | |
410 <hr width="100%" size="1" class="hrcolor" /> | |
411 <div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] ? ' | |
412 <img src="' . $settings['images_url'] . '/icons/modify_inline.gif" alt="" align="right" id="modify_button_' . $message['id'] . '" style="cursor: pointer;" onclick="modify_msg(\'' . $message['id'] . '\', \'' . $context['session_id'] . '\')" />' : '' , ' | |
413 </td> | |
414 </tr>'; | |
415 | |
416 // Now for the attachments, signature, ip logged, etc... | |
417 echo ' | |
418 <tr> | |
419 <td valign="bottom" class="smalltext"> | |
420 <table width="100%" border="0"><tr> | |
421 <td align="left" colspan="2" class="smalltext">'; | |
422 | |
423 // Assuming there are attachments... | |
424 if (!empty($message['attachment'])) | |
425 { | |
426 echo ' | |
427 <hr width="100%" size="1" class="hrcolor" />'; | |
428 | |
429 foreach ($message['attachment'] as $attachment) | |
430 { | |
431 if ($attachment['is_image']) | |
432 { | |
433 if ($attachment['thumbnail']['has_thumb']) | |
434 echo ' | |
435 <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />'; | |
436 else | |
437 echo ' | |
438 <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />'; | |
439 } | |
440 echo ' | |
441 <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" /> ' . $attachment['name'] . '</a> (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />'; | |
442 } | |
443 } | |
444 | |
445 echo ' | |
446 </td> | |
447 </tr><tr> | |
448 <td align="left" valign="bottom" class="smalltext" id="modified_', $message['id'], '">'; | |
449 | |
450 // Show "« Last Edit: Time by Person »" if this post was edited. | |
451 if ($settings['show_modify'] && !empty($message['modified']['name'])) | |
452 echo ' | |
453 « <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> »'; | |
454 | |
455 echo ' | |
456 </td> | |
457 <td align="right" valign="bottom" class="smalltext">'; | |
458 | |
459 // Maybe they want to report this post to the moderator(s)? | |
460 if ($context['can_report_moderator']) | |
461 echo ' | |
462 <a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['rtm1'], '</a> '; | |
463 echo ' | |
464 <img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />'; | |
465 | |
466 // Show the IP to this user for this post - because you can moderate? | |
467 if ($context['can_moderate_forum'] && !empty($message['member']['ip'])) | |
468 echo ' | |
469 <a href="', $scripturl, '?action=trackip;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>'; | |
470 // Or, should we show it because this is you? | |
471 elseif ($message['can_see_ip']) | |
472 echo ' | |
473 <a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $message['member']['ip'], '</a>'; | |
474 // Okay, are you at least logged in? Then we can show something about why IPs are logged... | |
475 elseif (!$context['user']['is_guest']) | |
476 echo ' | |
477 <a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $txt[511], '</a>'; | |
478 // Otherwise, you see NOTHING! | |
479 else | |
480 echo ' | |
481 ', $txt[511]; | |
482 | |
483 echo ' | |
484 </td> | |
485 </tr></table>'; | |
486 | |
487 // Show the member's signature? | |
488 if (!empty($message['member']['signature']) && empty($options['show_no_signatures'])) | |
489 echo ' | |
490 <hr width="100%" size="1" class="hrcolor" /> | |
491 <div class="signature">', $message['member']['signature'], '</div>'; | |
492 | |
493 echo ' | |
494 </td> | |
495 </tr> | |
496 </table> | |
497 </td></tr> | |
498 </table> | |
499 </td></tr>'; | |
500 } | |
501 echo ' | |
502 </table> | |
503 <a name="lastPost"></a> | |
504 <table border="0" width="100%" cellspacing="0" cellpadding="0" class="bordercolor"><tr><td> | |
505 <table width="100%" border="0" cellpadding="3" cellspacing="1" class="bordercolor"> | |
506 <tr> | |
507 <td align="left" class="catbg" width="100%" height="30"> | |
508 <table cellpadding="3" cellspacing="0" width="100%"> | |
509 <tr> | |
510 <td> | |
511 <a name="bot"></a><b>', $txt[139], ':</b> ', $context['page_index'], (!empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a href="#top">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/go_up.gif" alt="' . $txt['topbottom4'] . '" border="0" align="top" />' : $txt['topbottom4']) . '</a>' : ''), ' | |
512 </td> | |
513 <td align="right" style="font-size: smaller;"> | |
514 ', theme_show_main_buttons(), ' | |
515 </td> | |
516 </tr> | |
517 </table> | |
518 </td> | |
519 </tr> | |
520 </table> | |
521 </td></tr></table>'; | |
522 | |
523 if ($context['show_spellchecking']) | |
524 echo ' | |
525 <script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/spellcheck.js"></script>'; | |
526 | |
527 echo' | |
528 <script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/xml_topic.js"></script> | |
529 <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[ | |
530 quickReplyCollapsed = ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true', '; | |
531 | |
532 smf_topic = ', $context['current_topic'], '; | |
533 smf_start = ', $context['start'], '; | |
534 smf_show_modify = ', $settings['show_modify'] ? '1' : '0', '; | |
535 | |
536 // On quick modify, this is what the body will look like. | |
537 var smf_template_body_edit = \'<div id="error_box" style="padding: 4px; color: red;"></div><textarea class="editor" name="message" rows="12" style="width: 94%; margin-bottom: 10px;">%body%</textarea><br /><input type="hidden" name="sc" value="', $context['session_id'], '" /><input type="hidden" name="topic" value="', $context['current_topic'], '" /><input type="hidden" name="msg" value="%msg_id%" /><div style="text-align: center;"><input type="submit" name="post" value="', $txt[10], '" onclick="return modify_save(\\\'' . $context['session_id'] . '\\\');" accesskey="s" /> ', $context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" onclick="spellCheck(\\\'quickModForm\\\', \\\'message\\\');" /> ' : '', '<input type="submit" name="cancel" value="', $txt['modify_cancel'], '" onclick="return modify_cancel();" /></div>\'; | |
538 | |
539 // And this is the replacement for the subject. | |
540 var smf_template_subject_edit = \'<input type="text" name="subject" value="%subject%" size="60" style="width: 99%;" maxlength="80" />\'; | |
541 | |
542 // Restore the message to this after editing. | |
543 var smf_template_body_normal = \'%body%\'; | |
544 var smf_template_subject_normal = \'<a href="', $scripturl, '?topic=', $context['current_topic'], '.msg%msg_id%#msg%msg_id%">%subject%</a>\'; | |
545 var smf_template_top_subject = "', $txt[118], ': %subject% (', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')" | |
546 | |
547 if (window.XMLHttpRequest) | |
548 showModifyButtons(); | |
549 // ]]></script> | |
550 <table border="0" width="100%" cellpadding="0" cellspacing="0"> | |
551 <tr>'; | |
552 if ($settings['linktree_inline']) | |
553 echo ' | |
554 <td valign="top" align="left">', theme_linktree(), '</td> '; | |
555 echo ' | |
556 <td valign="top" align="right" class="smalltext"> <span class="nav"> ', $context['previous_next'], '</span></td> | |
557 </tr><tr> | |
558 <td align="left" colspan="2" style="padding-top: 4px;"> | |
559 ', theme_show_mod_buttons(), ' | |
560 </td> | |
561 </tr> | |
562 </table>'; | |
563 | |
564 // This button has an identity crisis: it wishes it were an image. (kinda like the characters in The Wizard of Oz.) | |
565 if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post']) | |
566 echo ' | |
567 <input type="hidden" name="sc" value="', $context['session_id'], '">'; | |
568 echo ' | |
569 </form>'; | |
570 | |
571 echo ' | |
572 <table border="0" width="100%"> | |
573 <tr> | |
574 <td align="right" colspan="2"> | |
575 <form action="', $scripturl, '" method="get" accept-charset="', $context['character_set'], '"> | |
576 <span class="smalltext">' . $txt[160] . ':</span> | |
577 <select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 && this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);"> | |
578 <option value="">' . $txt[251] . ':</option>'; | |
579 foreach ($context['jump_to'] as $category) | |
580 { | |
581 echo ' | |
582 <option value="" disabled="disabled">-----------------------------</option> | |
583 <option value="#', $category['id'], '">', $category['name'], '</option> | |
584 <option value="" disabled="disabled">-----------------------------</option>'; | |
585 foreach ($category['boards'] as $board) | |
586 echo ' | |
587 <option value="?board=', $board['id'], '.0"', $board['is_current'] ? ' selected="selected"' : '', '> ' . str_repeat('==', $board['child_level']) . '=> ' . $board['name'] . '</option>'; | |
588 } | |
589 echo ' | |
590 </select> | |
591 <input type="button" value="', $txt[161], '" onclick="if (this.form.jumpto.options[this.form.jumpto.selectedIndex].value) window.location.href = \'', $scripturl, '\' + this.form.jumpto.options[this.form.jumpto.selectedIndex].value;" /> | |
592 </form> | |
593 </td> | |
594 </tr> | |
595 </table>'; | |
596 | |
597 if ($context['can_reply'] && !empty($options['display_quick_reply'])) | |
598 { | |
599 echo ' | |
600 <a name="quickreply"></a> | |
601 <table border="0" cellspacing="1" cellpadding="3" class="bordercolor" width="100%" style="clear: both;"> | |
602 <tr> | |
603 <td colspan="2" class="catbg"><a href="javascript:swapQuickReply();"><img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" border="0" id="quickReplyExpand" /></a> <a href="javascript:swapQuickReply();">', $txt['quick_reply_1'], '</a></td> | |
604 </tr> | |
605 <tr id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '> | |
606 <td class="windowbg" width="25%" valign="top">', $txt['quick_reply_2'], $context['is_locked'] ? '<br /><br /><b>' . $txt['quick_reply_warning'] . '</b>' : '', '</td> | |
607 <td class="windowbg" width="75%" align="center"> | |
608 <form action="', $scripturl, '?action=post2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" style="margin:0px;"> | |
609 <input type="hidden" name="topic" value="' . $context['current_topic'] . '" /> | |
610 <input type="hidden" name="subject" value="' . $context['response_prefix'] . $context['subject'] . '" /> | |
611 <input type="hidden" name="icon" value="xx" /> | |
612 <input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" /> | |
613 <input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" /> | |
614 <input type="hidden" name="num_replies" value="', $context['num_replies'], '" /> | |
615 <textarea cols="75" rows="7" style="width: 95%; height: 100px;" name="message" tabindex="1"></textarea><br /> | |
616 <input type="submit" name="post" value="' . $txt[105] . '" accesskey="s" tabindex="2" /> | |
617 <input type="submit" name="preview" value="' . $txt[507] . '" accesskey="p" tabindex="4" />'; | |
618 if ($context['show_spellchecking']) | |
619 echo ' | |
620 <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" />'; | |
621 echo ' | |
622 <input type="hidden" name="sc" value="' . $context['session_id'] . '" /> | |
623 <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" /> | |
624 </form> | |
625 </td> | |
626 </tr> | |
627 </table>'; | |
628 } | |
629 if ($context['show_spellchecking']) | |
630 echo ' | |
631 <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>'; | |
632 | |
633 } | |
634 | |
635 function theme_show_main_buttons() | |
636 { | |
637 global $context, $settings, $options, $txt, $scripturl; | |
638 | |
639 $buttonArray = array(); | |
640 if ($context['can_reply']) | |
641 $buttonArray[] = '<a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]) . '</a>'; | |
642 if ($context['can_add_poll']) | |
643 $buttonArray[] = '<a href="' . $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/addpoll.gif" alt="' . $txt['add_poll'] . '" border="0" />' : $txt['add_poll']) . '</a>'; | |
644 if ($context['can_mark_notify']) | |
645 $buttonArray[] = '<a href="' . $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '" onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/notify.gif" alt="' . $txt[131] . '" border="0" />' : $txt[131]) . '</a>'; | |
646 if ($context['can_send_topic']) | |
647 $buttonArray[] = '<a href="' . $scripturl . '?action=sendtopic;topic=' . $context['current_topic'] . '.0">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/sendtopic.gif" alt="' . $txt[707] . '" border="0" />' : $txt[707]) . '</a>'; | |
648 $buttonArray[] = '<a href="' . $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0" target="_blank">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/print.gif" alt="' . $txt[465] . '" border="0" />' : $txt[465]) . '</a>'; | |
649 | |
650 return implode($context['menu_separator'], $buttonArray); | |
651 } | |
652 | |
653 function theme_show_mod_buttons() | |
654 { | |
655 global $context, $settings, $options, $txt, $scripturl, $modSettings; | |
656 | |
657 $moderationButtons = array(); | |
658 | |
659 if ($context['can_move']) | |
660 $moderationButtons[] = '<a href="' . $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_move.gif" alt="' . $txt[132] . '" border="0" />' : $txt[132]) . '</a>'; | |
661 if ($context['can_delete']) | |
662 $moderationButtons[] = '<a href="' . $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt[162] . '\');">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_rem.gif" alt="' . $txt[63] . '" border="0" />' : $txt[63]) . '</a>'; | |
663 if ($context['can_lock']) | |
664 $moderationButtons[] = '<a href="' . $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_lock.gif" alt="' . (empty($context['is_locked']) ? $txt['smf279'] : $txt['smf280']) . '" border="0" />' : (empty($context['is_locked']) ? $txt['smf279'] : $txt['smf280'])) . '</a>'; | |
665 if ($context['can_sticky']) | |
666 $moderationButtons[] = '<a href="' . $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_sticky.gif" alt="' . (empty($context['is_sticky']) ? $txt['smf277'] : $txt['smf278']) . '" border="0" />' : (empty($context['is_sticky']) ? $txt['smf277'] : $txt['smf278'])) . '</a>'; | |
667 if ($context['can_merge']) | |
668 $moderationButtons[] = '<a href="' . $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/merge.gif" alt="' . $txt['smf252'] . '" border="0" />' : $txt['smf252']) . '</a>'; | |
669 if ($context['can_remove_poll']) | |
670 $moderationButtons[] = '<a href="' . $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_remove_poll.gif" alt="' . $txt['poll_remove'] . '" border="0" />' : $txt['poll_remove']) . '</a>'; | |
671 | |
672 if ($context['calendar_post']) | |
673 $moderationButtons[] = '<a href="' . $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/linktocal.gif" alt="' . $txt['calendar37'] . '" border="0" />' : $txt['calendar37']) . '</a>'; | |
674 | |
675 if ($context['can_remove_post'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) | |
676 $moderationButtons[] = $settings['use_image_buttons'] ? '<input type="image" name="submit" src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/delete_selected.gif" alt="' . $txt['quickmod_delete_selected'] . '" style="background-color: transparent;" />' : '<a href="javascript:document.forms.quickModForm.submit();">' . $txt['quickmod_delete_selected'] . '</a>'; | |
677 | |
678 return implode($context['menu_separator'], $moderationButtons); | |
679 } | |
680 | |
681 ?> |