当前位置: 首页>>代码示例>>PHP>>正文


PHP bp_the_thread_message_content函数代码示例

本文整理汇总了PHP中bp_the_thread_message_content函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_the_thread_message_content函数的具体用法?PHP bp_the_thread_message_content怎么用?PHP bp_the_thread_message_content使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了bp_the_thread_message_content函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: bp_legacy_theme_ajax_messages_send_reply

/**
 * Send a private message reply to a thread via a POST request.
 *
 * @return string HTML
 * @since BuddyPress (1.2)
 */
function bp_legacy_theme_ajax_messages_send_reply()
{
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    check_ajax_referer('messages_send_message');
    $result = messages_new_message(array('thread_id' => (int) $_REQUEST['thread_id'], 'content' => $_REQUEST['content']));
    if (!empty($result)) {
        // pretend we're in the message loop
        global $thread_template;
        bp_thread_has_messages(array('thread_id' => (int) $_REQUEST['thread_id']));
        // set the current message to the 2nd last
        $thread_template->message = end($thread_template->thread->messages);
        $thread_template->message = prev($thread_template->thread->messages);
        // set current message to current key
        $thread_template->current_message = key($thread_template->thread->messages);
        // now manually iterate message like we're in the loop
        bp_thread_the_message();
        // manually call oEmbed
        // this is needed because we're not at the beginning of the loop
        bp_messages_embed();
        ?>

		<div class="message-box new-message <?php 
        bp_the_thread_message_css_class();
        ?>
">
			<div class="message-metadata">
				<?php 
        /**
         * Fires before the single message header is displayed.
         *
         * @since BuddyPress (1.1.0)
         */
        do_action('bp_before_message_meta');
        ?>
				<?php 
        echo bp_loggedin_user_avatar('type=thumb&width=30&height=30');
        ?>

				<strong><a href="<?php 
        echo bp_loggedin_user_domain();
        ?>
"><?php 
        bp_loggedin_user_fullname();
        ?>
</a> <span class="activity"><?php 
        printf(__('Sent %s', 'buddypress'), bp_core_time_since(bp_core_current_time()));
        ?>
</span></strong>

				<?php 
        /**
         * Fires after the single message header is displayed.
         *
         * @since BuddyPress (1.1.0)
         */
        do_action('bp_after_message_meta');
        ?>
			</div>

			<?php 
        /**
         * Fires before the message content for a private message.
         *
         * @since BuddyPress (1.1.0)
         */
        do_action('bp_before_message_content');
        ?>

			<div class="message-content">
				<?php 
        bp_the_thread_message_content();
        ?>
			</div>

			<?php 
        /**
         * Fires after the message content for a private message.
         *
         * @since BuddyPress (1.1.0)
         */
        do_action('bp_after_message_content');
        ?>

			<div class="clear"></div>
		</div>
	<?php 
        // clean up the loop
        bp_thread_messages();
    } else {
        echo "-1<div id='message' class='error'><p>" . __('There was a problem sending that reply. Please try again.', 'buddypress') . '</p></div>';
    }
//.........这里部分代码省略.........
开发者ID:kosir,项目名称:thatcamp-org,代码行数:101,代码来源:buddypress-functions.php

示例2: do_action

          <?php 
        /** This action is documented in bp-templates/bp-legacy/buddypress-functions.php */
        do_action('bp_after_message_meta');
        ?>

        </div><!-- .message-metadata -->

        <?php 
        /** This action is documented in bp-templates/bp-legacy/buddypress-functions.php */
        do_action('bp_before_message_content');
        ?>

        <div class="message-content">

          <?php 
        bp_the_thread_message_content();
        ?>

        </div><!-- .message-content -->

        <?php 
        /** This action is documented in bp-templates/bp-legacy/buddypress-functions.php */
        do_action('bp_after_message_content');
        ?>

        <div class="clear"></div>

      </div><!-- .message-box -->

    <?php 
    }
开发者ID:hakkens,项目名称:davehakkens,代码行数:31,代码来源:single.php

示例3: do_action

				<div class="message-metadata">

					<?php do_action( 'bp_before_message_meta' ) ?>

					<?php bp_the_thread_message_sender_avatar( 'type=thumb&width=30&height=30' ) ?>
					<strong><a href="<?php bp_the_thread_message_sender_link() ?>" title="<?php bp_the_thread_message_sender_name() ?>"><?php bp_the_thread_message_sender_name() ?></a> <span class="activity"><?php bp_the_thread_message_time_since() ?></span></strong>

					<?php do_action( 'bp_after_message_meta' ) ?>

				</div><!-- .message-metadata -->

				<?php do_action( 'bp_before_message_content' ) ?>

				<div class="message-content">

					<?php bp_the_thread_message_content() ?>

				</div><!-- .message-content -->

				<?php do_action( 'bp_after_message_content' ) ?>

				<div class="clear"></div>

			</div><!-- .message-box -->

		<?php endwhile; ?>

		<?php do_action( 'bp_after_message_thread_list' ) ?>

		<?php do_action( 'bp_before_message_thread_reply' ) ?>
开发者ID:n-sane,项目名称:zaroka,代码行数:30,代码来源:single.php


注:本文中的bp_the_thread_message_content函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。