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>'; }
function template_info_center() { global $context, $settings, $options, $txt, $scripturl, $modSettings; // Here's where the "Info Center" starts... echo ' <br class="clear" /> <div><div class="innerframe"> <div class="catbg"> <span class="floatright circleborder">', my_toggle('ic', 'upshrinkHeaderIC'), '</span> <h3>', sprintf($txt['info_center_title'], $context['forum_name_html_safe']), '</h3> <p class="subtitle">', $context['current_time'], '</p> </div> <div id="upshrinkHeaderIC" class="', empty($options['togglecatic']) ? 'no' : '', 'togglecat">'; // This is the "Recent Posts" bar. if (!empty($settings['number_recent_posts']) && (!empty($context['latest_posts']) || !empty($context['latest_post']))) { echo ' <div class="fmodule"> <h4 class="titlebg"> <a href="', $scripturl, '?action=recent"><span class="icon-file-text"></span> ', $txt['recent_posts'], '</a> </h4> <div class="hslice" id="recent_posts_content"> <div class="entry-title" style="display: none;">', $context['forum_name_html_safe'], ' - ', $txt['recent_posts'], '</div> <div class="entry-content" style="display: none;"> <a rel="feedurl" href="', $scripturl, '?action=.xml;type=webslice">', $txt['subscribe_webslice'], '</a> </div> </div>'; // Only show one post. if ($settings['number_recent_posts'] == 1) { // latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.) echo ' <strong><a href="', $scripturl, '?action=recent">', $txt['recent_posts'], '</a></strong> <p id="infocenter_onepost" class="middletext"> ', $txt['recent_view'], ' "', $context['latest_post']['link'], '" ', $txt['recent_updated'], ' (', $context['latest_post']['time'], ')<br /> </p>'; } elseif (!empty($context['latest_posts'])) { echo ' <div class="windowbg" style="overflow: hidden;">'; /* Each post in latest_posts has: board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.), subject, short_subject (shortened with...), time, link, and href. */ foreach ($context['latest_posts'] as $post) { echo ' <div class="clear aposts bwgrid"> <div class="bwcell1"> <div class="bdate floatleft" style="margin-right: 2rem;"> <span class="ftime">', date("H:i", $post['timestamp']), ' <span><span class="fdate"><span class="fday">', date("d", $post['timestamp']), '</span> <span class="fmonth">', date("M", $post['timestamp']), '</span><span class="fyear">', date("Y", $post['timestamp']), '</span></span> </div> </div> <div class="bwcell15"> <div><strong>', $post['link'], '</strong></div> <span class="fpreview">"', $post['preview'], '"</span> <hr class="fclose"><span class="fpreview">', $txt['by'], ' ', $post['poster']['link'], ' ', $txt['in'], ' ', $post['board']['link'], ' </span> </div> </div>'; } echo ' </div>'; } echo ' </div>'; } // Show information about events, birthdays, and holidays on the calendar. if ($context['show_calendar']) { echo ' <div class="title_barIC"> <h4 class="titlebg"> <span class="ie6_header floatleft"> <a href="', $scripturl, '?action=calendar' . '"><img class="icon" src="', $settings['images_url'], '/icons/calendar.gif', '" alt="', $context['calendar_only_today'] ? $txt['calendar_today'] : $txt['calendar_upcoming'], '" /></a> ', $context['calendar_only_today'] ? $txt['calendar_today'] : $txt['calendar_upcoming'], ' </span> </h4> </div> <div class="windowbg">'; // Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P. if (!empty($context['calendar_holidays'])) { echo ' <span class="holiday">', $txt['calendar_prompt'], ' ', implode(', ', $context['calendar_holidays']), '</span><br />'; } // People's birthdays. Like mine. And yours, I guess. Kidding. if (!empty($context['calendar_birthdays'])) { echo ' <span class="birthday">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span> '; /* Each member in calendar_birthdays has: id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?) */ foreach ($context['calendar_birthdays'] as $member) { echo ' <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong>' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '<br />' : ', '; } } // Events like community get-togethers. if (!empty($context['calendar_events'])) { echo ' <span class="event">', $context['calendar_only_today'] ? $txt['events'] : $txt['events_upcoming'], '</span> '; /* Each event in calendar_events should have: title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. */ foreach ($context['calendar_events'] as $event) { echo ' ', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" title="' . $txt['calendar_edit'] . '"><img src="' . $settings['images_url'] . '/icons/modify_small.gif" alt="*" /></a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<strong>' . $event['title'] . '</strong>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br />' : ', '; } } echo ' </div>'; } // Show statistical style information... if ($settings['show_stats_index']) { echo ' <div class="fmodule"> <h4 class="titlebg"> <a href="', $scripturl, '?action=stats"><span class="icon-stats-bars"></span> ', $txt['forum_stats'], '</a> </h4> <div class="windowbg"> ', $context['common_stats']['total_posts'], ' ', $txt['posts_made'], ' ', $txt['in'], ' ', $context['common_stats']['total_topics'], ' ', $txt['topics'], ' ', $txt['by'], ' ', $context['common_stats']['total_members'], ' ', $txt['members'], '. ', !empty($settings['show_latest_member']) ? $txt['latest_member'] . ': <strong> ' . $context['common_stats']['latest_member']['link'] . '</strong>' : '', '<br /> ', !empty($context['latest_post']) ? $txt['latest_post'] . ': <strong>"' . $context['latest_post']['link'] . '"</strong> ( ' . $context['latest_post']['time'] . ' )<br />' : '', ' <a href="', $scripturl, '?action=recent">', $txt['recent_view'], '</a>', $context['show_stats'] ? '<br /> <a href="' . $scripturl . '?action=stats">' . $txt['more_stats'] . '</a>' : '', ' </div> </div>'; } // "Users online" - in order of activity. echo ' <div class="fmodule"> <h4 class="titlebg"> ', $context['show_who'] ? '<a href="' . $scripturl . '?action=who' . '">' : '', '<span class="icon-eye"></span> ', $txt['online_users'], $context['show_who'] ? '</a>' : '', ' </h4> <div class="inline stats windowbg"> ', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', comma_format($context['num_guests']), ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . comma_format($context['num_users_online']), ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users']; // Handle hidden users and buddies. $bracketList = array(); if ($context['show_buddies']) { $bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']); } if (!empty($context['num_spiders'])) { $bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']); } if (!empty($context['num_users_hidden'])) { $bracketList[] = comma_format($context['num_users_hidden']) . ' ' . $txt['hidden']; } if (!empty($bracketList)) { echo ' (' . implode(', ', $bracketList) . ')'; } echo $context['show_who'] ? '</a>' : '', ' </div> <div class="windowbg3">'; // Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link. if (!empty($context['users_online'])) { echo ' ', sprintf($txt['users_active'], $modSettings['lastActive']), ':<br />', implode(', ', $context['list_users_online']); // Showing membergroups? if (!empty($settings['show_group_key']) && !empty($context['membergroups'])) { echo ' <br />[' . implode('] [', $context['membergroups']) . ']'; } } echo ' </div> <div class="last smalltext windowbg"> ', $txt['most_online_today'], ': <strong>', comma_format($modSettings['mostOnlineToday']), '</strong>. ', $txt['most_online_ever'], ': ', comma_format($modSettings['mostOnline']), ' (', timeformat($modSettings['mostDate']), ') </div>'; echo ' </div> </div> </div></div>'; }