function template_announcement() { global $context, $scripturl, $txt, $settings; echo ' <div id="admincenter"> <div class="cat_bar"> <h3 class="catbg"> <img alt="" style="vertical-align: middle;" width="16" height="16" border="0" src="' . $settings['default_images_url'] . '/ultimate-portal/information.png"/> ', $txt['ultport_admin_announcements_title'], ' </h3> </div> <form name="newsform" method="post" action="', $scripturl, '?action=adminportal;area=up-news;sa=announcements" accept-charset="', $context['character_set'], '"> <div class="windowbg2"> <span class="topslice"><span></span></span> <div class="content"> ', $txt['ultport_global_annoucements'], ' <div id="bbcBox_message"></div> <div id="smileyBox_message"></div> ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), ' </div> <div class="righttext"> <input type="hidden" name="save" value="ok" /> <input type="hidden" name="sc" value="', $context['session_id'], '" /> <input type="submit" name="', $txt['ultport_button_save'], '" value="', $txt['ultport_button_save'], '" /> </div> </div> </form> </div>'; }
/** * AdmBlock_content(). * Open a the richtext editor, to create or edit the content. * Returns the AdmBlock_settings */ function pmxc_AdmBlock_content() { global $context, $txt; // show the content area echo ' <td valign="top" colspan="2" style="padding:4px;"> <div class="cat_bar catbg_grid" style="margin-right:1px;"> <h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_edit_content'] . '</span></h4> </div> <input type="hidden" id="smileyset" value="PortaMx" /> <div id="bbcBox_message"></div> <div id="smileyBox_message"></div> <div style="padding-right:3px;margin-top:-10px;margin-right:-9px;">', template_control_richedit($context['pmx']['editorID'], 'smileyBox_message', 'bbcBox_message'), '</div> </td> </tr> <tr>'; // return the default settings return $this->pmxc_AdmBlock_settings(); }
function template_main() { global $context, $settings, $options, $txt, $scripturl, $modSettings, $counter; // Start the javascript... and boy is there a lot. echo ' <script type="text/javascript"><!-- // --><![CDATA['; // When using Go Back due to fatal_error, allow the form to be re-submitted with changes. if ($context['browser']['is_firefox']) { echo ' function reActivate() { document.forms.postmodify.message.readOnly = false; } window.addEventListener("pageshow", reActivate, false);'; } // Start with message icons - and any missing from this theme. echo ' var icon_urls = {'; foreach ($context['icons'] as $icon) { echo ' \'', $icon['value'], '\': \'', $settings['images_url'] . '/post/' . $icon['value'], '.png\'', $icon['is_last'] ? '' : ','; } echo ' };'; // The actual message icon selector. echo ' function showimage() { document.images.icons.src = icon_urls[document.forms.postmodify.icon.options[document.forms.postmodify.icon.selectedIndex].value]; }'; // If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations. if ($context['make_poll']) { echo ' function pollOptions() { var expire_time = document.getElementById(\'poll_expire\'); if (isEmptyText(expire_time) || expire_time.value == 0) { document.forms.postmodify.poll_hide[2].disabled = true; if (document.forms.postmodify.poll_hide[2].checked) document.forms.postmodify.poll_hide[1].checked = true; } else document.forms.postmodify.poll_hide[2].disabled = false; } var pollOptionNum = 0, pollTabIndex; function addPollOption() { if (pollOptionNum == 0) { for (var i = 0, n = document.forms.postmodify.elements.length; i < n; i++) if (document.forms.postmodify.elements[i].id.substr(0, 8) == \'options-\') { pollOptionNum++; pollTabIndex = document.forms.postmodify.elements[i].tabIndex; } } pollOptionNum++ setOuterHTML(document.getElementById(\'pollMoreOptions\'), ', JavaScriptEscape('<li><label for="options-'), ' + pollOptionNum + ', JavaScriptEscape('">' . $txt['option'] . ' '), ' + pollOptionNum + ', JavaScriptEscape('</label>: <input type="text" name="options['), ' + pollOptionNum + ', JavaScriptEscape(']" id="options-'), ' + pollOptionNum + ', JavaScriptEscape('" value="" size="80" maxlength="255" tabindex="'), ' + pollTabIndex + ', JavaScriptEscape('" class="input_text" /></li><li id="pollMoreOptions"></li>'), '); }'; } // If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here. if ($context['make_event']) { echo ' var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; function generateDays() { var dayElement = document.getElementById(\'day\'), yearElement = document.getElementById(\'year\'), monthElement = document.getElementById(\'month\'); var days, selected = dayElement.selectedIndex; monthLength[1] = yearElement.options[yearElement.selectedIndex].value % 4 == 0 ? 29 : 28; days = monthLength[monthElement.value - 1]; while (dayElement.options.length) dayElement.options[0] = null; for (i = 1; i <= days; i++) dayElement.options[dayElement.length] = new Option(i, i); if (selected < days) dayElement.selectedIndex = selected; }'; } // End of the javascript, start the form and display the link tree. echo ' // ]]></script> <form action="', $scripturl, '?action=', $context['destination'], ';', empty($context['current_board']) ? '' : 'board=' . $context['current_board'], '" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" class="flow_hidden" onsubmit="', $context['becomes_approved'] ? '' : 'alert(\'' . $txt['js_post_will_require_approval'] . '\');', 'submitonce(this);smc_saveEntities(\'postmodify\', [\'subject\', \'', $context['post_box_name'], '\', \'guestname\', \'evtitle\', \'question\'], \'options\');" enctype="multipart/form-data">'; // If the user wants to see how their message looks - the preview section is where it's at! echo ' <div id="preview_section"', isset($context['preview_message']) ? '' : ' style="display: none;"', '> <div class="cat_bar"> <h3 class="catbg"> <span id="preview_subject">', empty($context['preview_subject']) ? '' : $context['preview_subject'], '</span> </h3> </div> <div class="windowbg"> <span class="topslice"><span></span></span> <div class="content"> <div class="post" id="preview_body"> ', empty($context['preview_message']) ? '<br />' : $context['preview_message'], ' </div> </div> <span class="botslice"><span></span></span> </div> </div><br />'; if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) { echo ' <input type="hidden" name="eventid" value="', $context['event']['id'], '" />'; } // Start the main table. echo ' <div class="cat_bar"> <h3 class="catbg">', $context['page_title'], '</h3> </div> <div> <span class="upperframe"><span></span></span> <div class="roundframe">', isset($context['current_topic']) ? ' <input type="hidden" name="topic" value="' . $context['current_topic'] . '" />' : ''; // If an error occurred, explain what happened. echo ' <div class="errorbox"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors"> <dl class="settings narrow"> <dt> <strong style="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'display: none;' : '', '" id="error_serious">', $txt['error_while_submitting'], '</strong> </dt> <dt class="error" id="error_list"> ', empty($context['post_error']['messages']) ? '' : implode('<br />', $context['post_error']['messages']), ' </dt> </dl> </div>'; // If this won't be approved let them know! if (!$context['becomes_approved']) { echo ' <p class="information"> <em>', $txt['wait_for_approval'], '</em> <input type="hidden" name="not_approved" value="1" /> </p>'; } // If it's locked, show a message to warn the replyer. echo ' <p class="information"', $context['locked'] ? '' : ' style="display: none"', ' id="lock_warning"> ', $txt['topic_locked_no_reply'], ' </p>'; // The post header... important stuff echo ' <dl id="post_header" class="settings narrow">'; // Guests have to put in their name and email... if (isset($context['name']) && isset($context['email'])) { echo ' <dt> <span', isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) || isset($context['post_error']['bad_name']) ? ' class="error"' : '', ' id="caption_guestname">', $txt['name'], ':</span> </dt> <dd> <input type="text" name="guestname" size="25" value="', $context['name'], '" tabindex="', $context['tabindex']++, '" class="input_text" /> </dd>'; if (empty($modSettings['guest_post_no_email'])) { echo ' <dt> <span', isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' class="error"' : '', ' id="caption_email">', $txt['email'], ':</span> </dt> <dd> <input type="text" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" /> </dd>'; } } // Now show the subject box for this post. echo ' <dt> <span', isset($context['post_error']['no_subject']) ? ' class="error"' : '', ' id="caption_subject">', $txt['subject'], ':</span> </dt> <dd> <input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" class="input_text" /> </dd> <dt class="clear_left"> ', $txt['message_icon'], ': </dt> <dd> <select name="icon" id="icon" onchange="showimage()">'; // Loop through each message icon allowed, adding it to the drop down list. foreach ($context['icons'] as $icon) { echo ' <option value="', $icon['value'], '"', $icon['value'] == $context['icon'] ? ' selected="selected"' : '', '>', $icon['name'], '</option>'; } echo ' </select> <img src="', $settings['images_url'] . '/post/' . $context['icon'], '.png" name="icons" alt="" style="display: inline-block; vertical-align: middle;margin-left: 1rem;" /> </dd> </dl><hr class="clear" />'; // Are you posting a calendar event? if ($context['make_event']) { echo ' <div id="post_event"> <fieldset id="event_main"> <legend><span', isset($context['post_error']['no_event']) ? ' class="error"' : '', ' id="caption_evtitle">', $txt['calendar_event_title'], '</span></legend> <input type="text" name="evtitle" maxlength="255" size="60" value="', $context['event']['title'], '" tabindex="', $context['tabindex']++, '" class="input_text" /> <div class="smalltext"> <input type="hidden" name="calendar" value="1" />', $txt['calendar_year'], ' <select name="year" id="year" tabindex="', $context['tabindex']++, '" onchange="generateDays();">'; // Show a list of all the years we allow... for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) { echo ' <option value="', $year, '"', $year == $context['event']['year'] ? ' selected="selected"' : '', '>', $year, ' </option>'; } echo ' </select> ', $txt['calendar_month'], ' <select name="month" id="month" onchange="generateDays();">'; // There are 12 months per year - ensure that they all get listed. for ($month = 1; $month <= 12; $month++) { echo ' <option value="', $month, '"', $month == $context['event']['month'] ? ' selected="selected"' : '', '>', $txt['months'][$month], ' </option>'; } echo ' </select> ', $txt['calendar_day'], ' <select name="day" id="day">'; // This prints out all the days in the current month - this changes dynamically as we switch months. for ($day = 1; $day <= $context['event']['last_day']; $day++) { echo ' <option value="', $day, '"', $day == $context['event']['day'] ? ' selected="selected"' : '', '>', $day, ' </option>'; } echo ' </select> </div> </fieldset>'; if (!empty($modSettings['cal_allowspan']) || $context['event']['new'] && $context['is_new_post']) { echo ' <fieldset id="event_options"> <legend>', $txt['calendar_event_options'], '</legend> <div class="event_options smalltext"> <ul class="event_options">'; // If events can span more than one day then allow the user to select how long it should last. if (!empty($modSettings['cal_allowspan'])) { echo ' <li> ', $txt['calendar_numb_days'], ' <select name="span">'; for ($days = 1; $days <= $modSettings['cal_maxspan']; $days++) { echo ' <option value="', $days, '"', $days == $context['event']['span'] ? ' selected="selected"' : '', '>', $days, ' </option>'; } echo ' </select> </li>'; } // If this is a new event let the user specify which board they want the linked post to be put into. if ($context['event']['new'] && $context['is_new_post']) { echo ' <li> ', $txt['calendar_post_in'], ' <select name="board">'; foreach ($context['event']['categories'] as $category) { echo ' <optgroup label="', $category['name'], '">'; foreach ($category['boards'] as $board) { echo ' <option value="', $board['id'], '"', $board['selected'] ? ' selected="selected"' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], ' </option>'; } echo ' </optgroup>'; } echo ' </select> </li>'; } echo ' </ul> </div> </fieldset>'; } echo ' </div>'; } // If this is a poll then display all the poll options! if ($context['make_poll']) { echo ' <div id="edit_poll"> <fieldset id="poll_main"> <legend><span ', isset($context['poll_error']['no_question']) ? ' class="error"' : '', '>', $txt['poll_question'], '</span></legend> <input type="text" name="question" value="', isset($context['question']) ? $context['question'] : '', '" tabindex="', $context['tabindex']++, '" size="80" class="input_text" /> <ul class="poll_main">'; // Loop through all the choices and print them out. foreach ($context['choices'] as $choice) { echo ' <li> <label for="options-', $choice['id'], '">', $txt['option'], ' ', $choice['number'], '</label>: <input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="255" class="input_text" /> </li>'; } echo ' <li id="pollMoreOptions"></li> </ul> <strong><a href="javascript:addPollOption(); void(0);">(', $txt['poll_add_option'], ')</a></strong> </fieldset> <fieldset id="poll_options"> <legend>', $txt['poll_options'], '</legend> <dl class="settings narrow poll_options"> <dt> <label for="poll_max_votes">', $txt['poll_max_votes'], ':</label> </dt> <dd> <input type="text" name="poll_max_votes" id="poll_max_votes" size="2" value="', $context['poll_options']['max_votes'], '" class="input_text" /> </dd> <dt> <label for="poll_expire">', $txt['poll_run'], ':</label><br /> <em class="smalltext">', $txt['poll_run_limit'], '</em> </dt> <dd> <input type="text" name="poll_expire" id="poll_expire" size="2" value="', $context['poll_options']['expire'], '" onchange="pollOptions();" maxlength="4" class="input_text" /> ', $txt['days_word'], ' </dd> <dt> <label for="poll_change_vote">', $txt['poll_do_change_vote'], ':</label> </dt> <dd> <input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked="checked"' : '', ' class="input_check" /> </dd>'; if ($context['poll_options']['guest_vote_enabled']) { echo ' <dt> <label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label> </dt> <dd> <input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked="checked"' : '', ' class="input_check" /> </dd>'; } echo ' <dt> ', $txt['poll_results_visibility'], ': </dt> <dd> <input type="radio" name="poll_hide" id="poll_results_anyone" value="0"', $context['poll_options']['hide'] == 0 ? ' checked="checked"' : '', ' class="input_radio" /> <label for="poll_results_anyone">', $txt['poll_results_anyone'], '</label><br /> <input type="radio" name="poll_hide" id="poll_results_voted" value="1"', $context['poll_options']['hide'] == 1 ? ' checked="checked"' : '', ' class="input_radio" /> <label for="poll_results_voted">', $txt['poll_results_voted'], '</label><br /> <input type="radio" name="poll_hide" id="poll_results_expire" value="2"', $context['poll_options']['hide'] == 2 ? ' checked="checked"' : '', empty($context['poll_options']['expire']) ? 'disabled="disabled"' : '', ' class="input_radio" /> <label for="poll_results_expire">', $txt['poll_results_after'], '</label> </dd> </dl> </fieldset> </div>'; } echo ' <div class="bwgrid"> <div class="bwcell16">'; // Show the actual posting area... if ($context['show_bbc']) { echo ' <div id="bbcBox_message"></div>'; } // What about smileys? if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { echo ' <div id="smileyBox_message"></div>'; } echo ' </div> <div class="bwcell16"> ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), '<br> </div> </div> <div class="bwgrid"> <div class="bwcell4"><div class="inner_right"> '; // If this message has been edited in the past - display when it was. if (isset($context['last_modified'])) { echo ' <div class="padding smalltext"> <strong>', $txt['last_edit'], ':</strong> ', $context['last_modified'], ' </div>'; } echo ' </div></div> <div class="bwcell12">'; // If the admin has enabled the hiding of the additional options - show a link and image for it. if (!empty($settings['additional_options_collapsable'])) { echo ' <div id="postAdditionalOptionsHeader"> <img src="', $settings['images_url'], '/collapse.gif" alt="-" id="postMoreExpand" style="display: none;" /> <strong><a href="#" id="postMoreExpandLink">', $txt['post_additionalopt'], '</a></strong> </div>'; } // Display the check boxes for all the standard options - if they are available to the user! echo ' <div id="postMoreOptions" class="smalltext"> <ul class="post_options nolist"> ', $context['can_notify'] ? '<li><input type="hidden" name="notify" value="0" /><label for="check_notify"><input type="checkbox" name="notify" id="check_notify"' . ($context['notify'] || !empty($options['auto_notify']) ? ' checked="checked"' : '') . ' value="1" class="input_check" /> ' . $txt['notify_replies'] . '</label></li>' : '', ' ', $context['can_lock'] ? '<li><input type="hidden" name="lock" value="0" /><label for="check_lock"><input type="checkbox" name="lock" id="check_lock"' . ($context['locked'] ? ' checked="checked"' : '') . ' value="1" class="input_check" /> ' . $txt['lock_topic'] . '</label></li>' : '', ' <li><label for="check_back"><input type="checkbox" name="goback" id="check_back"' . ($context['back_to_topic'] || !empty($options['return_to_post']) ? ' checked="checked"' : '') . ' value="1" class="input_check" /> ' . $txt['back_to_topic'] . '</label></li> ', $context['can_sticky'] ? '<li><input type="hidden" name="sticky" value="0" /><label for="check_sticky"><input type="checkbox" name="sticky" id="check_sticky"' . ($context['sticky'] ? ' checked="checked"' : '') . ' value="1" class="input_check" /> ' . $txt['sticky_after'] . '</label></li>' : '', ' <li><label for="check_smileys"><input type="checkbox" name="ns" id="check_smileys"', $context['use_smileys'] ? '' : ' checked="checked"', ' value="NS" class="input_check" /> ', $txt['dont_use_smileys'], '</label></li>', ' ', $context['can_move'] ? '<li><input type="hidden" name="move" value="0" /><label for="check_move"><input type="checkbox" name="move" id="check_move" value="1" class="input_check" ' . (!empty($context['move']) ? 'checked="checked" ' : '') . '/> ' . $txt['move_after2'] . '</label></li>' : '', ' ', $context['can_announce'] && $context['is_first_post'] ? '<li><label for="check_announce"><input type="checkbox" name="announce_topic" id="check_announce" value="1" class="input_check" ' . (!empty($context['announce']) ? 'checked="checked" ' : '') . '/> ' . $txt['announce_topic'] . '</label></li>' : '', ' ', $context['show_approval'] ? '<li><label for="approve"><input type="checkbox" name="approve" id="approve" value="2" class="input_check" ' . ($context['show_approval'] === 2 ? 'checked="checked"' : '') . ' /> ' . $txt['approve_this_post'] . '</label></li>' : '', ' </ul> </div> </div> </div>'; // If this post already has attachments on it - give information about them. if (!empty($context['current_attachments'])) { echo ' <dl id="postAttachment"> <dt> ', $txt['attached'], ': </dt> <dd class="smalltext"> <input type="hidden" name="attach_del[]" value="0" /> ', $txt['uncheck_unwatchd_attach'], ': </dd>'; foreach ($context['current_attachments'] as $attachment) { echo ' <dd class="smalltext"> <label for="attachment_', $attachment['id'], '"><input type="checkbox" id="attachment_', $attachment['id'], '" name="attach_del[]" value="', $attachment['id'], '"', empty($attachment['unchecked']) ? ' checked="checked"' : '', ' class="input_check" /> ', $attachment['name'], empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : '', ' ', in_array(substr($attachment['name'], strlen($attachment['name']) - 4, 4), array('.jpg', '.png', '.gif')) ? '<br><img src="' . $scripturl . '?action=dlattach;topic=' . $context['current_topic'] . '.0;attach=' . $attachment['id'] . ';image" style="max-width: 120px;" alt="" />' : '', ' </label> </dd>'; } echo ' </dl>'; } // Is the user allowed to post any additional ones? If so give them the boxes to do it! if ($context['can_post_attachment']) { echo ' <dl id="postAttachment2"> <dt> ', $txt['attach'], ': </dt> <dd class="smalltext"> <input type="file" size="60" name="attachment[]" id="attachment1" class="input_file" /> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)'; // Show more boxes only if they aren't approaching their limit. if ($context['num_allowed_attachments'] > 1) { echo ' <script type="text/javascript"><!-- // --><![CDATA[ var allowed_attachments = ', $context['num_allowed_attachments'], '; var current_attachment = 1; function addAttachment() { allowed_attachments = allowed_attachments - 1; current_attachment = current_attachment + 1; if (allowed_attachments <= 0) return alert("', $txt['more_attachments_error'], '"); setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="60" name="attachment[]" id="attachment\' + current_attachment + \'" class="input_file" /> (<a href="javascript:void(0);" onclick="cleanFileInput(\\\'attachment\' + current_attachment + \'\\\');">', $txt['clean_attach'], '</a>)\' + \'</dd><dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')<\' + \'/a><\' + \'/dd>\'); return true; } // ]]></script> </dd> <dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')</a></dd>'; } echo ' <dd class="smalltext">'; // Show some useful information such as allowed extensions, maximum size and amount of attachments allowed. if (!empty($modSettings['attachmentCheckExtensions'])) { echo ' ', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br />'; } if (!empty($context['attachment_restrictions'])) { echo ' ', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br />'; } if (!$context['can_post_attachment_unapproved']) { echo ' <span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br />'; } echo ' </dd> </dl>'; } // Is visual verification enabled? if ($context['require_verification']) { echo ' <div class="post_verification"> <span', !empty($context['post_error']['need_qr_verification']) ? ' class="error"' : '', '> <strong>', $txt['verification'], ':</strong> </span> ', template_control_verification($context['visual_verification_id'], 'all'), ' </div>'; } // Finally, the submit buttons. echo ' <p class="smalltext" id="shortcuts"> ', $context['browser']['is_firefox'] ? $txt['shortcuts_firefox'] : $txt['shortcuts'], ' </p> <p id="post_confirm_buttons" class="righttext"> ', template_control_richedit_buttons($context['post_box_name']); // Option to delete an event if user is editing one. if ($context['make_event'] && !$context['event']['new']) { echo ' <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" onclick="return confirm(\'', $txt['event_delete_confirm'], '\');" class="button_submit" />'; } echo ' </p> </div> <span class="lowerframe"><span></span></span> </div> <br class="clear" />'; // Assuming this isn't a new topic pass across the last message id. if (isset($context['topic_last_message'])) { echo ' <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '" />'; } echo ' <input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '" /> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" /> </form>'; echo ' <script type="text/javascript"><!-- // --><![CDATA['; // The functions used to preview a posts without loading a new page. echo ' var current_board = ', empty($context['current_board']) ? 'null' : $context['current_board'], '; var make_poll = ', $context['make_poll'] ? 'true' : 'false', '; var txt_preview_title = "', $txt['preview_title'], '"; var txt_preview_fetch = "', $txt['preview_fetch'], '"; var new_replies = new Array(); var reply_counter = ', empty($counter) ? 0 : $counter, '; function previewPost() {'; if ($context['browser']['is_firefox']) { echo ' // Firefox doesn\'t render <marquee> that have been put it using javascript if (document.forms.postmodify.elements[', JavaScriptEscape($context['post_box_name']), '].value.indexOf(\'[move]\') != -1) { return submitThisOnce(document.forms.postmodify); }'; } echo ' if (window.XMLHttpRequest) { // Opera didn\'t support setRequestHeader() before 8.01. if (\'opera\' in window) { var test = new XMLHttpRequest(); if (!(\'setRequestHeader\' in test)) return submitThisOnce(document.forms.postmodify); } // !!! Currently not sending poll options and option checkboxes. var x = new Array(); var textFields = [\'subject\', ', JavaScriptEscape($context['post_box_name']), ', \'icon\', \'guestname\', \'email\', \'evtitle\', \'question\', \'topic\', ', JavaScriptEscape($context['session_var']), ']; var numericFields = [ \'board\', \'topic\', \'last_msg\', \'eventid\', \'calendar\', \'year\', \'month\', \'day\', \'poll_max_votes\', \'poll_expire\', \'poll_change_vote\', \'poll_hide\' ]; var checkboxFields = [ \'ns\' ]; for (var i = 0, n = textFields.length; i < n; i++) if (textFields[i] in document.forms.postmodify) { // Handle the WYSIWYG editor. if (textFields[i] == ', JavaScriptEscape($context['post_box_name']), ' && ', JavaScriptEscape('oEditorHandle_' . $context['post_box_name']), ' in window && oEditorHandle_', $context['post_box_name'], '.bRichTextEnabled) x[x.length] = \'message_mode=1&\' + textFields[i] + \'=\' + oEditorHandle_', $context['post_box_name'], '.getText(false).replace(/&#/g, \'&#\').php_to8bit().php_urlencode(); else x[x.length] = textFields[i] + \'=\' + document.forms.postmodify[textFields[i]].value.replace(/&#/g, \'&#\').php_to8bit().php_urlencode(); } for (var i = 0, n = numericFields.length; i < n; i++) if (numericFields[i] in document.forms.postmodify && \'value\' in document.forms.postmodify[numericFields[i]]) x[x.length] = numericFields[i] + \'=\' + parseInt(document.forms.postmodify.elements[numericFields[i]].value); for (var i = 0, n = checkboxFields.length; i < n; i++) if (checkboxFields[i] in document.forms.postmodify && document.forms.postmodify.elements[checkboxFields[i]].checked) x[x.length] = checkboxFields[i] + \'=\' + document.forms.postmodify.elements[checkboxFields[i]].value; sendXMLDocument(smf_prepareScriptUrl(smf_scripturl) + \'action=post2\' + (current_board ? \';board=\' + current_board : \'\') + (make_poll ? \';poll\' : \'\') + \';preview;xml\', x.join(\'&\'), onDocSent); document.getElementById(\'preview_section\').style.display = \'\'; setInnerHTML(document.getElementById(\'preview_subject\'), txt_preview_title); setInnerHTML(document.getElementById(\'preview_body\'), txt_preview_fetch); return false; } else return submitThisOnce(document.forms.postmodify); } function onDocSent(XMLDoc) { if (!XMLDoc) { document.forms.postmodify.preview.onclick = new function () { return true; } document.forms.postmodify.preview.click(); } // Show the preview section. var preview = XMLDoc.getElementsByTagName(\'smf\')[0].getElementsByTagName(\'preview\')[0]; setInnerHTML(document.getElementById(\'preview_subject\'), preview.getElementsByTagName(\'subject\')[0].firstChild.nodeValue); var bodyText = \'\'; for (var i = 0, n = preview.getElementsByTagName(\'body\')[0].childNodes.length; i < n; i++) bodyText += preview.getElementsByTagName(\'body\')[0].childNodes[i].nodeValue; setInnerHTML(document.getElementById(\'preview_body\'), bodyText); document.getElementById(\'preview_body\').className = \'post\'; // Show a list of errors (if any). var errors = XMLDoc.getElementsByTagName(\'smf\')[0].getElementsByTagName(\'errors\')[0]; var errorList = new Array(); for (var i = 0, numErrors = errors.getElementsByTagName(\'error\').length; i < numErrors; i++) errorList[errorList.length] = errors.getElementsByTagName(\'error\')[i].firstChild.nodeValue; document.getElementById(\'errors\').style.display = numErrors == 0 ? \'none\' : \'\'; document.getElementById(\'error_serious\').style.display = errors.getAttribute(\'serious\') == 1 ? \'\' : \'none\'; setInnerHTML(document.getElementById(\'error_list\'), numErrors == 0 ? \'\' : errorList.join(\'<br />\')); // Show a warning if the topic has been locked. document.getElementById(\'lock_warning\').style.display = errors.getAttribute(\'topic_locked\') == 1 ? \'\' : \'none\'; // Adjust the color of captions if the given data is erroneous. var captions = errors.getElementsByTagName(\'caption\'); for (var i = 0, numCaptions = errors.getElementsByTagName(\'caption\').length; i < numCaptions; i++) if (document.getElementById(\'caption_\' + captions[i].getAttribute(\'name\'))) document.getElementById(\'caption_\' + captions[i].getAttribute(\'name\')).className = captions[i].getAttribute(\'class\'); if (errors.getElementsByTagName(\'post_error\').length == 1) document.forms.postmodify.', $context['post_box_name'], '.style.border = \'1px solid red\'; else if (document.forms.postmodify.', $context['post_box_name'], '.style.borderColor == \'red\' || document.forms.postmodify.', $context['post_box_name'], '.style.borderColor == \'red red red red\') { if (\'runtimeStyle\' in document.forms.postmodify.', $context['post_box_name'], ') document.forms.postmodify.', $context['post_box_name'], '.style.borderColor = \'\'; else document.forms.postmodify.', $context['post_box_name'], '.style.border = null; } // Set the new last message id. if (\'last_msg\' in document.forms.postmodify) document.forms.postmodify.last_msg.value = XMLDoc.getElementsByTagName(\'smf\')[0].getElementsByTagName(\'last_msg\')[0].firstChild.nodeValue; // Remove the new image from old-new replies! for (i = 0; i < new_replies.length; i++) document.getElementById(\'image_new_\' + new_replies[i]).style.display = \'none\'; new_replies = new Array(); var ignored_replies = new Array(), ignoring; var newPosts = XMLDoc.getElementsByTagName(\'smf\')[0].getElementsByTagName(\'new_posts\')[0] ? XMLDoc.getElementsByTagName(\'smf\')[0].getElementsByTagName(\'new_posts\')[0].getElementsByTagName(\'post\') : {length: 0}; var numNewPosts = newPosts.length; if (numNewPosts != 0) { var newPostsHTML = \'<span id="new_replies"><\' + \'/span>\'; for (var i = 0; i < numNewPosts; i++) { new_replies[new_replies.length] = newPosts[i].getAttribute("id"); ignoring = false; if (newPosts[i].getElementsByTagName("is_ignored")[0].firstChild.nodeValue != 0) ignored_replies[ignored_replies.length] = ignoring = newPosts[i].getAttribute("id"); newPostsHTML += \'<div class="windowbg\' + (++reply_counter % 2 == 0 ? \'2\' : \'\') + \' core_posts"><span class="topslice"><span></span></span><div class="content" id="msg\' + newPosts[i].getAttribute("id") + \'"><div class="floatleft"><h5>', $txt['posted_by'], ': \' + newPosts[i].getElementsByTagName("poster")[0].firstChild.nodeValue + \'</h5><span class="smalltext">« <strong>', $txt['on'], ':</strong> \' + newPosts[i].getElementsByTagName("time")[0].firstChild.nodeValue + \' »</span> <img src="\' + smf_images_url + \'/', $context['user']['language'], '/new.gif" alt="', $txt['preview_new'], '" id="image_new_\' + newPosts[i].getAttribute("id") + \'" /></div>\';'; if ($context['can_quote']) { echo ' newPostsHTML += \'<ul class="reset smalltext quickbuttons" id="msg_\' + newPosts[i].getAttribute("id") + \'_quote"><li class="quote_button"><a href="#postmodify" onclick="return insertQuoteFast(\\\'\' + newPosts[i].getAttribute("id") + \'\\\');"><span>', $txt['bbc_quote'], '</span><\' + \'/a></li></ul>\';'; } echo ' newPostsHTML += \'<br class="clear" />\'; if (ignoring) newPostsHTML += \'<div id="msg_\' + newPosts[i].getAttribute("id") + \'_ignored_prompt" class="smalltext">', $txt['ignoring_user'], '<a href="#" id="msg_\' + newPosts[i].getAttribute("id") + \'_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a></div>\'; newPostsHTML += \'<div class="list_posts smalltext" id="msg_\' + newPosts[i].getAttribute("id") + \'_body">\' + newPosts[i].getElementsByTagName("message")[0].firstChild.nodeValue + \'<\' + \'/div></div><span class="botslice"><span></span></span></div>\'; } setOuterHTML(document.getElementById(\'new_replies\'), newPostsHTML); } var numIgnoredReplies = ignored_replies.length; if (numIgnoredReplies != 0) { for (var i = 0; i < numIgnoredReplies; i++) { aIgnoreToggles[ignored_replies[i]] = new smc_Toggle({ bToggleEnabled: true, bCurrentlyCollapsed: true, aSwappableContainers: [ \'msg_\' + ignored_replies[i] + \'_body\', \'msg_\' + ignored_replies[i] + \'_quote\', ], aSwapLinks: [ { sId: \'msg_\' + ignored_replies[i] + \'_ignored_link\', msgExpanded: \'\', msgCollapsed: ', JavaScriptEscape($txt['show_ignore_user_post']), ' } ] }); } } if (typeof(smf_codeFix) != \'undefined\') smf_codeFix(); }'; // Code for showing and hiding additional options. if (!empty($settings['additional_options_collapsable'])) { echo ' var oSwapAdditionalOptions = new smc_Toggle({ bToggleEnabled: true, bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ', funcOnBeforeCollapse: function () { document.getElementById(\'additional_options\').value = \'0\'; }, funcOnBeforeExpand: function () { document.getElementById(\'additional_options\').value = \'1\'; }, aSwappableContainers: [ \'postMoreOptions\', \'postAttachment\', \'postAttachment2\', \'postAttachment3\' ], aSwapImages: [ { sId: \'postMoreExpand\', srcExpanded: smf_images_url + \'/collapse.gif\', altExpanded: \'-\', srcCollapsed: smf_images_url + \'/expand.gif\', altCollapsed: \'+\' } ], aSwapLinks: [ { sId: \'postMoreExpandLink\', msgExpanded: ', JavaScriptEscape($txt['post_additionalopt']), ', msgCollapsed: ', JavaScriptEscape($txt['post_additionalopt']), ' } ] });'; } echo ' // ]]></script>'; // If the user is replying to a topic show the previous posts. if (isset($context['previous_posts']) && count($context['previous_posts']) > 0) { echo ' <div id="recent" class="flow_hidden main_section"> <div class="cat_bar"> <h3 class="catbg">', $txt['topic_summary'], '</h3> </div> <span id="new_replies"></span>'; $ignored_posts = array(); foreach ($context['previous_posts'] as $post) { $ignoring = false; if (!empty($post['is_ignored'])) { $ignored_posts[] = $ignoring = $post['id']; } echo ' <div class="', $post['alternate'] == 0 ? 'windowbg' : 'windowbg2', ' core_posts"> <span class="topslice"><span></span></span> <div class="content" id="msg', $post['id'], '"> <div class="floatleft"> <h5>', $txt['posted_by'], ': ', $post['poster'], '</h5> <span class="smalltext">« <strong>', $txt['on'], ':</strong> ', $post['time'], ' »</span> </div>'; if ($context['can_quote']) { echo ' <ul class="reset smalltext quickbuttons" id="msg_', $post['id'], '_quote"> <li class="quote_button"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span>', $txt['bbc_quote'], '</span></a></li> </ul>'; } echo ' <br class="clear" />'; if ($ignoring) { echo ' <div id="msg_', $post['id'], '_ignored_prompt" class="smalltext"> ', $txt['ignoring_user'], ' <a href="#" id="msg_', $post['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a> </div>'; } echo ' <div class="list_posts smalltext" id="msg_', $post['id'], '_body">', $post['message'], '</div> </div> <span class="botslice"><span></span></span> </div>'; } echo ' </div> <script type="text/javascript"><!-- // --><![CDATA[ var aIgnoreToggles = new Array();'; foreach ($ignored_posts as $post_id) { echo ' aIgnoreToggles[', $post_id, '] = new smc_Toggle({ bToggleEnabled: true, bCurrentlyCollapsed: true, aSwappableContainers: [ \'msg_', $post_id, '_body\', \'msg_', $post_id, '_quote\', ], aSwapLinks: [ { sId: \'msg_', $post_id, '_ignored_link\', msgExpanded: \'\', msgCollapsed: ', JavaScriptEscape($txt['show_ignore_user_post']), ' } ] });'; } echo ' function insertQuoteFast(messageid) { if (window.XMLHttpRequest) getXMLDocument(smf_prepareScriptUrl(smf_scripturl) + \'action=quotefast;quote=\' + messageid + \';xml;pb=', $context['post_box_name'], ';mode=\' + (oEditorHandle_', $context['post_box_name'], '.bRichTextEnabled ? 1 : 0), onDocReceived); else reqWin(smf_prepareScriptUrl(smf_scripturl) + \'action=quotefast;quote=\' + messageid + \';pb=', $context['post_box_name'], ';mode=\' + (oEditorHandle_', $context['post_box_name'], '.bRichTextEnabled ? 1 : 0), 240, 90); return true; } function onDocReceived(XMLDoc) { var text = \'\'; for (var i = 0, n = XMLDoc.getElementsByTagName(\'quote\')[0].childNodes.length; i < n; i++) text += XMLDoc.getElementsByTagName(\'quote\')[0].childNodes[i].nodeValue; oEditorHandle_', $context['post_box_name'], '.insertText(text, false, true); } // ]]></script>'; } }
/** * @name ElkArte Forum * @copyright ElkArte Forum contributors * @license BSD http://opensource.org/licenses/BSD-3-Clause * * This software is a derived product, based on: * * Simple Machines Forum (SMF) * copyright: 2011 Simple Machines (http://www.simplemachines.org) * license: BSD, See included LICENSE.TXT for terms and conditions. * * @version 1.0 Alpha */ function template_main() { global $context, $settings, $options, $txt, $scripturl, $modSettings; // Let them know, if their report was a success! if ($context['report_sent']) { echo ' <div class="infobox"> ', $txt['report_sent'], ' </div>'; } // Show the anchor for the top and for the first message. If the first message is new, say so. echo ' <a id="msg', $context['first_message'], '"></a>', $context['first_new_message'] ? '<a name="new" id="new"></a>' : ''; // Is this topic also a poll? if ($context['is_poll']) { echo ' <div id="poll"> <div class="cat_bar"> <h3 class="catbg"> <img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.png" alt="" class="icon" /> ', $txt['poll'], ' </h3> </div> <div class="windowbg"> <div class="content" id="poll_options"> <h4 id="pollquestion"> ', $context['poll']['question'], ' </h4>'; // Are they not allowed to vote but allowed to view the options? if ($context['poll']['show_results'] || !$context['allow_vote']) { echo ' <dl class="options">'; // Show each option with its corresponding percentage bar. foreach ($context['poll']['options'] as $option) { echo ' <dt class="', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt> <dd class="statsbar', $option['voted_this'] ? ' voted' : '', '">'; if ($context['allow_poll_view']) { echo ' ', $option['bar_ndt'], ' <span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>'; } echo ' </dd>'; } echo ' </dl>'; if ($context['allow_poll_view']) { echo ' <p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>'; } } else { echo ' <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="UTF-8">'; // Show a warning if they are allowed more than one option. if ($context['poll']['allowed_warning']) { echo ' <p class="smallpadding">', $context['poll']['allowed_warning'], '</p>'; } echo ' <ul class="reset options">'; // Show each option with its button - a radio likely. foreach ($context['poll']['options'] as $option) { echo ' <li>', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>'; } echo ' </ul> <div class="submitbutton"> <input type="submit" value="', $txt['poll_vote'], '" class="button_submit" /> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> </div> </form>'; } // Is the clock ticking? if (!empty($context['poll']['expire_time'])) { echo ' <p><strong>', $context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on'], ':</strong> ', $context['poll']['expire_time'], '</p>'; } echo ' </div> </div> </div> <div id="pollmoderation">'; template_button_strip($context['poll_buttons']); echo ' </div>'; } // Does this topic have some events linked to it? if (!empty($context['linked_calendar_events'])) { echo ' <div class="linked_events"> <div class="title_bar"> <h3 class="titlebg headerpadding">', $txt['calendar_linked_events'], '</h3> </div> <div class="windowbg"> <div class="content"> <ul class="reset">'; foreach ($context['linked_calendar_events'] as $event) { echo ' <li> ', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '"> <img src="' . $settings['images_url'] . '/icons/calendar_modify.png" alt="" title="' . $txt['modify'] . '" class="edit_event" /></a> ' : '', '<strong>', $event['title'], '</strong>: ', $event['start_date'], $event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : '', ' </li>'; } echo ' </ul> </div> </div> </div>'; } // Show the page index... "Pages: [1]". echo ' <div class="pagesection"> ', template_button_strip($context['normal_buttons'], 'right'), ' ', !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a id="pagetop" href="#bot" class="topbottom floatleft">' . $txt['go_down'] . '</a>' : '', ' <div class="pagelinks floatleft"> ', $context['page_index'], ' </div> </div>'; // Show the topic information - icon, subject, etc. echo ' <div id="forumposts"> <div class="cat_bar"> <h3 class="catbg"> <img src="', $settings['images_url'], '/topic/', $context['class'], '.png" alt="" /> ', $txt['topic'], ': ', $context['subject'], ' <span>(', $context['num_views_text'], ')</span> <span class="nextlinks floatright">', $context['previous_next'], '</span> </h3> </div>'; if (!empty($settings['display_who_viewing'])) { echo ' <p id="whoisviewing">'; // Show just numbers...? if ($settings['display_who_viewing'] == 1) { echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members']; } else { 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'] . ')'); } // Now show how many guests are here too. echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], ' </p>'; } echo ' <form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="UTF-8" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return oQuickModify.bInEditMode ? oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\') : false">'; $ignoredMsgs = array(); $removableMessageIDs = array(); $alternate = false; // Get all the messages... while ($message = $context['get_message']()) { $ignoring = false; $alternate = !$alternate; if ($message['can_remove']) { $removableMessageIDs[] = $message['id']; } // Are we ignoring this message? if (!empty($message['is_ignored'])) { $ignoring = true; $ignoredMsgs[] = $message['id']; } // Show the message anchor and a "new" anchor if this message is new. echo ' <div class="', $message['approved'] ? $message['alternate'] == 0 ? 'windowbg' : 'windowbg2' : 'approvebg', '">', $message['id'] != $context['first_message'] ? ' <a id="msg' . $message['id'] . '"></a>' . ($message['first_new'] ? '<a name="new" id="new"></a>' : '') : '', ' <div class="post_wrapper">'; // Showing the sidebar posting area? if (empty($options['hide_poster_area'])) { echo ' <div class="poster">', template_build_poster_div($message, $ignoring), '</div> <div class="postarea">'; } echo ' <div class="keyinfo"> ', !empty($options['hide_poster_area']) ? '<div class="poster poster2" style="">' . template_build_poster_div($message, $ignoring) . '</div>' : ''; if (!empty($context['follow_ups'][$message['id']])) { echo ' <ul class="follow_ups quickbuttons"> <li>', $txt['follow_ups'], ' <ul>'; foreach ($context['follow_ups'][$message['id']] as $follow_up) { echo ' <li><a href="', $scripturl, '?topic=', $follow_up['follow_up'], '.0">', $follow_up['subject'], '</a></li>'; } echo ' </ul> </li> </ul>'; } echo ' <span id="post_subject_', $message['id'], '" class="post_subject">', $message['subject'], '</span> <span id="messageicon_', $message['id'], '" class="messageicon" ', $message['icon_url'] !== $settings['images_url'] . '/post/xx.png' ? '' : 'style="display:none;"', '> <img src="', $message['icon_url'] . '" alt=""', $message['can_modify'] ? ' id="msg_icon_' . $message['id'] . '"' : '', ' /> </span> <h5 id="info_', $message['id'], '"> <a href="', $message['href'], '" rel="nofollow" title="', !empty($message['counter']) ? sprintf($txt['reply_number'], $message['counter']) : '', '">', !empty($message['counter']) ? sprintf($txt['reply_number'], $message['counter']) : '', '</a>', !empty($message['counter']) ? ' – ' : '', $message['time'], ' </h5> <div id="msg_', $message['id'], '_quick_mod"', $ignoring ? ' style="display:none;"' : '', '></div> </div>'; // Ignoring this user? Hide the post. if ($ignoring) { echo ' <div id="msg_', $message['id'], '_ignored_prompt"> ', $txt['ignoring_user'], ' <a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a> </div>'; } // Show the post itself, finally! echo ' <div class="post">'; if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) { echo ' <div class="approve_post"> ', $txt['post_awaiting_approval'], ' </div>'; } echo ' <div class="inner" id="msg_', $message['id'], '"', $ignoring ? ' style="display:none;"' : '', '>', $message['body'], '</div> </div>'; // Assuming there are attachments... if (!empty($message['attachment'])) { echo ' <div id="msg_', $message['id'], '_footer" class="attachments"', $ignoring ? ' style="display:none;"' : '', '>'; $last_approved_state = 1; $attachments_per_line = 4; $i = 0; foreach ($message['attachment'] as $attachment) { // Show a special box for unapproved attachments... if ($attachment['is_approved'] != $last_approved_state) { $last_approved_state = 0; echo ' <fieldset> <legend>', $txt['attach_awaiting_approve']; if ($context['can_approve']) { echo ' [<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]'; } echo ' </legend>'; } echo ' <div class="floatleft">'; if ($attachment['is_image']) { echo ' <div class="attachments_top">'; if ($attachment['thumbnail']['has_thumb']) { echo ' <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" /></a>'; } else { echo ' <img src="' . $attachment['href'] . ';image" alt="" style="width:' . $attachment['width'] . 'px; height:' . $attachment['height'] . 'px"/>'; } echo ' </div>'; } echo ' <div class="attachments_bot"> <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.png" class="centericon" alt="*" /> ' . $attachment['name'] . '</a> '; if (!$attachment['is_approved'] && $context['can_approve']) { echo ' [<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>] | [<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] '; } echo ' <br />', $attachment['size'], $attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . '<br />' . sprintf($txt['attach_viewed'], $attachment['downloads']) : '<br />' . sprintf($txt['attach_downloaded'], $attachment['downloads']), ' </div>'; echo ' </div>'; // Next attachment line ? if (++$i % $attachments_per_line === 0) { echo ' <hr />'; } } // If we had unapproved attachments clean up. if ($last_approved_state == 0) { echo ' </fieldset>'; } echo ' </div>'; } if (empty($options['hide_poster_area'])) { echo ' </div>'; } // Show the quickbuttons, for various operations on posts. echo ' <div class="quickbuttons_wrap"', empty($options['hide_poster_area']) ? '' : ' style="margin:0"', '> <ul class="quickbuttons nojs_visible">'; // Show "Last Edit: Time by Person" if this post was edited. if ($settings['show_modify'] && !empty($message['modified']['name'])) { echo ' <li class="modified" id="modified_', $message['id'], '"> ', $message['modified']['last_edit_text'], ' </li>'; } // Show a checkbox for quick moderation? if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) { echo ' <li class="inline_mod_check" style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>'; } // Maybe they can modify the post (this is the more button) if ($message['can_modify']) { echo ' <li class="post_options"><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '">', $txt['post_options'], '</a>'; } if ($message['can_modify'] || $message['can_remove'] || $context['can_split'] && !empty($context['real_num_replies']) || $context['can_restore_msg'] || $message['can_approve'] || $message['can_unapprove'] || $context['can_report_moderator']) { // Let show them the other options they may have in a nice pulldown echo ' <ul>'; // Can the user modify the contents of this post? if ($message['can_modify']) { echo ' <li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '" class="modify_button">', $txt['modify'], '</a></li>'; } // How about... even... remove it entirely?! if ($message['can_remove']) { echo ' <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'], '?\');" class="remove_button">', $txt['remove'], '</a></li>'; } // What about splitting it off the rest of the topic? if ($context['can_split'] && !empty($context['real_num_replies'])) { echo ' <li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '" class="split_button">', $txt['split'], '</a></li>'; } // Can we restore topics? if ($context['can_restore_msg']) { echo ' <li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" class="restore_button">', $txt['restore_message'], '</a></li>'; } // Maybe we can approve it, maybe we should? if ($message['can_approve']) { echo ' <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'], '" class="approve_button">', $txt['approve'], '</a></li>'; } // Maybe we can unapprove it? if ($message['can_unapprove']) { echo ' <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'], '" class="unapprove_button">', $txt['unapprove'], '</a></li>'; } // Maybe they want to report this post to the moderator(s)? if ($context['can_report_moderator']) { echo ' <li><a href="' . $scripturl . '?action=reporttm;topic=' . $context['current_topic'] . '.' . $message['counter'] . ';msg=' . $message['id'] . '" class="warn_button">' . $txt['report_to_mod'] . '</a></li>'; } echo ' </ul>'; } // Can the user quick modify the contents of this post? Show the quick (inline) modify button. if ($message['can_modify']) { echo ' </li> <li class="quick_edit"><img src="', $settings['images_url'], '/icons/modify_inline.png" alt="', $txt['modify_msg'], '" title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\')" />', $txt['quick_edit'], '</li>'; } // Can they reply? Have they turned on quick reply? if ($context['can_quote'] && !empty($options['display_quick_reply'])) { echo ' <li class="quote"><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'], ');" class="quote_button">', $txt['quote'], '</a>'; } elseif ($context['can_quote']) { echo ' <li class="quote"><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" class="quote_button">', $txt['quote'], '</a>'; } if ($context['can_follow_up']) { echo ' <ul> <li><a href="', $scripturl, '?action=post;board=', $context['current_board'], ';quote=', $message['id'], ';followup=', $message['id'], '">', $txt['quote_new'], '</a></li> </ul> </li>'; } echo ' </ul> </div>'; echo ' <div class="moderatorbar"', empty($options['hide_poster_area']) ? '' : ' style="margin:0"', '>'; // Are there any custom profile fields for above the signature? if (!empty($message['member']['custom_fields'])) { $shown = false; foreach ($message['member']['custom_fields'] as $custom) { if ($custom['placement'] != 2 || empty($custom['value'])) { continue; } if (empty($shown)) { $shown = true; echo ' <div class="custom_fields_above_signature"> <ul class="reset nolist">'; } echo ' <li>', $custom['value'], '</li>'; } if ($shown) { echo ' </ul> </div>'; } } // Show the member's signature? if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) { echo ' <div class="signature" id="msg_', $message['id'], '_signature"', $ignoring ? ' style="display:none;"' : '', '>', $message['member']['signature'], '</div>'; } echo ' </div> </div> </div> <hr class="post_separator" />'; } echo ' </form> </div>'; // Show the page index... "Pages: [1]". echo ' <div class="pagesection"> ', template_button_strip($context['normal_buttons'], 'right'), ' ', !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a id="pagebot" href="#top" class="topbottom floatleft">' . $txt['go_up'] . '</a>' : '', ' <div class="pagelinks floatleft"> ', $context['page_index'], ' </div> </div>'; // Show the lower breadcrumbs. theme_linktree(); echo ' <div id="moderationbuttons">', template_button_strip($context['mod_buttons'], 'bottom', array('id' => 'moderationbuttons_strip')), '</div>'; // Show the jumpto box, or actually...let Javascript do it. echo ' <div class="plainbox" id="display_jump_to"> </div>'; if ($context['can_reply'] && !empty($options['display_quick_reply'])) { echo ' <a id="quickreply"></a> <div class="tborder" id="quickreplybox"> <div class="cat_bar"> <h3 class="catbg"> <a href="javascript:oQuickReply.swap();"><img src="', $settings['images_url'], '/', $options['display_quick_reply'] > 1 ? 'collapse' : 'expand', '.png" alt="+" id="quickReplyExpand" class="icon" /></a> <a href="javascript:oQuickReply.swap();">', $txt['quick_reply'], '</a> </h3> </div> <div id="quickReplyOptions"', $options['display_quick_reply'] > 1 ? '' : ' style="display: none"', '> <div class="roundframe"> <p class="smalltext lefttext">', $txt['quick_reply_desc'], '</p> ', $context['is_locked'] ? '<p class="alert smalltext">' . $txt['quick_reply_warning'] . '</p>' : '', $context['oldTopicError'] ? '<p class="alert smalltext">' . sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']) . '</p>' : '', ' ', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', ' ', !$context['can_reply_approved'] && $context['require_verification'] ? '<br />' : '', ' <form action="', $scripturl, '?board=', $context['current_board'], ';action=post2" method="post" accept-charset="UTF-8" name="postmodify" id="postmodify" onsubmit="submitonce(this);" > <input type="hidden" name="topic" value="', $context['current_topic'], '" /> <input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '" /> <input type="hidden" name="icon" value="xx" /> <input type="hidden" name="from_qr" value="1" /> <input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" /> <input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '" /> <input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" /> <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '" /> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />'; // Guests just need more. if ($context['user']['is_guest']) { echo ' <strong>', $txt['name'], ':</strong> <input type="text" name="guestname" value="', $context['name'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /> <strong>', $txt['email'], ':</strong> <input type="text" name="email" value="', $context['email'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /><br />'; } // Is visual verification enabled? if ($context['require_verification']) { echo ' <strong>', $txt['verification'], ':</strong>', template_control_verification($context['visual_verification_id'], 'quick_reply'), '<br />'; } // Using the full editor if (empty($options['use_editor_quick_reply'])) { echo ' <div class="quickReplyContent"> <textarea cols="600" rows="7" name="message" tabindex="', $context['tabindex']++, '"></textarea> </div>'; } else { // Show the actual posting area... if ($context['show_bbc']) { echo ' <div id="bbcBox_message"></div>'; } // What about smileys? if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { echo ' <div id="smileyBox_message"></div>'; } echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), ' <script><!-- // --><![CDATA[ var post_box_name = "', $context['post_box_name'], '"; // ]]></script>'; } echo ' <div class="padding"> <input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="', $context['tabindex']++, '" class="button_submit" /> <input type="submit" name="preview" value="', $txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />'; if ($context['show_spellchecking']) { echo ' <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\', ', empty($options['use_editor_quick_reply']) ? 'false' : 'true', ')" tabindex="', $context['tabindex']++, '" class="button_submit" />'; } if ($context['drafts_save'] && !empty($options['display_quick_reply'])) { echo ' <input type="submit" name="save_draft" value="', $txt['draft_save'], '" onclick="return confirm(' . JavaScriptEscape($txt['draft_save_note']) . ') && submitThisOnce(this);" accesskey="d" tabindex="', $context['tabindex']++, '" class="button_submit" /> <input type="hidden" id="id_draft" name="id_draft" value="', empty($context['id_draft']) ? 0 : $context['id_draft'], '" />'; if (!empty($context['drafts_autosave']) && !empty($options['drafts_autosave_enabled'])) { echo ' <div class="clear righttext padding"><span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon" /> </span><span id="draft_lastautosave"></span></div>'; } } echo ' </div> </form> </div> </div> </div>'; } else { echo ' <br class="clear" />'; } // draft autosave available and the user has it enabled? if (!empty($context['drafts_autosave']) && !empty($options['drafts_autosave_enabled']) && !empty($options['display_quick_reply'])) { echo ' <script><!-- // --><![CDATA[ var oDraftAutoSave = new elk_DraftAutoSave({ sSelf: \'oDraftAutoSave\', sLastNote: \'draft_lastautosave\', sLastID: \'id_draft\', sSceditorID: ' . (!empty($context['post_box_name']) ? "'" . $context['post_box_name'] . "'" : "null") . ', sType: \'', !empty($options['use_editor_quick_reply']) ? 'qpost' : 'quick', '\', iBoard: ', empty($context['current_board']) ? 0 : $context['current_board'], ', iFreq: ', isset($context['drafts_autosave_frequency']) ? $context['drafts_autosave_frequency'] : 30000, ', }); // ]]></script>'; } // Spell check for quick modify and quick reply (w/o the editor) if ($context['show_spellchecking'] && (empty($options['use_editor_quick_reply']) || empty($options['display_quick_reply']))) { echo ' <form name="spell_form" id="spell_form" method="post" accept-charset="UTF-8" target="spellWindow" action="', $scripturl, '?action=spellcheck"> <input type="hidden" name="spellstring" value="" /> <input type="hidden" name="fulleditor" value="" /> </form> <script src="' . $settings['default_theme_url'] . '/scripts/spellcheck.js"></script>'; } echo ' <script><!-- // --><![CDATA['; if (!empty($options['display_quick_reply'])) { echo ' var oQuickReply = new QuickReply({ bDefaultCollapsed: ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] > 1 ? 'false' : 'true', ', iTopicId: ', $context['current_topic'], ', iStart: ', $context['start'], ', sScriptUrl: smf_scripturl, sImagesUrl: smf_images_url, sContainerId: "quickReplyOptions", sImageId: "quickReplyExpand", sImageCollapsed: "collapse.png", sImageExpanded: "expand.png", sJumpAnchor: "quickreply", bIsFull: ', !empty($options['use_editor_quick_reply']) ? 'true' : 'false', ' });'; } if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post']) { echo ' var oInTopicModeration = new InTopicModeration({ sSelf: \'oInTopicModeration\', sCheckboxContainerMask: \'in_topic_mod_check_\', aMessageIds: [\'', implode('\', \'', $removableMessageIDs), '\'], sSessionId: smf_session_id, sSessionVar: smf_session_var, sButtonStrip: \'moderationbuttons\', sButtonStripDisplay: \'moderationbuttons_strip\', bUseImageButton: false, bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ', sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\', sRemoveButtonImage: \'delete_selected.png\', sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\', bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ', sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\', sRestoreButtonImage: \'restore_selected.png\', sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\', bCanSplit: ', $context['can_split'] ? 'true' : 'false', ', sSplitButtonLabel: \'', $txt['quickmod_split_selected'], '\', sSplitButtonImage: \'split_selected.png\', sSplitButtonConfirm: \'', $txt['quickmod_confirm'], '\', sFormId: \'quickModForm\' });'; } echo ' if (\'XMLHttpRequest\' in window) { var oQuickModify = new QuickModify({ sIconHide: \'xx.png\', sScriptUrl: smf_scripturl, sClassName: \'quick_edit\', sIDSubject: \'post_subject_\', sIDInfo: \'info_\', bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ', iTopicId: ', $context['current_topic'], ', sTemplateBodyEdit: ', JavaScriptEscape(' <div id="quick_edit_body_container" style="width: 90%"> <div id="error_box" class="errorbox" style="display:none;"></div> <textarea class="editor" name="message" rows="12" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 100%; min-width: 100%' : 'width: 100%') . '; margin-bottom: 10px;" tabindex="' . $context['tabindex']++ . '">%body%</textarea><br /> <input type="hidden" name="\' + smf_session_var + \'" value="\' + smf_session_id + \'" /> <input type="hidden" name="topic" value="' . $context['current_topic'] . '" /> <input type="hidden" name="msg" value="%msg_id%" /> <div class="righttext"> <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" /> ' . ($context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" tabindex="' . $context['tabindex']++ . '" onclick="spellCheck(\'quickModForm\', \'message\');" class="button_submit" /> ' : '') . '<input type="submit" name="cancel" value="' . $txt['modify_cancel'] . '" tabindex="' . $context['tabindex']++ . '" onclick="return oQuickModify.modifyCancel();" class="button_submit" /> </div> </div>'), ', sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ', sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 85%;" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />'), ', sTemplateSubjectNormal: ', JavaScriptEscape('%subject%'), ', sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ': %subject% (' . $context['num_views_text'] . ')'), ', sTemplateInfoNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a><span class="smalltext modified" id="modified_%msg_id%"></span>'), ', sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), $context['can_reply'] && !empty($options['display_quick_reply']) ? ', sFormRemoveAccessKeys: \'postmodify\'' : '', ' }); aJumpTo[aJumpTo.length] = new JumpTo({ sContainerId: "display_jump_to", sJumpToTemplate: "<label class=\\"smalltext\\" for=\\"%select_id%\\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%", iCurBoardId: ', $context['current_board'], ', iCurBoardChildLevel: ', $context['jump_to']['child_level'], ', sCurBoardName: "', $context['jump_to']['board_name'], '", sBoardChildLevelIndicator: "==", sBoardPrefix: "=> ", sCatSeparator: "-----------------------------", sCatPrefix: "", sGoButtonLabel: "', $txt['go'], '" }); aIconLists[aIconLists.length] = new IconList({ sBackReference: "aIconLists[" + aIconLists.length + "]", sIconIdPrefix: "msg_icon_", sScriptUrl: smf_scripturl, bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ', iBoardId: ', $context['current_board'], ', iTopicId: ', $context['current_topic'], ', sSessionId: smf_session_id, sSessionVar: smf_session_var, sAction: "messageicons;board=', $context['current_board'], '" , sLabelIconList: "', $txt['message_icon'], '", sBoxBackground: "transparent", sBoxBackgroundHover: "#ffffff", iBoxBorderWidthHover: 1, sBoxBorderColorHover: "#adadad" , sContainerBackground: "#ffffff", sContainerBorder: "1px solid #adadad", sItemBorder: "1px solid #ffffff", sItemBorderHover: "1px dotted gray", sItemBackground: "transparent", sItemBackgroundHover: "#e0e0f0" }); }'; if (!empty($ignoredMsgs)) { echo ' ignore_toggles([', implode(', ', $ignoredMsgs), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');'; } echo ' // ]]></script>'; }
function template_send() { global $context, $settings, $options, $scripturl, $modSettings, $txt; // Show which messages were sent successfully and which failed. if (!empty($context['send_log'])) { echo ' <div class="cat_bar"> <h3 class="catbg">', $txt['pm_send_report'], '</h3> </div> <div class="windowbg"> <span class="topslice"><span></span></span> <div class="content">'; if (!empty($context['send_log']['sent'])) { foreach ($context['send_log']['sent'] as $log_entry) { echo '<span class="error">', $log_entry, '</span><br />'; } } if (!empty($context['send_log']['failed'])) { foreach ($context['send_log']['failed'] as $log_entry) { echo '<span class="error">', $log_entry, '</span><br />'; } } echo ' </div> <span class="botslice"><span></span></span> </div> <br />'; } // Show the preview of the personal message. if (isset($context['preview_message'])) { echo ' <div class="cat_bar"> <h3 class="catbg">', $context['preview_subject'], '</h3> </div> <div class="windowbg"> <span class="topslice"><span></span></span> <div class="content"> ', $context['preview_message'], ' </div> <span class="botslice"><span></span></span> </div> <br />'; } // Main message editing box. echo ' <div class="cat_bar"> <h3 class="catbg"> <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/im_newmsg.gif" alt="', $txt['new_message'], '" title="', $txt['new_message'], '" /> ', $txt['new_message'], '</span> </h3> </div>'; echo ' <form action="', $scripturl, '?action=pm;sa=send2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);smc_saveEntities(\'postmodify\', [\'subject\', \'message\']);"> <div> <span class="upperframe"><span></span></span> <div class="roundframe">'; // If there were errors for sending the PM, show them. if (!empty($context['post_error']['messages'])) { echo ' <div class="errorbox"> <strong>', $txt['error_while_submitting'], '</strong> <ul>'; foreach ($context['post_error']['messages'] as $error) { echo ' <li class="error">', $error, '</li>'; } echo ' </ul> </div>'; } echo ' <dl id="post_header">'; // To and bcc. Include a button to search for members. echo ' <dt> <span', isset($context['post_error']['no_to']) || isset($context['post_error']['bad_to']) ? ' class="error"' : '', '>', $txt['pm_to'], ':</span> </dt>'; // Autosuggest will be added by the JavaScript later on. echo ' <dd> <input type="text" name="to" id="to_control" value="', $context['to_value'], '" tabindex="', $context['tabindex']++, '" size="40" style="width: 130px;" class="input_text" />'; // A link to add BCC, only visible with JavaScript enabled. echo ' <span class="smalltext" id="bcc_link_container" style="display: none;"></span>'; // A div that'll contain the items found by the autosuggest. echo ' <div id="to_item_list_container"></div>'; echo ' </dd>'; // This BCC row will be hidden by default if JavaScript is enabled. echo ' <dt id="bcc_div"> <span', isset($context['post_error']['no_to']) || isset($context['post_error']['bad_bcc']) ? ' class="error"' : '', '>', $txt['pm_bcc'], ':</span> </dt> <dd id="bcc_div2"> <input type="text" name="bcc" id="bcc_control" value="', $context['bcc_value'], '" tabindex="', $context['tabindex']++, '" size="40" style="width: 130px;" class="input_text" /> <div id="bcc_item_list_container"></div> </dd>'; // The subject of the PM. echo ' <dt> <span', isset($context['post_error']['no_subject']) ? ' class="error"' : '', '>', $txt['subject'], ':</span> </dt> <dd> <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="40" maxlength="50" /> </dd> </dl>'; // Showing BBC? if ($context['show_bbc']) { echo ' <div id="bbcBox_message"></div>'; } // What about smileys? if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { echo ' <div id="smileyBox_message"></div>'; } // Show BBC buttons, smileys and textbox. echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); // Require an image to be typed to save spamming? if ($context['require_verification']) { echo ' <div class="post_verification"> <strong>', $txt['pm_visual_verification_label'], ':</strong> ', template_control_verification($context['visual_verification_id'], 'all'), ' </div>'; } // Send, Preview, spellcheck buttons. echo ' <p><label for="outbox"><input type="checkbox" name="outbox" id="outbox" value="1" tabindex="', $context['tabindex']++, '"', $context['copy_to_outbox'] ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['pm_save_outbox'], '</label></p> <p id="shortcuts" class="smalltext"> ', $context['browser']['is_firefox'] ? $txt['shortcuts_firefox'] : $txt['shortcuts'], ' </p> <p id="post_confirm_strip" class="righttext"> ', template_control_richedit_buttons($context['post_box_name']), ' </p> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" /> <input type="hidden" name="replied_to" value="', !empty($context['quoted_message']['id']) ? $context['quoted_message']['id'] : 0, '" /> <input type="hidden" name="pm_head" value="', !empty($context['quoted_message']['pm_head']) ? $context['quoted_message']['pm_head'] : 0, '" /> <input type="hidden" name="f" value="', isset($context['folder']) ? $context['folder'] : '', '" /> <input type="hidden" name="l" value="', isset($context['current_label_id']) ? $context['current_label_id'] : -1, '" /> </div> <span class="lowerframe"><span></span></span> </div> </form>'; // Show the message you're replying to. if ($context['reply']) { echo ' <br /> <br /> <div class="cat_bar"> <h3 class="catbg">', $txt['subject'], ': ', $context['quoted_message']['subject'], '</h3> </div> <div class="title_bar"> <h3 class="titlebg"> <span class="floatleft">', $txt['from'], ': ', $context['quoted_message']['member']['name'], '</span> <span class="floatright">', $txt['on'], ': ', $context['quoted_message']['time'], '</span> </h3> </div> <div class="windowbg2"> <span class="topslice"><span></span></span> <div class="content"> ', $context['quoted_message']['body'], ' </div> <span class="botslice"><span></span></span> </div>'; } echo ' <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/PersonalMessage.js?fin20"></script> <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script> <script type="text/javascript"><!-- // --><![CDATA[ var oPersonalMessageSend = new smf_PersonalMessageSend({ sSelf: \'oPersonalMessageSend\', sSessionId: \'', $context['session_id'], '\', sSessionVar: \'', $context['session_var'], '\', sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\', sToControlId: \'to_control\', aToRecipients: ['; foreach ($context['recipients']['to'] as $i => $member) { echo ' { sItemId: ', JavaScriptEscape($member['id']), ', sItemName: ', JavaScriptEscape($member['name']), ' }', $i == count($context['recipients']['to']) - 1 ? '' : ','; } echo ' ], aBccRecipients: ['; foreach ($context['recipients']['bcc'] as $i => $member) { echo ' { sItemId: ', JavaScriptEscape($member['id']), ', sItemName: ', JavaScriptEscape($member['name']), ' }', $i == count($context['recipients']['bcc']) - 1 ? '' : ','; } echo ' ], sBccControlId: \'bcc_control\', sBccDivId: \'bcc_div\', sBccDivId2: \'bcc_div2\', sBccLinkId: \'bcc_link\', sBccLinkContainerId: \'bcc_link_container\', bBccShowByDefault: ', empty($context['recipients']['bcc']) && empty($context['bcc_value']) ? 'false' : 'true', ', sShowBccLinkTemplate: ', JavaScriptEscape(' <a href="#" id="bcc_link">' . $txt['make_bcc'] . '</a> <a href="' . $scripturl . '?action=helpadmin;help=pm_bcc" onclick="return reqWin(this.href);">(?)</a>'), ' }); '; echo ' // ]]></script>'; }
function template_edittopic() { global $context, $scripturl, $txt, $settings, $modSettings; // Load the spell checker? if ($context['show_spellchecking']) { echo ' <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/scripts/spellcheck.js"></script>'; } echo '<div class="tborder"> <form method="post" name="cprofile" id="cprofile" action="', $scripturl, '?action=welcome&sa=edit2" onsubmit="submitonce(this);"> <div class="cat_bar"> <h3 class="catbg"> ', $txt['welcome_edittopic'], ' </h3> </div> <table class="tborder" align="center" border="0" cellpadding="4" cellspacing="0" width="100%"> <tr> <tr> <td width="28%" valign="top" class="windowbg2" align="right"><span class="gen"><b>' . $txt['welcome_subject'] . '</b> </span></td> <td width="72%" class="windowbg2"><input type="text" size="50" name="topicsubject" value="' . $context['welcome_topic']['SUBJECT'] . '" /></td> </tr> <td class="windowbg2" align="center" colspan="2"><table> '; if (!function_exists('getLanguages')) { // Showing BBC? if ($context['show_bbc']) { echo ' <tr class="windowbg2"> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'bbc'), ' </td> </tr>'; } // What about smileys? if (!empty($context['smileys']['postform'])) { echo ' <tr class="windowbg2"> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'smileys'), ' </td> </tr>'; } // Show BBC buttons, smileys and textbox. echo ' <tr class="windowbg2"> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'message'), ' </td> </tr>'; } else { echo ' <tr class="windowbg2"> <td>'; // Showing BBC? if ($context['show_bbc']) { echo ' <div id="bbcBox_message"></div>'; } // What about smileys? if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { echo ' <div id="smileyBox_message"></div>'; } // Show BBC buttons, smileys and textbox. echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); echo '</td></tr>'; } echo ' </table> <br /> ', $txt['welcome_topicnote'], ' </td></tr> <tr> <td width="28%" colspan="2" height="26" align="center" class="windowbg2"> <input type="hidden" name="id" value="' . $context['welcome_topic']['ID'] . '" /> '; if ($context['show_spellchecking']) { echo ' <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'cprofile\', \'topicbody\');" />'; } echo ' <input type="submit" value="', $txt['welcome_edittopic'], '" name="submit" /></td> </tr> </table> </form></div>'; if ($context['show_spellchecking']) { echo '<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>'; } // Copryright link must remain. To remove you need to purchase link removal at smfhacks.com echo '<div align="center"><a href="http://www.smfhacks.com" target="blank">Welcome Topic Mod</a></div>'; }
/** * This is quick reply area below all the message body's */ function template_quickreply_below() { global $context, $options, $settings, $txt, $modSettings, $scripturl; // Yeah, I know, though at the moment is the only way... global $removableMessageIDs, $ignoredMsgs; // Using the quick reply box below the messages and you can reply? if ($context['can_reply'] && !empty($options['display_quick_reply'])) { echo ' <a id="quickreply"></a> <div class="forumposts" id="quickreplybox"> <h2 class="category_header"> <span id="category_toggle"> <a href="javascript:oQuickReply.swap();"> <span id="quickReplyExpand" class="', empty($context['minmax_preferences']['qreply']) ? 'collapse' : 'expand', '" title="', $txt['hide'], '"></span> </a> </span> <a href="javascript:oQuickReply.swap();">', $txt['quick_reply'], '</a> </h2> <div id="quickReplyOptions" class="windowbg"', empty($context['minmax_preferences']['qreply']) ? '' : ' style="display: none"', '> <div class="editor_wrapper"> ', $context['is_locked'] ? '<p class="alert smalltext">' . $txt['quick_reply_warning'] . '</p>' : '', $context['oldTopicError'] ? '<p class="alert smalltext">' . sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']) . '</p>' : '', ' ', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', ' ', !$context['can_reply_approved'] && $context['require_verification'] ? '<br />' : '', ' <form action="', $scripturl, '?board=', $context['current_board'], ';action=post2" method="post" accept-charset="UTF-8" name="postmodify" id="postmodify" onsubmit="submitonce(this);', !empty($modSettings['mentions_enabled']) ? 'revalidateMentions(\'postmodify\', \'' . (empty($options['use_editor_quick_reply']) ? 'message' : $context['post_box_name']) . '\');' : '', '"> <input type="hidden" name="topic" value="', $context['current_topic'], '" /> <input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '" /> <input type="hidden" name="icon" value="xx" /> <input type="hidden" name="from_qr" value="1" /> <input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" /> <input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '" /> <input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" /> <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '" /> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />'; // Guests just need more. if ($context['user']['is_guest']) { echo ' <dl> <dt> <strong><label for="guestname">', $txt['name'], '</label>:</strong> <input type="text" name="guestname" id="guestname" value="', $context['name'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /> </dd> <dt> <strong><label for="email">', $txt['email'], '</label>:</strong> <input type="text" name="email" id="email" value="', $context['email'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /> </dd> </dl>'; } // Is visual verification enabled? if ($context['require_verification']) { template_verification_controls($context['visual_verification_id'], ' <strong>' . $txt['verification'] . ':</strong>', '<br />'); } // Using the full editor or a plain text box? if (empty($options['use_editor_quick_reply'])) { echo ' <div class="quickReplyContent"> <textarea cols="600" rows="7" class="quickreply" name="message" id="message" tabindex="', $context['tabindex']++, '"></textarea> </div>'; } else { echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); } echo ' <div id="post_confirm_buttons" class="submitbutton"> <input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="', $context['tabindex']++, '" class="button_submit" /> <input type="submit" name="preview" value="', $txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />'; // Spellcheck button? if ($context['show_spellchecking']) { echo ' <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\', ', empty($options['use_editor_quick_reply']) ? 'false' : 'true', ')" tabindex="', $context['tabindex']++, '" class="button_submit" />'; } // Draft save button? if (!empty($context['drafts_save'])) { echo ' <input type="submit" name="save_draft" value="', $txt['draft_save'], '" onclick="return confirm(' . JavaScriptEscape($txt['draft_save_note']) . ') && submitThisOnce(this);" accesskey="d" tabindex="', $context['tabindex']++, '" class="button_submit" /> <input type="hidden" id="id_draft" name="id_draft" value="', empty($context['id_draft']) ? 0 : $context['id_draft'], '" />'; } echo ' </div>'; // Show the draft last saved on area if (!empty($context['drafts_autosave']) && !empty($options['drafts_autosave_enabled'])) { echo ' <div class="draftautosave"> <span id="throbber" style="display:none"><i class="fa fa-spinner fa-spin"></i> </span> <span id="draft_lastautosave"></span> </div>'; } echo ' </form> </div> </div> </div>'; // Using the plain text box we need to load in some additonal javascript if (empty($options['use_editor_quick_reply'])) { echo ' <script><!-- // --><![CDATA['; // Draft autosave available and the user has it enabled? if (!empty($context['drafts_autosave']) && !empty($options['drafts_autosave_enabled'])) { echo ' var oDraftAutoSave = new elk_DraftAutoSave({ sSelf: \'oDraftAutoSave\', sLastNote: \'draft_lastautosave\', sLastID: \'id_draft\', iBoard: ', empty($context['current_board']) ? 0 : $context['current_board'], ', iFreq: ', isset($context['drafts_autosave_frequency']) ? $context['drafts_autosave_frequency'] : 30000, ' });'; } // Mentions enabled if (!empty($modSettings['mentions_enabled'])) { echo ' add_elk_mention(\'#message\');'; } echo ' // ]]></script>'; } } // Finally enable the quick reply quote function echo ' <script><!-- // --><![CDATA[ var oQuickReply = new QuickReply({ bDefaultCollapsed: ', empty($context['minmax_preferences']['qreply']) ? 'false' : 'true', ', iTopicId: ', $context['current_topic'], ', iStart: ', $context['start'], ', sScriptUrl: elk_scripturl, sImagesUrl: elk_images_url, sContainerId: "quickReplyOptions", sClassId: "quickReplyExpand", sClassCollapsed: "collapse", sTitleCollapsed: ', JavaScriptEscape($txt['show']), ', sClassExpanded: "expand", sTitleExpanded: ', JavaScriptEscape($txt['hide']), ', sJumpAnchor: "quickreply", bIsFull: ', !empty($options['use_editor_quick_reply']) ? 'true, sEditorId: ' . $options['use_editor_quick_reply'] : 'false', ', oThemeOptions: { bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ', sOptionName: \'minmax_preferences\', sSessionId: elk_session_id, sSessionVar: elk_session_var, sAdditionalVars: \';minmax_key=qreply\' }, oCookieOptions: { bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ', sCookieName: \'elk_qreply\' } }); // ]]></script>'; // Spell check for quick modify and quick reply (w/o the editor) if ($context['show_spellchecking']) { echo ' <form name="spell_form" id="spell_form" method="post" accept-charset="UTF-8" target="spellWindow" action="', $scripturl, '?action=spellcheck"> <input type="hidden" id="spellstring" name="spellstring" value="" /> <input type="hidden" id="fulleditor" name="fulleditor" value="" /> </form>'; } // Quick moderation options echo ' <script><!-- // --><![CDATA['; if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post']) { echo ' var oInTopicModeration = new InTopicModeration({ sSelf: \'oInTopicModeration\', sCheckboxContainerMask: \'in_topic_mod_check_\', aMessageIds: [\'', implode('\', \'', $removableMessageIDs), '\'], sSessionId: elk_session_id, sSessionVar: elk_session_var, sButtonStrip: \'moderationbuttons\', sButtonStripDisplay: \'moderationbuttons_strip\', sButtonStripClass: \'menuitem\', bUseImageButton: false, bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ', sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\', sRemoveButtonImage: \'delete_selected.png\', sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\', bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ', sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\', sRestoreButtonImage: \'restore_selected.png\', sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\', bCanSplit: ', $context['can_split'] ? 'true' : 'false', ', sSplitButtonLabel: \'', $txt['quickmod_split_selected'], '\', sSplitButtonImage: \'split_selected.png\', sSplitButtonConfirm: \'', $txt['quickmod_confirm'], '\', sFormId: \'quickModForm\' });'; } // Quick modify can be used echo ' var oQuickModify = new QuickModify({ sIconHide: \'xx.png\', sScriptUrl: elk_scripturl, sClassName: \'quick_edit\', sIDSubject: \'post_subject_\', sIDInfo: \'info_\', bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ', iTopicId: ', $context['current_topic'], ', sTemplateBodyEdit: ', JavaScriptEscape(' <div id="quick_edit_body_container" style="width: 90%;"> <div id="error_box" class="errorbox" style="display:none;"></div> <textarea class="editor" name="message" rows="12" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 100%; min-width: 100%' : 'width: 100%') . '; margin-bottom: 10px;" tabindex="' . $context['tabindex']++ . '">%body%</textarea><br /> <input type="hidden" name="\' + elk_session_var + \'" value="\' + elk_session_id + \'" /> <input type="hidden" name="topic" value="' . $context['current_topic'] . '" /> <input type="hidden" name="msg" value="%msg_id%" /> <div class="righttext"> <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" /> ' . ($context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" tabindex="' . $context['tabindex']++ . '" onclick="spellCheck(\'quickModForm\', \'message\', false);" class="button_submit" /> ' : '') . '<input type="submit" name="cancel" value="' . $txt['modify_cancel'] . '" tabindex="' . $context['tabindex']++ . '" onclick="return oQuickModify.modifyCancel();" class="button_submit" /> </div> </div>'), ', sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ', sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 85%;" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />'), ', sTemplateSubjectNormal: ', JavaScriptEscape('%subject%'), ', sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ': %subject% (' . $context['num_views_text'] . ')'), ', sTemplateInfoNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a><span class="smalltext modified" id="modified_%msg_id%"></span>'), $context['can_reply'] && !empty($options['display_quick_reply']) ? ', sFormRemoveAccessKeys: \'postmodify\'' : '', ', funcOnAfterCreate: function () { // Attach AtWho to the quick edit box add_elk_mention(\'#quick_edit_body_container textarea\'); var i = all_elk_mentions.length - 1; all_elk_mentions[i].oMention = new elk_mentions(all_elk_mentions[i].oOptions); } }); aIconLists[aIconLists.length] = new IconList({ sBackReference: "aIconLists[" + aIconLists.length + "]", sIconIdPrefix: "msg_icon_", sScriptUrl: elk_scripturl, bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ', iBoardId: ', $context['current_board'], ', iTopicId: ', $context['current_topic'], ', sSessionId: elk_session_id, sSessionVar: elk_session_var, sAction: "messageicons;board=', $context['current_board'], '" , sLabelIconList: "', $txt['message_icon'], '", sBoxBackground: "transparent", sBoxBackgroundHover: "#ffffff", iBoxBorderWidthHover: 1, sBoxBorderColorHover: "#adadad" , sContainerBackground: "#ffffff", sContainerBorder: "1px solid #adadad", sItemBorder: "1px solid #ffffff", sItemBorderHover: "1px dotted gray", sItemBackground: "transparent", sItemBackgroundHover: "#e0e0f0" });'; if (!empty($ignoredMsgs)) { echo ' ignore_toggles([', implode(', ', $ignoredMsgs), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');'; } echo ' // ]]></script>'; }
/** * The main template for the post page. */ function template_post_page() { global $context, $txt; // Show the actual posting area... echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); // A placeholder for our mention box if needed if (!empty($context['member_ids'])) { echo ' <div id="mentioned" style="display:none">'; foreach ($context['member_ids'] as $id) { echo ' <input type="hidden" name="uid[]" value="', $id, '" />'; } echo ' </div>'; } // Show our submit buttons before any more options echo ' <div id="post_confirm_buttons" class="submitbutton"> ', template_control_richedit_buttons($context['post_box_name']); // Option to delete an event if user is editing one. if ($context['make_event'] && !$context['event']['new']) { echo ' <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" onclick="return confirm(\'', $txt['event_delete_confirm'], '\');" class="button_submit" />'; } // Option to add a poll (javascript if enabled, otherwise preview with poll) if (!$context['make_poll'] && $context['can_add_poll']) { echo ' <input type="submit" name="poll" value="', $txt['add_poll'], '" onclick="return loadAddNewPoll(this, ', empty($context['current_board']) ? '0' : $context['current_board'], ', \'postmodify\');" class="button_submit" />'; } echo ' </div>'; }
function TP_bbcbox($input) { echo '<div id="tp_messbox"></div>'; echo '<div id="tp_smilebox"></div>'; echo template_control_richedit($input, 'tp_messbox', 'tp_smilebox'); }
/** * Used to edit a blocks details when using the block on the portal */ function template_block_edit() { global $context, $settings, $options, $scripturl, $txt, $helptxt, $modSettings; // Want to take a look before you save? if (!empty($context['SPortal']['preview'])) { if (!empty($context['SPortal']['error'])) { echo ' <div class="errorbox">', $context['SPortal']['error'], '</div>'; } echo ' <div class="sp_auto_align" style="width: ', $context['widths'][$context['SPortal']['block']['column']], ';">'; template_block($context['SPortal']['block']); echo ' </div>'; } echo ' <div id="sp_edit_block"> <form id="admin_form_wrapper" name="sp_edit_block_form" id="sp_edit_block_form" action="', $scripturl, '?action=admin;area=portalblocks;sa=edit" method="post" accept-charset="UTF-8" onsubmit="submitonce(this);"> <h3 class="category_header"> <a class="hdicon cat_img_helptopics help" href="', $scripturl, '?action=quickhelp;help=sp-blocks', $context['SPortal']['is_new'] ? 'Add' : 'Edit', '" onclick="return reqOverlayDiv(this.href);" title="', $txt['help'], '"></a> ', $context['SPortal']['is_new'] ? $txt['sp-blocksAdd'] : $txt['sp-blocksEdit'], ' </h3> <div class="windowbg"> <div class="sp_content_padding"> <dl class="sp_form"> <dt> ', $txt['sp-adminColumnType'], ': </dt> <dd> ', $context['SPortal']['block']['type_text'], ' </dd> <dt> <label for="block_name">', $txt['sp-adminColumnName'], ':</label> </dt> <dd> <input type="text" name="block_name" id="block_name" value="', $context['SPortal']['block']['label'], '" size="30" class="input_text" /> </dd> <dt> <label for="block_permissions">', $txt['sp_admin_blocks_col_permissions'], ':</label> </dt> <dd> <select name="permissions" id="block_permissions">'; foreach ($context['SPortal']['block']['permission_profiles'] as $profile) { echo ' <option value="', $profile['id'], '"', $profile['id'] == $context['SPortal']['block']['permissions'] ? ' selected="selected"' : '', '>', $profile['label'], '</option>'; } echo ' </select> </dd>'; // Display any options that are available for this block foreach ($context['SPortal']['block']['options'] as $name => $type) { if (empty($context['SPortal']['block']['parameters'][$name])) { $context['SPortal']['block']['parameters'][$name] = ''; } echo ' <dt>'; if (!empty($helptxt['sp_param_' . $context['SPortal']['block']['type'] . '_' . $name])) { echo ' <a class="help" href="', $scripturl, '?action=quickhelp;help=sp_param_', $context['SPortal']['block']['type'], '_', $name, '" onclick="return reqOverlayDiv(this.href);"> <img class="icon" src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" /> </a>'; } echo ' <label for="', $type == 'bbc' ? 'bbc_content' : $name, '">', $txt['sp_param_' . $context['SPortal']['block']['type'] . '_' . $name], ':</label> </dt> <dd>'; if ($type == 'bbc') { echo ' </dd> </dl> <div id="sp_rich_editor"> <div id="sp_rich_bbc"></div> <div id="sp_rich_smileys"></div> ', template_control_richedit($context['SPortal']['bbc'], 'sp_rich_smileys', 'sp_rich_bbc'), ' <input type="hidden" name="bbc_name" value="', $name, '" /> <input type="hidden" name="bbc_parameter" value="', $context['SPortal']['bbc'], '" /> </div> <dl class="sp_form">'; } elseif ($type == 'boards' || $type == 'board_select') { echo ' <input type="hidden" name="parameters[', $name, ']" value="" />'; if ($type == 'boards') { echo ' <select name="parameters[', $name, '][]" id="', $name, '" size="7" multiple="multiple">'; } else { echo ' <select name="parameters[', $name, '][]" id="', $name, '">'; } foreach ($context['SPortal']['block']['board_options'][$name] as $option) { echo ' <option value="', $option['value'], '"', $option['selected'] ? ' selected="selected"' : '', ' >', $option['text'], '</option>'; } echo ' </select>'; } elseif ($type == 'int') { echo ' <input type="text" name="parameters[', $name, ']" id="', $name, '" value="', $context['SPortal']['block']['parameters'][$name], '" size="7" class="input_text" />'; } elseif ($type == 'text') { echo ' <input type="text" name="parameters[', $name, ']" id="', $name, '" value="', $context['SPortal']['block']['parameters'][$name], '" size="25" class="input_text" />'; } elseif ($type == 'check') { echo ' <input type="checkbox" name="parameters[', $name, ']" id="', $name, '"', !empty($context['SPortal']['block']['parameters'][$name]) ? ' checked="checked"' : '', ' class="input_check" />'; } elseif ($type == 'select') { $options = explode('|', $txt['sp_param_' . $context['SPortal']['block']['type'] . '_' . $name . '_options']); echo ' <select name="parameters[', $name, ']" id="', $name, '">'; foreach ($options as $key => $option) { echo ' <option value="', $key, '"', $context['SPortal']['block']['parameters'][$name] == $key ? ' selected="selected"' : '', '>', $option, '</option>'; } echo ' </select>'; } elseif (is_array($type)) { echo ' <select name="parameters[', $name, ']" id="', $name, '">'; foreach ($type as $key => $option) { echo ' <option value="', $key, '"', $context['SPortal']['block']['parameters'][$name] == $key ? ' selected="selected"' : '', '>', $option, '</option>'; } echo ' </select>'; } elseif ($type == 'textarea') { echo ' </dd> </dl> <div id="sp_text_editor"> <textarea name="parameters[', $name, ']" id="', $name, '" cols="45" rows="10">', $context['SPortal']['block']['parameters'][$name], '</textarea> <input type="button" class="button_submit" value="-" onclick="document.getElementById(\'', $name, '\').rows -= 10" /> <input type="button" class="button_submit" value="+" onclick="document.getElementById(\'', $name, '\').rows += 10" /> </div> <dl class="sp_form">'; } if ($type != 'bbc') { echo ' </dd>'; } } if (empty($context['SPortal']['block']['column'])) { echo ' <dt> <label for="block_column">', $txt['sp-blocksColumn'], ':</label> </dt> <dd> <select id="block_column" name="block_column">'; $block_sides = array(5 => 'Header', 1 => 'Left', 2 => 'Top', 3 => 'Bottom', 4 => 'Right', 6 => 'Footer'); foreach ($block_sides as $id => $side) { echo ' <option value="', $id, '">', $txt['sp-position' . $side], '</option>'; } echo ' </select> </dd>'; } if (count($context['SPortal']['block']['list_blocks']) > 1) { echo ' <dt> ', $txt['sp-blocksRow'], ': </dt> <dd> <select id="order" name="placement"', !$context['SPortal']['is_new'] ? ' onchange="this.form.block_row.disabled = this.options[this.selectedIndex].value == \'\';"' : '', '> ', !$context['SPortal']['is_new'] ? '<option value="nochange">' . $txt['sp-placementUnchanged'] . '</option>' : '', ' <option value="before"', !empty($context['SPortal']['block']['placement']) && $context['SPortal']['block']['placement'] == 'before' ? ' selected="selected"' : '', '>', $txt['sp-placementBefore'], '...</option> <option value="after"', !empty($context['SPortal']['block']['placement']) && $context['SPortal']['block']['placement'] == 'after' ? ' selected="selected"' : '', '>', $txt['sp-placementAfter'], '...</option> </select> <select id="block_row" name="block_row"', !$context['SPortal']['is_new'] ? ' disabled="disabled"' : '', '>'; foreach ($context['SPortal']['block']['list_blocks'] as $block) { if ($block['id'] != $context['SPortal']['block']['id']) { echo ' <option value="', $block['row'], '"', !empty($context['SPortal']['block']['row']) && $context['SPortal']['block']['row'] == $block['row'] ? ' selected="selected"' : '', '>', $block['label'], '</option>'; } } echo ' </select> </dd>'; } if ($context['SPortal']['block']['type'] != 'sp_boardNews') { echo ' <dt> <label for="block_force">', $txt['sp-blocksForce'], ':</label> </dt> <dd> <input type="checkbox" name="block_force" id="block_force" value="1"', $context['SPortal']['block']['force_view'] ? ' checked="checked"' : '', ' class="input_check" /> </dd>'; } echo ' <dt> <label for="block_active">', $txt['sp-blocksActive'], ':</label> </dt> <dd> <input type="checkbox" name="block_active" id="block_active" value="1"', $context['SPortal']['block']['state'] ? ' checked="checked"' : '', ' class="input_check" /> </dd> </dl> <div class="sp_button_container"> <input type="submit" name="preview_block" value="', $txt['sp-blocksPreview'], '" class="right_submit" /> <input type="submit" name="add_block" value="', !$context['SPortal']['is_new'] ? $txt['sp-blocksEdit'] : $txt['sp-blocksAdd'], '" class="right_submit" /> </div> </div> </div>'; if (!empty($context['SPortal']['block']['column'])) { echo ' <input type="hidden" name="block_column" value="', $context['SPortal']['block']['column'], '" />'; } echo ' <input type="hidden" name="block_type" value="', $context['SPortal']['block']['type'], '" /> <input type="hidden" name="block_id" value="', $context['SPortal']['block']['id'], '" /> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />'; // Display Options is integrated if (!empty($modSettings['sp_enableIntegration'])) { echo ' <br /> <h3 class="category_header"> <a class="hdicon cat_img_helptopics help" href="', $scripturl, '?action=quickhelp;help=sp-blocksDisplayOptions" onclick="return reqOverlayDiv(this.href);" title="', $txt['help'], '"></a> ', $txt['sp-blocksDisplayOptions'], ' </h3> <div class="windowbg2"> <div class="sp_content_padding"> <span class="floatright">', $txt['sp-blocksAdvancedOptions'], '<input type="checkbox" name="display_advanced" id="display_advanced" onclick="$(\'#sp_display_advanced\').slideToggle(300); document.getElementById(\'display_simple\').disabled = this.checked;" ', empty($context['SPortal']['block']['display_type']) ? '' : ' checked="checked"', ' class="input_check" /></span> ', $txt['sp-blocksShowBlock'], ' <select name="display_simple" id="display_simple"', empty($context['SPortal']['block']['display_type']) ? '' : ' disabled="disabled"', '>'; foreach ($context['simple_actions'] as $action => $label) { echo ' <option value="', $action, '"', in_array($action, $context['SPortal']['block']['display']) ? ' selected="selected"' : '', '>', $label, '</option>'; } echo ' </select> <div id="sp_display_advanced"', empty($context['SPortal']['block']['display_type']) ? ' style="display: none;"' : '', '>'; $display_types = array('actions', 'boards', 'pages'); foreach ($display_types as $type) { if (empty($context['display_' . $type])) { continue; } echo ' <a href="javascript:void(0);" onclick="sp_collapseObject(\'', $type, '\')"> <img id="sp_collapse_', $type, '" src="', $settings['images_url'], '/selected_open.png" alt="*" /> </a> ', $txt['sp-blocksSelect' . ucfirst($type)], ' <ul id="sp_object_', $type, '" class="reset sp_display_list" style="display: none;">'; foreach ($context['display_' . $type] as $index => $action) { echo ' <li> <input type="checkbox" name="display_', $type, '[]" id="', $type, $index, '" value="', $index, '"', in_array($index, $context['SPortal']['block']['display']) ? ' checked="checked"' : '', ' class="input_check" /> <label for="', $type, $index, '">', $action, '</label> </li>'; } echo ' <li> <input type="checkbox" onclick="invertAll(this, this.form, \'display_', $type, '[]\');" class="input_check" /> <em>', $txt['check_all'], '</em> </li> </ul> <br />'; } echo ' <a class="help" href="', $scripturl, '?action=quickhelp;help=sp-blocksCustomDisplayOptions" onclick="return reqOverlayDiv(this.href);"> <img class="icon" src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" /> </a> <label for="display_custom">', $txt['sp_display_custom'], ': </label> <input class="input_text" type="text" name="display_custom" id="display_custom" value="', $context['SPortal']['block']['display_custom'], '" /> </div> <div class="sp_button_container"> <input type="submit" name="add_block" value="', !$context['SPortal']['is_new'] ? $txt['sp-blocksEdit'] : $txt['sp-blocksAdd'], '" class="right_submit" /> </div> </div> </div>'; } $style_sections = array('title' => 'left', 'body' => 'right'); $style_types = array('default' => 'DefaultClass', 'class' => 'CustomClass', 'style' => 'CustomStyle'); $style_parameters = array('title' => array('category_header', 'secondary_header'), 'body' => array('portalbg', 'portalbg2', 'information', 'roundframe')); // Style options for the block, but not boardNews if ($context['SPortal']['block']['type'] != 'sp_boardNews') { echo ' <br /> <h3 class="category_header"> <a class="hdicon cat_img_helptopics help" href="', $scripturl, '?action=quickhelp;help=sp-blocksStyleOptions" onclick="return reqOverlayDiv(this.href);" title="', $txt['help'], '"></a> ', $txt['sp-blocksStyleOptions'], ' </h3> <div class="windowbg2"> <div class="sp_content_padding">'; foreach ($style_sections as $section => $float) { echo ' <dl id="sp_edit_style_', $section, '" class="sp_form sp_float_', $float, '">'; foreach ($style_types as $type => $label) { echo ' <dt> ', $txt['sp-blocks' . ucfirst($section) . $label], ': </dt> <dd>'; if ($type == 'default') { echo ' <select name="', $section, '_default_class" id="', $section, '_default_class">'; foreach ($style_parameters[$section] as $class) { echo ' <option value="', $class, '"', $context['SPortal']['block']['style'][$section . '_default_class'] == $class ? ' selected="selected"' : '', '>', $class, '</option>'; } echo ' </select>'; } else { echo ' <input type="text" name="', $section, '_custom_', $type, '" id="', $section, '_custom_', $type, '" value="', $context['SPortal']['block']['style'][$section . '_custom_' . $type], '" class="input_text" />'; } echo ' </dd>'; } echo ' <dt> ', $txt['sp-blocksNo' . ucfirst($section)], ': </dt> <dd> <input type="checkbox" name="no_', $section, '" id="no_', $section, '" value="1"', !empty($context['SPortal']['block']['style']['no_' . $section]) ? ' checked="checked"' : '', 'onclick="check_style_options();" class="input_check" /> </dd> </dl>'; } echo ' <script><!-- // --><![CDATA[ check_style_options(); // ]]></script> <div class="sp_button_container"> <input type="submit" name="add_block" value="', !$context['SPortal']['is_new'] ? $txt['sp-blocksEdit'] : $txt['sp-blocksAdd'], '" class="right_submit" /> </div> </div> </div>'; } echo ' </form> </div>'; }
function template_add_a_new_download() { global $context, $txt, $scripturl, $modSettings, $adkportal, $boardurl, $adkFolder; $category = $context['id_cat_']; $rest = $adkportal['download_max_attach_download'] - $context['important_info']['rest']; //Multi Files echo ' <script type="text/javascript"><!-- // --><![CDATA[ var allowed_attachments = ' . $rest . '; function addAttachment() { allowed_attachments = allowed_attachments - 1; if (allowed_attachments <= 0) return alert("' . $txt['adkdown_not_add_more'] . '"); setOuterHTML(document.getElementById("moreAttachments"), \'<input type="file" size="60" name="download[]" class="input_file" /><br /><dd class="smalltext" id="moreAttachments" style="color: ' . $adkportal['Designeds']['letra'] . '; ">( <a style="color: ' . $adkportal['Designeds']['link'] . '; " href="#" onclick="addAttachment(); return false;">' . $txt['adkdown_add_more'] . '<\' + \'/a> )<\' + \'/dd>\'); return true; } // ]]></script>'; echo ' <div class="eds_cat_bar" style="background: ' . $adkportal['Designeds']['borde'] . ';"> <h3 class="eds_catbg" style="padding-top: 3px; background: ' . $adkportal['Designeds']['borde'] . '; color: ' . $adkportal['Designeds']['titulo'] . ';"> <img src="' . $adkFolder['images'] . '/stats_s_green.png" style="vertical-align: text-bottom;" alt="' . $context['page_title'] . '" /> ' . $context['page_title'] . ' </h3> </div> <div class="eds_down" style="border-color: ' . $adkportal['Designeds']['borde'] . '; background: ' . $adkportal['Designeds']['fondo'] . ';"> <form method="post" enctype="multipart/form-data" action="' . $scripturl . '?action=downloads;sa=', $context['save_action'], '"> <div class="tborder"> <table cellspacing="0" style="width: 100%;"> <tr> <td style="text-align: left; width: 100px; color: ' . $adkportal['Designeds']['letra'] . '; "> <strong>' . $txt['adkdown_title'] . ' </strong> </td> <td style="text-align: left;"> <input type="text" size="50" name="title" value="', $context['important_info']['title'], '" /> </td> </tr> <tr> <td style="color: ' . $adkportal['Designeds']['letra'] . '; "> <strong>', $txt['adkdown_desc'], '</strong> </td> <td> <input type="text" size="50" maxlength="200" name="short_desc" value="', $context['important_info']['short_desc'], '" /> </td> </tr>'; if ($context['save_action'] == 'saveeditdownload') { echo ' <tr> <td style="text-align: left; color: ' . $adkportal['Designeds']['letra'] . ';"> <strong>' . $txt['adkdown_category'] . ' </strong> </td> <td style="text-align: left;"> <select name="cat">'; foreach ($context['downloads_cat'] as $cat) { echo ' <option value="' . $cat['id'] . '"', $cat['id'] == $context['important_info']['id_cat'] ? ' selected="selected"' : '', '>' . $cat['title'] . '</option>'; } echo ' </select> </td> </tr>'; } echo ' <tr> <td colspan="2"> <hr /> </td> </tr> <tr> <td colspan="2"> <table>'; if (!function_exists('getLanguages')) { // Showing BBC? if ($context['show_bbc']) { echo ' <tr> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'bbc'), ' </td> </tr>'; } // What about smileys? if (!empty($context['smileys']['postform'])) { echo ' <tr> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'smileys'), ' </td> </tr>'; } // Show BBC buttons, smileys and textbox. echo ' <tr> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'message'), ' </td> </tr>'; } else { echo ' <tr> <td>'; // Showing BBC? if ($context['show_bbc']) { echo ' <div id="bbcBox_message"></div>'; } // What about smileys? if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { echo ' <div id="smileyBox_message"></div>'; } // Show BBC buttons, smileys and textbox. echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); echo ' </td> </tr>'; } echo ' </table> </td> </tr> <tr> <td style="text-align: left; color: ' . $adkportal['Designeds']['letra'] . '; "> <strong>' . $txt['adkdown_screen'] . ' </strong> </td> <td style="text-align: left;"> <input type="file" size="60" name="screen" class="input_file" /> ', !empty($context['important_info']['image']) ? ' <br /> <input type="checkbox" name="screen2" value="' . $context['important_info']['image'] . '" checked="checked" /> <strong> <a href="' . $context['important_info']['image'] . '"> ' . $context['important_info']['image'] . ' </a> </strong>' : '', ' </td> </tr> <tr> <td colspan="2"> <hr /> </td> </tr> <tr> <td valign="top" style="text-align: left; color: ' . $adkportal['Designeds']['letra'] . '; "> <strong>' . $txt['adkdown_attach'] . ' </strong> </td> <td style="text-align: left; color: ' . $adkportal['Designeds']['letra'] . '; "> ', $context['important_info']['rest'] < 4 ? '<input type="file" size="60" name="download[]" class="input_file" />' : '', ' <dl> <dd class="smalltext" id="moreAttachments" style="color: ' . $adkportal['Designeds']['letra'] . '; "> (<a style="color: ' . $adkportal['Designeds']['link'] . '; " href="#" onclick="addAttachment(); return false;"> ' . $txt['adkdown_add_more'] . ' </a>) </dd> </dl> <br /> ', !empty($context['load_attachs']) ? implode('<br />', $context['load_attachs']) : '', ' </td> </tr> <tr> <td align="center" colspan="2"> <hr /> <input type="submit" value="' . $txt['save'] . '" class="button_submit" /> <input type="hidden" name="sc" value="' . $context['session_id'] . '" /> <input type="hidden" name="id_cat" value="' . $category . '" /> <input type="hidden" name="id_file" value="' . $context['important_info']['id_file'] . '" /> <input type="hidden" name="id_member" value="' . $context['important_info']['id_member'] . '" /> <input type="hidden" name="ex_id_cat" value="' . $context['important_info']['id_cat'] . '" /> </td> </tr> </table> </div> </form> </div> <div class="eds_botbar" style="background: ' . $adkportal['Designeds']['borde'] . ';"> <span style="background: ' . $adkportal['Designeds']['borde'] . ';"> </span> </div>'; }
function template_char_template_edit() { global $context, $txt, $scripturl; echo ' <form method="post" action="', $scripturl, '?action=admin;area=templates;sa=save;', $context['session_var'], '=', $context['session_id'], '"> <div class="cat_bar"> <h3 class="catbg">', $txt['char_templates'], '</h3> </div> <div class="windowbg2"> ', $txt['char_template_name'], ' <input type="text" name="template_name" value="', $context['template_name'], '"><br><br>'; template_control_richedit('message', null, 'bbcBox'); echo ' <br> <div> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> <input type="hidden" name="template_id" value="', $context['template_id'], '"> <input type="submit" value="', $txt['save'], '" class="button_submit"> </div> </div> </form>'; }
function template_main() { global $context, $settings, $options, $txt, $scripturl, $modSettings, $counter; echo ' <form action="', $scripturl, '?action=', $context['destination'], ';', empty($context['current_board']) ? '' : 'board=' . $context['current_board'], '" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" class="flow_hidden" enctype="multipart/form-data">'; // If the user wants to see how their message looks - the preview section is where it's at! echo ' <ul data-role="listview" data-inset="true" ', isset($context['preview_message']) ? '' : 'style="display: none;"', '> <li> <h3> <span id="preview_subject">', empty($context['preview_subject']) ? '' : $context['preview_subject'], '</span> </h3> </li> <li> <div class="post" id="preview_body"> ', empty($context['preview_message']) ? '<br />' : $context['preview_message'], ' </div> </li> </ul>'; if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) { echo ' <input type="hidden" name="eventid" value="', $context['event']['id'], '" />'; } if (isset($context['current_topic'])) { echo ' <input type="hidden" name="topic" value="' . $context['current_topic'] . '" />'; } // If an error occurred, explain what happened. echo ' <ul data-role="listview" data-inset="true" ', empty($context['post_error']['messages']) ? 'style="display: none"' : '', '> <li> <div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '" id="errors"> <strong id="error_serious">', $txt['error_while_submitting'], '</strong> ', empty($context['post_error']['messages']) ? '' : implode('<br />', $context['post_error']['messages']), ' </div> </li> </ul>'; // If this won't be approved let them know! if (!$context['becomes_approved']) { echo ' <ul data-role="listview" data-inset="true"> <li class="information"> <em>', $txt['wait_for_approval'], '</em> <input type="hidden" name="not_approved" value="1" /> </li> </ul>'; } // If it's locked, show a message to warn the replyer. echo ' <ul data-role="listview" data-inset="true"> <li class="information"', $context['locked'] ? '' : ' style="display: none"', ' id="lock_warning"> ', $txt['topic_locked_no_reply'], ' </pli> </ul>'; // The post header... important stuff // Start the main table. echo '<ul data-role="listview" data-inset="true"> <li data-role="list-divider">', $context['page_title'], '</li>'; // Guests have to put in their name and email... if (isset($context['name']) && isset($context['email'])) { echo ' <li> <label for="guestname">', $txt['name'], ':</label> <input type="text" name="guestname" size="25" value="', $context['name'], '" tabindex="', $context['tabindex']++, '" class="input_text" />'; if (empty($modSettings['guest_post_no_email'])) { echo ' <label for="email">', $txt['email'], ':</label> <input type="text" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" />'; } echo ' </li>'; } // Now show the subject box for this post. echo ' <li> <label for="subject" >', $txt['subject'], ':</label> <input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : ' class="input_text"', ' placeholder="', $txt['subject'], '" /> </li>'; echo ' <li> <label for="icon">', $txt['message_icon'], ':<span><img src="', $context['icon_url'], '" name="icons" id="message_icon" hspace="15" alt="" /></span></label> <select name="icon" id="icon">'; // Loop through each message icon allowed, adding it to the drop down list. foreach ($context['icons'] as $icon) { echo ' <option value="', $icon['value'], '"', $icon['value'] == $context['icon'] ? ' selected="selected"' : '', '>', $icon['name'], '</option>'; } echo ' </select> <script><!-- // --><![CDATA[ $(document).ready ( function () { $("#icon").bind("change", function () { // Get the value of the selected option var img_name = $(this).val(); var url = "' . $settings['images_url'] . '/post/"; if (img_name) { $("#message_icon").attr("src", url + img_name + ".png"); } return false; }); }); // ]]></script> </li>'; // If this is a poll then display all the poll options! if ($context['make_poll']) { echo ' <li> <span ', isset($context['poll_error']['no_question']) ? ' class="error"' : '', '>', $txt['poll_question'], '</span> <input type="text" name="question" value="', isset($context['question']) ? $context['question'] : '', '" tabindex="', $context['tabindex']++, '" size="80" class="input_text" /> </li> <li id="pollMoreOptions">'; // Loop through all the choices and print them out. foreach ($context['choices'] as $choice) { echo ' <label for="options-', $choice['id'], '">', $txt['option'], ' ', $choice['number'], ':</label> <input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="255" class="input_text" />'; } // Some javascript for adding more options. echo ' <script> var pollOptionNum = 0; var pollOptionId = ', $context['last_choice_id'], '; function addPollOption() { if (pollOptionNum == 0) { for (var i = 0; i < document.forms.postmodify.elements.length; i++) if (document.forms.postmodify.elements[i].id.substr(0, 8) == "options-") pollOptionNum++; } pollOptionNum++ pollOptionId++ $("#pollMoreOptions").append(\'<label class="ui-input-text" for="options-\' + pollOptionId + \'" ', isset($context['poll_error']['no_question']) ? ' class="error"' : '', '>', $txt['option'], ' \' + pollOptionNum + \':</label><input class="input_text ui-input-text ui-body-c ui-corner-all ui-shadow-inset" type="text" name="options[\' + (pollOptionId) + \']" id="options-\' + (pollOptionId) + \'" value="" size="80" maxlength="255" class="input_text" />\'); } </script> </li> <li><strong><a href="javascript:addPollOption(); void(0);">(', $txt['poll_add_option'], ')</a></strong></li> <li> <fieldset id="poll_options"> <legend>', $txt['poll_options'], '</legend> <label for="poll_max_votes">', $txt['poll_max_votes'], ':</label> <input type="text" name="poll_max_votes" id="poll_max_votes" size="2" value="', $context['poll_options']['max_votes'], '" class="input_text" /> <label for="poll_expire">', $txt['poll_run'], ': (', $txt['days_word'], ')</label> <span>', $txt['poll_run_limit'], '</span> <input type="text" name="poll_expire" id="poll_expire" size="2" value="', $context['poll_options']['expire'], '" onchange="pollOptions();" maxlength="4" class="input_text" /> <label for="poll_change_vote">', $txt['poll_do_change_vote'], ':</label> <input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked="checked"' : '', ' class="input_check" />'; if ($context['poll_options']['guest_vote_enabled']) { echo ' <label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label> <input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked="checked"' : '', ' class="input_check" />'; } echo ' ', $txt['poll_results_visibility'], ': <input type="radio" name="poll_hide" id="poll_results_anyone" value="0"', $context['poll_options']['hide'] == 0 ? ' checked="checked"' : '', ' class="input_radio" /> <label for="poll_results_anyone">', $txt['poll_results_anyone'], '</label> <input type="radio" name="poll_hide" id="poll_results_voted" value="1"', $context['poll_options']['hide'] == 1 ? ' checked="checked"' : '', ' class="input_radio" /> <label for="poll_results_voted">', $txt['poll_results_voted'], '</label> <input type="radio" name="poll_hide" id="poll_results_expire" value="2"', $context['poll_options']['hide'] == 2 ? ' checked="checked"' : '', empty($context['poll_options']['expire']) ? 'disabled="disabled"' : '', ' class="input_radio" /> <label for="poll_results_expire">', $txt['poll_results_after'], '</label> </fieldset> </li>'; } echo ' <li> ', template_control_richedit($context['post_box_name']), ' </li> </ul> <div data-role="collapsible" data-theme="b" data-content-theme="d"> <h3>', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</h3>'; // Display the check boxes for all the standard options - if they are available to the user! if ($context['can_notify']) { echo ' <div data-role="fieldcontain"> <input type="hidden" name="notify" value="0" /> <label for="notify">', $txt['notify_replies'], '</label> <select name="notify" id="notify" data-role="slider" data-theme="c"> <option value="0">', $txt['no'], '</option> <option value="1"' . ($context['notify'] || !empty($options['auto_notify']) ? ' selected="selected"' : '') . '>', $txt['yes'], '</option> </select> </div>'; } if ($context['can_lock']) { echo ' <div data-role="fieldcontain"> <input type="hidden" name="lock" value="0" /> <label for="check_lock">', $txt['lock_topic'], '</label> <select name="lock" id="check_lock" data-role="slider" data-theme="c"> <option value="0">', $txt['no'], '</option> <option value="1"' . ($context['locked'] ? ' selected="selected"' : '') . '>', $txt['yes'], '</option> </select> </div>'; } echo ' <div data-role="fieldcontain"> <label for="check_back">', $txt['back_to_topic'], '</label> <select name="goback" id="check_back" data-role="slider" data-theme="c"> <option value="0">', $txt['no'], '</option> <option value="1"' . ($context['back_to_topic'] || !empty($options['return_to_post']) ? ' selected="selected"' : '') . '>', $txt['yes'], '</option> </select> </div>'; if ($context['can_sticky']) { echo ' <div data-role="fieldcontain"> <label for="check_sticky">', $txt['sticky_after'], '</label> <select name="sticky" id="check_sticky" data-role="slider" data-theme="c"> <option value="0">', $txt['no'], '</option> <option value="1"' . ($context['sticky'] ? ' selected="selected"' : '') . '>', $txt['yes'], '</option> </select> </div>'; } echo ' <div data-role="fieldcontain"> <input type="hidden" name="check_smileys" value="0" /> <label for="check_smileys">', $txt['dont_use_smileys'], '</label> <select name="ns" id="check_smileys" data-role="slider" data-theme="c"> <option value="0">', $txt['no'], '</option> <option value="1"', $context['use_smileys'] ? '' : ' selected="selected"', '>', $txt['yes'], '</option> </select> </div>'; if ($context['can_move']) { echo ' <div data-role="fieldcontain"> <label for="check_move">', $txt['move_after2'], '</label> <select name="move" id="check_move" data-role="slider" data-theme="c"> <option value="0">', $txt['no'], '</option> <option value="1"' . (!empty($context['move']) ? ' selected="selected"' : '') . '>', $txt['yes'], '</option> </select> </div>'; } if ($context['can_announce'] && $context['is_first_post']) { echo ' <div data-role="fieldcontain"> <label for="check_announce">', $txt['announce_topic'], '</label> <select name="announce_topic" id="check_announce" data-role="slider" data-theme="c"> <option value="0">', $txt['no'], '</option> <option value="1"' . (!empty($context['announce']) ? ' selected="selected"' : '') . '>', $txt['yes'], '</option> </select> </div>'; } if ($context['show_approval']) { echo ' <div data-role="fieldcontain"> <label for="check_announce">', $txt['announce_topic'], '</label> <select name="announce_topic" id="check_announce" data-role="slider" data-theme="c"> <option value="0">', $txt['no'], '</option> <option value="1"' . ($context['show_approval'] === 2 ? ' selected="selected"' : '') . '>', $txt['yes'], '</option> </select> </div>'; } echo ' <div id="postMoreOptions" class="smalltext"> <ul class="post_options"> ', $context['show_approval'] ? '<li><label for="approve"><input type="checkbox" name="approve" id="approve" value="2" class="input_check" ' . ($context['show_approval'] === 2 ? 'checked="checked"' : '') . ' /> ' . $txt['approve_this_post'] . '</label></li>' : '', ' </ul> </div>'; // If this post already has attachments on it - give information about them. if (!empty($context['current_attachments'])) { echo ' <dl id="postAttachment"> <dt> ', $txt['attached'], ': </dt> <dd class="smalltext"> <input type="hidden" name="attach_del[]" value="0" /> ', $txt['uncheck_unwatchd_attach'], ': </dd>'; foreach ($context['current_attachments'] as $attachment) { echo ' <dd class="smalltext"> <label for="attachment_', $attachment['id'], '"><input type="checkbox" id="attachment_', $attachment['id'], '" name="attach_del[]" value="', $attachment['id'], '"', empty($attachment['unchecked']) ? ' checked="checked"' : '', ' class="input_check" /> ', $attachment['name'], empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : '', !empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1028) / 1028), 0)) : '', '</label> </dd>'; } if (!empty($context['files_in_session_warning'])) { echo ' <dd class="smalltext">', $context['files_in_session_warning'], '</dd>'; } echo ' </dl>'; } // Is the user allowed to post any additional ones? If so give them the boxes to do it! if ($context['can_post_attachment']) { echo ' <dl id="postAttachment2">'; // But, only show them if they haven't reached a limit. Or a mod author hasn't hidden them. if ($context['num_allowed_attachments'] > 0 || !empty($context['dont_show_them'])) { echo ' <dt> ', $txt['attach'], ': </dt> <dd class="smalltext"> ', empty($modSettings['attachmentSizeLimit']) ? '' : '<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1028 . '" />', ' <input type="file" size="60" name="attachment[]" id="attachment1" class="input_file" /> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)'; // Show more boxes if they aren't approaching that limit. if ($context['num_allowed_attachments'] > 1) { echo ' <script type="text/javascript"><!-- // --><![CDATA[ var allowed_attachments = ', $context['num_allowed_attachments'], '; var current_attachment = 1; function addAttachment() { allowed_attachments = allowed_attachments - 1; current_attachment = current_attachment + 1; if (allowed_attachments <= 0) return alert("', $txt['more_attachments_error'], '"); setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="60" name="attachment[]" id="attachment\' + current_attachment + \'" class="input_file" /> (<a href="javascript:void(0);" onclick="cleanFileInput(\\\'attachment\' + current_attachment + \'\\\');">', $txt['clean_attach'], '<\\/a>)\' + \'<\\/dd><dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')<\' + \'/a><\' + \'/dd>\'); return true; } // ]]></script> </dd> <dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')</a></dd>'; } else { echo ' </dd>'; } } // Add any template changes for an alternative upload system here. call_integration_hook('integrate_upload_template', array()); echo ' <dd class="smalltext">'; // Show some useful information such as allowed extensions, maximum size and amount of attachments allowed. if (!empty($modSettings['attachmentCheckExtensions'])) { echo ' ', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br />'; } if (!empty($context['attachment_restrictions'])) { echo ' ', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br />'; } if ($context['num_allowed_attachments'] == 0) { echo ' ', $txt['attach_limit_nag'], '<br />'; } if (!$context['can_post_attachment_unapproved']) { echo ' <span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br />'; } echo ' </dd> </dl>'; } echo ' </div>'; // Is visual verification enabled? if ($context['require_verification']) { echo ' <div class="post_verification"> <span', !empty($context['post_error']['need_qr_verification']) ? ' class="error"' : '', '> <strong>', $txt['verification'], ':</strong> </span> ', template_control_verification($context['visual_verification_id'], 'all'), ' </div>'; } // Finally, the submit buttons. echo template_control_richedit_buttons($context['post_box_name']); // Assuming this isn't a new topic pass across the last message id. if (isset($context['topic_last_message'])) { echo ' <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '" />'; } echo ' <input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '" /> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" /> </form>'; }
function template_edit_comment() { global $context, $scripturl, $txt, $settings, $modSettings; ShowTopDownloadBar2(); // Load the spell checker? if ($context['show_spellchecking']) { echo ' <script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/spellcheck.js"></script>'; } echo ' <form method="post" name="cprofile" id="cprofile" action="', $scripturl, '?action=downloads&sa=editcomment2" onsubmit="submitonce(this);"> <div class="cat_bar"> <h3 class="catbg centertext"> ', $txt['downloads_text_editcomment'], ' </h3> </div> <table border="0" cellpadding="0" cellspacing="0" width="100%"> '; if (!function_exists('getLanguages')) { // Showing BBC? if ($context['show_bbc']) { echo ' <tr class="windowbg2"> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'bbc'), ' </td> </tr>'; } // What about smileys? if (!empty($context['smileys']['postform'])) { echo ' <tr class="windowbg2"> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'smileys'), ' </td> </tr>'; } // Show BBC buttons, smileys and textbox. echo ' <tr class="windowbg2"> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'message'), ' </td> </tr>'; } else { echo ' <tr class="windowbg2"> <td colspan="2">'; // Showing BBC? if ($context['show_bbc']) { echo ' <div id="bbcBox_message"></div>'; } // What about smileys? if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { echo ' <div id="smileyBox_message"></div>'; } // Show BBC buttons, smileys and textbox. echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); echo '</td></tr>'; } echo ' <tr> <td width="28%" colspan="2" align="center" class="windowbg2"> <input type="hidden" name="id" value="' . $context['downloads_comment']['ID_COMMENT'] . '" />'; // Check if comments are autoapproved if (allowedTo('downloads_autocomment') == false) { echo $txt['downloads_text_commentwait'] . '<br />'; } if ($context['show_spellchecking']) { echo ' <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'cprofile\', \'comment\');" />'; } echo ' <input type="submit" value="' . $txt['downloads_text_editcomment'] . '" name="submit" /></td> </tr> </table> </form>'; if ($context['show_spellchecking']) { echo '<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>'; } downloads_copyright(); }
/** * Output the Article config screen */ function pmxc_ShowAdmArticleConfig() { global $context, $settings, $modSettings, $boarddir, $options, $txt; echo ' <tr> <td> <div class="windowbg"> <table class="pmx_table"> <tr> <td style="width:50%;padding:4px;"> <input type="hidden" name="id" value="' . $this->cfg['id'] . '" /> <input type="hidden" name="owner" value="' . $this->cfg['owner'] . '" /> <input type="hidden" name="contenttype" value="' . $this->cfg['ctype'] . '" /> <input type="hidden" name="config[settings]" value="" /> <input type="hidden" name="active" value="' . $this->cfg['active'] . '" /> <input type="hidden" name="approved" value="' . $this->cfg['approved'] . '" /> <input type="hidden" name="approvedby" value="' . $this->cfg['approvedby'] . '" /> <input type="hidden" name="created" value="' . $this->cfg['created'] . '" /> <input type="hidden" name="updated" value="' . $this->cfg['updated'] . '" /> <input type="hidden" name="updatedby" value="' . $this->cfg['updatedby'] . '" /> <input type="hidden" name="check_num_vars[]" value="[config][maxheight], \'\'" /> <div style="height:61px;"> <div style="float:left;width:100px; padding-top:1px;">' . $txt['pmx_article_title'] . '</div>'; // all titles depend on language $curlang = ''; foreach ($context['pmx']['languages'] as $lang => $sel) { $curlang = !empty($sel) ? $lang : $curlang; echo ' <span id="' . $lang . '" style="white-space:nowrap;' . (!empty($sel) ? '' : ' display:none;') . '"> <input style="width:65%;" type="text" name="config[title][' . $lang . ']" value="' . (isset($this->cfg['config']['title'][$lang]) ? htmlspecialchars($this->cfg['config']['title'][$lang], ENT_QUOTES) : '') . '" /> </span>'; } echo ' <input id="curlang" type="hidden" value="' . $curlang . '" /> <div style="clear:both; height:10px;"> <img style="float:left;" src="' . $context['pmx_imageurl'] . 'arrow_down.gif" alt="*" title="" /> </div> <div style="float:left; width:100px;">' . $txt['pmx_edit_title_lang'] . ' <img class="info_toggle" onclick=\'Show_help("pmxBH01")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </div> <select style="float:left; width:165px;" size="1" onchange="setTitleLang(this)">'; foreach ($context['pmx']['languages'] as $lang => $sel) { echo ' <option value="' . $lang . '"' . (!empty($sel) ? ' selected="selected"' : '') . '>' . $lang . '</option>'; } echo ' </select> <div style="margin-left:280px;"> <span style="vertical-align:6px;">' . $txt['pmx_edit_title_align'] . '</span>'; // title align if (!isset($this->cfg['config']['title_align'])) { $this->cfg['config']['title_align'] = 'left'; } echo ' <input type="hidden" id="titlealign" name="config[title_align]" value="' . $this->cfg['config']['title_align'] . '" />'; foreach ($txt['pmx_edit_title_align_types'] as $key => $val) { echo ' <img id="img' . $key . '" src="' . $context['pmx_imageurl'] . 'text_align_' . $key . '.gif" alt="*" title="' . $txt['pmx_edit_title_helpalign'] . $val . '" style="cursor:pointer;vertical-align:1px;' . ($this->cfg['config']['title_align'] == $key ? 'background-color:#e02000;' : '') . '" onclick="setAlign(\'\', \'' . $key . '\')" />'; } echo ' </div> </div> <div id="pmxBH01" style="margin-top:4px;" class="info_frame">' . $txt['pmx_edit_titlehelp'] . ' </div>'; // Title icons $this->cfg['config']['title_icon'] = empty($this->cfg['config']['title_icon']) || $this->cfg['config']['title_icon'] == 'none.gif' ? 'none.png' : $this->cfg['config']['title_icon']; echo ' <div style="float:left;height:40px;"> <div style="float:left;width:100px; padding-top:8px;">' . $txt['pmx_edit_titleicon'] . '</div> <div class="ttliconDiv" onclick="setNewIcon(document.getElementById(\'pWind.icon_sel\'), event)"> <input id="post_image" type="hidden" name="config[title_icon]" value="' . $this->cfg['config']['title_icon'] . '" /> <input id="iconDD" value="' . ucfirst(str_replace('.png', '', $this->cfg['config']['title_icon'])) . '" readonly /> <img id="pWind.icon" class="pwindiconBlk" src="' . $context['pmx_Iconsurl'] . $this->cfg['config']['title_icon'] . '" alt="*" /> <img class="ddImageBlk" src="' . $context['pmx_imageurl'] . 'state_expanded.png" alt="*" title="" /> </div> <ul class="ttlicondd Artedit" id="pWind.icon_sel" onclick="updIcon(this)">'; foreach ($this->title_icons as $file => $name) { echo ' <li id="' . $file . '" class="ttlicon' . ($this->cfg['config']['title_icon'] == $file ? ' active' : '') . '"> <img src="' . $context['pmx_Iconsurl'] . $file . '" alt="*" /><span>' . $name . '</span> </li>'; } echo ' </ul> <script>$("li").hover(function(){$(this).toggleClass("active")});</script> </div>'; // show article types echo ' </td> <td style="padding:4px;"> <div style="float:left;width:130px;">' . $txt['pmx_article_type'] . '</div>'; $RegBlocks = $context['pmx']['RegBlocks']; foreach ($RegBlocks as $key => $val) { if (!in_array($key, array('html', 'script', 'bbc_script', 'php'))) { unset($RegBlocks[$key]); } } function cmpBDesc($a, $b) { return strcasecmp(str_replace(' ', '', $a["description"]), str_replace(' ', '', $b["description"])); } uasort($RegBlocks, 'cmpBDesc'); if (allowPmx('pmx_admin, pmx_create')) { echo ' <select style="width:60%;" size="1" name="ctype" onchange="FormFunc(\'edit_change\', \'1\')">'; foreach ($RegBlocks as $type => $articleType) { echo ' <option value="' . $type . '"' . ($this->cfg['ctype'] == $type ? ' selected="selected"' : '') . '>' . $articleType['description'] . '</option>'; } echo ' </select>'; } else { echo ' <input type="hidden" name="ctype" value="' . $this->cfg['ctype'] . '" /> <input style="width:60%;" value="' . $RegBlocks[$this->cfg['ctype']]['description'] . '" disabled="disabled" />'; } // all exist categories $selcats = array_merge(array(PortaMx_getDefaultCategory($txt['pmx_categories_none'])), $this->categories); $ordercats = array_merge(array(0), $context['pmx']['catorder']); $isWriter = allowPmx('pmx_create, pmx_articles', true); $isAdm = allowPmx('pmx_admin'); echo ' <div style="float:left;width:130px;margin-top:9px;">' . $txt['pmx_article_cats'] . '</div> <select style="width:60%;margin-top:9px;" size="1" name="catid">'; foreach ($ordercats as $catorder) { $cat = PortaMx_getCatByOrder($selcats, $catorder); $cfg = unserialize($cat['config']); if (!empty($isAdm) || !empty($isWriter) && empty($cfg['global'])) { echo ' <option value="' . $cat['id'] . '"' . ($cat['id'] == $this->cfg['catid'] ? ' selected="selected"' : '') . '">' . str_repeat('•', $cat['level']) . ' ' . $cat['name'] . '</option>'; } } echo ' </select> </div>'; // articlename echo ' <div style="float:left;width:130px;margin-top:9px">' . $txt['pmx_article_name'] . ' <img class="info_toggle" onclick=\'Show_help("pmxBH11")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </div> <input id="check.name" style="width:60%;margin-top:9px" onkeyup="check_requestname(this)" onkeypress="check_requestname(this)" type="text" name="name" value="' . $this->cfg['name'] . '" /> <span id="check.name.error" style="display:none;">' . sprintf($txt['namefielderror'], $txt['pmx_article_name']) . '</span> <div id="pmxBH11" class="info_frame" style="margin-top:5px;">' . $txt['pmx_edit_pagenamehelp'] . ' </div> </td> </tr>'; // the editor area dependent on article type echo ' <tr> <td colspan="2" style="padding:4px 4px 10px 4px;">'; // show the editor if ($this->cfg['ctype'] == 'html') { $allow = allowPmx('pmx_admin') || allowPmx('pmx_blocks'); $fnd = explode('/', str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT'])); $smfpath = str_replace('\\', '/', $boarddir); foreach ($fnd as $key => $val) { $fnd[$key] = $val; $rep[] = ''; } $filepath = trim(str_replace($fnd, $rep, $smfpath), '/') . '/CustomImages'; if (count($fnd) == count(explode('/', $smfpath))) { $filepath = '/' . $filepath; } $_SESSION['pmx_ckfm'] = array('ALLOW' => $allow, 'FILEPATH' => $filepath); echo ' <div class="cat_bar catbg_grid"> <h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_edit_content'] . '</span></h4> </div> <textarea name="' . $context['pmx']['htmledit']['id'] . '">' . $context['pmx']['htmledit']['content'] . '</textarea> <script type="text/javascript"> CKEDITOR.replace("' . $context['pmx']['htmledit']['id'] . '", {filebrowserBrowseUrl: "ckeditor/fileman/index.php"}); </script>'; } elseif ($this->cfg['ctype'] == 'bbc_script') { echo ' <style type="text/css"> .sceditor-container iframe{width:99.1% !important;} .sceditor-container{max-width:inherit;width:inherit !important; margin-right:-2px;} textarea{max-width:99% !important;width:99.2% !important;} </style> <div class="cat_bar catbg_grid" style="margin-right:1px;"> <h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_edit_content'] . '</span></h4> </div> <input type="hidden" id="smileyset" value="PortaMx" /> <div id="bbcBox_message"></div> <div id="smileyBox_message"></div> <div style="padding-right:3px;margin-top:-10px;">', template_control_richedit($context['pmx']['editorID'], 'smileyBox_message', 'bbcBox_message'), '</div>'; } elseif ($this->cfg['ctype'] == 'php') { $options['collapse_phpinit'] = empty($context['pmx']['phpInit']['havecont']); echo ' <div class="cat_bar catbg_grid"> <h4 class="catbg catbg_grid"> <span style="float:right;display:block;margin-top:-2px;"> <img onclick="php_syntax(\'' . $context['pmx']['phpShow']['id'] . '\')" style="padding:3px 5px 3px 10px;cursor:pointer;" alt="Syntax check" title="' . $txt['pmx_check_phpsyntax'] . '" src="' . $context['pmx_imageurl'] . 'syntaxcheck.png" class="pmxright" /> </span> <span class="cat_left_title">' . $txt['pmx_edit_content'] . ' <span id="upshrinkPHPinitCont"' . (empty($options['collapse_phpinit']) ? '' : ' style="display:none;"') . '>' . $txt['pmx_edit_content_show'] . '</span></span> </h4> </div> <div id="check_' . $context['pmx']['phpShow']['id'] . '" class="info_frame" style="line-height:1.4em;margin:1px 0;"></div> <textarea name="' . $context['pmx']['phpShow']['id'] . '" id="' . $context['pmx']['phpShow']['id'] . '" style="display:block;resize:vertical;width:' . $context['pmx']['phpShow']['width'] . ';height:' . $context['pmx']['phpShow']['height'] . ';">' . $context['pmx']['phpShow']['value'] . '</textarea> <div class="plainbox info_text" style="margin-top:5px;margin-right:0px;padding:5px 0 7px 0;display:block;"> <div class="normaltext" style="margin:0 10px;"> ' . (empty($context['pmx']['phpInit']['havecont']) ? '<span style="margin-top:2px;margin-right:-4px;" id="upshrinkPHPshowImg" class="floatright ' . (empty($options['collapse_visual']) ? 'toggle_up" align="bottom"' : 'toggle_down" align="bottom"') . ' title="' . (empty($options['collapse_visual']) ? $txt['pmx_collapse'] : $txt['pmx_expand']) . $txt['pmx_php_partblock'] . '"> </span>' : '') . ' <span>' . $txt['pmx_php_partblock_note'] . ' <img class="info_toggle" onclick=\'Toggle_help("pmxPHPH01")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" style="vertical-align: -3px;" /> </span> </div> <div id="pmxPHPH01" style="display:none; margin:4px 10px 0;">' . $txt['pmx_php_partblock_help'] . '</div> </div> <div id="upshrinkPHPshowCont"' . (empty($options['collapse_phpinit']) ? '' : ' style="margin-top:5px;display:none;"') . '> <div class="cat_bar catbg_grid"> <h4 class="catbg catbg_grid"> <span style="float:right;display:block;margin-top:-2px;"> <img onclick="php_syntax(\'' . $context['pmx']['phpInit']['id'] . '\')" style="padding:3px 5px 3px 10px;cursor:pointer;" title="' . $txt['pmx_check_phpsyntax'] . '" alt="Syntax check" src="' . $context['pmx_imageurl'] . 'syntaxcheck.png" class="pmxright" /> </span> <span class="cat_left_title">' . $txt['pmx_edit_content'] . $txt['pmx_edit_content_init'] . '</span> </h4> </div> <div id="check_' . $context['pmx']['phpInit']['id'] . '" class="info_frame" style="line-height:1.4em;margin:1px 0;"></div> <textarea name="' . $context['pmx']['phpInit']['id'] . '" id="' . $context['pmx']['phpInit']['id'] . '" style="display:block;width:' . $context['pmx']['phpInit']['width'] . ';height:' . $context['pmx']['phpInit']['height'] . ';">' . $context['pmx']['phpInit']['value'] . '</textarea> </div>'; if (empty($context['pmx']['phpInit']['havecont'])) { addInlineJavascript("\t" . str_replace("\n", "\n\t", PortaMx_compressJS(' var upshrinkPHPshow = new smc_Toggle({ bToggleEnabled: true, bCurrentlyCollapsed: ' . (empty($options['collapse_phpinit']) ? 'false' : 'true') . ', aSwappableContainers: [ \'upshrinkPHPshowCont\', \'upshrinkPHPinitCont\' ], aSwapImages: [ { sId: \'upshrinkPHPshowImg\', altCollapsed: ' . JavaScriptEscape($txt['pmx_expand'] . $txt['pmx_php_partblock']) . ', altExpanded: ' . JavaScriptEscape($txt['pmx_collapse'] . $txt['pmx_php_partblock']) . ' } ], oCookieOptions: { bUseCookie: false } });')), true); } } else { echo ' <div class="cat_bar catbg_grid"> <h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_edit_content'] . '</span></h4> </div> <textarea name="' . $context['pmx']['script']['id'] . '" id="' . $context['pmx']['script']['id'] . '" style="display:block;width:' . $context['pmx']['script']['width'] . ';height:' . $context['pmx']['script']['height'] . ';">' . $context['pmx']['script']['value'] . '</textarea>'; } echo ' </td> </tr> <tr> <td style="padding:4px;"> <div style="min-height:182px;"> <input type="hidden" name="config[settings]" value="" />'; // show the settings area echo ' <div class="cat_bar catbg_grid grid_padd"> <h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_articles_types'][$this->cfg['ctype']] . ' ' . $txt['pmx_article_settings_title'] . '</span></h4> </div> <div>'; if ($this->cfg['ctype'] == 'html') { echo ' <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_html_teaser'] . ' <img class="info_toggle" onclick=\'Show_help("pmxHTMLH01")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </span> <input type="hidden" name="config[settings][teaser]" value="0" /> <div><input class="input_check" type="checkbox" name="config[settings][teaser]" value="1"' . (isset($this->cfg['config']['settings']['teaser']) && !empty($this->cfg['config']['settings']['teaser']) ? ' checked="checked"' : '') . ' /></div> </div> <div id="pmxHTMLH01" class="info_frame" style="margin-top:4px;">' . str_replace('@@', '<img src="' . $context['pmx_imageurl'] . 'pgbreak.png" alt="*" style="vertical-align:-5px;"/>', $txt['pmx_html_teasehelp']) . '</div>'; } elseif ($this->cfg['ctype'] != 'php') { echo ' <div class="adm_check"> <span class="adm_w80">' . sprintf($txt['pmx_article_teaser'], $txt['pmx_teasemode'][intval(!empty($context['pmx']['settings']['teasermode']))]) . ' <img class="info_toggle" onclick=\'Show_help("pmxHTMLH02")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </span> <div><input type="text" size="5" name="config[settings][teaser]" value="' . (isset($this->cfg['config']['settings']['teaser']) ? $this->cfg['config']['settings']['teaser'] : '') . '" /></div> </div> <div id="pmxHTMLH02" class="info_frame" style="margin-top:4px;">' . $txt['pmx_article_teasehelp'] . '</div>'; } echo ' <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_content_print'] . '</span> <input type="hidden" name="config[settings][printing]" value="0" /> <div><input class="input_check" type="checkbox" name="config[settings][printing]" value="1"' . (!empty($this->cfg['config']['settings']['printing']) ? ' checked="checked"' : '') . ' /></div> </div> <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_article_footer'] . ' <img class="info_toggle" onclick=\'Show_help("pmxARTH01")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </span> <input type="hidden" name="config[settings][showfooter]" value="0" /> <div><input class="input_check" type="checkbox" name="config[settings][showfooter]" value="1"' . (isset($this->cfg['config']['settings']['showfooter']) && !empty($this->cfg['config']['settings']['showfooter']) ? ' checked="checked"' : '') . ' /></div> </div> <div id="pmxARTH01" class="info_frame" style="margin-top:4px;">' . $txt['pmx_article_footerhelp'] . '</div> <input type="hidden" name="config[show_sitemap]" value="0" />'; if ($this->cfg['ctype'] != 'php') { echo ' <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_articles_disableHSimage'] . '</span> <input type="hidden" name="config[settings][disableHSimg]" value="0" /> <div><input class="input_check" type="checkbox" name="config[settings][disableHSimg]" value="1"' . (isset($this->cfg['config']['settings']['disableHSimg']) && !empty($this->cfg['config']['settings']['disableHSimg']) ? ' checked="checked"' : '') . (!empty($context['pmx']['settings']['disableHS']) ? ' disabled="disabled"' : '') . ' /></div> </div>'; } echo ' </div> </div>'; // the group access echo ' <div class="cat_bar catbg_grid grid_padd grid_top"> <h4 class="catbg catbg_grid"> <img class="grid_click_image pmxleft" onclick=\'Show_help("pmxBH03")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> <span class="cat_msg_title">' . $txt['pmx_article_groups'] . '</span> </h4> </div> <select id="pmxgroups" onchange="changed(\'pmxgroups\');" style="width:83%;" name="acsgrp[]" multiple="multiple" size="5">'; if (!empty($this->cfg['acsgrp'])) { list($grpacs, $denyacs) = Pmx_StrToArray($this->cfg['acsgrp'], ',', '='); } else { $grpacs = $denyacs = array(); } foreach ($this->smf_groups as $grp) { echo ' <option value="' . $grp['id'] . '=' . intval(!in_array($grp['id'], $denyacs)) . '"' . (in_array($grp['id'], $grpacs) ? ' selected="selected"' : '') . '>' . (in_array($grp['id'], $denyacs) ? '^' : '') . $grp['name'] . '</option>'; } echo ' </select> <div id="pmxBH03" class="info_frame">' . $txt['pmx_article_groupshelp'] . '</div> <script type="text/javascript"> var pmxgroups = new MultiSelect("pmxgroups"); </script>'; // article moderate if (!isset($this->cfg['config']['can_moderate'])) { $this->cfg['config']['can_moderate'] = 1; } if (allowPmx('pmx_articles, pmx_create', true)) { echo ' <input type="hidden" name="config[can_moderate]" value="' . $this->cfg['config']['can_moderate'] . '" />'; } if (allowPmx('pmx_admin, pmx_articles, pmx_create')) { echo ' <div class="cat_bar catbg_grid grid_padd grid_top"> <h4 class="catbg catbg_grid"> <span class="cat_msg_title">' . $txt['pmx_article_moderate_title'] . '</span> </h4> </div>'; } if (allowPmx('pmx_admin')) { echo ' <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_article_moderate'] . ' </span> <input type="hidden" name="config[can_moderate]" value="0" /> <div><input class="input_check" type="checkbox" name="config[can_moderate]" value="1"' . (!empty($this->cfg['config']['can_moderate']) ? ' checked="checked"' : '') . ' /></div> </div>'; } echo ' <input type="hidden" name="config[check_ecl]" value="0" /> <input type="hidden" name="config[check_eclbots]" value="0" />'; if (allowPmx('pmx_admin, pmx_articles, pmx_create') && !empty($modSettings['pmx_ecl'])) { echo ' <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_check_artelcmode'] . ' <img class="info_toggle" onclick=\'Show_help("pmxArteclHelp")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </span> <div><input class="input_check" type="checkbox" name="config[check_ecl]" value="1"' . (!empty($this->cfg['config']['check_ecl']) ? ' checked="checked"' : '') . ' onclick="showeclbots(this)" /></div> </div> <div id="pmxArteclHelp" class="info_frame" style="margin-top:0px;">' . $txt['pmx_art_eclcheckhelp'] . '</div> <div id="eclextend" style="display:' . (!empty($this->cfg['config']['check_ecl']) ? 'block' : 'none') . '"> <div class="adm_check"> <span class="adm_w80">' . $txt['pmx_check_artelcbots'] . ' <img class="info_toggle" onclick=\'Show_help("pmxeclHelpbots")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" /> </span> <div><input id="eclextendinp" class="input_check" type="checkbox" name="config[check_eclbots]" value="1"' . (!empty($this->cfg['config']['check_eclbots']) ? ' checked="checked"' : '') . ' /></div> </div> <div id="pmxeclHelpbots" class="info_frame" style="margin-top:0;">' . $txt['pmx_art_eclcheckbotshelp'] . '</div> <script type="text/javascript"> function showeclbots(elm) {if(elm.checked == true) document.getElementById("eclextend").style.display = "block"; else {document.getElementById("eclextend").style.display = "none"; document.getElementById("eclextendinp").checked = false;}} </script> </td>'; } // the visual options echo ' <td id="set_col" style="padding:4px;"> <div class="cat_bar catbg_grid grid_padd"> <h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_edit_visuals'] . '</span></h4> </div> <div style="float:left; height:30px; width:177px;">' . $txt['pmx_edit_cancollapse'] . '</div> <input style="padding-left:141px;" type="hidden" name="config[collapse]" value="0" /> <input class="input_check" id="collapse" type="checkbox" name="config[collapse]" value="1"' . ($this->cfg['config']['visuals']['header'] == 'none' ? ' disabled="disabled"' : ($this->cfg['config']['collapse'] == 1 ? ' checked="checked"' : '')) . ' /> <div style="clear:both;" /></div> <div style="float:left; height:30px; width:180px;">' . $txt['pmx_edit_collapse_state'] . '</div> <select style="width:46%;" size="1" name="config[collapse_state]">'; foreach ($txt['pmx_collapse_mode'] as $key => $text) { echo ' <option value="' . $key . '"' . (isset($this->cfg['config']['collapse_state']) && $this->cfg['config']['collapse_state'] == $key ? ' selected="selected"' : '') . '>' . $text . '</option>'; } echo ' </select> <br style="clear:both;" /> <div style="float:left; height:30px; width:180px;">' . $txt['pmx_edit_overflow'] . '</div> <select style="width:46%;" size="1" id="mxhgt" name="config[overflow]" onchange="checkMaxHeight(this);">'; foreach ($txt['pmx_overflow_actions'] as $key => $text) { echo ' <option value="' . $key . '"' . (isset($this->cfg['config']['overflow']) && $this->cfg['config']['overflow'] == $key ? ' selected="selected"' : '') . '>' . $text . '</option>'; } echo ' </select> <br style="clear:both;" /> <div style="float:left; min-height:30px; width:99%;"> <div style="float:left; min-height:30px; width:180px;">' . $txt['pmx_edit_height'] . '</div> <div style="float:left; width:46%"> <input onkeyup="check_numeric(this)" id="maxheight" type="text" size="4" name="config[maxheight]" value="' . (isset($this->cfg['config']['maxheight']) ? $this->cfg['config']['maxheight'] : '') . '"' . (!isset($this->cfg['config']['overflow']) || empty($this->cfg['config']['overflow']) ? ' disabled="disabled"' : '') . ' /><span class="smalltext">' . $txt['pmx_pixel'] . '</span><span style="display:inline-block; width:3px;"></span> <select id="maxheight_sel" style="float:right;width:52%;margin-right:-1%;" size="1" name="config[height]">'; foreach ($txt['pmx_edit_height_mode'] as $key => $text) { echo ' <option value="' . $key . '"' . (isset($this->cfg['config']['height']) && $this->cfg['config']['height'] == $key ? ' selected="selected"' : '') . '>' . $text . '</option>'; } echo ' </select> </div> </div> <br style="clear:both;" /> <script type="text/javascript"> checkMaxHeight(document.getElementById("mxhgt")); </script> <div style="float:left; height:30px; width:180px;">' . $txt['pmx_edit_innerpad'] . '</div> <input onkeyup="check_numeric(this, \',\')" type="text" size="4" name="config[innerpad]" value="' . (isset($this->cfg['config']['innerpad']) ? $this->cfg['config']['innerpad'] : '4') . '" /><span class="smalltext">' . $txt['pmx_pixel'] . ' (xy/y,x)</span> <br style="clear:both;" />'; // CSS class settings echo ' <div class="cat_bar catbg_grid grid_padd"> <h4 class="catbg catbg_grid grid_botpad"> <div style="float:left; width:177px;"><span class="cat_left_title">' . $txt['pmx_edit_usedclass_type'] . '</span></div> <span class="cat_left_title">' . $txt['pmx_edit_usedclass_style'] . '</span> </h4> </div> <div style="margin:0px 2px;">'; // write out the classes foreach ($this->usedClass as $ucltyp => $ucldata) { echo ' <div style="float:left; width:180px; height:30px; padding-top:2px;">' . $ucltyp . '</div> <select' . ($ucltyp == 'frame' || $ucltyp == 'postframe' ? ' id="pmx_' . $ucltyp . '" ' : ' ') . 'style="width:46%;" name="config[visuals][' . $ucltyp . ']" onchange="checkCollapse(this)">'; foreach ($ucldata as $cname => $class) { echo ' <option value="' . $class . '"' . (!empty($this->cfg['config']['visuals'][$ucltyp]) ? $this->cfg['config']['visuals'][$ucltyp] == $class ? ' selected="selected"' : '' : (substr($cname, 0, 1) == '+' ? ' selected="selected"' : '')) . '>' . substr($cname, 1) . '</option>'; } echo ' </select> <br style="clear:both;" />'; } echo ' </div> <div class="cat_bar catbg_grid grid_padd" style="margin-top:-2px;"> <h4 class="catbg catbg_grid"><span class="cat_left_title" style="margin-left:-3px;">' . $txt['pmx_edit_canhavecssfile'] . '</span></h4> </div> <div style="float:left; margin:0px 2px; width:176px;">' . $txt['pmx_edit_cssfilename'] . '</div> <select id="sel.css.file" style="width:46%;margin-bottom:2px;" name="config[cssfile]" onchange="pmxChangeCSS(this)"> <option value=""></option>'; // custon css files exist ? if (!empty($this->custom_css)) { // write out custom mpt/css definitions foreach ($this->custom_css as $custcss) { if (is_array($custcss)) { echo ' <option value="' . $custcss['file'] . '"' . ($this->cfg['config']['cssfile'] == $custcss['file'] ? ' selected="selected"' : '') . '>' . $custcss['file'] . '</option>'; } } echo ' </select> <div style="clear:both; height:2px;"></div>'; // write out all class definitions (hidden) foreach ($this->custom_css as $custcss) { if (is_array($custcss)) { echo ' <div id="' . $custcss['file'] . '" style="display:none;">'; foreach ($custcss['class'] as $key => $val) { if (in_array($key, array_keys($this->usedClass))) { echo ' <div style="float:left; width:180px; padding:0 2px;">' . $key . '</div>' . (empty($val) ? sprintf($txt['pmx_edit_nocss_class'], $settings['theme_id']) : $val) . '<br />'; } } echo ' </div>'; } } echo ' <script type="text/javascript"> var elm = document.getElementById("sel.css.file"); var fname = elm.options[elm.selectedIndex].value; if(document.getElementById(fname)) document.getElementById(fname).style.display = ""; function pmxChangeCSS(elm) { for(i=0; i<elm.length; i++) { if(document.getElementById(elm.options[i].value)) document.getElementById(elm.options[i].value).style.display = "none"; } var fname = elm.options[elm.selectedIndex].value; if(document.getElementById(fname)) document.getElementById(fname).style.display = ""; } </script>'; } else { echo ' </select> <div style="clear:both; height:6px;"></div>'; } echo ' </td> </tr> <tr> <td colspan="2" style="text-align:center;padding:4px 4px 0 4px;"><hr class="pmx_hr" /> <div style="height:10px;"></div> <input class="button_submit" type="button" style="margin-right:10px;" value="' . $txt['pmx_save_exit'] . '" onclick="FormFuncCheck(\'save_edit\', \'1\')" /> <input class="button_submit" type="button" style="margin-right:10px;" value="' . $txt['pmx_save_cont'] . '" onclick="FormFuncCheck(\'save_edit_continue\', \'1\')" /> <input class="button_submit" type="button" style="margin-right:10px;" value="' . $txt['pmx_cancel'] . '" onclick="FormFunc(\'cancel_edit\', \'1\')" /> </td> </tr> </table> </div> </td> </tr>'; }
function template_kb_knowcont() { global $scripturl, $txt, $settings, $memberContext, $total_rates, $sc, $user_info, $modSettings, $context; $max_num_stars = 5; if (isset($_GET['reported'])) { echo '<div style="text-align: center;" class="information"><strong>' . $txt['kb_reports24'] . '</strong></div>'; } if ($context['know'][0]['approved'] == 0) { echo '<div style="text-align: center;" class="errorbox"><strong>' . $txt['kb_appp24'] . '</strong></div>'; } if (isset($_GET['yesa'])) { echo '<div style="text-align: center;" class="information"><strong>' . $txt['kb_appp244'] . '</strong></div>'; } if (isset($_GET['noa'])) { echo '<div style="text-align: center;" class="errorbox"><strong>' . $txt['kb_appp2444'] . '</strong></div>'; } foreach ($context['know'] as $knowl) { if ($knowl['approved'] == 1) { $approved = '<span style="color: #008000;">' . $txt['kb_alist6'] . '</span>'; } else { $approved = '<span style="color: #f00;">' . $txt['kb_alist7'] . '</span>'; } echo ' <div class="cat_bar"> <h3 class="catbg">', $knowl['title'], '</h3> </div>'; echo ' <span class="upperframe"><span></span></span> <div class="roundframe">'; $float = empty($modSettings['kb_article_detaildisplay']) ? 'right' : 'left'; $pos = $float == 'left' ? 'right' : 'left'; echo ' <div style="position: relative; ' . $pos . ':10px; padding-right:10px; padding-left:10px" class="float' . $float . '"> <div class="information"> <strong>' . $txt['kb_pinfi9'] . '</strong><br /><br />'; loadMemberData($knowl['id_member']); loadMemberContext($knowl['id_member']); if ($memberContext[$knowl['id_member']]['avatar']['href']) { echo ' <img class="resizeav" border="0" src="' . $memberContext[$knowl['id_member']]['avatar']['href'] . '" alt="" />'; } else { echo ' <img border="0" src="', $settings['images_url'], '/icons/online.gif" width="50" height="50" alt="" />'; } echo ' <br /><br /> <strong>' . $txt['kb_pinfi8'] . ':</strong> '; if ($knowl['id_member'] != 0) { echo KB_profileLink($knowl['real_name'], $knowl['id_member']); } else { echo $txt['guest_title']; } echo ' <br /> <strong>' . $txt['kb_pinfi7'] . ':</strong> ' . $knowl['kbnid'] . ''; if (!empty($modSettings['kb_show_view'])) { echo '<br /><strong>' . $txt['kb_pinfi6'] . ':</strong> ' . $knowl['views'] . ''; } if (allowedTo('rate_kb') && $modSettings['kb_eratings']) { echo '<br /> <strong>' . $txt['kb_pinfi3'] . ':</strong> <a href="' . $scripturl . '?action=kb;area=rate;value=1;kbnid=' . $knowl['kbnid'] . ';sesc=' . $sc . '"> <img src="', $settings['default_images_url'], '/sort_up.gif" title="' . $txt['kb_pinfi4'] . '" alt="' . $txt['kb_pinfi4'] . '" border="0" /></a> <a href="' . $scripturl . '?action=kb;area=rate;value=0;kbnid=' . $knowl['kbnid'] . ';sesc=' . $sc . '"> <img src="', $settings['default_images_url'], '/sort_down.gif" title="' . $txt['kb_pinfi5'] . '" alt="' . $txt['kb_pinfi5'] . '" border="0" /></a><br /> '; } else { echo '<br />'; } if (!empty($modSettings['kb_eratings'])) { echo '<strong>' . $txt['kb_pinfi2'] . ':</strong> ' . KB_Stars_Precent($knowl['rate']) . '<br />'; } echo ' <strong>' . $txt['kb_pinfi1'] . ': </strong> <span class="smalltext">' . $knowl['date'] . '</span> <br /><strong>' . $txt['kb_alist5'] . ':</strong> ' . $approved . '<br /><br /> </div> </div>'; if (!empty($modSettings['kb_social'])) { echo ' <div style="position: relative; left:10px;"> <g:plusone size="small"></g:plusone><script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script> <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal">' . $txt['kb_tweet'] . '</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> <iframe src="http://www.facebook.com/plugins/like.php?href=', $scripturl, '?action=kb;area=article;cont=' . $_GET['cont'] . '&layout=button_count&show_faces=true&width=85&action=like&font&colorscheme=light&height=20" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:85px; height:20px;" allowTransparency="true"></iframe> </div>'; if (!empty($knowl['source'])) { echo '<br /> <strong>' . $txt['kb_osource'] . '</strong>: ', $knowl['source'], ''; } echo '<hr />'; } else { if (!empty($knowl['source'])) { echo ' <strong>' . $txt['kb_osource'] . '</strong>: ', $knowl['source'], ' <hr />'; } } echo ' <div style="padding-right:10px; padding-top:10px; padding-left:10px"> ', $knowl['content'], ' </div> <br class="clear" /><br class="clear" /> </div><span class="lowerframe"><span></span></span>'; } if (!empty($context['kbimg']) && $modSettings['kb_enable_attachment']) { echo '<br /> <span class="upperframe"><span></span></span> <div class="roundframe">'; echo ' <div class="highslide-gallery">'; foreach ($context['kbimg'] as $img) { if (!empty($modSettings['kb_enablehs_attach'])) { echo ' <a id="thumb' . $img['id_article'] . '" href="' . $modSettings['kb_url_attachment'] . '' . $img['filename'] . '" class="highslide" onclick="return hs.expand(this, { slideshowGroup: 2, thumbnailId: \'thumb' . $img['id_article'] . '\' } )"> <img class="resizeme" src="' . $modSettings['kb_url_attachment'] . '' . $img['filename'] . '" alt="' . $img['filename'] . '" title="' . $img['filename'] . '" /> </a>'; echo ' <div class="highslide-caption"> ' . $img['filename'] . ' </div>'; } else { echo '<a href="' . $modSettings['kb_url_attachment'] . '' . $img['filename'] . '" rel="lightbox[roadtrip]" title="' . $img['filename'] . '"> <img class="resizeme" src="' . $modSettings['kb_url_attachment'] . '' . $img['filename'] . '" alt="' . $img['filename'] . '" /></a> '; } } echo '</div>'; echo ' </div> <span class="lowerframe"><span></span></span>'; } if (!empty($modSettings['kb_ecom'])) { echo '<br /> <div class="cat_bar"> <h3 class="catbg">' . $txt['kb_ecom2'] . ''; if (allowedTo('com_kb')) { echo ' - <a href="javascript:void(0)" onclick="javascript:kbsearch_showhide(\'commentkb\');">' . $txt['kb_articlwnot_add_com'] . '</a>'; } echo '</h3> </div>'; echo '<div align="center"><div class="error" id="com_done" style="display:none;"><strong>' . $txt['kb_com_sub_compleat'] . '</strong></div></div>'; echo '<div class="commentkb" id="commentkb" style="display:none;"> '; echo '<form id="mykbform" action="', $scripturl, '?action=kb;area=kb;area=article;comment;arid=' . $_GET['cont'] . ';cont=' . $_GET['cont'] . '" method="post" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);smc_saveEntities(\'postmodify\', [\'title\', \'description\']);"> <span class="upperframe"><span></span></span> <div class="roundframe centertext"><br class="clear" /> <div class="error" id="ajax_in_progress" style="display:none;">' . $txt['kb_loading'] . '</div>'; if (!allowedTo('auto_approvecom_kb')) { echo '<div class="error"><strong>' . $txt['kb_ecomauto'] . '</strong></div><br />'; } if ($context['show_bbc']) { echo '<div id="bbcBox_message"></div>'; } if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { echo '<div id="smileyBox_message"></div>'; } echo template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); if ($user_info['is_guest']) { echo template_control_verification($context['visual_verification_id'], 'all'); } echo '<br /><input type="submit" name="send" class="button_submit" value="' . $txt['kb_catperm6'] . '" /> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"/> </div> <span class="lowerframe"><span></span></span><br /> </form></div>'; if (!empty($context['kbcom'])) { echo '' . $txt['pages'] . ': ' . $context['page_index'] . ''; } $windowclass = false; echo '<div id="results">'; foreach ($context['kbcom'] as $com) { $windowclass = $windowclass == 'windowbg' ? 'windowbg2' : 'windowbg'; echo '<div class="' . $windowclass . '"> <span class="topslice"><span></span></span>'; echo '<div class="poster">'; echo '<ul class="reset"> <li class="title">'; if ($com['id_member'] != 0) { echo KB_profileLink($com['real_name'], $com['id_member']); } else { echo $txt['guest_title']; } loadMemberData($com['id_member']); loadMemberContext($com['id_member']); if ($memberContext[$com['id_member']]['avatar']['href']) { echo ' <br /><br /><img class="resizeav" border="0" src="' . $memberContext[$com['id_member']]['avatar']['href'] . '" alt="" />'; } else { echo ' <br /><br /><img border="0" src="', $settings['images_url'], '/icons/online.gif" width="50" height="50" alt="" />'; } echo ' </li> </ul>'; echo '</div>'; echo '<div class="postarea"> <div class="flow_hidden"> <div class="keyinfo"> <div class="messageicon"> <img src="', $settings['images_url'] . '/post/xx.gif" alt="" border="0" /> </div> <h5>' . $txt['kb_re'] . ': ', $context['know'][0]['title'], '</h5> <div class="smalltext">« <strong>', $txt['on'], ':</strong> ', $com['date'], ' »</div> </div>'; if ($com['id_member'] == $user_info['id'] && $context['user']['is_logged'] && allowedTo('comdel_kb') || allowedTo('manage_kb')) { echo '<ul class="reset smalltext quickbuttons"> <li class="remove_button"> <a href="', $scripturl, '?action=kb;area=kb;area=article;commentdel;arid=' . $com['id'] . ';cont=' . $_GET['cont'] . '" onclick="return confirm(\'' . $txt['knowledgebaseeditedsure101'] . '\');"> ', $txt['remove'], ' </a> </li> </ul>'; } echo ' </div> <div class="post"> <div class="inner"> ', $com['comment'], ' </div> </div>'; echo '<br class="clear" /></div> <span class="botslice"><span></span></span></div>'; } echo '</div>'; if (!empty($context['kbcom'])) { echo '' . $txt['pages'] . ': ' . $context['page_index'] . ''; } } template_kb_copy(); }
function template_view_post() { global $context, $scripturl, $txt; echo ' <h2 class="blog_heading">', $context['blog_post']['subject'], '</h2>'; // Output the blog post itself. echo ' <div class="windowbg2 blog_post"> <div class="blog_post_heading">', $context['blog_post']['icon'], ' ', $context['blog_post']['subject'], '</div> <div class="smaller">', $context['blog_post']['time'], ' ', $txt['smfblog_by'], ' ', $context['blog_post']['poster']['link'], '</div> <div class="blog_post_body">', $context['blog_post']['body'], '</div><br /><br /> </div> <h2 class="blog_heading">', $txt['blog_write_comment'], ':</h2>'; // Not logged in? No commenting for you! // !!! Check the permissions!! if (!$context['user']['is_logged']) { echo ' ', $txt['blog_error_login']; } else { echo ' <form action="', $scripturl, '?action=post2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);"> <input type="hidden" name="topic" value="' . $context['blog_post']['id'] . '" /> <input type="hidden" name="sc" value="', $context['session_id'], '" /> <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" /> <input type="hidden" name="blog_post" value="', $context['blog_post']['id'], '" />', !empty($context['blog_name']) ? ' <input type="hidden" name="blog_name" value="' . htmlentities($context['blog_name']) . '" />' : '', ' <table border="0" width="100%" align="center" cellspacing="1" cellpadding="3"> <!--class="bordercolor"--> <tr> <td align="right" style="font-weight: bold;" id="caption_subject"> ', $txt['smfblog_subject'], ': </td> <td> <input type="text" name="subject" value="', $txt['smfblog_re'], $context['blog_post']['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80" /> </td> </tr> <tr> <td colspan="2" align="center"> <table> '; } if (!function_exists('getLanguages')) { // Showing BBC? if ($context['show_bbc']) { echo ' <tr class="windowbg2"> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'bbc'), ' </td> </tr>'; } // What about smileys? if (!empty($context['smileys']['postform'])) { echo ' <tr class="windowbg2"> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'smileys'), ' </td> </tr>'; } // Show BBC buttons, smileys and textbox. echo ' <tr class="windowbg2"> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'message'), ' </td> </tr>'; } else { echo ' <tr class="windowbg2"> <td>'; // Showing BBC? if ($context['show_bbc']) { echo ' <div id="bbcBox_message"></div>'; } // What about smileys? if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { echo ' <div id="smileyBox_message"></div>'; } // Show BBC buttons, smileys and textbox. echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); echo '</td></tr>'; } echo ' </table> </td> </tr> <tr> <td align="center" colspan="2"> <span class="smalltext"><br />', $txt['smfblog_shortcuts'], '</span><br /> <input type="submit" name="post" value="', $txt['smfblog_save'], '" tabindex="', $context['tabindex']++, '" onclick="return submitThisOnce(this);" accesskey="s" /> <input type="submit" name="preview" value="', $txt['smfblog_preview'], '" tabindex="', $context['tabindex']++, '" onclick="return event.ctrlKey || previewPost();" accesskey="p" /> </td> </tr> <tr> <td colspan="2"></td> </tr> </table> </form>'; echo ' <a name="comments"></a> <h2 class="blog_heading">', $txt['blog_comments'], ':</h2>'; // No replies? Too bad! :P. if ($context['blog_post']['reply_count'] == 0) { echo ' ', $txt['blog_no_comments']; } else { // Page numbers, please! echo ' ', $context['blog_post']['pageindex']; // Now, go through all replies... foreach ($context['blog_post']['replies'] as $post) { echo ' <a name="msg', $post['id'], '"></a>', $post['is_last'] ? '<a name="new"></a>' : '', ' <div id="msg', $post['id'], '" class="windowbg2 blog_reply"> <div class="blog_reply_heading">', $post['icon'], ' ', $post['subject'], ' (', $txt['ssiTopic_reply'], ' ', $post['number'], ') </div> <div class="smaller">', $post['time'], ' ', $txt['smfblog_by'], ' ', $post['poster']['link'], '</div> <div class="blog_reply_body">', $post['body'], '</div> </div>'; } // Again, some page numbers on the bottom this time! echo ' ', $context['blog_post']['pageindex']; } }
function template_block_edit() { global $context, $settings, $options, $scripturl, $txt, $helptxt, $modSettings; if (!empty($context['SPortal']['preview'])) { echo ' <div class="sp_auto_align" style="width: ', $context['widths'][$context['SPortal']['block']['column']], ';">'; template_block($context['SPortal']['block']); echo ' </div>'; } echo ' <div id="sp_edit_block"> <form name="sp_edit_block_form" id="sp_edit_block_form" action="', $scripturl, '?action=admin;area=portalblocks;sa=edit" method="post" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);"> <div class="cat_bar"> <h3 class="catbg"> <a href="', $scripturl, '?action=helpadmin;help=sp-blocks', $context['SPortal']['is_new'] ? 'Add' : 'Edit', '" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt['help'], '" class="icon" /></a> ', $context['SPortal']['is_new'] ? $txt['sp-blocksAdd'] : $txt['sp-blocksEdit'], ' </h3> </div> <div class="windowbg2"> <span class="topslice"><span></span></span> <div class="sp_content_padding"> <dl class="sp_form"> <dt> ', $txt['sp-adminColumnType'], ': </dt> <dd> ', $context['SPortal']['block']['type_text'], ' </dd> <dt> <label for="block_name">', $txt['sp-adminColumnName'], ':</label> </dt> <dd> <input type="text" name="block_name" id="block_name" value="', $context['SPortal']['block']['label'], '" size="30" class="input_text" /> </dd> <dt> <a href="', $scripturl, '?action=helpadmin;help=sp_permissions" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt['help'], '" class="icon" /></a> ', $txt['sp_admin_blocks_col_permissions'], ': </dt> <dd> <select name="permission_set" id="block_permission_set" onchange="sp_update_permissions();">'; $permission_sets = array(1 => 'guests', 2 => 'members', 3 => 'everyone', 0 => 'custom'); foreach ($permission_sets as $id => $label) { echo ' <option value="', $id, '"', $id == $context['SPortal']['block']['permission_set'] ? ' selected="selected"' : '', '>', $txt['sp_admin_blocks_permissions_set_' . $label], '</option>'; } echo ' </select> </dd> <dt id="block_custom_permissions_label"> ', $txt['sp_admin_blocks_col_custom_permissions'], ': </dt> <dd id="block_custom_permissions_input"> <table> <tr> <th>', $txt['sp_admin_blocks_custom_permissions_membergroup'], '</td> <th title="', $txt['sp_admin_blocks_custom_permissions_allowed'], '">', $txt['sp_admin_blocks_custom_permissions_allowed_short'], '</th> <th title="', $txt['sp_admin_blocks_custom_permissions_disallowed'], '">', $txt['sp_admin_blocks_custom_permissions_disallowed_short'], '</th> <th title="', $txt['sp_admin_blocks_custom_permissions_denied'], '">', $txt['sp_admin_blocks_custom_permissions_denied_short'], '</th> </tr>'; foreach ($context['SPortal']['block']['groups'] as $id => $label) { $current = 0; if (in_array($id, $context['SPortal']['block']['groups_allowed'])) { $current = 1; } elseif (in_array($id, $context['SPortal']['block']['groups_denied'])) { $current = -1; } echo ' <tr> <td>', $label, '</td> <td><input type="radio" name="membergroups[', $id, ']" value="1"', $current == 1 ? ' checked="checked"' : '', ' class="input_radio"></td> <td><input type="radio" name="membergroups[', $id, ']" value="0"', $current == 0 ? ' checked="checked"' : '', ' class="input_radio"></td> <td><input type="radio" name="membergroups[', $id, ']" value="-1"', $current == -1 ? ' checked="checked"' : '', ' class="input_radio"></td> </tr>'; } echo ' </table> </dd>'; foreach ($context['SPortal']['block']['options'] as $name => $type) { if (empty($context['SPortal']['block']['parameters'][$name])) { $context['SPortal']['block']['parameters'][$name] = ''; } echo ' <dt>'; if (!empty($helptxt['sp_param_' . $context['SPortal']['block']['type'] . '_' . $name])) { echo ' <a href="', $scripturl, '?action=helpadmin;help=sp_param_', $context['SPortal']['block']['type'], '_', $name, '" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt['help'], '" class="icon" /></a>'; } echo ' <label for="', $type == 'bbc' ? 'bbc_content' : $name, '">', $txt['sp_param_' . $context['SPortal']['block']['type'] . '_' . $name], ':</label> </dt> <dd>'; if ($type == 'bbc') { echo ' </dd> </dl> <div id="sp_rich_editor"> <div id="sp_rich_bbc"></div> <div id="sp_rich_smileys"></div> ', template_control_richedit($context['SPortal']['bbc'], 'sp_rich_smileys', 'sp_rich_bbc'), ' <input type="hidden" name="bbc_name" value="', $name, '" /> <input type="hidden" name="bbc_parameter" value="', $context['SPortal']['bbc'], '" /> </div> <dl class="sp_form">'; } elseif ($type == 'boards' || $type == 'board_select') { echo ' <input type="hidden" name="parameters[', $name, ']" value="" />'; if ($type == 'boards') { echo ' <select name="parameters[', $name, '][]" id="', $name, '" size="7" multiple="multiple">'; } else { echo ' <select name="parameters[', $name, '][]" id="', $name, '">'; } foreach ($context['SPortal']['block']['board_options'][$name] as $option) { echo ' <option value="', $option['value'], '"', $option['selected'] ? ' selected="selected"' : '', ' >', $option['text'], '</option>'; } echo ' </select>'; } elseif ($type == 'int') { echo ' <input type="text" name="parameters[', $name, ']" id="', $name, '" value="', $context['SPortal']['block']['parameters'][$name], '" size="7" class="input_text" />'; } elseif ($type == 'text') { echo ' <input type="text" name="parameters[', $name, ']" id="', $name, '" value="', $context['SPortal']['block']['parameters'][$name], '" size="25" class="input_text" />'; } elseif ($type == 'check') { echo ' <input type="checkbox" name="parameters[', $name, ']" id="', $name, '"', !empty($context['SPortal']['block']['parameters'][$name]) ? ' checked="checked"' : '', ' class="input_check" />'; } elseif ($type == 'select') { $options = explode('|', $txt['sp_param_' . $context['SPortal']['block']['type'] . '_' . $name . '_options']); echo ' <select name="parameters[', $name, ']" id="', $name, '">'; foreach ($options as $key => $option) { echo ' <option value="', $key, '"', $context['SPortal']['block']['parameters'][$name] == $key ? ' selected="selected"' : '', '>', $option, '</option>'; } echo ' </select>'; } elseif (is_array($type)) { echo ' <select name="parameters[', $name, ']" id="', $name, '">'; foreach ($type as $key => $option) { echo ' <option value="', $key, '"', $context['SPortal']['block']['parameters'][$name] == $key ? ' selected="selected"' : '', '>', $option, '</option>'; } echo ' </select>'; } elseif ($type == 'textarea') { echo ' </dd> </dl> <div id="sp_text_editor"> <textarea name="parameters[', $name, ']" id="', $name, '" cols="45" rows="10">', $context['SPortal']['block']['parameters'][$name], '</textarea> <input type="button" class="button_submit" value="-" onclick="document.getElementById(\'', $name, '\').rows -= 10" /> <input type="button" class="button_submit" value="+" onclick="document.getElementById(\'', $name, '\').rows += 10" /> </div> <dl class="sp_form">'; } if ($type != 'bbc') { echo ' </dd>'; } } if (empty($context['SPortal']['block']['column'])) { echo ' <dt> <label for="block_column">', $txt['sp-blocksColumn'], ':</label> </dt> <dd> <select id="block_column" name="block_column">'; $block_sides = array(5 => 'Header', 1 => 'Left', 2 => 'Top', 3 => 'Bottom', 4 => 'Right', 6 => 'Footer'); foreach ($block_sides as $id => $side) { echo ' <option value="', $id, '">', $txt['sp-position' . $side], '</option>'; } echo ' </select> </dd>'; } if (count($context['SPortal']['block']['list_blocks']) > 1) { echo ' <dt> ', $txt['sp-blocksRow'], ': </dt> <dd> <select id="order" name="placement"', !$context['SPortal']['is_new'] ? ' onchange="this.form.block_row.disabled = this.options[this.selectedIndex].value == \'\';"' : '', '> ', !$context['SPortal']['is_new'] ? '<option value="nochange">' . $txt['sp-placementUnchanged'] . '</option>' : '', ' <option value="before">', $txt['sp-placementBefore'], '...</option> <option value="after">', $txt['sp-placementAfter'], '...</option> </select> <select id="block_row" name="block_row"', !$context['SPortal']['is_new'] ? ' disabled="disabled"' : '', '>'; foreach ($context['SPortal']['block']['list_blocks'] as $block) { if ($block['id'] != $context['SPortal']['block']['id']) { echo ' <option value="', $block['row'], '">', $block['label'], '</option>'; } } echo ' </select> </dd>'; } if ($context['SPortal']['block']['type'] != 'sp_boardNews') { echo ' <dt> <label for="block_force">', $txt['sp-blocksForce'], ':</label> </dt> <dd> <input type="checkbox" name="block_force" id="block_force" value="1"', $context['SPortal']['block']['force_view'] ? ' checked="checked"' : '', ' class="input_check" /> </dd>'; } echo ' <dt> <label for="block_active">', $txt['sp-blocksActive'], ':</label> </dt> <dd> <input type="checkbox" name="block_active" id="block_active" value="1"', $context['SPortal']['block']['state'] ? ' checked="checked"' : '', ' class="input_check" /> </dd> </dl> <div class="sp_button_container"> <input type="submit" name="preview_block" value="', $txt['sp-blocksPreview'], '" class="button_submit" /> <input type="submit" name="add_block" value="', !$context['SPortal']['is_new'] ? $txt['sp-blocksEdit'] : $txt['sp-blocksAdd'], '" class="button_submit" /> </div> </div> <span class="botslice"><span></span></span> </div>'; if (!empty($context['SPortal']['block']['column'])) { echo ' <input type="hidden" name="block_column" value="', $context['SPortal']['block']['column'], '" />'; } echo ' <input type="hidden" name="block_type" value="', $context['SPortal']['block']['type'], '" /> <input type="hidden" name="block_id" value="', $context['SPortal']['block']['id'], '" /> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />'; if (!empty($modSettings['sp_enableIntegration'])) { echo ' <br /> <div class="cat_bar"> <h3 class="catbg"> <a href="', $scripturl, '?action=helpadmin;help=sp-blocksDisplayOptions" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt['help'], '" class="icon" /></a> ', $txt['sp-blocksDisplayOptions'], ' </h3> </div> <div class="windowbg2"> <span class="topslice"><span></span></span> <div class="sp_content_padding"> <span class="sp_float_right">', $txt['sp-blocksAdvancedOptions'], '<input type="checkbox" name="display_advanced" id="display_advanced" onclick="document.getElementById(\'sp_display_advanced\').style.display = this.checked ? \'block\' : \'none\'; document.getElementById(\'display_simple\').disabled = this.checked;" ', empty($context['SPortal']['block']['display_type']) ? '' : ' checked="checked"', ' class="input_check" /></span> ', $txt['sp-blocksShowBlock'], ' <select name="display_simple" id="display_simple"', empty($context['SPortal']['block']['display_type']) ? '' : ' disabled="disabled"', '>'; foreach ($context['simple_actions'] as $action => $label) { echo ' <option value="', $action, '"', in_array($action, $context['SPortal']['block']['display']) ? ' selected="selected"' : '', '>', $label, '</option>'; } echo ' </select> <div id="sp_display_advanced"', empty($context['SPortal']['block']['display_type']) ? ' style="display: none;"' : '', '>'; $display_types = array('actions', 'boards', 'pages'); foreach ($display_types as $type) { if (empty($context['display_' . $type])) { continue; } echo ' <a href="javascript:void(0);" onclick="sp_collapseObject(\'', $type, '\')"><img id="sp_collapse_', $type, '" src="', $settings['images_url'], '/expand.gif" alt="*" /></a> ', $txt['sp-blocksSelect' . ucfirst($type)], ' <ul id="sp_object_', $type, '" class="reset sp_display_list" style="display: none;">'; foreach ($context['display_' . $type] as $index => $action) { echo ' <li><input type="checkbox" name="display_', $type, '[]" id="', $type, $index, '" value="', $index, '"', in_array($index, $context['SPortal']['block']['display']) ? ' checked="checked"' : '', ' class="input_check" /> <label for="', $type, $index, '">', $action, '</label></li>'; } echo ' <li><input type="checkbox" onclick="invertAll(this, this.form, \'display_', $type, '[]\');" class="input_check" /> <em>', $txt['check_all'], '</em></li> </ul> <br />'; } echo ' <a href="', $scripturl, '?action=helpadmin;help=sp-blocksCustomDisplayOptions" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt['help'], '" class="icon" /></a> <label for="display_custom">', $txt['sp_display_custom'], ':</label> <input type="text" name="display_custom" id="display_custom" value="', $context['SPortal']['block']['display_custom'], '" class="input_text" /> </div> <div class="sp_button_container"> <input type="submit" name="add_block" value="', !$context['SPortal']['is_new'] ? $txt['sp-blocksEdit'] : $txt['sp-blocksAdd'], '" class="button_submit" /> </div> </div> <span class="botslice"><span></span></span> </div>'; } $style_sections = array('title' => 'left', 'body' => 'right'); $style_types = array('default' => 'DefaultClass', 'class' => 'CustomClass', 'style' => 'CustomStyle'); $style_parameters = array('title' => array('catbg', 'catbg2', 'catbg3', 'titlebg', 'titlebg2'), 'body' => array('windowbg', 'windowbg2', 'windowbg3', 'information', 'roundframe')); if ($context['SPortal']['block']['type'] != 'sp_boardNews') { echo ' <br /> <div class="cat_bar"> <h3 class="catbg"> <a href="', $scripturl, '?action=helpadmin;help=sp-blocksStyleOptions" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt['help'], '" class="icon" /></a> ', $txt['sp-blocksStyleOptions'], ' </h3> </div> <div class="windowbg2"> <span class="topslice"><span></span></span> <div class="sp_content_padding">'; foreach ($style_sections as $section => $float) { echo ' <dl id="sp_edit_style_', $section, '" class="sp_form sp_float_', $float, '">'; foreach ($style_types as $type => $label) { echo ' <dt> ', $txt['sp-blocks' . ucfirst($section) . $label], ': </dt> <dd>'; if ($type == 'default') { echo ' <select name="', $section, '_default_class" id="', $section, '_default_class">'; foreach ($style_parameters[$section] as $class) { echo ' <option value="', $class, '"', $context['SPortal']['block']['style'][$section . '_default_class'] == $class ? ' selected="selected"' : '', '>', $class, '</option>'; } echo ' </select>'; } else { echo ' <input type="text" name="', $section, '_custom_', $type, '" id="', $section, '_custom_', $type, '" value="', $context['SPortal']['block']['style'][$section . '_custom_' . $type], '" class="input_text" />'; } echo ' </dd>'; } echo ' <dt> ', $txt['sp-blocksNo' . ucfirst($section)], ': </dt> <dd> <input type="checkbox" name="no_', $section, '" id="no_', $section, '" value="1"', !empty($context['SPortal']['block']['style']['no_' . $section]) ? ' checked="checked"' : '', ' onclick="document.getElementById(\'', $section, '_default_class\').disabled', $section == 'title' ? ' = document.getElementById(\'title_custom_class\').disabled = document.getElementById(\'title_custom_style\').disabled' : '', ' = this.checked;" class="input_check" /> </dd> </dl>'; } echo ' <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[ document.getElementById("title_default_class").disabled = document.getElementById("no_title").checked; document.getElementById("title_custom_class").disabled = document.getElementById("no_title").checked; document.getElementById("title_custom_style").disabled = document.getElementById("no_title").checked; document.getElementById("body_default_class").disabled = document.getElementById("no_body").checked; // ]]></script> <div class="sp_button_container"> <input type="submit" name="add_block" value="', !$context['SPortal']['is_new'] ? $txt['sp-blocksEdit'] : $txt['sp-blocksAdd'], '" class="button_submit" /> </div> </div> <span class="botslice"><span></span></span> </div>'; } echo ' </form> </div> <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[ sp_update_permissions(); function sp_update_permissions() { var new_state = document.getElementById("block_permission_set").value; document.getElementById("block_custom_permissions_label").style.display = new_state != 0 ? "none" : ""; document.getElementById("block_custom_permissions_input").style.display = new_state != 0 ? "none" : ""; } // ]]></script>'; }
function getTemplateEditor() { global $context; if (!function_exists('getLanguages')) { // Showing BBC? if ($context['show_bbc']) { template_control_richedit($context['post_box_name'], 'bbc'); } // What about smileys? if (!empty($context['smileys']['postform'])) { template_control_richedit($context['post_box_name'], 'smileys'); } // Show BBC buttons, smileys and textbox. template_control_richedit($context['post_box_name'], 'message'); } else { if ($context['show_bbc']) { echo ' <div id="bbcBox_message"></div>'; } // What about smileys? if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { echo ' <div id="smileyBox_message"></div>'; } echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); } }
function template_email_members_compose() { global $context, $settings, $options, $txt, $scripturl; echo ' <div id="preview_section"', isset($context['preview_message']) ? '' : ' style="display: none;"', '> <div class="cat_bar"> <h3 class="catbg"> <span id="preview_subject">', empty($context['preview_subject']) ? '' : $context['preview_subject'], '</span> </h3> </div> <div class="windowbg"> <div class="content"> <div class="post" id="preview_body"> ', empty($context['preview_message']) ? '<br />' : $context['preview_message'], ' </div> </div> </div> </div><br />'; echo ' <div id="admincenter"> <form name="newsmodify" action="', $scripturl, '?action=admin;area=news;sa=mailingsend" method="post" accept-charset="', $context['character_set'], '"> <div class="cat_bar"> <h3 class="catbg"> <a href="', $scripturl, '?action=helpadmin;help=email_members" onclick="return reqOverlayDiv(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" class="icon" /></a> ', $txt['admin_newsletters'], ' </h3> </div> <div class="information"> ', $txt['email_variables'], ' </div> <div class="windowbg"> <div class="content"> <div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors"> <dl> <dt> <strong id="error_serious">', $txt['error_while_submitting'], '</strong> </dt> <dd class="error" id="error_list"> ', empty($context['post_error']['messages']) ? '' : implode('<br />', $context['post_error']['messages']), ' </dd> </dl> </div> <dl id="post_header"> <dt class="clear_left"> <span', isset($context['post_error']['no_subject']) ? ' class="error"' : '', ' id="caption_subject">', $txt['subject'], ':</span> </dt> <dd id="pm_subject"> <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="60" maxlength="60"', isset($context['post_error']['no_subject']) ? ' class="error"' : ' class="input_text"', '/> </dd> </dl><hr class="clear" /> <div id="bbcBox_message"></div>'; // What about smileys? if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { echo ' <div id="smileyBox_message"></div>'; } // Show BBC buttons, smileys and textbox. echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); echo ' <ul class="reset"> <li><label for="send_pm"><input type="checkbox" name="send_pm" id="send_pm" ', !empty($context['send_pm']) ? 'checked="checked"' : '', 'class="input_check" onclick="checkboxes_status(this);" /> ', $txt['email_as_pms'], '</label></li> <li><label for="send_html"><input type="checkbox" name="send_html" id="send_html" ', !empty($context['send_html']) ? 'checked="checked"' : '', 'class="input_check" onclick="checkboxes_status(this);" /> ', $txt['email_as_html'], '</label></li> <li><label for="parse_html"><input type="checkbox" name="parse_html" id="parse_html" checked="checked" disabled="disabled" class="input_check" /> ', $txt['email_parsed_html'], '</label></li> </ul> <p id="shortcuts" class="smalltext"> ', isBrowser('is_firefox') ? $txt['shortcuts_firefox'] : $txt['shortcuts'], ' </p> <p id="post_confirm_strip" class="righttext"> ', template_control_richedit_buttons($context['post_box_name']), ' </p> </div> </div> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> <input type="hidden" name="email_force" value="', $context['email_force'], '" /> <input type="hidden" name="total_emails" value="', $context['total_emails'], '" /> <input type="hidden" name="max_id_member" value="', $context['max_id_member'], '" />'; foreach ($context['recipients'] as $key => $values) { echo ' <input type="hidden" name="', $key, '" value="', implode($key == 'emails' ? ';' : ',', $values), '" />'; } echo ' <script type="text/javascript"><!-- // --><![CDATA['; // The functions used to preview a posts without loading a new page. echo ' var txt_preview_title = "', $txt['preview_title'], '"; var txt_preview_fetch = "', $txt['preview_fetch'], '"; function previewPost() {'; if (isBrowser('is_firefox')) { echo ' // Firefox doesn\'t render <marquee> that have been put it using javascript if (document.forms.newsmodify.elements[', JavaScriptEscape($context['post_box_name']), '].value.indexOf(\'[move]\') != -1) { return submitThisOnce(document.forms.newsmodify); }'; } echo ' if (window.XMLHttpRequest) { // Opera didn\'t support setRequestHeader() before 8.01. // @todo Remove support for old browsers if (\'opera\' in window) { var test = new XMLHttpRequest(); if (!(\'setRequestHeader\' in test)) return submitThisOnce(document.forms.newsmodify); } // @todo Currently not sending poll options and option checkboxes. var x = new Array(); var textFields = [\'subject\', ', JavaScriptEscape($context['post_box_name']), ']; var checkboxFields = [\'send_html\', \'send_pm\']; for (var i = 0, n = textFields.length; i < n; i++) if (textFields[i] in document.forms.newsmodify) { // Handle the WYSIWYG editor. if (textFields[i] == ', JavaScriptEscape($context['post_box_name']), ' && ', JavaScriptEscape('oEditorHandle_' . $context['post_box_name']), ' in window && oEditorHandle_', $context['post_box_name'], '.bRichTextEnabled) x[x.length] = \'message_mode=1&\' + textFields[i] + \'=\' + oEditorHandle_', $context['post_box_name'], '.getText(false).replace(/&#/g, \'&#\').php_to8bit().php_urlencode(); else x[x.length] = textFields[i] + \'=\' + document.forms.newsmodify[textFields[i]].value.replace(/&#/g, \'&#\').php_to8bit().php_urlencode(); } for (var i = 0, n = checkboxFields.length; i < n; i++) if (checkboxFields[i] in document.forms.newsmodify && document.forms.newsmodify.elements[checkboxFields[i]].checked) x[x.length] = checkboxFields[i] + \'=\' + document.forms.newsmodify.elements[checkboxFields[i]].value; x[x.length] = \'item=newsletterpreview\'; sendXMLDocument(smf_prepareScriptUrl(smf_scripturl) + \'action=xmlhttp;sa=previews;xml\', x.join(\'&\'), onDocSent); document.getElementById(\'preview_section\').style.display = \'\'; setInnerHTML(document.getElementById(\'preview_subject\'), txt_preview_title); setInnerHTML(document.getElementById(\'preview_body\'), txt_preview_fetch); return false; } else return submitThisOnce(document.forms.newsmodify); } function onDocSent(XMLDoc) { if (!XMLDoc) { document.forms.newsmodify.preview.onclick = new function () { return true; } document.forms.newsmodify.preview.click(); } // Show the preview section. var preview = XMLDoc.getElementsByTagName(\'smf\')[0].getElementsByTagName(\'preview\')[0]; setInnerHTML(document.getElementById(\'preview_subject\'), preview.getElementsByTagName(\'subject\')[0].firstChild.nodeValue); var bodyText = \'\'; for (var i = 0, n = preview.getElementsByTagName(\'body\')[0].childNodes.length; i < n; i++) bodyText += preview.getElementsByTagName(\'body\')[0].childNodes[i].nodeValue; setInnerHTML(document.getElementById(\'preview_body\'), bodyText); document.getElementById(\'preview_body\').className = \'post\'; // Show a list of errors (if any). var errors = XMLDoc.getElementsByTagName(\'smf\')[0].getElementsByTagName(\'errors\')[0]; var errorList = new Array(); for (var i = 0, numErrors = errors.getElementsByTagName(\'error\').length; i < numErrors; i++) errorList[errorList.length] = errors.getElementsByTagName(\'error\')[i].firstChild.nodeValue; document.getElementById(\'errors\').style.display = numErrors == 0 ? \'none\' : \'\'; setInnerHTML(document.getElementById(\'error_list\'), numErrors == 0 ? \'\' : errorList.join(\'<br />\')); // Adjust the color of captions if the given data is erroneous. var captions = errors.getElementsByTagName(\'caption\'); for (var i = 0, numCaptions = errors.getElementsByTagName(\'caption\').length; i < numCaptions; i++) if (document.getElementById(\'caption_\' + captions[i].getAttribute(\'name\'))) document.getElementById(\'caption_\' + captions[i].getAttribute(\'name\')).className = captions[i].getAttribute(\'class\'); if (errors.getElementsByTagName(\'post_error\').length == 1) document.forms.newsmodify.', $context['post_box_name'], '.style.border = \'1px solid red\'; else if (document.forms.newsmodify.', $context['post_box_name'], '.style.borderColor == \'red\' || document.forms.newsmodify.', $context['post_box_name'], '.style.borderColor == \'red red red red\') { if (\'runtimeStyle\' in document.forms.newsmodify.', $context['post_box_name'], ') document.forms.newsmodify.', $context['post_box_name'], '.style.borderColor = \'\'; else document.forms.newsmodify.', $context['post_box_name'], '.style.border = null; } location.hash = \'#\' + \'preview_section\'; }'; echo ' // ]]></script>'; echo ' <script type="text/javascript"><!-- // --><![CDATA[ function checkboxes_status (item) { if (item.id == \'send_html\') document.getElementById(\'parse_html\').disabled = !document.getElementById(\'parse_html\').disabled; if (item.id == \'send_pm\') { if (!document.getElementById(\'send_html\').checked) document.getElementById(\'parse_html\').disabled = true; else document.getElementById(\'parse_html\').disabled = false; document.getElementById(\'send_html\').disabled = !document.getElementById(\'send_html\').disabled; } } // ]]></script> </form> </div>'; }
function template_char_sheet_edit() { global $context, $txt, $scripturl; echo ' <div class="cat_bar"> <h3 class="catbg profile_hd"> ', $txt['char_sheet'], ' - ', $context['character']['character_name'], ' </h3> </div> <form action="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=characters;char=', $context['character']['id_character'], ';sa=sheet_edit" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" class="flow_hidden" onsubmit="submitonce(this);smc_saveEntities(\'postmodify\', [\'message\'], \'options\');"> <div id="post_area"> <div class="roundframe">'; if (!empty($context['sheet_templates'])) { echo ' ', $txt['char_templates_sel'], ' <select id="char_sheet_template"> <option>-- ', $txt['char_templates'], ' --</option>'; foreach ($context['sheet_templates'] as $id_template => $template) { echo ' <option value="', $id_template, '">', $template['name'], '</option>'; } echo ' </select> <a href="#" class="button" id="insert_char_template">', $txt['char_templates_add'], '</a><br><br>'; } template_control_richedit('message', null, 'bbcBox'); echo ' <br class="clear"> <input type="submit" class="button_submit" value="', $txt['save'], '" /> </div> </div> <br class="clear"> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> </form>'; insert_char_sheet_js(); if (!empty($context['sheet_comments'])) { echo ' <div class="cat_bar"> <h3 class="catbg"> ', $txt['char_sheet_comments'], ' </h3> </div>'; foreach ($context['sheet_comments'] as $id_comment => $comment) { echo ' <div class="windowbg"> <h4>', $comment['real_name'], ' - ', timeformat($comment['time_posted']), '</h4> <div class="list_posts"> ', nl2br($comment['sheet_comment']), ' </div> </div>'; } } }
function template_editpost() { global $context, $txt, $scripturl, $settings; echo ' <div class="cat_bar"> <h3 class="catbg centertext"> ', $txt['postscheduler_editpost'], ' </h3> </div> <form method="post" action="', $scripturl, '?action=postscheduler;sa=editpost2" name="frmfeed" id="frmfeed" onsubmit="submitonce(this);"> <table border="0" width="100%" cellspacing="0" align="center" cellpadding="4"> <tr class="windowbg"> <td width="30%">', $txt['postscheduler_subject'], '</td><td><input type="text" name="subject" size="50" value="' . $context['schedulepost']['subject'] . '" /></td> </tr> <tr class="windowbg"> <td width="30%">' . $txt['postscheduler_date'] . '</td> <td> '; $day = date("j", $context['schedulepost']['post_time']); $month = date("n", $context['schedulepost']['post_time']); $year = date("Y", $context['schedulepost']['post_time']); $minute = date("i", $context['schedulepost']['post_time']); $ampm = date("a", $context['schedulepost']['post_time']); $hour = date("g", $context['schedulepost']['post_time']); echo '<select name="month"> <option value="0"></option>'; for ($i = 1; $i < 13; $i++) { echo '<option value="' . $i . '" ' . ($i == $month ? ' selected="selected" ' : '') . '>' . date("M", mktime(0, 0, 0, $i + 1, 0, 0)) . '</option>'; } echo ' </select> <select name="day"> <option value="0"></option> '; for ($i = 1; $i < 32; $i++) { echo '<option value="' . $i . '" ' . ($i == $day ? ' selected="selected" ' : '') . '>' . $i . '</option>'; } echo ' </select> <select name="year"> <option value="0"></option> '; for ($i = date("Y"); $i < date("Y") + 3; $i++) { echo '<option value="' . $i . '" ' . ($i == $year ? ' selected="selected" ' : '') . '>' . $i . '</option>'; } echo ' </select>'; echo '<select name="hour">'; for ($i = 1; $i < 13; $i++) { echo '<option value="' . $i . '" ' . ($i == $hour ? ' selected="selected" ' : '') . '>' . $i . '</option>'; } echo ' </select>'; echo '<select name="minute">'; for ($i = 0; $i < 60; $i++) { echo '<option value="' . $i . '" ' . ($i == $minute ? ' selected="selected" ' : '') . '>' . str_pad($i, 2, "0", STR_PAD_LEFT) . '</option>'; } echo ' </select> <select name="ampm"> <option value="am" ' . ('am' == $ampm ? ' selected="selected" ' : '') . '>AM</option> <option value="pm" ' . ('pm' == $ampm ? ' selected="selected" ' : '') . '>PM</option> </select> </td> </tr> <tr class="windowbg"> <td width="30%">', $txt['postscheduler_topicid'], '</td><td><input type="text" name="topicid" size="10" value="' . $context['schedulepost']['ID_TOPIC'] . '" /></td></tr> <tr class="windowbg"> <td width="30%">', $txt['postscheduler_forum'], '</td> <td><select name="boardselect" id="boardselect"> '; foreach ($context['schedule_boards'] as $key => $option) { echo '<option value="', $key, ' " ', $key == $context['schedulepost']['ID_BOARD'] ? ' selected="selected" ' : '', '>', $option, '</option>'; } echo '</select></td></tr> <tr class="windowbg"> <td width="30%">', $txt['postscheduler_msg_icon'], '</td><td> <select name="msgicon" id="msgicon" onchange="ChangeIconPic(this.value)"> '; foreach ($context['msg_icons'] as $key => $option) { echo '<option value="', $option['filename'], '"' . ($context['schedulepost']['msgicon'] == $option['filename'] ? ' selected="selected"' : '') . '>', $option['title'], '</option>'; } echo '</select> <img id="iconPick" src="" alter="" /> <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[ // iconSelect var selectIcons = new Array(); '; foreach ($context['msg_icons'] as $key => $option) { echo ' selectIcons["', $option['filename'], '"] = "', $settings[file_exists($settings['theme_dir'] . '/images/post/' . $option['filename'] . '.gif') ? 'actual_images_url' : 'default_images_url'] . '/post/' . $option['filename'] . '.gif' . '";'; } echo ' function ChangeIconPic(iconIndex) { document.frmfeed.iconPick.src = selectIcons[iconIndex]; } ChangeIconPic("' . $context['schedulepost']['msgicon'] . '"); // ]]></script> </td> </tr> <tr class="windowbg"> <td width="30%">', $txt['postscheduler_postername'], '</td><td><input type="text" name="postername" id="postername" value="' . $context['schedulepost']['postername'] . '" /><a href="', $scripturl, '?action=findmember;input=postername;quote=1;sesc=', $context['session_id'], '" onclick="return reqWin(this.href, 350, 400);"><img src="', $settings['images_url'], '/icons/assist.gif" alt="', $txt['find_members'], '" /></a> <a href="', $scripturl, '?action=findmember;input=postername;quote=1;sesc=', $context['session_id'], '" onclick="return reqWin(this.href, 350, 400);">', $txt['find_members'], '</a> </td> </tr> <tr class="windowbg"> <td colspan="2" align="center"> <table> '; if (!function_exists('getLanguages')) { // Showing BBC? if ($context['show_bbc']) { echo ' <tr class="windowbg2"> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'bbc'), ' </td> </tr>'; } // What about smileys? if (!empty($context['smileys']['postform'])) { echo ' <tr class="windowbg2"> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'smileys'), ' </td> </tr>'; } // Show BBC buttons, smileys and textbox. echo ' <tr class="windowbg2"> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'message'), ' </td> </tr>'; } else { echo ' <tr class="windowbg2"> <td colspan="2">'; // Showing BBC? if ($context['show_bbc']) { echo ' <div id="bbcBox_message"></div>'; } // What about smileys? if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { echo ' <div id="smileyBox_message"></div>'; } // Show BBC buttons, smileys and textbox. echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); echo '</td></tr>'; } echo ' </table> </td> </tr> <tr class="windowbg"> <td width="30%" align="right"><input type="checkbox" name="topiclocked" ', $context['schedulepost']['locked'] ? ' checked="checked" ' : '', ' /></td><td>', $txt['postscheduler_topiclocked'], '</td></tr> <tr class="windowbg"> <td colspan="2" align="center"> <input type="hidden" name="id" value="', $context['schedulepost']['ID_POST'], '" /> <input type="submit" name="editpost" value="', $txt['postscheduler_editpost'], '" /> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> </td> </tr> </table> </form> '; schedulercopyright(); }
/** * Display the admin page for this plugin, with a custom template. * * @since 2.0 */ function template_shd_frontpage_admin() { global $context, $settings, $txt, $modSettings; if (empty($modSettings['shdp_frontpage_type'])) { $modSettings['shdp_frontpage_type'] = 'bbcode'; } if (empty($modSettings['shdp_frontpage_appear'])) { $modSettings['shdp_frontpage_appear'] = 'firstdefault'; } echo ' <div id="admincenter"> <form name="adminform" action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '"', !empty($context['force_form_onsubmit']) ? ' onsubmit="' . $context['force_form_onsubmit'] . '"' : '', '> <div class="tborder"> <div class="cat_bar grid_header"> <h3 class="catbg"> <img src="', shd_image_url('frontpage.png'), '" class="icon" alt="*"/> ', $txt['shdp_frontpage'], ' </h3> </div> <div class="windowbg2"> <div class="content"> <dl class="permsettings"> <dt style="width: 30%;"> <a id="setting_shdp_frontpage_appear"></a> <span><label id="label_shdp_frontpage_appear" for="shdp_frontpage_appear">', $txt['shdp_frontpage_appear'], '</label></span> </dt> <dd style="width: 68%;"> <select name="shdp_frontpage_appear" id="shdp_frontpage_appear"> <option value="always"', $modSettings['shdp_frontpage_appear'] == 'always' ? ' selected="selected"' : '', '>', $txt['shdp_frontpage_appear_always'], '</option> <option value="firstload"', $modSettings['shdp_frontpage_appear'] == 'firstload' ? ' selected="selected"' : '', '>', $txt['shdp_frontpage_appear_firstload'], '</option> <option value="firstdefault"', $modSettings['shdp_frontpage_appear'] == 'firstdefault' ? ' selected="selected"' : '', '>', $txt['shdp_frontpage_appear_firstdefault'], '</option> </select> </dd> </dl> <hr class="hrcolor" /> <dl class="permsettings"> <dt style="width: 30%;"> <a id="setting_shdp_frontpage_type"></a> <span><label id="label_shdp_frontpage_type" for="shdp_frontpage_type">', $txt['shdp_frontpage_type'], '</label></span> </dt> <dd style="width: 68%;"> <select name="shdp_frontpage_type" id="shdp_frontpage_type" onchange="invertBBC();"> <option value="bbcode"', $modSettings['shdp_frontpage_type'] == 'bbcode' ? ' selected="selected"' : '', '>', $txt['shdp_frontpage_type_bbcode'], '</option> <option value="php"', $modSettings['shdp_frontpage_type'] == 'php' ? ' selected="selected"' : '', '>', $txt['shdp_frontpage_type_php'], '</option> </select> </dd> <dt style="width: 30%;"> <a id="setting_shdp_frontpage_content"></a> <span><label id="label_shdp_frontpage_content" for="shdp_frontpage_content">Main content</label></span> </dt> <dd style="width: 68%;">'; $editor_context =& $context['controls']['richedit'][$context['post_box_name']]; // The postbox echo ' <div id="shd_bbcbox"', $modSettings['shdp_frontpage_type'] == 'php' ? ' style="display:none;"' : '', '></div> <div id="shd_smileybox"', $modSettings['shdp_frontpage_type'] == 'php' ? ' style="display:none;"' : '', '></div>'; echo template_control_richedit($context['post_box_name'], 'shd_smileybox', 'shd_bbcbox'); echo ' </dd> </dl> <hr class="hrcolor" /> <div class="righttext"> <input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : $txt['save'], '" tabindex="', $context['tabindex']++, '" accesskey="s" class="button_submit" /> </div> </div> <span class="botslice"><span></span></span> </div> </div> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> </form> </div> <script type="text/javascript"><!-- // --><![CDATA[ function invertBBC() { var state = document.getElementById("shdp_frontpage_type").value == "bbcode"; document.getElementById("shd_bbcbox").style.display = state ? "" : "none"; document.getElementById("shd_smileybox").style.display = state ? "" : "none"; } // ]]></script>'; }
/** * Simple Machines Forum (SMF) * * @package SMF * @author Simple Machines * @copyright 2012 Simple Machines * @license http://www.simplemachines.org/about/smf/license.php BSD * * @version 2.1 Alpha 1 */ function template_main() { global $context, $settings, $options, $txt, $scripturl, $modSettings; // Let them know, if their report was a success! if ($context['report_sent']) { echo ' <div class="infobox"> ', $txt['report_sent'], ' </div>'; } // Show the anchor for the top and for the first message. If the first message is new, say so. echo ' <a id="msg', $context['first_message'], '"></a>', $context['first_new_message'] ? '<a id="new"></a>' : ''; // Is this topic also a poll? if ($context['is_poll']) { echo ' <div id="poll"> <div class="cat_bar"> <h3 class="catbg"> <img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.png" alt="" class="icon" /> ', $txt['poll'], ' </h3> </div> <div class="windowbg"> <div class="content" id="poll_options"> <h4 id="pollquestion"> ', $context['poll']['question'], ' </h4>'; // Are they not allowed to vote but allowed to view the options? if ($context['poll']['show_results'] || !$context['allow_vote']) { echo ' <dl class="options">'; // Show each option with its corresponding percentage bar. foreach ($context['poll']['options'] as $option) { echo ' <dt class="', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt> <dd class="statsbar', $option['voted_this'] ? ' voted' : '', '">'; if ($context['allow_poll_view']) { echo ' ', $option['bar_ndt'], ' <span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>'; } echo ' </dd>'; } echo ' </dl>'; if ($context['allow_poll_view']) { echo ' <p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>'; } } else { echo ' <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">'; // Show a warning if they are allowed more than one option. if ($context['poll']['allowed_warning']) { echo ' <p class="smallpadding">', $context['poll']['allowed_warning'], '</p>'; } echo ' <ul class="reset options">'; // Show each option with its button - a radio likely. foreach ($context['poll']['options'] as $option) { echo ' <li>', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>'; } echo ' </ul> <div class="submitbutton"> <input type="submit" value="', $txt['poll_vote'], '" class="button_submit" /> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> </div> </form>'; } // Is the clock ticking? if (!empty($context['poll']['expire_time'])) { echo ' <p><strong>', $context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on'], ':</strong> ', $context['poll']['expire_time'], '</p>'; } echo ' </div> </div> </div> <div id="pollmoderation">'; template_button_strip($context['poll_buttons']); echo ' </div>'; } // Does this topic have some events linked to it? if (!empty($context['linked_calendar_events'])) { echo ' <div class="linked_events"> <div class="title_bar"> <h3 class="titlebg headerpadding">', $txt['calendar_linked_events'], '</h3> </div> <div class="windowbg"> <div class="content"> <ul class="reset">'; foreach ($context['linked_calendar_events'] as $event) { echo ' <li> ', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '"> <img src="' . $settings['images_url'] . '/icons/calendar_modify.png" alt="" title="' . $txt['modify'] . '" class="edit_event" /></a> ' : '', '<strong>', $event['title'], '</strong>: ', $event['start_date'], $event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : '', ' </li>'; } echo ' </ul> </div> </div> </div>'; } // Show the page index... "Pages: [1]". echo ' <div class="pagesection"> ', template_button_strip($context['normal_buttons'], 'right'), ' ', !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a href="#bot" class="topbottom floatleft">' . $txt['go_down'] . '</a>' : '', ' <div class="pagelinks floatleft"> ', $context['page_index'], ' </div> </div>'; // Show the topic information - icon, subject, etc. echo ' <div id="forumposts"> <div class="cat_bar"> <h3 class="catbg"> <img src="', $settings['images_url'], '/topic/', $context['class'], '.png" alt="" /> ', $txt['topic'], ': ', $context['subject'], ' <span>(', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')</span> <span class="nextlinks floatright">', $context['previous_next'], '</span> </h3> </div>'; echo ' <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">'; $ignoredMsgs = array(); $removableMessageIDs = array(); $alternate = false; // Get all the messages... while ($message = $context['get_message']()) { $ignoring = false; $alternate = !$alternate; if ($message['can_remove']) { $removableMessageIDs[] = $message['id']; } // Are we ignoring this message? if (!empty($message['is_ignored'])) { $ignoring = true; $ignoredMsgs[] = $message['id']; } // Show the message anchor and a "new" anchor if this message is new. if ($message['id'] != $context['first_message']) { echo ' <a id="msg', $message['id'], '"></a>', $message['first_new'] ? '<a id="new"></a>' : ''; } echo ' <div class="', $message['approved'] ? $message['alternate'] == 0 ? 'windowbg' : 'windowbg2' : 'approvebg', '"> <div class="post_wrapper">'; // Show information about the poster of this message. echo ' <div class="poster"> <ul class="dropmenu"> <li> <h4>'; // Show a link to the member's profile. echo ' <a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '"> <span style="padding: 6px; display: block;">', $message['member']['name'], '</span>'; // Show avatars, images, etc.? if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) { echo ' ', $message['member']['avatar']['image'], ''; } echo ' </a> </h4>'; // [WIP] The new member info dropdown starts here. Note that conditionals have not been fully checked yet. echo ' <ul class="smalltext" id="msg_', $message['id'], '_extra_info"', $ignoring ? ' style="display:none;"' : '', '>'; // Don't show these things for guests. if (!$message['member']['is_guest']) { // 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. if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') { echo ' <li class="postgroup">', $message['member']['post_group'], '</li>'; } // Show how many posts they have made. if (!isset($context['disabled_fields']['posts'])) { echo ' <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>'; } // Is karma display enabled? Total or +/-? if ($modSettings['karmaMode'] == '1') { echo ' <li class="karma">', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '</li>'; } elseif ($modSettings['karmaMode'] == '2') { echo ' <li class="karma">', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '</li>'; } // Is this user allowed to modify this member's karma? if ($message['member']['karma']['allow']) { echo ' <li class="karma_allow"> <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> <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> </li>'; } // Show the member's gender icon? if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '' && !isset($context['disabled_fields']['gender'])) { echo ' <li class="gender">', $txt['gender'], ': ', $message['member']['gender']['image'], '</li>'; } // Show their personal text? if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '') { echo ' <li class="blurb">', $message['member']['blurb'], '</li>'; } // Any custom fields to show as icons? if (!empty($message['member']['custom_fields'])) { $shown = false; foreach ($message['member']['custom_fields'] as $custom) { if ($custom['placement'] != 1 || empty($custom['value'])) { continue; } if (empty($shown)) { $shown = true; echo ' <li class="im_icons"> <ol>'; } echo ' <li>', $custom['value'], '</li>'; } if ($shown) { echo ' </ol> </li>'; } } // This shows the popular messaging icons. if ($message['member']['has_messenger'] && $message['member']['can_view_profile']) { echo ' <li class="im_icons"> <hr /> <ol> ', !empty($message['member']['icq']['link']) ? '<li>' . $message['member']['icq']['link'] . '</li>' : '', ' ', !empty($message['member']['msn']['link']) ? '<li>' . $message['member']['msn']['link'] . '</li>' : '', ' ', !empty($message['member']['aim']['link']) ? '<li>' . $message['member']['aim']['link'] . '</li>' : '', ' ', !empty($message['member']['yim']['link']) ? '<li>' . $message['member']['yim']['link'] . '</li>' : '', ' </ol> </li>'; } // Show the website and email address buttons. if ($message['member']['show_profile_buttons']) { echo ' <li class="profile"> <ol>'; // Don't show an icon if they haven't specified a website. if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) { echo ' <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.png" alt="' . $message['member']['website']['title'] . '" />' : $txt['www'], '</a></li>'; } // Don't show the email address if they want it hidden. if (in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')) && $context['can_send_email']) { echo ' <li><a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email'], '</a></li>'; } echo ' </ol> </li>'; } // Any custom fields for standard placement? if (!empty($message['member']['custom_fields'])) { foreach ($message['member']['custom_fields'] as $custom) { if (empty($custom['placement']) || empty($custom['value'])) { echo ' <li class="custom">', $custom['title'], ': ', $custom['value'], '</li>'; } } } } elseif (!empty($message['member']['email']) && in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')) && $context['can_send_email']) { echo ' <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.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email'], '</a></li>'; } // Stuff for the staff to wallop them with. // Maybe they want to report this post to the moderator(s)? if ($context['can_report_moderator']) { echo ' <li class="report_link"><hr /><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a></li>'; } // Can we issue a warning because of this post? Remember, we can't give guests warnings. if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) { echo ' <li class="issue_warning"><a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '"><img src="', $settings['images_url'], '/warn.png" alt="', $txt['issue_warning_post'], '" title="', $txt['issue_warning_post'], '" /></a></li>'; } //echo ' // <img class="centericon" src="', $settings['images_url'], '/ip.png" alt="" />'; // Show the IP to this user for this post - because you can moderate? if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) { echo ' <li class="poster_ip"><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 reqOverlayDiv(this.href);" class="help">(?)</a></li>'; } elseif ($message['can_see_ip']) { echo ' <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a></li>'; } elseif (!$context['user']['is_guest']) { echo ' <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>'; } else { echo ' <li class="poster_ip">', $txt['logged'], '</li>'; } // Done with the information about the poster... on to the post itself. echo ' </ul> </li>'; // Show the post group icons, but not for guests. if (!$message['member']['is_guest']) { echo ' <li class="icons">', $message['member']['group_icons'], '</li>'; } // Show the member's primary group (like 'Administrator') if they have one. if (!empty($message['member']['group'])) { echo ' <li class="membergroup">', $message['member']['group'], '</li>'; } // Show the member's custom title, if they have one. if (!empty($message['member']['title'])) { echo ' <li class="title">', $message['member']['title'], '</li>'; } // Show online and offline buttons? PHP could do with a little bit of cleaning up here for brevity, but it works. // The plan is to make these buttons act sensibly, and link to your own inbox in your own posts (with new PM notification). // Still has a little bit of hard-coded text. This may be a place where translators should be able to write inclusive strings, // instead of dealing with $txt['by'] etc in the markup. Must be brief to work, anyway. Cannot ramble on at all. if ($context['can_send_pm'] && $message['is_message_author']) { echo ' <li class="poster_online"><a href="', $scripturl, '?action=pm">', $txt['pm_short'], ' ', $context['user']['unread_messages'] > 0 ? '[<strong>' . $context['user']['unread_messages'] . '</strong>]' : '', '</a></li>'; } if ($context['can_send_pm'] && !$message['is_message_author'] && !$message['member']['is_guest']) { if (!empty($modSettings['onlineEnable'])) { echo ' <li class="poster_online"><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $message['member']['name'] . ' is online' : $message['member']['name'] . ' is offline', '">', $txt['send_message'], ' <img src="' . $message['member']['online']['image_href'] . '" alt="" /></a></li>'; } else { echo ' <li class="poster_online"><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '">', $txt['send_message'], '</a></li>'; } } if (!$context['can_send_pm'] && !empty($modSettings['onlineEnable'])) { echo ' <li class="poster_online">', $message['member']['online']['is_online'] ? $txt['online'] : $txt['offline'], '<img src="' . $message['member']['online']['image_href'] . '" alt="" /></li>'; } // Are we showing the warning status? // Don't show these things for guests. if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) { echo ' <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'], '.png" 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>'; } echo ' </ul>'; echo ' </div> <div class="postarea"> <div class="keyinfo"> <div class="messageicon" ', $message['icon_url'] !== $settings['images_url'] . '/post/xx.png' ? '' : 'style="position: absolute; z-index: -1;"', '> <img src="', $message['icon_url'] . '" alt=""', $message['can_modify'] ? ' id="msg_icon_' . $message['id'] . '"' : '', ' /> </div> <h5 id="subject_', $message['id'], '"> <a href="', $message['href'], '" rel="nofollow" title="', !empty($message['counter']) ? $txt['reply_noun'] . ' #' . $message['counter'] : '', ' - ', $message['subject'], '">', $message['time'], '</a>'; // Show "<< Last Edit: Time by Person >>" if this post was edited. if ($settings['show_modify'] && !empty($message['modified']['name'])) { echo ' <span class="smalltext modified" id="modified_', $message['id'], '"> ', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], ' </span>'; } echo ' </h5> <div id="msg_', $message['id'], '_quick_mod"', $ignoring ? ' style="display:none;"' : '', '></div> </div>'; // Ignoring this user? Hide the post. if ($ignoring) { echo ' <div id="msg_', $message['id'], '_ignored_prompt"> ', $txt['ignoring_user'], ' <a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a> </div>'; } // Show the post itself, finally! echo ' <div class="post">'; if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) { echo ' <div class="approve_post"> ', $txt['post_awaiting_approval'], ' </div>'; } echo ' <div class="inner" id="msg_', $message['id'], '"', $ignoring ? ' style="display:none;"' : '', '>', $message['body'], '</div> </div>'; // Assuming there are attachments... if (!empty($message['attachment'])) { echo ' <div id="msg_', $message['id'], '_footer" class="attachments"', $ignoring ? ' style="display:none;"' : '', '>'; $last_approved_state = 1; $attachments_per_line = 4; $i = 0; foreach ($message['attachment'] as $attachment) { // Show a special box for unapproved attachments... if ($attachment['is_approved'] != $last_approved_state) { $last_approved_state = 0; echo ' <fieldset> <legend>', $txt['attach_awaiting_approve']; if ($context['can_approve']) { echo ' [<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]'; } echo ' </legend>'; } echo ' <div class="floatleft">'; if ($attachment['is_image']) { echo ' <div class="attachments_top">'; if ($attachment['thumbnail']['has_thumb']) { echo ' <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" /></a>'; } else { echo ' <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '"/>'; } echo ' </div>'; } echo ' <div class="attachments_bot"> <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.png" class="centericon" alt="*" /> ' . $attachment['name'] . '</a> '; if (!$attachment['is_approved'] && $context['can_approve']) { echo ' [<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>] | [<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] '; } echo ' <br />', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . '<br />' . $txt['attach_viewed'] : '<br />' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . ' </div>'; echo ' </div>'; // Next attachment line ? if (++$i % $attachments_per_line === 0) { echo ' <hr />'; } } // If we had unapproved attachments clean up. if ($last_approved_state == 0) { echo ' </fieldset>'; } echo ' </div>'; } echo ' </div>'; // Show the quickbuttons, for various operations on posts. if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) { echo ' <ul class="quickbuttons">'; } // Maybe we can approve it, maybe we should? if ($message['can_approve']) { echo ' <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'], '" class="approve_button">', $txt['approve'], '</a></li>'; } // Can they reply? Have they turned on quick reply? if ($context['can_quote'] && !empty($options['display_quick_reply'])) { echo ' <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'], ');" class="quote_button">', $txt['quote'], '</a></li>'; } elseif ($context['can_quote']) { echo ' <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" class="quote_button">', $txt['quote'], '</a></li>'; } // Can the user modify the contents of this post? Show the modify inline image. if ($message['can_modify']) { echo ' <li class="quick_edit"><img src="', $settings['images_url'], '/icons/modify_inline.png" alt="', $txt['modify_msg'], '" title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" style="cursor: pointer; display: none; margin: 0 0 0 0;" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\')" />', $txt['quick_edit'], '</li>'; } // Can the user modify the contents of this post? if ($message['can_modify']) { echo ' <li class="post_options">', $txt['post_options'], ''; } echo ' <ul>'; // Can the user modify the contents of this post? if ($message['can_modify']) { echo ' <li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '" class="modify_button">', $txt['modify'], '</a></li>'; } // How about... even... remove it entirely?! if ($message['can_remove']) { echo ' <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'], '?\');" class="remove_button">', $txt['remove'], '</a></li>'; } // What about splitting it off the rest of the topic? if ($context['can_split'] && !empty($context['real_num_replies'])) { echo ' <li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '" class="split_button">', $txt['split'], '</a></li>'; } // Can we restore topics? if ($context['can_restore_msg']) { echo ' <li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" class="restore_button">', $txt['restore_message'], '</a></li>'; } // Maybe we can unapprove it? if ($message['can_unapprove']) { echo ' <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'], '" class="unapprove_button">', $txt['unapprove'], '</a></li>'; } echo ' </ul> </li>'; // Show a checkbox for quick moderation? if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) { echo ' <li class="inline_mod_check" style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>'; } if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) { echo ' </ul>'; } echo ' <div class="moderatorbar">'; // Are there any custom profile fields for above the signature? if (!empty($message['member']['custom_fields'])) { $shown = false; foreach ($message['member']['custom_fields'] as $custom) { if ($custom['placement'] != 2 || empty($custom['value'])) { continue; } if (empty($shown)) { $shown = true; echo ' <div class="custom_fields_above_signature"> <ul class="reset nolist">'; } echo ' <li>', $custom['value'], '</li>'; } if ($shown) { echo ' </ul> </div>'; } } // Show the member's signature? if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) { echo ' <div class="signature" id="msg_', $message['id'], '_signature"', $ignoring ? ' style="display:none;"' : '', '>', $message['member']['signature'], '</div>'; } echo ' </div> </div> </div> <hr class="post_separator" />'; } echo ' </form> </div>'; // Show the page index... "Pages: [1]". echo ' <div class="pagesection"> ', template_button_strip($context['normal_buttons'], 'right'), ' ', !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a href="#top" class="topbottom floatleft">' . $txt['go_up'] . '</a>' : '', ' <div class="pagelinks floatleft"> ', $context['page_index'], ' </div> </div>'; // Show the lower breadcrumbs. theme_linktree(); echo ' <div id="moderationbuttons">', template_button_strip($context['mod_buttons'], 'bottom', array('id' => 'moderationbuttons_strip')), '</div>'; // Show the jumpto box, or actually...let Javascript do it. echo ' <div class="plainbox" id="display_jump_to"> </div>'; if ($context['can_reply'] && !empty($options['display_quick_reply'])) { echo ' <a id="quickreply"></a> <div class="tborder" id="quickreplybox"> <div class="cat_bar"> <h3 class="catbg"> <a href="javascript:oQuickReply.swap();"><img src="', $settings['images_url'], '/', $options['display_quick_reply'] > 1 ? 'collapse' : 'expand', '.png" alt="+" id="quickReplyExpand" class="icon" /></a> <a href="javascript:oQuickReply.swap();">', $txt['quick_reply'], '</a> </h3> </div> <div id="quickReplyOptions"', $options['display_quick_reply'] > 1 ? '' : ' style="display: none"', '> <div class="roundframe"> <p class="smalltext lefttext">', $txt['quick_reply_desc'], '</p> ', $context['is_locked'] ? '<p class="alert smalltext">' . $txt['quick_reply_warning'] . '</p>' : '', $context['oldTopicError'] ? '<p class="alert smalltext">' . sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']) . '</p>' : '', ' ', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', ' ', !$context['can_reply_approved'] && $context['require_verification'] ? '<br />' : '', ' <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;"> <input type="hidden" name="topic" value="', $context['current_topic'], '" /> <input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '" /> <input type="hidden" name="icon" value="xx" /> <input type="hidden" name="from_qr" value="1" /> <input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" /> <input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '" /> <input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" /> <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '" /> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />'; // Guests just need more. if ($context['user']['is_guest']) { echo ' <strong>', $txt['name'], ':</strong> <input type="text" name="guestname" value="', $context['name'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /> <strong>', $txt['email'], ':</strong> <input type="text" name="email" value="', $context['email'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /><br />'; } // Is visual verification enabled? if ($context['require_verification']) { echo ' <strong>', $txt['verification'], ':</strong>', template_control_verification($context['visual_verification_id'], 'quick_reply'), '<br />'; } if ($options['display_quick_reply'] < 3) { echo ' <div class="quickReplyContent"> <textarea cols="600" rows="7" name="message" tabindex="', $context['tabindex']++, '"></textarea> </div>'; } else { // Show the actual posting area... if ($context['show_bbc']) { echo ' <div id="bbcBox_message"></div>'; } // What about smileys? if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { echo ' <div id="smileyBox_message"></div>'; } echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), ' <script type="text/javascript"><!-- // --><![CDATA[ function insertQuoteFast(messageid) { if (window.XMLHttpRequest) getXMLDocument(smf_prepareScriptUrl(smf_scripturl) + \'action=quotefast;quote=\' + messageid + \';xml;pb=', $context['post_box_name'], ';mode=\' + (oEditorHandle_', $context['post_box_name'], '.bRichTextEnabled ? 1 : 0), onDocReceived); else reqWin(smf_prepareScriptUrl(smf_scripturl) + \'action=quotefast;quote=\' + messageid + \';pb=', $context['post_box_name'], ';mode=\' + (oEditorHandle_', $context['post_box_name'], '.bRichTextEnabled ? 1 : 0), 240, 90); return false; } function onDocReceived(XMLDoc) { var text = \'\'; for (var i = 0, n = XMLDoc.getElementsByTagName(\'quote\')[0].childNodes.length; i < n; i++) text += XMLDoc.getElementsByTagName(\'quote\')[0].childNodes[i].nodeValue; oEditorHandle_', $context['post_box_name'], '.insertText(text, false, true); ajax_indicator(false); } // ]]></script>'; } echo ' <div class="padding"> <input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="', $context['tabindex']++, '" class="button_submit" /> <input type="submit" name="preview" value="', $txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />'; if ($context['show_spellchecking']) { echo ' <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="', $context['tabindex']++, '" class="button_submit" />'; } if ($context['drafts_save'] && !empty($options['drafts_show_saved_enabled'])) { echo ' <input type="submit" name="save_draft" value="', $txt['draft_save'], '" onclick="return confirm(' . JavaScriptEscape($txt['draft_save_note']) . ') && submitThisOnce(this);" accesskey="d" tabindex="', $context['tabindex']++, '" class="button_submit" /> <input type="hidden" id="id_draft" name="id_draft" value="', empty($context['id_draft']) ? 0 : $context['id_draft'], '" />'; } if (!empty($context['drafts_autosave']) && !empty($options['drafts_autosave_enabled'])) { echo ' <div class="clear righttext padding"><span id="throbber" style="display:none"><img src="' . $settings['images_url'] . '/loading_sm.gif" alt="" class="centericon" /> </span><span id="draft_lastautosave" ></span></div>'; } echo ' </div> </form> </div> </div> </div>'; } else { echo ' <br class="clear" />'; } if (!empty($context['drafts_autosave']) && !empty($options['drafts_autosave_enabled'])) { echo ' <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/drafts.js?alp21"></script> <script type="text/javascript"><!-- // --><![CDATA[ var oDraftAutoSave = new smf_DraftAutoSave({ sSelf: \'oDraftAutoSave\', sLastNote: \'draft_lastautosave\', sLastID: \'id_draft\',', !empty($context['post_box_name']) ? ' sSceditorID: \'' . $context['post_box_name'] . '\',' : '', ' sType: \'', !empty($options['display_quick_reply']) && $options['display_quick_reply'] > 2 ? 'quick' : 'quick', '\', iBoard: ', empty($context['current_board']) ? 0 : $context['current_board'], ', iFreq: ', empty($modSettings['masterAutoSaveDraftsDelay']) ? 60000 : $modSettings['masterAutoSaveDraftsDelay'] * 1000, ' }); // ]]></script>'; } if ($context['show_spellchecking']) { echo ' <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> <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/spellcheck.js"></script>'; } echo ' <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/topic.js"></script> <script type="text/javascript"><!-- // --><![CDATA['; if (!empty($options['display_quick_reply'])) { echo ' var oQuickReply = new QuickReply({ bDefaultCollapsed: ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] > 1 ? 'false' : 'true', ', iTopicId: ', $context['current_topic'], ', iStart: ', $context['start'], ', sScriptUrl: smf_scripturl, sImagesUrl: smf_images_url, sContainerId: "quickReplyOptions", sImageId: "quickReplyExpand", sImageCollapsed: "collapse.png", sImageExpanded: "expand.png", sJumpAnchor: "quickreply", bIsFull: ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] > 2 ? 'true' : 'false', ' });'; } if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post']) { echo ' var oInTopicModeration = new InTopicModeration({ sSelf: \'oInTopicModeration\', sCheckboxContainerMask: \'in_topic_mod_check_\', aMessageIds: [\'', implode('\', \'', $removableMessageIDs), '\'], sSessionId: smf_session_id, sSessionVar: smf_session_var, sButtonStrip: \'moderationbuttons\', sButtonStripDisplay: \'moderationbuttons_strip\', bUseImageButton: false, bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ', sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\', sRemoveButtonImage: \'delete_selected.png\', sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\', bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ', sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\', sRestoreButtonImage: \'restore_selected.png\', sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\', bCanSplit: ', $context['can_split'] ? 'true' : 'false', ', sSplitButtonLabel: \'', $txt['quickmod_split_selected'], '\', sSplitButtonImage: \'split_selected.png\', sSplitButtonConfirm: \'', $txt['quickmod_confirm'], '\', sFormId: \'quickModForm\' });'; } echo ' $(".quick_edit").css("display", "inline"); if (\'XMLHttpRequest\' in window) { var oQuickModify = new QuickModify({ sScriptUrl: smf_scripturl, bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ', iTopicId: ', $context['current_topic'], ', sTemplateBodyEdit: ', JavaScriptEscape(' <div id="quick_edit_body_container" style="width: 90%"> <div id="error_box" style="padding: 4px;" class="error"></div> <textarea class="editor" name="message" rows="12" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 100%; min-width: 100%' : 'width: 100%') . '; margin-bottom: 10px;" tabindex="' . $context['tabindex']++ . '">%body%</textarea><br /> <input type="hidden" name="\' + smf_session_var + \'" value="\' + smf_session_id + \'" /> <input type="hidden" name="topic" value="' . $context['current_topic'] . '" /> <input type="hidden" name="msg" value="%msg_id%" /> <div class="righttext"> <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" /> ' . ($context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" tabindex="' . $context['tabindex']++ . '" onclick="spellCheck(\'quickModForm\', \'message\');" class="button_submit" /> ' : '') . '<input type="submit" name="cancel" value="' . $txt['modify_cancel'] . '" tabindex="' . $context['tabindex']++ . '" onclick="return oQuickModify.modifyCancel();" class="button_submit" /> </div> </div>'), ', sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 90%;" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />'), ', sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ', sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ', sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ': %subject% (' . $txt['read'] . ' ' . $context['num_views'] . ' ' . $txt['times'] . ')'), ', sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), $context['can_reply'] && !empty($options['display_quick_reply']) ? ', sFormRemoveAccessKeys: \'postmodify\'' : '', ' }); aJumpTo[aJumpTo.length] = new JumpTo({ sContainerId: "display_jump_to", sJumpToTemplate: "<label class=\\"smalltext\\" for=\\"%select_id%\\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%", iCurBoardId: ', $context['current_board'], ', iCurBoardChildLevel: ', $context['jump_to']['child_level'], ', sCurBoardName: "', $context['jump_to']['board_name'], '", sBoardChildLevelIndicator: "==", sBoardPrefix: "=> ", sCatSeparator: "-----------------------------", sCatPrefix: "", sGoButtonLabel: "', $txt['go'], '" }); aIconLists[aIconLists.length] = new IconList({ sBackReference: "aIconLists[" + aIconLists.length + "]", sIconIdPrefix: "msg_icon_", sScriptUrl: smf_scripturl, bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ', iBoardId: ', $context['current_board'], ', iTopicId: ', $context['current_topic'], ', sSessionId: smf_session_id, sSessionVar: smf_session_var, sLabelIconList: "', $txt['message_icon'], '", sBoxBackground: "transparent", sBoxBackgroundHover: "#ffffff", iBoxBorderWidthHover: 1, sBoxBorderColorHover: "#adadad" , sContainerBackground: "#ffffff", sContainerBorder: "1px solid #adadad", sItemBorder: "1px solid #ffffff", sItemBorderHover: "1px dotted gray", sItemBackground: "transparent", sItemBackgroundHover: "#e0e0f0" }); }'; if (!empty($ignoredMsgs)) { echo ' ignore_toggles([', implode(', ', $ignoredMsgs), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');'; } echo ' // ]]></script>'; }
/** * @package SimplePortal ElkArte * * @author SimplePortal Team * @copyright 2015 SimplePortal Team * @license BSD 3-clause * @version 1.0.0 Beta 1 */ function template_pages_edit() { global $context, $scripturl, $txt; // Previewing the page before submitting? echo ' <div id="preview_section" class="forumposts"', !empty($context['SPortal']['preview']) ? '' : ' style="display: none;"', '>', !empty($context['SPortal']['preview']) ? template_view_page() : '', ' </div>'; // If there were errors creating the page, show them. template_show_error('pages_errors'); // Adding or editing a page echo ' <div id="sp_edit_page"> <form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=portalpages;sa=edit" method="post" accept-charset="UTF-8" onsubmit="submitonce(this);"> <h3 class="category_header"> ', $context['SPortal']['is_new'] ? $txt['sp_admin_pages_add'] : $txt['sp_admin_pages_edit'], ' </h3> <div class="editor_wrapper"> <dl class="sp_form"> <dt> <label for="page_title">', $txt['sp_admin_pages_col_title'], ':</label> </dt> <dd> <input type="text" name="title" id="page_title" value="', $context['SPortal']['page']['title'], '" class="input_text" /> </dd> <dt> <label for="page_namespace">', $txt['sp_admin_pages_col_namespace'], ':</label> </dt> <dd> <input type="text" name="namespace" id="page_namespace" value="', $context['SPortal']['page']['page_id'], '" class="input_text" /> </dd> <dt> <label for="page_type">', $txt['sp_admin_pages_col_type'], ':</label> </dt> <dd> <select name="type" id="page_type">'; $content_types = array('bbc', 'html', 'php'); foreach ($content_types as $type) { echo ' <option value="', $type, '"', $context['SPortal']['page']['type'] == $type ? ' selected="selected"' : '', '>', $txt['sp_pages_type_' . $type], '</option>'; } echo ' </select> </dd> <dt> <label for="page_permissions">', $txt['sp_admin_pages_col_permissions'], ':</label> </dt> <dd> <select name="permissions" id="page_permissions">'; foreach ($context['SPortal']['page']['permission_profiles'] as $profile) { echo ' <option value="', $profile['id'], '"', $profile['id'] == $context['SPortal']['page']['permissions'] ? ' selected="selected"' : '', '>', $profile['label'], '</option>'; } echo ' </select> </dd> <dt> <label for="page_blocks">', $txt['sp_admin_pages_col_blocks'], ':</label> </dt> <dd> <select name="blocks[]" id="page_blocks" size="7" multiple="multiple">'; foreach ($context['sides'] as $side => $label) { if (empty($context['page_blocks'][$side])) { continue; } echo ' <optgroup label="', $label, '">'; foreach ($context['page_blocks'][$side] as $block) { echo ' <option value="', $block['id'], '"', $block['shown'] ? ' selected="selected"' : '', '>', $block['label'], '</option>'; } echo ' </optgroup>'; } echo ' </select> </dd> <dt> <label for="page_status">', $txt['sp_admin_pages_col_status'], ':</label> </dt> <dd> <input type="checkbox" name="status" id="page_status" value="1"', $context['SPortal']['page']['status'] ? ' checked="checked"' : '', ' class="input_check" /> </dd> <dt> ', $txt['sp_admin_pages_col_body'], ': </dt> <dd> </dd> </dl> <div>', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), '</div> <input type="submit" name="submit" value="', $context['page_title'], '" class="right_submit" /> <input type="submit" name="preview" value="', $txt['sp_admin_pages_preview'], '" class="right_submit" /> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> </div>'; $style_sections = array('title' => 'left', 'body' => 'right'); $style_types = array('default' => 'DefaultClass', 'class' => 'CustomClass', 'style' => 'CustomStyle'); $style_parameters = array('title' => array('category_header', 'secondary_header'), 'body' => array('content', 'information', 'roundframe')); echo ' <br /> <h3 class="category_header"> ', $txt['sp_admin_pages_style'], ' </h3> <div class="sp_content_padding">'; foreach ($style_sections as $section => $float) { echo ' <dl id="sp_edit_style_', $section, '" class="sp_form sp_float_', $float, '">'; foreach ($style_types as $type => $label) { echo ' <dt> ', $txt['sp-blocks' . ucfirst($section) . $label], ': </dt> <dd>'; if ($type == 'default') { echo ' <select name="', $section, '_default_class" id="', $section, '_default_class">'; foreach ($style_parameters[$section] as $class) { echo ' <option value="', $class, '"', $context['SPortal']['page']['style'][$section . '_default_class'] == $class ? ' selected="selected"' : '', '>', $class, '</option>'; } echo ' </select>'; } else { echo ' <input type="text" name="', $section, '_custom_', $type, '" id="', $section, '_custom_', $type, '" value="', $context['SPortal']['page']['style'][$section . '_custom_' . $type], '" class="input_text" />'; } echo ' </dd>'; } echo ' <dt> ', $txt['sp-blocksNo' . ucfirst($section)], ': </dt> <dd> <input type="checkbox" name="no_', $section, '" id="no_', $section, '" value="1"', !empty($context['SPortal']['page']['style']['no_' . $section]) ? ' checked="checked"' : '', ' onclick="check_style_options();" class="input_check" /> </dd> </dl>'; } echo ' <input type="submit" name="submit" value="', $context['page_title'], '" class="right_submit" /> <input type="submit" name="preview" value="', $txt['sp_admin_pages_preview'], '" class="right_submit" /> </div> <input type="hidden" name="page_id" value="', $context['SPortal']['page']['id'], '" /> </form> </div>'; addInlineJavascript('sp_editor_change_type("page_type");', true); }
function template_shd_edit_canned_reply() { global $context, $settings, $txt, $modSettings, $scripturl; $editor_context =& $context['controls']['richedit'][$context['post_box_name']]; echo ' <div class="tborder"> <div class="cat_bar"> <h3 class="catbg"> <img src="', $settings['default_images_url'], '/simpledesk/cannedreplies.png" class="icon" alt="*" /> ', $txt['shd_admin_cannedreplies_home'], ' </h3> </div> <p class="description"> ', $txt['shd_admin_cannedreplies_homedesc'], ' </p> </div> <form action="', $scripturl, '?action=admin;area=helpdesk_cannedreplies;sa=savereply" method="post" accept-charset="', $context['character_set'], '" name="cannedreply" id="cannedreply" onsubmit="', 'submitonce(this);smc_saveEntities(\'cannedreply\', [\'title\', \'', $context['post_box_name'], '\']);" enctype="multipart/form-data" style="margin: 0;"> <div class="cat_bar grid_header"> <h3 class="catbg"> <img src="', $settings['default_images_url'], '/simpledesk/additional_information.png" alt="*" /> ', $context['page_title'], ' </h3> </div> <div class="roundframe"> <div class="content"> <dl class="permsettings cannedsettings"> <dt><strong>', $txt['shd_admin_cannedreplies_replytitle'], '</strong></dt> <dd><input type="text" class="input_text" value="', $context['canned_reply']['title'], '" name="title" /></dd> <dt><strong>', $txt['shd_admin_cannedreplies_content'], '</strong> <dd> <div id="bbcbox"></div> <div id="smileybox"></div>', template_control_richedit($context['post_box_name'], 'smileybox', 'bbcbox'), ' </dd> <dt><strong>', $txt['shd_admin_cannedreplies_active'], '</strong></dt> <dd><input type="checkbox" name="active" class="input_check"', !empty($context['canned_reply']['active']) ? ' checked="checked"' : '', ' /> <dt><strong>', $txt['shd_admin_cannedreplies_selectvisible'], '</strong></dt> <dd> <input type="checkbox" name="vis_user" class="input_check"', !empty($context['canned_reply']['vis_user']) ? ' checked="checked"' : '', ' /> <img src="', $settings['default_images_url'], '/simpledesk/user.png" class="icon" alt="', $txt['shd_admin_custom_field_users'], '" title="', $txt['shd_admin_custom_field_users'], '"> <input type="checkbox" name="vis_staff" class="input_check"', !empty($context['canned_reply']['vis_staff']) ? ' checked="checked"' : '', ' /> <img src="', $settings['default_images_url'], '/simpledesk/staff.png" class="icon" alt="', $txt['shd_admin_custom_field_staff'], '" title="', $txt['shd_admin_custom_field_staff'], '"> <input type="checkbox" name="vis_admin" class="input_check" checked="checked" disabled="disabled"> <img src="', $settings['default_images_url'], '/simpledesk/admin.png" class="icon" alt="', $txt['shd_admin_custom_field_admins'], '" title="', $txt['shd_admin_custom_field_admins'], '"> </dd> </dl> </div> </div> <span class="lowerframe"><span></span></span> <br /> <div class="cat_bar grid_header"> <h3 class="catbg"> <img src="', $settings['default_images_url'], '/simpledesk/departments.png" alt="*" /> ', $txt['shd_admin_cannedreplies_departments'], ' </h3> </div> <div class="roundframe"> <div class="content"> <dl class="permsettings cannedsettings">'; foreach ($context['canned_reply']['depts_available'] as $dept_id => $dept_name) { echo ' <dt><strong>', $dept_name, '</strong></dt> <dd><input type="checkbox" name="dept_', $dept_id, '"', in_array($dept_id, $context['canned_reply']['depts_selected']) ? ' checked="checked"' : '', ' class="input_check" /></dd>'; } echo ' </dl> </div> </div> <span class="lowerframe"><span></span></span> <br /> <input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : $txt['save'], '" tabindex="', $context['tabindex']++, '" accesskey="s" class="button_submit" />'; if ($context['canned_reply']['id'] != 'new') { echo ' <input type="submit" name="delete" value="', $txt['shd_admin_cannedreplies_deletereply'], '" onclick="return confirm(', JavaScriptEscape($txt['shd_admin_cannedreplies_deletereply_confirm']), ') && submitThisOnce(this);" class="button_submit" />'; } echo ' <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" /> <input type="hidden" name="reply" value="', $context['canned_reply']['id'], '" /> <input type="hidden" name="cat" value="', $context['canned_reply']['cat'], '" /> </form> <br />'; }
function theme_postbox($msg) { global $context; return template_control_richedit($context['post_box_name']); }
function template_editlink() { global $context, $scripturl, $txt, $modSettings, $settings; // Load the spell checker? if ($context['show_spellchecking']) { echo ' <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/scripts/spellcheck.js"></script>'; } echo ' <form name="links" id="links" method="POST" action="' . $scripturl . '?action=links&sa=editlink2" onsubmit="submitonce(this);"> <table cellspacing="0" align="center" cellpadding="4" class="tborder" width="100%"> <tr> <td width="50%" colspan="2" align="center" class="catbg"> <strong>' . $txt['smflinks_editlink'] . '</strong></td> </tr> <tr> <td width="28%" class="windowbg2"><span class="gen"><strong>' . $txt['smflinks_ctitle'] . '</strong></span></td> <td width="72%" class="windowbg2"><input type="text" name="title" size="64" maxlength="100" value="' . $context['links_link']['title'] . '" /></td> </tr> <tr> <td width="28%" class="windowbg2"><span class="gen"><strong>' . $txt['smflinks_category'] . '</strong></span></td> <td width="72%" class="windowbg2"><select name="catid">'; foreach ($context['links_cats'] as $row2) { echo '<option value="' . $row2['ID_CAT'] . '" ' . ($row2['ID_CAT'] == $context['links_link']['ID_CAT'] ? 'selected="selected" ' : '') . '>' . $row2['title'] . '</option>'; } echo '</select> </td> </tr> <tr> <td width="28%" class="windowbg2"><span class="gen"><strong>' . $txt['smflinks_url'] . '</strong></span></td> <td width="72%" class="windowbg2"><input type="text" name="url" size="64" maxlength="250" value="' . $context['links_link']['url'] . '" /></td> </tr> <tr> <td width="28%" valign="top" class="windowbg2"><span class="gen"><strong>' . $txt['smflinks_description'] . '</strong></span></td> <td width="72%" class="windowbg2">'; if (!empty($modSettings['smflinks_setallowbbc'])) { echo ' <table>'; if (!function_exists('getLanguages')) { // Showing BBC? if ($context['show_bbc']) { echo ' <tr class="windowbg2"> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'bbc'), ' </td> </tr>'; } // What about smileys? if (!empty($context['smileys']['postform'])) { echo ' <tr class="windowbg2"> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'smileys'), ' </td> </tr>'; } // Show BBC buttons, smileys and textbox. echo ' <tr class="windowbg2"> <td colspan="2" align="center"> ', template_control_richedit($context['post_box_name'], 'message'), ' </td> </tr>'; } else { echo ' <tr class="windowbg2"> <td colspan="2">'; // Showing BBC? if ($context['show_bbc']) { echo ' <div id="bbcBox_message"></div>'; } // What about smileys? if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { echo ' <div id="smileyBox_message"></div>'; } // Show BBC buttons, smileys and textbox. echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); echo '</td></tr>'; } echo ' </table>'; } else { // No BBC echo ' <textarea rows="6" name="descript" cols="54">' . $context['links_link']['description'] . '</textarea><br />'; } if ($context['show_spellchecking']) { echo ' <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'links\', \'description\');" />'; } echo ' </td> </tr> <tr> <td width="28%" colspan="2" align="center" class="windowbg2"> <input type="hidden" value="' . $context['link_id'] . '" name="id" /> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> <input type="submit" value="' . $txt['smflinks_editlink'] . '" name="submit" class="button_submit" /></td> </tr> </table> </form>'; if ($context['show_spellchecking']) { echo '<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>'; } LinksCopyright(); }
function template_ticket_postbox() { global $modSettings, $context, $txt; $editor_context =& $context['controls']['richedit'][$context['post_box_name']]; // The postbox echo ' <div id="shd_bbcbox"', empty($modSettings['shd_allow_ticket_bbc']) || !empty($context['shd_display']) ? ' style="display:none;"' : '', '></div> <div id="shd_smileybox"', empty($modSettings['shd_allow_ticket_smileys']) || !empty($context['shd_display']) ? ' style="display:none;"' : '', '></div>'; if ($editor_context['width'] == (int) $editor_context['width'] . '%') { $width = round((int) $editor_context['width'] / 0.988, 1); echo ' <div style="width: ', $width, '%;">', template_control_richedit($context['post_box_name'], 'shd_smileybox', 'shd_bbcbox'), '</div>'; } else { echo template_control_richedit($context['post_box_name'], 'shd_smileybox', 'shd_bbcbox'); } // Custom fields template_ticket_custom_fields(); // Additional ticket options (attachments, smileys, etc) template_ticket_additional_options(); // Canned replies template_ticket_cannedreplies(); echo ' <br class="clear" /> <span class="smalltext"><br />', $context['browser']['is_firefox'] ? $txt['shortcuts_firefox'] : $txt['shortcuts'], '</span><br /> <input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : $txt['post'], '" tabindex="', $context['tabindex']++, '" accesskey="s" class="button_submit" /> <input class="button_submit" type="submit" name="preview" value="', $txt['preview'], '" accesskey="p" tabindex="', $context['tabindex']++, '" />'; }
/** * Template for the section to compose an email to members */ function template_email_members_compose() { global $context, $txt, $scripturl; echo ' <div id="admincenter"> <form name="newsmodify" action="', $scripturl, '?action=admin;area=news;sa=mailingsend" method="post" accept-charset="UTF-8"> <h3 class="category_header"> <a class="hdicon cat_img_helptopics help" href="', $scripturl, '?action=quickhelp;help=email_members" onclick="return reqOverlayDiv(this.href);" title="', $txt['help'], '"></a> ', $txt['admin_newsletters'], ' </h3> <div class="information"> ', str_replace('{help_emailmembers}', $scripturl . '?action=quickhelp;help=emailmembers" onclick="return reqOverlayDiv(this.href);', $txt['email_variables']), ' </div>'; // The preview section echo ' <div id="preview_section" class="forumposts"', isset($context['preview_message']) ? '' : ' style="display: none;"', '> <h3 class="category_header"> <span id="preview_subject">', empty($context['preview_subject']) ? '' : $context['preview_subject'], '</span> </h3> <div class="post" id="preview_body"> ', empty($context['preview_message']) ? '<br />' : $context['preview_message'], ' </div> </div>'; // Any errors to speak of? echo ' <div class="windowbg"> <div id="post_error" class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'warningbox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', '> <dl> <dt> <strong id="error_serious">', $txt['error_while_submitting'], '</strong> </dt> <dd> <ul class="error" id="post_error_list"> ', empty($context['post_error']['messages']) ? '' : '<li>' . implode('</li><li>', $context['post_error']['messages']) . '</li>', ' </ul> </dd> </dl> </div>'; // Show the editor area echo ' <div class="editor_wrapper"> <dl id="post_header"> <dt class="clear_left"> <label for="subject"', isset($context['post_error']['no_subject']) ? ' class="error"' : '', ' id="caption_subject">', $txt['subject'], ':</label> </dt> <dd id="pm_subject"> <input type="text" id="subject" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="60" maxlength="60"', isset($context['post_error']['no_subject']) ? ' class="error"' : ' class="input_text"', '/> </dd> </dl> <hr class="clear" />'; // Show BBC buttons, smileys and textbox. echo ' ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); echo ' <ul> <li><label for="send_pm"><input type="checkbox" name="send_pm" id="send_pm" ', !empty($context['send_pm']) ? 'checked="checked"' : '', 'class="input_check" onclick="checkboxes_status(this);" /> ', $txt['email_as_pms'], '</label></li> <li><label for="send_html"><input type="checkbox" name="send_html" id="send_html" ', !empty($context['send_html']) ? 'checked="checked"' : '', 'class="input_check" onclick="checkboxes_status(this);" /> ', $txt['email_as_html'], '</label></li> <li><label for="parse_html"><input type="checkbox" name="parse_html" id="parse_html" checked="checked" disabled="disabled" class="input_check" /> ', $txt['email_parsed_html'], '</label></li> </ul> <div class="submitbutton"> ', template_control_richedit_buttons($context['post_box_name']), ' </div> </div> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> <input type="hidden" name="email_force" value="', $context['email_force'], '" /> <input type="hidden" name="total_emails" value="', $context['total_emails'], '" /> <input type="hidden" name="max_id_member" value="', $context['max_id_member'], '" /> </div>'; foreach ($context['recipients'] as $key => $values) { echo ' <input type="hidden" name="', $key, '" value="', implode($key == 'emails' ? ';' : ',', $values), '" />'; } // The vars used to preview a newsletter without loading a new page, used by post.js previewControl() addInlineJavascript(' var form_name = "newsmodify", preview_area = "news", txt_preview_title = "' . $txt['preview_title'] . '", txt_preview_fetch = "' . $txt['preview_fetch'] . '"; function checkboxes_status (item) { if (item.id == \'send_html\') document.getElementById(\'parse_html\').disabled = !document.getElementById(\'parse_html\').disabled; if (item.id == \'send_pm\') { if (!document.getElementById(\'send_html\').checked) document.getElementById(\'parse_html\').disabled = true; else document.getElementById(\'parse_html\').disabled = false; document.getElementById(\'send_html\').disabled = !document.getElementById(\'send_html\').disabled; } }', true); echo ' </form> </div>'; }