コード例 #1
0
ファイル: replies.php プロジェクト: joeyblake/bbpress
 /**
  * Print extra columns for the replies page
  *
  * @since 2.0.0 bbPress (r2577)
  *
  * @param string $column Column
  * @param int $reply_id reply id
  * @uses bbp_get_reply_topic_id() To get the topic id of the reply
  * @uses bbp_topic_title() To output the reply's topic title
  * @uses apply_filters() Calls 'reply_topic_row_actions' with an array
  *                        of reply topic actions
  * @uses bbp_get_topic_permalink() To get the topic permalink
  * @uses bbp_get_topic_forum_id() To get the forum id of the topic of
  *                                 the reply
  * @uses bbp_get_forum_permalink() To get the forum permalink
  * @uses admin_url() To get the admin url of post.php
  * @uses apply_filters() Calls 'reply_topic_forum_row_actions' with an
  *                        array of reply topic forum actions
  * @uses bbp_reply_author_display_name() To output the reply author name
  * @uses get_the_date() Get the reply creation date
  * @uses get_the_time() Get the reply creation time
  * @uses esc_attr() To sanitize the reply creation time
  * @uses bbp_get_reply_last_active_time() To get the time when the reply was
  *                                    last active
  * @uses do_action() Calls 'bbp_admin_replies_column_data' with the
  *                    column and reply id
  */
 public function column_data($column, $reply_id)
 {
     if ($this->bail()) {
         return;
     }
     // Get topic ID
     $topic_id = bbp_get_reply_topic_id($reply_id);
     // Populate Column Data
     switch ($column) {
         // Topic
         case 'bbp_reply_topic':
             // Output forum name
             if (!empty($topic_id)) {
                 // Topic Title
                 $topic_title = bbp_get_topic_title($topic_id);
                 if (empty($topic_title)) {
                     $topic_title = esc_html__('No Topic', 'bbpress');
                 }
                 // Output the title
                 echo $topic_title;
                 // Reply has no topic
             } else {
                 esc_html_e('No Topic', 'bbpress');
             }
             break;
             // Forum
         // Forum
         case 'bbp_reply_forum':
             // Get Forum ID's
             $reply_forum_id = bbp_get_reply_forum_id($reply_id);
             $topic_forum_id = bbp_get_topic_forum_id($topic_id);
             // Output forum name
             if (!empty($reply_forum_id)) {
                 // Forum Title
                 $forum_title = bbp_get_forum_title($reply_forum_id);
                 if (empty($forum_title)) {
                     $forum_title = esc_html__('No Forum', 'bbpress');
                 }
                 // Alert capable users of reply forum mismatch
                 if ($reply_forum_id !== $topic_forum_id) {
                     if (current_user_can('edit_others_replies') || current_user_can('moderate')) {
                         $forum_title .= '<div class="attention">' . esc_html__('(Mismatch)', 'bbpress') . '</div>';
                     }
                 }
                 // Output the title
                 echo $forum_title;
                 // Reply has no forum
             } else {
                 _e('No Forum', 'bbpress');
             }
             break;
             // Author
         // Author
         case 'bbp_reply_author':
             bbp_reply_author_display_name($reply_id);
             break;
             // Freshness
         // Freshness
         case 'bbp_reply_created':
             // Output last activity time and date
             printf('%1$s <br /> %2$s', get_the_date(), esc_attr(get_the_time()));
             break;
             // Do action for anything else
         // Do action for anything else
         default:
             do_action('bbp_admin_replies_column_data', $column, $reply_id);
             break;
     }
 }
コード例 #2
0
?>


	</div><!-- .bbp-topic-author -->

	<div class="bbp-topic-content entry">

        <div class="bbp-reply-header">

            <span class="bbp-reply-author-name">
                <a href="<?php 
bbp_reply_author_url(bbp_get_reply_id());
?>
">
                    <?php 
bbp_reply_author_display_name(bbp_get_reply_id());
?>
                </a>
            </span>

            <?php 
if (bbp_is_user_keymaster()) {
    ?>
                <?php 
    do_action('bbp_theme_before_topic_author_admin_details');
    ?>
                <span class="bbp-reply-ip"><?php 
    bbp_author_ip(bbp_get_topic_id());
    ?>
</span>
                <?php 
コード例 #3
0
                <div class="td-reply">
                    <div class="td-reply-author-thumb">
                        <?php 
            bbp_reply_author_link(array('show_role' => true, 'type' => 'avatar', 'size' => 50));
            ?>
                    </div>
                    <div class="td-reply-desc">
                        <div class="td-reply-header">
                            <!-- author -->
                            <div class="td-reply-author">
                                <a href="<?php 
            bbp_reply_author_url();
            ?>
"><?php 
            bbp_reply_author_display_name();
            ?>
</a>
                            </div>

                            <!-- permalinks and post controls -->
                            <div class="td-reply-controls">
                                <a href="<?php 
            bbp_reply_url();
            ?>
" class="bbp-reply-permalink">#<?php 
            bbp_reply_id();
            ?>
</a>
                                <?php 
            do_action('bbp_theme_before_reply_admin_links');
コード例 #4
0
 /**
  * Output the contents of the `bbp_topic_reply_author` column
  *
  * @since 2.6.0 bbPress (r5886)
  */
 public function column_bbp_topic_reply_author($item = '')
 {
     bbp_reply_author_avatar($item->ID, 50);
     bbp_reply_author_display_name($item->ID);
     echo '<br>';
     bbp_reply_author_email($item->ID);
     echo '<br>';
     bbp_author_ip(array('post_id' => $item->ID));
 }