<?php mb_the_topic(); // Sets up the topic data. ?> <tr <?php post_class(); ?> > <td class="mb-col-title"> <?php if (!mb_is_user_page()) { echo get_avatar(mb_get_topic_author_id()); } ?> <?php mb_topic_link(); ?> <div class="mb-topic-meta"> <?php mb_topic_states(); ?> <?php /* Translators: Topic author and date. 1 is the topic author. 2 is the topic date. */ printf(__('Started by %1$s %2$s', 'message-board'), mb_get_topic_author_profile_link(), mb_get_topic_natural_time()); ?>
/** * Resets the topic voices. * * @since 1.0.0 * @access public * @param int $topic_id * @return array */ function mb_reset_topic_voices($topic_id) { global $wpdb; $voices = $wpdb->get_col($wpdb->prepare("SELECT post_author FROM {$wpdb->posts} WHERE post_parent = %d AND post_type = %s AND post_status = %s", absint($topic_id), mb_get_reply_post_type(), mb_get_publish_post_status())); $topic_author = mb_get_topic_author_id($topic_id); $voices = array_merge(array($topic_author), (array) $voices); $voices = array_unique($voices); mb_set_topic_voices($topic_id, $voices); mb_set_topic_voice_count($topic_id, count($voices)); return $voices; }
/** * Returns an array of user IDs (topic voices). * * @since 1.0.0 * @access public * @param int $topic_id * @return array */ function mb_get_topic_voices($topic_id = 0) { $topic_id = mb_get_topic_id($topic_id); /* @todo - Make this a single call before release. */ $voices = get_post_meta($topic_id, mb_get_topic_voices_meta_key()); /* @todo - remove count check and just use explode() before release. */ if (1 < count($voices)) { delete_post_meta($topic_id, '_topic_voices'); $voices = mb_reset_topic_voices($topic_id); } else { $voices = explode(',', array_shift($voices)); } $voices = !empty($voices) ? $voices : array(mb_get_topic_author_id($topic_id)); return apply_filters('mb_get_topic_voices', $voices, $topic_id); }
echo format_to_edit(mb_code_trick_reverse(mb_get_topic_content(mb_get_topic_id(), 'raw'))); ?> </textarea> </p> <p> <input type="submit" value="<?php esc_attr_e('Submit', 'message-board'); ?> " /> </p> <p> <label> <input type="checkbox" name="mb_topic_subscribe" value="<?php echo mb_is_user_subscribed_topic(mb_get_topic_author_id(), mb_get_topic_id()) ? 1 : 0; ?> " /> <?php _e('Notify me of follow-up posts via email', 'message-board'); ?> </label> </p> <input type="hidden" name="mb_topic_id" value="<?php echo absint(mb_get_topic_id()); ?> " /> <?php wp_nonce_field('mb_edit_topic_action', 'mb_edit_topic_nonce', false);
echo esc_url(get_the_author_meta('url'), mb_get_topic_author_id()); ?> "><?php _e('Web Site', 'message-board'); ?> </a> <?php } ?> <br /> <span class="mb-user-topic-count"><?php printf(__('Topics: %s', 'message-board'), mb_get_user_topic_count(mb_get_topic_author_id())); ?> </span> <br /> <span class="mb-user-reply-count"><?php printf(__('Replies: %s', 'message-board'), mb_get_user_reply_count(mb_get_topic_author_id())); ?> </span> </div><!-- .mb-author-info --> </div><!-- .mb-author-box --> <div class="mb-topic-content"> <?php mb_topic_content(); ?> </div><!-- .mb-topic-content --> </article> </li>