?>
">

	<fieldset>
		<legend><?php 
_e('Edit Topic', 'message-board');
?>
</legend>

		<p>
			<label for="mb_topic_title"><?php 
_e('Topic title: (be brief and descriptive)', 'message-board');
?>
</label>
			<input type="text" id="mb_topic_title" name="mb_topic_title" value="<?php 
echo esc_attr(mb_get_topic_title());
?>
" />
		</p>

		<p>
			<label for="mb_topic_forum"><?php 
_e('Select a forum:', 'message-board');
?>
</label>
			<?php 
mb_dropdown_forums(array('child_type' => mb_get_topic_post_type(), 'name' => 'mb_topic_forum', 'id' => 'mb_topic_forum', 'selected' => mb_get_topic_forum_id()));
?>
		</p>

		<p>
function mb_notify_topic_subscribers($topic_id, $post)
{
    $reply_id = mb_get_reply_id($post->ID);
    $topic_id = mb_get_topic_id($topic_id);
    $forum_id = mb_get_topic_forum_id($topic_id);
    $forum_subscribers = $forum_id ? mb_get_forum_subscribers($forum_id) : array();
    $topic_subscribers = $topic_id ? mb_get_topic_subscribers($topic_id) : array();
    /* Remove users who are already subscribed to the topic's forum or who wrote the post. */
    $subscribers = array_diff($topic_subscribers, $forum_subscribers, array($post->post_author));
    /* If there are no subscribers, bail. */
    if (empty($subscribers)) {
        return false;
    }
    /* Get needed topic data. */
    $topic_title = strip_tags(mb_get_topic_title($topic_id));
    /* Get needed reply data. */
    $reply_url = mb_get_reply_url($reply_id);
    $reply_author = mb_get_reply_author($reply_id);
    $reply_author_id = mb_get_reply_author_id($reply_id);
    $reply_content = mb_get_reply_content($reply_id, 'raw');
    /* Filter the reply content for email. */
    $reply_content = apply_filters('mb_pre_email_reply_content', $reply_content, $reply_id);
    /* Build the email message. */
    $message = sprintf(__('%1$s replied: %4$s%2$s %4$sPost Link: %3$s %4$sYou are receiving this email because you subscribed to a forum topic. Log in and visit the topic to unsubscribe from these emails.', 'message-board'), $reply_author, $reply_content, $reply_url, "\n\n");
    /* Get the site name and domain. */
    $site_name = esc_html(strip_tags(get_option('blogname')));
    $site_domain = untrailingslashit(str_replace(array('http://', 'https://'), '', home_url()));
    /* Who's the message from? */
    $from = '<noreply@' . $site_domain . '>';
    /* Translators: Email subject. 1 is the blog name. 2 is the topic title. */
    $subject = sprintf(esc_attr__('[$1%s] $2%s', 'message-board'), $site_name, $topic_title);
    /* Build the email headers. */
    $headers = array();
    $headers[] = sprintf('From: %s %s', $site_name, $from);
    foreach ($subscribers as $user_id) {
        $headers[] = 'Bcc: ' . get_userdata($user_id)->user_email;
    }
    /* Send the email. */
    return wp_mail($from, $subject, $message, $headers);
}
function mb_get_edit_page_title()
{
    $title = '';
    if (mb_is_forum_edit()) {
        $title = sprintf(mb_get_forum_label('mb_form_edit_item'), mb_get_forum_title());
    } elseif (mb_is_topic_edit()) {
        $title = sprintf(mb_get_topic_label('mb_form_edit_item'), mb_get_topic_title());
    } elseif (mb_is_reply_edit()) {
        $title = sprintf(mb_get_reply_label('mb_form_edit_item'), mb_get_reply_title());
    } elseif (mb_is_user_edit()) {
        $title = __('Edit User', 'message-board');
    }
    return apply_filters('mb_get_edit_title', $title);
}
 /**
  * Displays admin notices for the edit forum screen.
  *
  * @since  1.0.0
  * @access public
  * @return void
  */
 public function admin_notices()
 {
     $allowed_notices = array('restore', mb_get_spam_post_status(), mb_get_open_post_status(), mb_get_close_post_status(), 'sticky', 'unsticky', 'super', 'unsuper');
     if (isset($_GET['mb_topic_notice']) && in_array($_GET['mb_topic_notice'], $allowed_notices) && isset($_GET['topic_id'])) {
         $notice = $_GET['mb_topic_notice'];
         $topic_id = mb_get_topic_id(absint($_GET['topic_id']));
         if (mb_get_spam_post_status() === $notice) {
             $text = sprintf(__('The topic "%s" was successfully marked as spam.', 'message-board'), mb_get_topic_title($topic_id));
         } elseif ('restore' === $notice) {
             $text = sprintf(__('The topic "%s" was successfully removed from spam.', 'message-board'), mb_get_topic_title($topic_id));
         } elseif (mb_get_close_post_status() === $notice) {
             $text = sprintf(__('The topic "%s" was successfully closed.', 'message-board'), mb_get_topic_title($topic_id));
         } elseif (mb_get_open_post_status() === $notice) {
             $text = sprintf(__('The topic "%s" was successfully opened.', 'message-board'), mb_get_topic_title($topic_id));
         } elseif ('sticky' === $notice) {
             $text = sprintf(__('The topic "%s" was successfully added as a sticky topic.', 'message-board'), mb_get_topic_title($topic_id));
         } elseif ('unsticky' === $notice) {
             $text = sprintf(__('The topic "%s" was successfully removed from sticky topics.', 'message-board'), mb_get_topic_title($topic_id));
         } elseif ('super' === $notice) {
             $text = sprintf(__('The topic "%s" was successfully added as a super sticky topic.', 'message-board'), mb_get_topic_title($topic_id));
         } elseif ('unsuper' === $notice) {
             $text = sprintf(__('The topic "%s" was successfully removed from super sticky topics.', 'message-board'), mb_get_topic_title($topic_id));
         }
         if (!empty($text)) {
             printf('<div class="updated"><p>%s</p></div>', $text);
         }
     }
 }
 /**
  * Handles the output for custom columns.
  *
  * @since  1.0.0
  * @access public
  * @param  string  $column
  * @param  int     $post_id
  */
 public function manage_columns($column, $post_id)
 {
     /* Forum column. */
     if ('forum' === $column) {
         $forum_id = mb_get_reply_forum_id($post_id);
         if (0 === $forum_id || mb_is_reply_orphan($post_id)) {
             echo '&mdash;';
         } else {
             $post_type = get_post_type($post_id);
             $url = add_query_arg(array('post_type' => $post_type, 'mb_forum' => $forum_id), admin_url('edit.php'));
             printf('<a href="%s">%s</a>', $url, mb_get_forum_title($forum_id));
         }
         /* Topic column. */
     } elseif ('topic' === $column) {
         $topic_id = mb_get_reply_topic_id($post_id);
         if (0 === $topic_id || mb_is_reply_orphan($post_id)) {
             echo '&mdash;';
         } else {
             $post_type = get_post_type($post_id);
             $url = add_query_arg(array('post_type' => $post_type, 'post_parent' => $topic_id), admin_url('edit.php'));
             printf('<a href="%s">%s</a>', $url, mb_get_topic_title($topic_id));
         }
         /* Datetime column. */
     } elseif ('datetime' === $column) {
         the_time(get_option('date_format'));
         echo '<br />';
         the_time(get_option('time_format'));
     }
 }
/**
 * Returns the topic link.
 *
 * @since  1.0.0
 * @access public
 * @param  int     $topic_id
 * @return string
 */
function mb_get_topic_link($topic_id = 0)
{
    $topic_id = mb_get_topic_id($topic_id);
    $url = mb_get_topic_url($topic_id);
    $title = mb_get_topic_title($topic_id);
    $link = $url ? sprintf('<a class="mb-topic-link" href="%s">%s</a>', $url, $title) : '';
    if (!$link && $title) {
        $link = sprintf('<span class="mb-topic-link">%s</span>', $title);
    }
    return apply_filters('mb_get_topic_link', $link, $topic_id);
}
/**
 * Handles forums, topics, and replies without titles. The titles will use the post ID. By default, 
 * replies do not have titles and will be replaced with "Reply to: Topic Title".
 *
 * @since  1.0.0
 * @access public
 * @param  string  $title
 * @param  int     $post
 * @return string
 */
function mb_post_title_empty($title, $post)
{
    $post_id = is_object($post) ? $post->ID : $post;
    /* Forum post type. */
    if (empty($title) && mb_is_forum($post_id)) {
        /* Translators: Empty forum title "%s" is the forum ID. */
        $title = sprintf(__('Forum #%s', 'message-board'), $post_id);
        /* Topic post type. */
    } elseif (empty($title) && mb_is_topic($post_id)) {
        /* Translators: Empty topic title "%s" is the topic ID. */
        $title = sprintf(__('Topic #%s', 'message-board'), $post_id);
        /* Reply post type. */
    } elseif (empty($title) && mb_is_reply($post_id)) {
        $post = get_post($post_id);
        /* If the reply doesn't have a parent topic. */
        if (0 >= $post->post_parent || mb_is_reply_orphan($post_id)) {
            /* Translators: Empty reply title with no topic (orphan). "%s" is the reply ID. */
            $title = sprintf(__('Reply #%s', 'message-board'), $post_id);
            /* If the reply does belong to a topic. */
        } else {
            /* Translators: Empty reply title. "%s" is the topic title. */
            $title = sprintf(__('Reply to: %s', 'message-board'), mb_get_topic_title($post->post_parent));
        }
    }
    /* Return the filtered title. */
    return $title;
}