annotate forum/Themes/core/Display.template.php @ 94:e43e2f72254a rdfquery

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