Advertisement
Guest User

Untitled

a guest
Nov 1st, 2011
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.66 KB | None | 0 0
  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 class="tborder marginbottom" id="poll">
  36. <h3 class="titlebg">
  37. <img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="bottom" /> ', $txt['poll'], '
  38. </h3>
  39. <h4 class="windowbg headerpadding" id="pollquestion">
  40. ', $context['poll']['question'], '
  41. </h4>
  42. <div class="windowbg clearfix" id="poll_options">';
  43.  
  44. // Are they not allowed to vote but allowed to view the options?
  45. if ($context['poll']['show_results'] || !$context['allow_vote'])
  46. {
  47. echo '
  48. <dl class="options">';
  49.  
  50. // Show each option with its corresponding percentage bar.
  51. foreach ($context['poll']['options'] as $option)
  52. echo '
  53. <dt class="middletext', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt>
  54. <dd class="middletext">', $context['allow_poll_view'] ? $option['bar'] . ' ' . $option['votes'] . ' (' . $option['percent'] . '%)' : '', '</dd>';
  55.  
  56. echo '
  57. </dl>';
  58.  
  59. if ($context['allow_poll_view'])
  60. echo '
  61. <p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>';
  62.  
  63. }
  64. // They are allowed to vote! Go to it!
  65. else
  66. {
  67. echo '
  68. <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">';
  69.  
  70. // Show a warning if they are allowed more than one option.
  71. if ($context['poll']['allowed_warning'])
  72. echo '
  73. <p class="smallpadding">', $context['poll']['allowed_warning'], '</p>';
  74.  
  75. echo '
  76. <ul class="reset options">';
  77.  
  78. // Show each option with its button - a radio likely.
  79. foreach ($context['poll']['options'] as $option)
  80. echo '
  81. <li class="middletext">', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>';
  82.  
  83. echo '
  84. </ul>
  85.  
  86. <div class="submitbutton', !empty($context['poll']['expire_time']) ? ' border' : '', '">
  87. <input type="submit" value="', $txt['poll_vote'], '" class="button_submit" />
  88. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  89. </div>
  90. </form>';
  91. }
  92.  
  93. // Is the clock ticking?
  94. if (!empty($context['poll']['expire_time']))
  95. echo '
  96. <p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>';
  97.  
  98. echo '
  99. </div>
  100. </div>
  101. <div id="pollmoderation" class="clearfix">';
  102.  
  103. // Build the poll moderation button array.
  104. $poll_buttons = array(
  105. 'vote' => array('test' => 'allow_return_vote', 'text' => 'poll_return_vote', 'image' => 'poll_options.gif', 'lang' => true, 'url' => $scripturl . '?topic=' . $context['current_topic'] . '.' . $context['start']),
  106. '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'),
  107. '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']),
  108. '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']),
  109. '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']),
  110. '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']),
  111. );
  112.  
  113. template_button_strip($poll_buttons);
  114.  
  115. echo '
  116. </div><br class="clear" />';
  117. }
  118.  
  119. // Does this topic have some events linked to it?
  120. if (!empty($context['linked_calendar_events']))
  121. {
  122. echo '
  123. <div class="linked_events">
  124. <h3 class="titlebg headerpadding">', $txt['calendar_linked_events'], '</h3>
  125. <div class="content windowbg">
  126. <ul class="reset">';
  127.  
  128. foreach ($context['linked_calendar_events'] as $event)
  129. echo '
  130. <li>
  131. ', ($event['can_edit'] ? '<a href="' . $event['modify_href'] . '" class="edit_event">*</a> ' : ''), '<strong>', $event['title'], '</strong>: ', $event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : ''), '
  132. </li>';
  133.  
  134. echo '
  135. </ul>
  136. </div>
  137. </div>';
  138. }
  139.  
  140. // Build the normal button array.
  141. $normal_buttons = array(
  142. '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']),
  143. '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']),
  144. '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']),
  145. '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']),
  146. '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'),
  147. 'print' => array('text' => 'print', 'image' => 'print.gif', 'lang' => true, 'custom' => 'rel="new_win nofollow"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),
  148. );
  149.  
  150. // Allow adding new buttons easily.
  151. call_integration_hook('integrate_display_buttons', array(&$normal_buttons));
  152.  
  153. // Show the page index... "Pages: [1]".
  154. echo '
  155. <div class="clearfix margintop" id="postbuttons">
  156. <div class="next">', $context['previous_next'], '</div>
  157. <div class="margintop middletext floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div>
  158. <div class="nav floatright">', template_button_strip($normal_buttons, 'bottom'), '</div>
  159. </div>';
  160.  
  161. // Show the topic information - icon, subject, etc.
  162. echo '
  163. <div id="forumposts" class="tborder">
  164. <h3 class="catbg3">
  165. <img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />
  166. <span>', $txt['author'], '</span>
  167. <span id="top_subject">', $txt['topic'], ': ', $context['subject'], ' &nbsp;(', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')</span>
  168. </h3>';
  169.  
  170. if (!empty($settings['display_who_viewing']))
  171. {
  172. echo '
  173. <div id="whoisviewing" class="smalltext headerpadding windowbg2">';
  174.  
  175. // Show just numbers...?
  176. if ($settings['display_who_viewing'] == 1)
  177. echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
  178. // Or show the actual people viewing the topic?
  179. else
  180. 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'] . ')');
  181.  
  182. // Now show how many guests are here too.
  183. echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
  184. </div>';
  185. }
  186.  
  187. echo '
  188. <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">';
  189.  
  190. // These are some cache image buttons we may want.
  191. $reply_button = create_button('quote.gif', 'reply', 'quote', 'align="middle"');
  192. $modify_button = create_button('modify.gif', 'modify', 'modify', 'align="middle"');
  193. $remove_button = create_button('delete.gif', 'remove', 'remove', 'align="middle"');
  194. $split_button = create_button('split.gif', 'split', 'split', 'align="middle"');
  195. $approve_button = create_button('approve.gif', 'approve', 'approve', 'align="middle"');
  196. $restore_message_button = create_button('restore_topic.gif', 'restore_message', 'restore_message', 'align="middle"');
  197.  
  198. $ignoredMsgs = array();
  199. $removableMessageIDs = array();
  200.  
  201. // Get all the messages...
  202. while ($message = $context['get_message']())
  203. {
  204. $is_first_post = !isset($is_first_post) ? true : false;
  205. $ignoring = false;
  206.  
  207. // If this post is a Bad Post take actions according to the theme settings.
  208. $gpbp_badPost = false;
  209. $gpbp_action = 'none';
  210. if ($context['gpbp_enabled'])
  211. {
  212. // Prepare the GP/BP button set.
  213. $gpbp_set = $modSettings['gpbp_button_set'];
  214. $gpbp_ext = empty($gpbp_set) ? 'gif' : 'png';
  215. $gpbp_badPost = $message['gpbp_score'] <= $modSettings['gpbp_hide_threshold'];
  216. if ($gpbp_badPost)
  217. {
  218. /* The 'gpbp_hide_action' option may have one out of three values:
  219. 0: by default hide post contents,
  220. 1: display greyed-out post contents,
  221. 2: display post contents regardless.
  222. Remember to force post display for certain Bad posts: own or chosen.
  223. */
  224. if (($message['member']['id'] == $context['user']['id'] && !$message['member']['is_guest']) || $message['id'] == $context['gpbp_revealed'])
  225. $gpbp_action = 'grey';
  226. else
  227. $gpbp_action = !empty($options['gpbp_hide_action']) ? ($options['gpbp_hide_action'] == 1 ? 'grey' : 'none') : 'hide';
  228. }
  229. }
  230.  
  231. if ($message['can_remove'])
  232. $removableMessageIDs[] = $message['id'];
  233.  
  234. echo '
  235. <div class="bordercolor"', $gpbp_action == 'hide' ? ' id="gpbp_hidden_' . $message['id'] . '"' : '' ,'>';
  236.  
  237.  
  238.  
  239. // Are we ignoring this message?
  240. if (!empty($message['is_ignored']))
  241. {
  242. $ignoring = true;
  243. $ignoredMsgs[] = $message['id'];
  244. }
  245.  
  246. // Show the message anchor and a "new" anchor if this message is new.
  247. if ($message['id'] != $context['first_message'])
  248. echo '
  249. <a id="msg', $message['id'], '"></a>', $message['first_new'] ? '<a id="new"></a>' : '';
  250.  
  251. echo '
  252. <div class="clearfix ', !$is_first_post ? 'topborder ' : '', $message['approved'] ? ($gpbp_action == 'hide' ? 'gpbp_hider ' : '') . ($gpbp_badPost && $gpbp_action != 'none' ? 'gpbp_greyed' : ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2')) : 'approvebg', ' largepadding">';
  253.  
  254. // Show information about the poster of this message.
  255. echo '
  256. <div class="floatleft poster">
  257. <h4>', $message['member']['link'], '</h4>
  258. <ul class="reset smalltext" id="msg_', $message['id'], '_extra_info">';
  259.  
  260. // Show the member's custom title, if they have one.
  261. if (isset($message['member']['title']) && $message['member']['title'] != '')
  262. echo '
  263. <li>', $message['member']['title'], '</li>';
  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. <li>', $message['member']['group'], '</li>';
  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. <li>', $message['member']['post_group'], '</li>';
  277. echo '
  278. <li>', $message['member']['group_stars'], '</li>';
  279.  
  280. // Is karma display enabled? Total or +/-?
  281. if ($modSettings['karmaMode'] == '1')
  282. echo '
  283. <li class="margintop">', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '</li>';
  284. elseif ($modSettings['karmaMode'] == '2')
  285. echo '
  286. <li class="margintop">', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '</li>';
  287.  
  288. // Is this user allowed to modify this member's karma?
  289. if ($message['member']['karma']['allow'])
  290. echo '
  291. <li>
  292. <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>
  293. <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>
  294. </li>';
  295.  
  296. // Show online and offline buttons?
  297. if (!empty($modSettings['onlineEnable']))
  298. echo '
  299. <li>', $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" style="margin-top: 2px;" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '</li>';
  300.  
  301. // Show the member's gender icon?
  302. if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '' && !isset($context['disabled_fields']['gender']))
  303. echo '
  304. <li>', $txt['gender'], ': ', $message['member']['gender']['image'], '</li>';
  305.  
  306. // Show how many posts they have made.
  307. if (!isset($context['disabled_fields']['posts']))
  308. echo '
  309. <li>', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
  310.  
  311. // Any custom fields for standard placement?
  312. if (!empty($message['member']['custom_fields']))
  313. {
  314. foreach ($message['member']['custom_fields'] as $custom)
  315. if (empty($custom['placement']) && !empty($custom['value']))
  316. echo '
  317. <li>', $custom['title'], ': ', $custom['value'], '</li>';
  318. }
  319.  
  320. // Show avatars, images, etc.?
  321. if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
  322. echo '
  323. <li class="margintop" style="overflow: auto;">', $message['member']['avatar']['image'], '</li>';
  324.  
  325. // Show their personal text?
  326. if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
  327. echo '
  328. <li class="margintop">', $message['member']['blurb'], '</li>';
  329.  
  330. // Show their amount of Respect.
  331. if ($context['gpbp_enabled'] && !empty($modSettings['gpbp_display_respect']))
  332. echo '
  333. <li class="gpbp_respect">', $txt['gpbp_respect'], ': <span class="gpbp_respect_count_', $message['member']['id'], '">', $message['member']['gpbp_respect'] > 0 ? '+' : '', $message['member']['gpbp_respect'], '</span></li>';
  334.  
  335.  
  336. // Any custom fields to show as icons?
  337. if (!empty($message['member']['custom_fields']))
  338. {
  339. $shown = false;
  340. foreach ($message['member']['custom_fields'] as $custom)
  341. {
  342. if ($custom['placement'] != 1 || empty($custom['value']))
  343. continue;
  344. if (empty($shown))
  345. {
  346. $shown = true;
  347. echo '
  348. <li class="margintop">
  349. <ul class="reset nolist">';
  350. }
  351. echo '
  352. <li>', $custom['value'], '</li>';
  353. }
  354. if ($shown)
  355. echo '
  356. </ul>
  357. </li>';
  358. }
  359.  
  360. // This shows the popular messaging icons.
  361. if ($message['member']['has_messenger'] && $message['member']['can_view_profile'])
  362. echo '
  363. <li class="margintop">
  364. <ul class="reset nolist">
  365. ', !isset($context['disabled_fields']['icq']) && !empty($message['member']['icq']['link']) ? '<li>' . $message['member']['icq']['link'] . '</li>' : '', '
  366. ', !isset($context['disabled_fields']['msn']) && !empty($message['member']['msn']['link']) ? '<li>' . $message['member']['msn']['link'] . '</li>' : '', '
  367. ', !isset($context['disabled_fields']['aim']) && !empty($message['member']['aim']['link']) ? '<li>' . $message['member']['aim']['link'] . '</li>' : '', '
  368. ', !isset($context['disabled_fields']['yim']) && !empty($message['member']['yim']['link']) ? '<li>' . $message['member']['yim']['link'] . '</li>' : '', '
  369. </ul>
  370. </li>';
  371.  
  372. // Show the profile, website, email address, and personal message buttons.
  373. if ($settings['show_profile_buttons'])
  374. {
  375. echo '
  376. <li class="margintop">
  377. <ul class="reset nolist">';
  378. // Don't show the profile button if you're not allowed to view the profile.
  379. if ($message['member']['can_view_profile'])
  380. echo '
  381. <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'] . '" border="0" />' : $txt['view_profile']), '</a></li>';
  382.  
  383. // Don't show an icon if they haven't specified a website.
  384. if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website']))
  385. echo '
  386. <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'] . '" border="0" />' : $txt['www']), '</a></li>';
  387.  
  388. // Don't show the email address if they want it hidden.
  389. if (in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')))
  390. echo '
  391. <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>';
  392.  
  393. // Since we know this person isn't a guest, you *can* message them.
  394. if ($context['can_send_pm'])
  395. echo '
  396. <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']) . '" border="0" />' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
  397.  
  398. echo '
  399. </ul>
  400. </li>';
  401. }
  402.  
  403. // Are we showing the warning status?
  404. if ($message['member']['can_see_warning'])
  405. echo '
  406. <li>', $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>';
  407. }
  408. // Otherwise, show the guest's email.
  409. elseif (!empty($message['member']['email']) && in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')))
  410. echo '
  411. <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'] . '" border="0" />' : $txt['email']), '</a></li>';
  412.  
  413. // Done with the information about the poster... on to the post itself.
  414. echo '
  415. </ul>
  416. </div>
  417. <div class="postarea">
  418. <div class="flow_hidden">
  419. <div class="keyinfo">
  420. <div class="messageicon"><img src="', $message['icon_url'] . '" alt="" border="0"', $message['can_modify'] ? ' id="msg_icon_' . $message['id'] . '"' : '', ' /></div>
  421. <h5 id="subject_', $message['id'], '">
  422. <a href="', $message['href'], '" rel="nofollow">', $message['subject'], '</a>
  423. </h5>
  424. <div class="smalltext">&#171; <strong>', !empty($message['counter']) ? $txt['reply_noun'] . ' #' . $message['counter'] : '', ' ', $txt['on'], ':</strong> ', $message['time'], ' &#187;</div>
  425. <div id="msg_', $message['id'], '_quick_mod"></div>
  426. </div>';
  427.  
  428. // If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
  429. if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
  430. echo '
  431. <ul class="reset smalltext postingbuttons">';
  432.  
  433. // Maybe we can approve it, maybe we should?
  434. if ($message['can_approve'])
  435. echo '
  436. <li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $approve_button, '</a></li>';
  437.  
  438. // Can they reply? Have they turned on quick reply?
  439. if ($context['can_quote'] && !empty($options['display_quick_reply']))
  440. echo '
  441. <li><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'], ');">', $reply_button, '</a></li>';
  442.  
  443. // So... quick reply is off, but they *can* reply?
  444. elseif ($context['can_quote'])
  445. echo '
  446. <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '">', $reply_button, '</a></li>';
  447.  
  448. // Can the user modify the contents of this post?
  449. if ($message['can_modify'])
  450. echo '
  451. <li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '">', $modify_button, '</a></li>';
  452.  
  453. // How about... even... remove it entirely?!
  454. if ($message['can_remove'])
  455. echo '
  456. <li><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'], '?\');">', $remove_button, '</a></li>';
  457.  
  458. // What about splitting it off the rest of the topic?
  459. if ($context['can_split'] && !empty($context['real_num_replies']))
  460. echo '
  461. <li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '">', $split_button, '</a></li>';
  462.  
  463. // Can we restore topics?
  464. if ($context['can_restore_msg'])
  465. echo '
  466. <li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $restore_message_button, '</a></li>';
  467.  
  468. // Show a checkbox for quick moderation?
  469. if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
  470. echo '
  471. <li style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>';
  472.  
  473. if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
  474. echo '
  475. </ul>';
  476.  
  477. // Good Post/Bad Post score, voting and voters list retrieval.
  478. if ($context['gpbp_enabled'])
  479. {
  480. $message['gpbp_score'] = ( $message['gpbp_score'] > 0 ? '+' : '' ) . $message['gpbp_score'];
  481. echo '
  482. <div class="gpbp_vote">';
  483. if ($gpbp_action == 'hide' && $modSettings['gpbp_users_hide_again'])
  484. echo '
  485. <div class="smalltext gpbp_hide_again" onclick="gpbp_hide_post_again(\'', $message['id'], '\')">', $txt['gpbp_hide_again'], '</div>';
  486. echo '
  487. <span id="gpbp_score_', $message['id'], '" class="help" title="', $txt['gpbp_post_score'], '">', $message['gpbp_score'], '</span>';
  488.  
  489. if (!$ignoring)
  490. {
  491. if ($context['can_vote_gpbp'] && $message['member']['id'] != $context['user']['id'])
  492. {
  493. // Should we not display the voting down button?
  494. if (empty($modSettings['gpbp_disable_negative_voting']))
  495. echo '
  496. <a onclick="oVotePost.vote(\'down\', \'', $message['id'], '\'); return false" href="', $scripturl, '?action=gpbp;sa=down;msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], ';board=', $context['current_board'], ';topic=', $context['current_topic'], '"><img class="gpbp_vote_img" id="gpbp_vote_down_', $message['id'], '" src="', $settings['images_url'], '/gpbp', $gpbp_set, '_arrow_down', $message['gpbp_img']['down']['lit_suffix'], '.', $gpbp_ext, '" alt="', $txt[ $message['gpbp_img']['down']['alt'] ], '" title="', $txt[ $message['gpbp_img']['down']['title'] ], '" onmouseover="gpbp_toggleVotingIcon(\'gpbp_vote_down_', $message['id'], '\')" onmouseout="gpbp_toggleVotingIcon(\'gpbp_vote_down_', $message['id'], '\')" /></a>';
  497. echo '
  498. <a onclick="oVotePost.vote(\'up\', \'', $message['id'], '\'); return false" href="', $scripturl, '?action=gpbp;sa=up;msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], ';board=', $context['current_board'], ';topic=', $context['current_topic'], '"><img class="gpbp_vote_img" id="gpbp_vote_up_', $message['id'], '" src="', $settings['images_url'], '/gpbp', $gpbp_set, '_arrow_up', $message['gpbp_img']['up']['lit_suffix'], '.', $gpbp_ext, '" alt="', $txt[ $message['gpbp_img']['up']['alt'] ], '" title="', $txt[ $message['gpbp_img']['up']['title'] ], '" onmouseover="gpbp_toggleVotingIcon(\'gpbp_vote_up_', $message['id'], '\')" onmouseout="gpbp_toggleVotingIcon(\'gpbp_vote_up_', $message['id'], '\')" /></a>';
  499. }
  500. if ($context['reveal_voterslist'])
  501. echo '
  502. <a class="gpbp_voterslist" id="gpbp_voterslist_', $message['id'], '" onclick="oVotePost.voterslist(\'', $message['id'], '\'); return false"><img class="gpbp_vote_img" src="', $settings['images_url'], '/gpbp_voterslist.gif" alt="', $txt['gpbp_show_voters'], '" title="', $txt['gpbp_show_voters'], '" /></a>
  503. <select onchange="gpbp_toProfile(\'gpbp_voters_select_', $message['id'], '\')" class="gpbp_voterslist_select" id="gpbp_voters_select_', $message['id'], '"><option value="0" selected="selected">', $txt['gpbp_voters_list'], '</option></select>';
  504. }
  505.  
  506. echo '
  507. </div>';
  508. }
  509.  
  510.  
  511.  
  512. // Ignoring this user? Hide the post.
  513. if ($ignoring)
  514. echo '
  515. <div class="ignored" id="msg_', $message['id'], '_ignored_prompt">
  516. ', $txt['ignoring_user'], '
  517. <a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a>
  518. </div>';
  519.  
  520. // Show the post itself, finally!
  521. echo '
  522. <div class="post">
  523. <hr class="hrcolor" width="100%" size="1" />';
  524.  
  525. if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'])
  526. echo '
  527. <div class="approve_post">
  528. ', $txt['post_awaiting_approval'], '
  529. </div>';
  530. echo '
  531. <div class="inner" id="msg_', $message['id'], '"', '>', $gpbp_badPost && !$context['reveal_bad_post'] ? '' : $message['body'], '</div>
  532. </div>', $message['can_modify'] ? '
  533. <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'] . '\')" />' : '';
  534.  
  535. // Assuming there are attachments...
  536. if (!empty($message['attachment']))
  537. {
  538. // Now for the attachments, signature, ip logged, etc...
  539. echo '
  540. <div id="msg_', $message['id'], '_footer" class="attachments smalltext">';
  541.  
  542. $last_approved_state = 1;
  543. foreach ($message['attachment'] as $attachment)
  544. {
  545. // Show a special box for unapproved attachments...
  546. if ($attachment['is_approved'] != $last_approved_state)
  547. {
  548. $last_approved_state = 0;
  549. echo '
  550. <fieldset>
  551. <legend>', $txt['attach_awaiting_approve'];
  552.  
  553. if ($context['can_approve'])
  554. echo '&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]';
  555.  
  556. echo '</legend>';
  557. }
  558.  
  559. if ($attachment['is_image'])
  560. {
  561. if ($attachment['thumbnail']['has_thumb'])
  562. echo '
  563. <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 />';
  564. else
  565. echo '
  566. <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';
  567. }
  568. echo '
  569. <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> ';
  570.  
  571. if (!$attachment['is_approved'] && $context['can_approve'])
  572. echo '
  573. [<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>]&nbsp;|&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] ';
  574. echo '
  575. (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
  576. }
  577.  
  578. // If we had unapproved attachments clean up.
  579. if ($last_approved_state == 0)
  580. echo '
  581. </fieldset>';
  582.  
  583. echo '
  584. </div>';
  585. }
  586.  
  587. // If a Bad Post must be hidden, only display its date and a "Show" link... nothing else.
  588. if ($gpbp_badPost && $gpbp_action == 'hide')
  589. echo '
  590. </div>
  591. <div class="postarea gpbp_do_show" id="gpbp_hidden_notice_', $message['id'], '">
  592. <div class="middletext gpbp_hidden_notice">
  593. ', $message['time'], ' - <em>', $txt['gpbp_hidden'], '</em>', $context['reveal_bad_post'] ? ' <a class="gpbp_show" onclick="gpbp_show_post(\'' . $message['id'] . '\', '. ($modSettings['gpbp_users_hide_again'] ? 'true' : 'false') .'); return false" href="' . $message['href_gpbp_show'] . '">' . $txt['gpbp_show'] . '</a>' : '', '
  594. </div>';
  595.  
  596.  
  597.  
  598. echo '
  599. </div>
  600. <div class="moderatorbar">
  601. <div class="smalltext floatleft" id="modified_', $message['id'], '">';
  602.  
  603. // Show "ร‚ยซ Last Edit: Time by Person ร‚ยป" if this post was edited.
  604. if ($settings['show_modify'] && !empty($message['modified']['name']))
  605. echo '
  606. &#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;';
  607.  
  608. echo '
  609. </div>
  610. <div class="smalltext largepadding floatright">';
  611.  
  612. // Maybe they want to report this post to the moderator(s)?
  613. if ($context['can_report_moderator'])
  614. echo '
  615. <a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a> &nbsp;';
  616.  
  617. // Can we issue a warning because of this post? Remember, we can't give guests warnings.
  618. if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest'])
  619. echo '
  620. <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'], '" border="0" /></a>';
  621. echo '
  622. <img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />';
  623.  
  624. // Show the IP to this user for this post - because you can moderate?
  625. if ($context['can_moderate_forum'] && !empty($message['member']['ip']))
  626. echo '
  627. <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>';
  628. // Or, should we show it because this is you?
  629. elseif ($message['can_see_ip'])
  630. echo '
  631. <a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $message['member']['ip'], '</a>';
  632. // Okay, are you at least logged in? Then we can show something about why IPs are logged...
  633. elseif (!$context['user']['is_guest'])
  634. echo '
  635. <a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $txt['logged'], '</a>';
  636. // Otherwise, you see NOTHING!
  637. else
  638. echo '
  639. ', $txt['logged'];
  640.  
  641. echo '
  642. </div>';
  643.  
  644. // Are there any custom profile fields for above the signature?
  645. if (!empty($message['member']['custom_fields']))
  646. {
  647. $shown = false;
  648. foreach ($message['member']['custom_fields'] as $custom)
  649. {
  650. if ($custom['placement'] != 2 || empty($custom['value']))
  651. continue;
  652. if (empty($shown))
  653. {
  654. $shown = true;
  655. echo '
  656. <div class="custom_fields_above_signature">
  657. <ul class="reset nolist>';
  658. }
  659. echo '
  660. <li>', $custom['value'], '</li>';
  661. }
  662. if ($shown)
  663. echo '
  664. </ul>
  665. </div>';
  666. }
  667.  
  668. // Show the member's signature?
  669. if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
  670. echo '
  671. <div class="signature" id="msg_', $message['id'], '_signature">', $message['member']['signature'], '</div>';
  672.  
  673. echo '
  674. </div>
  675. </div>
  676. </div>';
  677. }
  678.  
  679. echo '
  680. </form>';
  681. echo '
  682. </div>
  683. <a id="lastPost"></a>';
  684.  
  685. echo '
  686. <div class="clearfix marginbottom" id="postbuttons_lower">
  687. <div class="nav floatright">', template_button_strip($normal_buttons, 'top'), '</div>
  688. <div class="middletext floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
  689. <div class="clear">', $context['previous_next'], '</div>
  690. </div>';
  691.  
  692. // Show the lower breadcrumbs.
  693. theme_linktree();
  694.  
  695. $mod_buttons = array(
  696. 'move' => array('test' => 'can_move', 'text' => 'move_topic', 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'),
  697. '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']),
  698. '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']),
  699. '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']),
  700. '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']),
  701. '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'),
  702. );
  703.  
  704. // Restore topic. eh? No monkey business.
  705. if ($context['can_restore_topic'])
  706. $mod_buttons[] = array('text' => 'restore_topic', 'image' => '', 'lang' => true, 'url' => $scripturl . '?action=restoretopic;topics=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']);
  707.  
  708. // Allow adding new mod buttons easily.
  709. call_integration_hook('integrate_mod_buttons', array(&$mod_buttons));
  710.  
  711. echo '
  712. <div id="moderationbuttons" class="clearfix">', template_button_strip($mod_buttons, 'bottom', array('id' => 'moderationbuttons_strip')), '</div>';
  713.  
  714. // Show the jumpto box, or actually...let Javascript do it.
  715. echo '
  716. <div class="tborder">
  717. <div class="titlebg2" style="padding: 4px;" align="', !$context['right_to_left'] ? 'right' : 'left', '" id="display_jump_to">&nbsp;</div>
  718. </div><br />';
  719.  
  720. if ($context['can_reply'] && !empty($options['display_quick_reply']))
  721. {
  722. echo '
  723. <a id="quickreply"></a>
  724. <div class="tborder" id="quickreplybox">';
  725.  
  726. echo '
  727. <h3 class="catbg">
  728. <a href="javascript:oQuickReply.swap();">
  729. <img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" id="quickReplyExpand" />
  730. </a>
  731. <a href="javascript:oQuickReply.swap();">', $txt['quick_reply'], '</a>
  732. </h3>
  733. <div class="windowbg" id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '>
  734. <div class="floatleft" id="quickReplyWarning">
  735. ', $txt['quick_reply_desc'], $context['is_locked'] ? '<p><strong>' . $txt['quick_reply_warning'] . '</strong></p>' : '', $context['oldTopicError'] ? '<p><strong>' . sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']) . '</strong></p>' : '', '
  736. </div>
  737. <div id="quickReplyContent">', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', '
  738. ', !$context['can_reply_approved'] && $context['require_verification'] ? '<br />' : '', '
  739. <form action="', $scripturl, '?action=post2', empty($context['current_board']) ? '' : ';board=' . $context['current_board'], '" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);smc_saveEntities(\'postmodify\', [\'subject\', \'message\', \'guestname\', \'evtitle\', \'question\']);" style="margin: 0;">
  740. <input type="hidden" name="topic" value="', $context['current_topic'], '" />
  741. <input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '" />
  742. <input type="hidden" name="icon" value="xx" />
  743. <input type="hidden" name="from_qr" value="1" />
  744. <input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
  745. <input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '" />
  746. <input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
  747. <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '" />';
  748.  
  749. // Guests just need more.
  750. if ($context['user']['is_guest'])
  751. echo '
  752. <strong>', $txt['name'], ':</strong> <input type="text" name="guestname" value="', $context['name'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" />
  753. <strong>', $txt['email'], ':</strong> <input type="text" name="email" value="', $context['email'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /><br />';
  754.  
  755. // Is visual verification enabled?
  756. if ($context['require_verification'])
  757. echo '
  758. <strong>', $txt['verification'], ':</strong>', template_control_verification($context['visual_verification_id'], 'quick_reply'), '<br />';
  759.  
  760. echo '
  761. <textarea cols="600" rows="7" name="message" tabindex="', $context['tabindex']++, '"></textarea><br />
  762. <input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="', $context['tabindex']++, '" class="button_submit" />
  763. <input type="submit" name="preview" value="', $txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />';
  764. if ($context['show_spellchecking'])
  765. echo '
  766. <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="', $context['tabindex']++, '" class="button_submit" />';
  767. echo '
  768. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  769. <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
  770. </form>
  771. </div>
  772. <div class="clear"></div>
  773. </div>
  774. </div>';
  775. }
  776.  
  777. if ($context['show_spellchecking'])
  778. echo '
  779. <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>
  780. <script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/spellcheck.js"></script>';
  781.  
  782. echo '
  783. <script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/topic.js"></script>
  784. <script type="text/javascript"><!-- // --><![CDATA[';
  785.  
  786. if (!empty($options['display_quick_reply']))
  787. echo '
  788. var oQuickReply = new QuickReply({
  789. bDefaultCollapsed: ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true', ',
  790. iTopicId: ', $context['current_topic'], ',
  791. iStart: ', $context['start'], ',
  792. sScriptUrl: smf_scripturl,
  793. sImagesUrl: "', $settings['images_url'], '",
  794. sContainerId: "quickReplyOptions",
  795. sImageId: "quickReplyExpand",
  796. sImageCollapsed: "collapse.gif",
  797. sImageExpanded: "expand.gif",
  798. sJumpAnchor: "quickreply"
  799. });';
  800.  
  801. if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post'])
  802. echo '
  803. var oInTopicModeration = new InTopicModeration({
  804. sSelf: \'oInTopicModeration\',
  805. sCheckboxContainerMask: \'in_topic_mod_check_\',
  806. aMessageIds: [\'', implode('\', \'', $removableMessageIDs), '\'],
  807. sSessionId: \'', $context['session_id'], '\',
  808. sSessionVar: \'', $context['session_var'], '\',
  809. sButtonStrip: \'moderationbuttons\',
  810. sButtonStripDisplay: \'moderationbuttons_strip\',
  811. bUseImageButton: false,
  812. bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ',
  813. sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\',
  814. sRemoveButtonImage: \'delete_selected.gif\',
  815. sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\',
  816. bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ',
  817. sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\',
  818. sRestoreButtonImage: \'restore_selected.gif\',
  819. sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\',
  820. sFormId: \'quickModForm\'
  821. });';
  822.  
  823. echo '
  824. if (\'XMLHttpRequest\' in window)
  825. {
  826. var oQuickModify = new QuickModify({
  827. sScriptUrl: smf_scripturl,
  828. bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
  829. iTopicId: ', $context['current_topic'], ',
  830. sTemplateBodyEdit: ', JavaScriptEscape('
  831. <div id="quick_edit_body_container" style="width: 90%">
  832. <div id="error_box" style="padding: 4px;" class="error"></div>
  833. <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 />
  834. <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
  835. <input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
  836. <input type="hidden" name="msg" value="%msg_id%" />
  837. <div class="righttext">
  838. <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" />&nbsp;&nbsp;' . ($context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" tabindex="' . $context['tabindex']++ . '" onclick="spellCheck(\'quickModForm\' . \'message\');" class="button_submit" />&nbsp;&nbsp;' : '') . '<input type="submit" name="cancel" value="' . $txt['modify_cancel'] . '" tabindex="' . $context['tabindex']++ . '" onclick="return oQuickModify.modifyCancel();" class="button_submit" />
  839. </div>
  840. </div>'), ',
  841. sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 90%" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />'), ',
  842. sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ',
  843. sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
  844. sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ': %subject% &nbsp;(' . $txt['read'] . ' ' . $context['num_views'] . ' ' . $txt['times'] . ')'), ',
  845. sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), '
  846. });
  847.  
  848. aJumpTo[aJumpTo.length] = new JumpTo({
  849. sContainerId: "display_jump_to",
  850. sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
  851. iCurBoardId: ', $context['current_board'], ',
  852. iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
  853. sCurBoardName: "', $context['jump_to']['board_name'], '",
  854. sBoardChildLevelIndicator: "==",
  855. sBoardPrefix: "=> ",
  856. sCatSeparator: "-----------------------------",
  857. sCatPrefix: "",
  858. sGoButtonLabel: "', $txt['go'], '"
  859. });
  860.  
  861. aIconLists[aIconLists.length] = new IconList({
  862. sBackReference: "aIconLists[" + aIconLists.length + "]",
  863. sIconIdPrefix: "msg_icon_",
  864. sScriptUrl: smf_scripturl,
  865. bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
  866. iBoardId: ', $context['current_board'], ',
  867. iTopicId: ', $context['current_topic'], ',
  868. sSessionId: "', $context['session_id'], '",
  869. sSessionVar: "', $context['session_var'], '",
  870. sLabelIconList: "', $txt['message_icon'], '",
  871. sBoxBackground: "transparent",
  872. sBoxBackgroundHover: "#ffffff",
  873. iBoxBorderWidthHover: 1,
  874. sBoxBorderColorHover: "#adadad" ,
  875. sContainerBackground: "#ffffff",
  876. sContainerBorder: "1px solid #adadad",
  877. sItemBorder: "1px solid #ffffff",
  878. sItemBorderHover: "1px dotted gray",
  879. sItemBackground: "transparent",
  880. sItemBackgroundHover: "#e0e0f0"
  881. });
  882. }';
  883.  
  884. if (!empty($ignoredMsgs))
  885. {
  886. echo '
  887. var aIgnoreToggles = new Array();';
  888.  
  889. foreach ($ignoredMsgs as $msgid)
  890. {
  891. echo '
  892. aIgnoreToggles[', $msgid, '] = new smc_Toggle({
  893. bToggleEnabled: true,
  894. bCurrentlyCollapsed: true,
  895. aSwappableContainers: [
  896. \'msg_', $msgid, '_extra_info\',
  897. \'msg_', $msgid, '\',
  898. \'msg_', $msgid, '_footer\',
  899. \'msg_', $msgid, '_quick_mod\',
  900. \'modify_button_', $msgid, '\',
  901. \'msg_', $msgid, '_signature\'
  902.  
  903. ],
  904. aSwapLinks: [
  905. {
  906. sId: \'msg_', $msgid, '_ignored_link\',
  907. msgExpanded: \'\',
  908. msgCollapsed: ', JavaScriptEscape($txt['show_ignore_user_post']), '
  909. }
  910. ]
  911. });';
  912. }
  913. }
  914.  
  915.  
  916.  
  917.  
  918. if ($context['gpbp_enabled'])
  919. echo '
  920. var oVotePost = new PostVoting({
  921. sSessionVar: "', $context['session_var'], '",
  922. sSessionId: "', $context['session_id'], '",
  923. iBoard: ', $context['this_board'], ',
  924. iTopic: ', $context['current_topic'], ',
  925. sButtonSet: "', $gpbp_set,'",
  926. sVoteDownAlt: "', $txt['gpbp_vote_down'], '",
  927. sVoteUpAlt: "', $txt['gpbp_vote_up'], '",
  928. sVotedDownAlt: "', $txt['gpbp_voted_down_alt'], '",
  929. sVotedUpAlt: "', $txt['gpbp_voted_up_alt'], '",
  930. sVotedDown: "', $txt['gpbp_voted_down'], '",
  931. sToVoteDown: "', $txt['gpbp_to_vote_down'], '",
  932. sVotedUp: "', $txt['gpbp_voted_up'], '",
  933. sToVoteUp: "', $txt['gpbp_to_vote_up'], '",
  934. sNoVoters: "', $txt['gpbp_no_voters'], '",
  935. sScriptUrl: "', $scripturl, '",
  936. sImagesUrl: "', $settings['images_url'], '"
  937. });';
  938.  
  939. echo '
  940. // ]]></script>';
  941. }
  942. ?>
  943.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement