function template_notification() { global $context, $txt, $scripturl, $modSettings; // The main containing header. echo ' <div class="cat_bar2"> <h3> <span class="ie6_header floatleft">', $txt['notifications_header'], '</span> </h3> </div> <div class="orange_container cleantop mediumpadding">', $txt['notification_info'], '</div><br>'; $collapser = array('id' => 'notify_settings_profile', 'title' => $txt['notifications_settings'], 'bodyclass' => 'blue_container cleantop'); template_create_collapsible_container($collapser); echo ' <div class="content"> <form action="', $scripturl, '?action=profile;area=notification;save" method="post" accept-charset="UTF-8" id="notify_options" class="flow_hidden">'; // Allow notification on announcements to be disabled? if (!empty($modSettings['allow_disableAnnounce'])) { echo ' <input type="hidden" name="notify_announcements" value="0" /> <label for="notify_announcements"><input type="checkbox" id="notify_announcements" name="notify_announcements"', !empty($context['member']['notify_announcements']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['notify_important_email'], '</label><br />'; } // More notification options. echo ' <input type="hidden" name="default_options[auto_notify]" value="0" /> <label for="auto_notify"><input type="checkbox" id="auto_notify" name="default_options[auto_notify]" value="1"', !empty($context['member']['options']['auto_notify']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['auto_notify'], '</label><br />'; if (empty($modSettings['disallow_sendBody'])) { echo ' <input type="hidden" name="notify_send_body" value="0" /> <label for="notify_send_body"><input type="checkbox" id="notify_send_body" name="notify_send_body"', !empty($context['member']['notify_send_body']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['notify_send_body'], '</label><br />'; } echo ' <br /> <label for="notify_regularity">', $txt['notify_regularity'], ':</label> <select name="notify_regularity" id="notify_regularity"> <option value="0"', $context['member']['notify_regularity'] == 0 ? ' selected="selected"' : '', '>', $txt['notify_regularity_instant'], '</option> <option value="1"', $context['member']['notify_regularity'] == 1 ? ' selected="selected"' : '', '>', $txt['notify_regularity_first_only'], '</option> <option value="2"', $context['member']['notify_regularity'] == 2 ? ' selected="selected"' : '', '>', $txt['notify_regularity_daily'], '</option> <option value="3"', $context['member']['notify_regularity'] == 3 ? ' selected="selected"' : '', '>', $txt['notify_regularity_weekly'], '</option> </select> <br /><br /> <label for="notify_types">', $txt['notify_send_types'], ':</label> <select name="notify_types" id="notify_types"> <option value="1"', $context['member']['notify_types'] == 1 ? ' selected="selected"' : '', '>', $txt['notify_send_type_everything'], '</option> <option value="2"', $context['member']['notify_types'] == 2 ? ' selected="selected"' : '', '>', $txt['notify_send_type_everything_own'], '</option> <option value="3"', $context['member']['notify_types'] == 3 ? ' selected="selected"' : '', '>', $txt['notify_send_type_only_replies'], '</option> <option value="4"', $context['member']['notify_types'] == 4 ? ' selected="selected"' : '', '>', $txt['notify_send_type_nothing'], '</option> </select><br class="clear" /> <div class="floatright smallpadding"> <input id="notify_submit" type="submit" value="', $txt['notify_save'], '" class="default" /> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> <input type="hidden" name="u" value="', $context['id_member'], '" /> <input type="hidden" name="sa" value="', $context['menu_item_selected'], '" /> </div><br class="clear" /> </form> </div> </div> <br>'; template_topiclist($context['topiclist']); echo ' <br />'; template_show_list('board_notification_list'); }
function template_replies() { global $context, $settings, $options, $txt, $scripturl, $modSettings; loadtemplate('Common'); echo ' <div id="recent">'; $showCheckboxes = !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $settings['show_mark_read']; if ($showCheckboxes) { echo ' <form action="', $scripturl, '?action=quickmod" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;"> <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> <input type="hidden" name="qaction" value="markread" /> <input type="hidden" name="redirect_url" value="action=unreadreplies', !empty($context['showing_all_topics']) ? ';all' : '', $context['querystring_board_limits'], '" />'; } if (isset($context['topics_to_mark']) && !empty($settings['show_mark_read'])) { // Generate the button strip. $mark_read = array('markread' => array('text' => 'mark_as_read', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=unreadreplies;topics=' . $context['topics_to_mark'] . ';' . $context['session_var'] . '=' . $context['session_id'])); if ($showCheckboxes) { $mark_read['markselectread'] = array('text' => 'quick_mod_markread', 'image' => 'markselectedread.gif', 'lang' => true, 'url' => 'javascript:document.quickModForm.submit();'); } } if (!empty($context['topics'])) { echo ' <div class="pagesection themepadding"> <div class="bwgrid"> <div class="bwcell8"> <br><div>', $txt['pages'], ': ', $context['page_index'], '</div> </div> <div class="bwcell8">'; if (!empty($mark_read) && !empty($settings['use_tabs'])) { echo template_button_strip($mark_read, 'right'); } echo ' </div> </div> </div> <div class="topic_table clear" id="unreadreplies"> <table class="table_grid" cellspacing="0"> <thead> <tr class="catbg"> <th scope="col" class="first_th"> </th> <th scope="col"> <a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=subject', $context['sort_by'] === 'subject' && $context['sort_direction'] === 'up' ? ';desc' : '', '">', $txt['subject'], $context['sort_by'] === 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> </th> <th scope="col" width="14%" align="center"> <a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=replies', $context['sort_by'] === 'replies' && $context['sort_direction'] === 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] === 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> </th>'; // Show a "select all" box for quick moderation? if ($showCheckboxes) { echo ' <th scope="col" width="22%"> <a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=last_post', $context['sort_by'] === 'last_post' && $context['sort_direction'] === 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] === 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> </th> <th class="last_th" width="2%"> <input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check" /> </th>'; } else { echo ' <th scope="col" class="last_th" width="22%"> <a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=last_post', $context['sort_by'] === 'last_post' && $context['sort_direction'] === 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] === 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> </th>'; } echo ' </tr> </thead> <tbody>'; template_topiclist($context['topics'], $showCheckboxes); if (empty($settings['use_tabs']) && !empty($mark_read)) { echo ' <tr class="catbg"> <td colspan="', $showCheckboxes ? '5' : '4', '" align="right"> ', template_button_strip($mark_read, 'top'), ' </td> </tr>'; } echo ' </tbody> </table> </div> <div class="pagesection themepadding">'; if (!empty($settings['use_tabs']) && !empty($mark_read)) { template_button_strip($mark_read, 'right'); } echo ' <span>', $txt['pages'], ': ', $context['page_index'], '</span> </div><br class="clear" />'; } else { echo ' <div class="cat_bar"> <h3 class="catbg centertext"> ', $context['showing_all_topics'] ? $txt['msg_alert_none'] : $txt['unread_topics_visit_none'], ' </h3> </div>'; } if ($showCheckboxes) { echo ' </form>'; } echo ' </div>'; }
function my_messageindex() { global $context, $settings, $options, $scripturl, $modSettings, $txt; loadtemplate('Common'); echo ' <a id="top"></a>'; if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0)) { echo ' <div class="catbg"> <span class="floatright circleborder" style="margin-top: 0rem;">', my_toggle('m' . $context['current_board'], 'mess_boards' . $context['current_board']), '</span> <h3>', $txt['parent_boards'], '</h3> </div> <div id="mess_boards', $context['current_board'], '" class="', !empty($options['togglecatm' . $context['current_board']]) ? '' : 'no', 'togglecat">'; $next = 1; template_board($context['boards']); echo ' </div>'; } echo ' <div class="catbg"> <h3>', $context['page_title'], '</h3>'; if (!empty($options['show_board_desc']) && $context['description'] != '') { echo ' <div class="subtitle">', $context['description'], '</div>'; } echo ' </div>'; // Create the button set... $normal_buttons = array('new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true), 'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'), 'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : '') . 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']), 'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id'])); // They can only mark read if they are logged in and it's enabled! if (!$context['user']['is_logged'] || !$settings['show_mark_read']) { unset($normal_buttons['markread']); } // Allow adding new buttons easily. call_integration_hook('integrate_messageindex_buttons', array(&$normal_buttons)); if (!$context['no_topic_listing']) { echo ' <div class="pagesection themepadding"><div class="bwgrid"> <div class="pagelinks bwcell8"><br>', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' <a href="#bot"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div> <div class="bwcell8">', template_button_strip($normal_buttons, 'right'), '</div> </div></div>'; // If Quick Moderation is enabled start the form. if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { echo ' <form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">'; } echo ' <div class="tborder topic_table" id="messageindex"> <table class="table_grid" cellspacing="0" style="width: 100%;"> <thead class="whide"> <tr class="catbg">'; // Are there actually any topics to show? if (!empty($context['topics'])) { echo '<th></th> <th scope="col" class="lefttext"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['subject'], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> / <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['started_by'], $context['sort_by'] == 'starter' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th> <th scope="col" class="rhide" width="14%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> / <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['views'], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>'; // Show a "select all" box for quick moderation? if (empty($context['can_quick_mod'])) { echo ' <th scope="col" class="lefttext last_th" width="22%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>'; } else { echo ' <th scope="col" class="lefttext rhide" width="22%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>'; } // Show a "select all" box for quick moderation? if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1) { echo ' <th scope="col" class="last_th" width="4%"><input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check" /></th>'; } elseif (!empty($context['can_quick_mod'])) { echo ' <th class="last_th" width="4%"> </th>'; } } else { echo ' <th scope="col" class="first_th" width="8%"> </th> <th colspan="3"><strong>', $txt['msg_alert_none'], '</strong></th> <th scope="col" class="last_th" width="8%"> </th>'; } echo ' </tr> </thead> <tbody>'; if (!empty($settings['display_who_viewing'])) { echo ' <tr class="windowbg2"> <td colspan="', !empty($context['can_quick_mod']) ? '5' : '4', '">'; 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']) or $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')'); } echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board'], ' </td> </tr>'; } // If this person can approve items and we have some awaiting approval tell them. if (!empty($context['unapproved_posts_message'])) { echo ' <tr class="windowbg2"> <td colspan="', !empty($context['can_quick_mod']) ? '5' : '4', '"> <span class="alert">!</span> ', $context['unapproved_posts_message'], ' </td> </tr>'; } template_topiclist($context['topics'], $ch = !empty($context['can_quick_mod']) ? true : false); if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics'])) { echo ' <tr class="titlebg"> <td colspan="5" align="right"> <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '> <option value="">--------</option>', $context['can_remove'] ? ' <option value="remove">' . $txt['quick_mod_remove'] . '</option>' : '', $context['can_lock'] ? ' <option value="lock">' . $txt['quick_mod_lock'] . '</option>' : '', $context['can_sticky'] ? ' <option value="sticky">' . $txt['quick_mod_sticky'] . '</option>' : '', $context['can_move'] ? ' <option value="move">' . $txt['quick_mod_move'] . ': </option>' : '', $context['can_merge'] ? ' <option value="merge">' . $txt['quick_mod_merge'] . '</option>' : '', $context['can_restore'] ? ' <option value="restore">' . $txt['quick_mod_restore'] . '</option>' : '', $context['can_approve'] ? ' <option value="approve">' . $txt['quick_mod_approve'] . '</option>' : '', $context['user']['is_logged'] ? ' <option value="markread">' . $txt['quick_mod_markread'] . '</option>' : '', ' </select>'; // Show a list of boards they can move the topic to. if ($context['can_move']) { echo ' <select class="qaction" id="moveItTo" name="move_to" disabled="disabled">'; foreach ($context['move_to_boards'] 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>'; } echo ' <input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' && confirm(\'', $txt['quickmod_confirm'], '\');" class="button_submit qaction" /> </td> </tr>'; } echo ' </tbody> </table> </div> <a id="bot"></a>'; // Finish off the form - again. if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics'])) { echo ' <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" /> </form>'; } echo ' <div class="pagesection themepadding"><div class="bwgrid"> <div class="pagelinks bwcell8">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' <a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div> <div class="bwcell8">', template_button_strip($normal_buttons, 'right'), '</div> </div></div>'; } echo ' <div class="themepadding windowbg2" id="topic_icons"> <div class="description"> <p class="floatright" id="message_index_jump_to"> </p> <script type="text/javascript"><!-- // --><![CDATA[ if (typeof(window.XMLHttpRequest) != "undefined") aJumpTo[aJumpTo.length] = new JumpTo({ sContainerId: "message_index_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['quick_mod_go'], '" }); // ]]></script> <br class="clear" /> </div> </div>'; // Javascript for inline editing. echo ' <script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/topic.js"></script> <script type="text/javascript"><!-- // --><![CDATA[ // Hide certain bits during topic edit. hide_prefixes.push("lockicon", "stickyicon", "pages", "newicon"); // Use it to detect when we\'ve stopped editing. document.onclick = modify_topic_click; var mouse_on_div; function modify_topic_click() { if (in_edit_mode == 1 && mouse_on_div == 0) modify_topic_save("', $context['session_id'], '", "', $context['session_var'], '"); } function modify_topic_keypress(oEvent) { if (typeof(oEvent.keyCode) != "undefined" && oEvent.keyCode == 13) { modify_topic_save("', $context['session_id'], '", "', $context['session_var'], '"); if (typeof(oEvent.preventDefault) == "undefined") oEvent.returnValue = false; else oEvent.preventDefault(); } } // For templating, shown when an inline edit is made. function modify_topic_show_edit(subject) { // Just template the subject. setInnerHTML(cur_subject_div, \'<input type="text" name="subject" value="\' + subject + \'" size="60" style="width: 95%;" maxlength="80" onkeypress="modify_topic_keypress(event)" class="input_text" /><input type="hidden" name="topic" value="\' + cur_topic_id + \'" /><input type="hidden" name="msg" value="\' + cur_msg_id.substr(4) + \'" />\'); } // And the reverse for hiding it. function modify_topic_hide_edit(subject) { // Re-template the subject! setInnerHTML(cur_subject_div, \'<a href="', $scripturl, '?topic=\' + cur_topic_id + \'.0">\' + subject + \'<\' +\'/a>\'); } // ]]></script>'; }