annotate forum/Themes/default/Display.template.php @ 78:96118bc49f04 website

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