Advertisement
Guest User

Untitled

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