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


PHP bp_activity_has_content函数代码示例

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


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

示例1: buddyboss_global_search_activity_intro

/**
 * Returns a trimmed activity content string.
 * Must be used while inside activity loop
 */
function buddyboss_global_search_activity_intro($character_limit = 50)
{
    $content = '';
    if (bp_activity_has_content()) {
        $content = bp_get_activity_content_body();
        if ($content) {
            $content = wp_strip_all_tags($content, true);
            $shortened_content = substr($content, 0, $character_limit);
            if (strlen($content) > $character_limit) {
                $shortened_content .= '...';
            }
            $content = $shortened_content;
        }
    }
    return apply_filters('buddyboss_global_search_activity_intro', $content);
}
开发者ID:tvolmari,项目名称:hammydowns,代码行数:20,代码来源:functions.php

示例2: _e

"><?php 
    _e('View', 'firmasite');
    ?>
</a>
            </div>
    
        <?php 
}
?>
    </div>

	<div class="activity-content">


		<?php 
if (bp_activity_has_content()) {
    ?>

			<div class="activity-inner fs-have-thumbnail">

				<?php 
    bp_activity_content_body();
    ?>

			</div>

		<?php 
}
?>

		<?php 
开发者ID:paulmedwal,项目名称:edxforumspublic,代码行数:31,代码来源:entry.php

示例3: unpin_activity

    /**
     *
     */
    function unpin_activity()
    {
        global $wpdb;
        $nonce = isset($_REQUEST['nonces']) ? sanitize_text_field($_REQUEST['nonces']) : 0;
        if (!wp_verify_nonce($nonce, 'pin-activity-nonce')) {
            exit(__('Not permitted', RW_Sticky_Activity::$textdomain));
        }
        $activityID = isset($_REQUEST['id']) && is_numeric($_REQUEST['id']) ? $_REQUEST['id'] : '';
        if ($activityID != '') {
            bp_activity_update_meta($activityID, 'rw_sticky_activity', 0);
        }
        $meta_query_args = array('relation' => 'AND', array('key' => 'rw_sticky_activity', 'value' => '1', 'compare' => '='));
        if (function_exists('bb_bp_activity_url_filter')) {
            // deactivate BuddyBoss Wall activity url preview
            remove_action('bp_get_activity_content_body', 'bb_bp_activity_url_filter');
        }
        add_filter('bp_activity_excerpt_length', function () {
            return 99999;
        });
        if (bp_has_activities(array('meta_query' => $meta_query_args))) {
            ?>
            <?php 
            while (bp_activities()) {
                bp_the_activity();
                ?>
                <div class="buddypress-sa">
                    <div id="factivity-stream">
                        <div class="activity-list">
                            <div class="activity-content" style="margin-left: 0px;">
                                <?php 
                $nonce = wp_create_nonce('pin-activity-nonce');
                $title = __('Unpin activity', RW_Sticky_Activity::$textdomain);
                $class = "sa-button-unpin  pinned";
                ?>
                                <a href="" class="fa fa-map-marker icon-button sa-button <?php 
                echo $class;
                ?>
" title="<?php 
                echo $title;
                ?>
" data-post-nonces="<?php 
                echo $nonce;
                ?>
" data-post-id="<?php 
                echo bp_get_activity_id();
                ?>
"></a>
                                <?php 
                if (bp_activity_has_content() && bp_get_activity_type() != 'bbp_topic_create' && bp_get_activity_type() != 'bbp_reply_create') {
                    ?>
                                    <div class="activity-inner">
                                        <?php 
                    bp_activity_content_body();
                    ?>
                                    </div>
                                <?php 
                }
                ?>
                                <?php 
                if (bp_get_activity_type() == 'bp_doc_edited') {
                    ?>
                                    <div class="activity-inner"><p>
                                            <?php 
                    $doc = get_post(url_to_postid(bp_get_activity_feed_item_link()));
                    echo __('Doc: ', RW_Sticky_Activity::$textdomain);
                    echo "<a href='" . get_permalink($doc->ID) . "'>";
                    echo $doc->post_title;
                    echo "</a>";
                    ?>
</p>
                                    </div>
                                    <?php 
                }
                // New forum topic created
                if (bp_get_activity_type() == 'bbp_topic_create') {
                    // url_to_postid fails on permalinks like http://gruppen.domain.tld/groups/frank-testgruppe/forum/topic/neues-thema/ !!!
                    ?>
                                    <div class="activity-inner"><p>
                                            <?php 
                    $link = bp_get_activity_feed_item_link();
                    $guid = substr($link, strpos($link, "/forum/topic") + 6);
                    $topicid = $wpdb->get_var($wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE guid like '%%%s%%'", $guid));
                    $topic = get_post($topicid);
                    echo __('Forum new topic: ', RW_Sticky_Activity::$textdomain);
                    echo "<a href='" . get_permalink($topic->ID) . "'> ";
                    echo $topic->post_title;
                    echo "</a><br>";
                    ?>
</p>
                                    </div>
                                    <?php 
                }
                // New forum reply
                if (bp_get_activity_type() == 'bbp_reply_create') {
                    // url_to_postid fails on permalinks like http://gruppen.domain.tld/groups/frank-testgruppe/forum/topic/neues-thema/ !!!
                    ?>
                                    <div class="activity-inner"><p>
//.........这里部分代码省略.........
开发者ID:rpi-virtuell,项目名称:rw-sticky-activity,代码行数:101,代码来源:RW_Sticky_Activity_Core.php

示例4: swa_activity_entry

function swa_activity_entry($show_avatar = false)
{
    ?>
 <?php 
    do_action('bp_before_activity_entry');
    ?>
    <li class="<?php 
    bp_activity_css_class();
    ?>
" id="activity-<?php 
    bp_activity_id();
    ?>
">
            <?php 
    if ($show_avatar == "yes") {
        ?>
                      <div class="swa-activity-avatar">
                            <a href="<?php 
        bp_activity_user_link();
        ?>
">
                                    <?php 
        bp_activity_avatar('type=thumb&width=50&height=50');
        ?>
                            </a>

                    </div>
           <?php 
    }
    ?>
          <div class="swa-activity-content">
		<div class="swa-activity-header">
			<?php 
    bp_activity_action();
    ?>
		</div>

		<?php 
    if (bp_activity_has_content()) {
        ?>
			<div class="swa-activity-inner">
				<?php 
        bp_activity_content_body();
        ?>
			</div>
		<?php 
    }
    ?>

	<?php 
    do_action('bp_activity_entry_content');
    ?>
	<div class="swa-activity-meta">
            <?php 
    if (is_user_logged_in() && bp_activity_can_comment()) {
        ?>
				<a href="<?php 
        bp_activity_comment_link();
        ?>
" class="acomment-reply" id="acomment-comment-<?php 
        bp_activity_id();
        ?>
"><?php 
        _e('Reply', 'buddypress');
        ?>
 (<span><?php 
        bp_activity_comment_count();
        ?>
</span>)</a>
			<?php 
    }
    ?>
            <?php 
    if (is_user_logged_in()) {
        ?>
		<?php 
        if (!bp_get_activity_is_favorite()) {
            ?>
                    <a href="<?php 
            bp_activity_favorite_link();
            ?>
" class="fav" title="<?php 
            _e('Mark as Favorite', 'swa');
            ?>
"><?php 
            _e('Favorite', 'swa');
            ?>
</a>
		<?php 
        } else {
            ?>
                    <a href="<?php 
            bp_activity_unfavorite_link();
            ?>
" class="unfav" title="<?php 
            _e('Remove Favorite', 'swa');
            ?>
"><?php 
            _e('Remove Favorite', 'swa');
            ?>
//.........这里部分代码省略.........
开发者ID:picassentviu,项目名称:AMMPro,代码行数:101,代码来源:bp-sitewide-activity.php

示例5: do_action

<?php do_action( 'bp_before_activity_entry' ) ?>

<li class="<?php bp_activity_css_class() ?>" id="activity-<?php bp_activity_id() ?>">
	<div class="activity-avatar">
		<a href="<?php bp_activity_user_link() ?>">
			<?php bp_activity_avatar( 'type=full&width=100&height=100' ) ?>
		</a>
	</div>

	<div class="activity-content">

		<div class="activity-header">
			<?php bp_activity_action() ?>
		</div>

		<?php if ( bp_activity_has_content() ) : ?>
			<div class="activity-inner">
				<?php bp_activity_content_body() ?>
			</div>
		<?php endif; ?>

		<?php do_action( 'bp_activity_entry_content' ) ?>

		<div class="activity-meta">
			<?php if ( is_user_logged_in() && bp_activity_can_comment() ) : ?>
				<a href="<?php bp_activity_comment_link() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Reply', 'buddypress' ) ?> (<span><?php bp_activity_comment_count() ?></span>)</a>
			<?php endif; ?>

			<?php if ( is_user_logged_in() ) : ?>
				<?php if ( !bp_get_activity_is_favorite() ) : ?>
					<a href="<?php bp_activity_favorite_link() ?>" class="fav" title="<?php _e( 'Mark as Favorite', 'buddypress' ) ?>"><?php _e( 'Favorite', 'buddypress' ) ?></a>
开发者ID:n-sane,项目名称:zaroka,代码行数:31,代码来源:entry.php

示例6: framework

        /**
         * Do widget framework.
         *
         * @param array $instance The settings for the particular instance of the widget.
         */
        public static function framework($instance)
        {
            global $gs_counter, $processed_activities;
            genesis_markup(array('html5' => '<article %s>', 'xhtml' => sprintf('<div class="%s">', implode(' ', get_post_class())), 'context' => 'entry'));
            $settings = get_option('widget_featured-content');
            if (!isset($settings[3]['buddypress-group']) || 1 != $settings[3]['buddypress-group']) {
                GS_Featured_Content::action('thememixfc_before_post_content', $instance);
                GS_Featured_Content::action('thememixfc_post_content', $instance);
                GS_Featured_Content::action('thememixfc_after_post_content', $instance);
            } else {
                if (!isset($processed_activities)) {
                    $processed_activities = array();
                }
                $group_id = $settings[3]['buddypress-group-group'];
                if (bp_has_activities(bp_ajax_querystring('activity') . '&primary_id=' . $group_id)) {
                    while (bp_activities()) {
                        bp_the_activity();
                        $url = trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/');
                        $fontawesome_position = $settings[3]['fontawesome-position'];
                        $activity_id = bp_get_activity_id();
                        if (!in_array($activity_id, $processed_activities) && !isset($done)) {
                            // Get image HTML
                            if (isset($settings[3]['show_image']) && 1 == $settings[3]['show_image']) {
                                $size = $settings[3]['image_size'];
                                $image_html = bp_get_activity_avatar('type=' . $size);
                                // Add image link to image HTML
                                if (isset($settings[3]['link_image']) && 1 == $settings[3]['link_image']) {
                                    $image_html = '<a href="' . esc_attr(bp_get_activity_user_link()) . '">' . $image_html . '</a>';
                                }
                            }
                            echo '
						<article itemscope="itemscope" itemtype="http://schema.org/Event">';
                            if (isset($settings[3]['image_position']) && 'before-title' == $settings[3]['image_position']) {
                                echo $image_html;
                            }
                            if ('before_title' == $fontawesome_position) {
                                echo thememixfc_span_fontawesome();
                            }
                            echo '
							<h2 class="entry-title">';
                            if ('inline_before_title' == $fontawesome_position) {
                                echo thememixfc_span_fontawesome();
                            }
                            echo '
								<a href="' . esc_url($url) . '" title="' . esc_attr($group->name) . '">' . esc_html($group->name) . '</a>';
                            if ('inline_after_title' == $fontawesome_position) {
                                echo thememixfc_span_fontawesome();
                            }
                            echo '
							</h2>';
                            if ('after_title' == $fontawesome_position) {
                                echo thememixfc_span_fontawesome();
                            }
                            if (isset($settings[3]['image_position']) && 'after-title' == $settings[3]['image_position']) {
                                echo $image_html;
                            }
                            if (bp_activity_has_content()) {
                                bp_activity_content_body();
                            }
                            if (isset($settings[3]['image_position']) && 'after-content' == $settings[3]['image_position']) {
                                echo $image_html;
                            }
                            echo '
						</article>';
                            $processed_activities[] = $activity_id;
                            $done = true;
                        }
                    }
                }
            }
            $gs_counter++;
            genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>'));
        }
开发者ID:ryanhellyer,项目名称:thememix-pro-genesis,代码行数:78,代码来源:widget.php

示例7: gears_get_activity_stream

 /**
  * @deprecated gears_get_activity_stream
  */
 function gears_get_activity_stream()
 {
     $output = '';
     $output .= '<li class="' . bp_get_activity_css_class() . '" id="activity-' . bp_get_activity_id() . '">';
     $output .= '<div class="activity-avatar">';
     $output .= '<a class="gears-activity-avatar" title="' . __('View Profile', 'gears') . '" href="' . bp_get_activity_user_link() . '">';
     $output .= bp_get_activity_avatar();
     $output .= '</a>';
     $output .= '</div>';
     // activity content
     $output .= '<div class="activity-content">';
     $output .= '<div class="activity-header">';
     $output .= bp_get_activity_action();
     $output .= '</div>';
     $output .= '<div class="activity-inner">';
     if (bp_activity_has_content()) {
         $output .= bp_get_activity_content_body();
     }
     $output .= '</div>';
     do_action('bp_activity_entry_content');
     $output .= '<div class="activity-meta">';
     if (bp_get_activity_type() == 'activity_comment') {
         $output .= '<a href="' . bp_get_activity_thread_permalink() . '" class="view bp-secondary-action" title="' . __('View Conversation', 'gears') . '">' . __('View Conversation', 'gears') . '</a>';
     }
     if (is_user_logged_in()) {
         if (bp_activity_can_favorite()) {
             if (!bp_get_activity_is_favorite()) {
                 $output .= '<a href="' . bp_get_activity_favorite_link() . '" class="fav bp-secondary-action" title="' . esc_attr(__('Mark as Favorite', 'gears')) . '">' . __('Favorite', 'gears') . '</a>';
             } else {
                 $output .= '<a href="' . bp_get_activity_unfavorite_link() . '" class="unfav bp-secondary-action" title="' . esc_attr(__('Remove Favorite', 'gears')) . '">' . __('Remove Favorite', 'gears') . '</a>';
             }
         }
         if (bp_activity_user_can_delete()) {
             $output .= bp_get_activity_delete_link();
         }
         do_action('bp_activity_entry_meta');
     }
     $output .= '</div>';
     if (bp_get_activity_type() == 'activity_comment') {
         $output .= '<a href="' . bp_get_activity_thread_permalink() . '" class="view bp-secondary-action" title="' . __('View Conversation', 'gears') . '">' . __('View Conversation', 'gears');
     }
     // end bp_get_activity_type()
     $output .= '</div>';
     // end activity content
     $output .= '</li>';
     return $output;
 }
开发者ID:poweronio,项目名称:mbsite,代码行数:50,代码来源:library.php

示例8: themefix_buddypress_groups_widget

function themefix_buddypress_groups_widget($settings, $key, $group)
{
    global $gs_counter, $processed_activities;
    if (!isset($processed_activities)) {
        $processed_activities = array();
    }
    $group_id = $settings[$key]['buddypress-group-group'];
    $group = groups_get_group(array('group_id' => $group_id));
    if (bp_has_activities(bp_ajax_querystring('activity') . '&primary_id=' . $group_id)) {
        while (bp_activities()) {
            bp_the_activity();
            $url = trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/');
            $fontawesome_position = $settings[$key]['fontawesome-position'];
            $activity_id = bp_get_activity_id();
            if (!in_array($activity_id, $processed_activities) && !isset($done)) {
                // Get image HTML
                if (isset($settings[$key]['show_image']) && 1 == $settings[$key]['show_image']) {
                    $size = $settings[$key]['image_size'];
                    $image_html = bp_get_activity_avatar('type=' . $size);
                    // Add image link to image HTML
                    if (isset($settings[$key]['link_image']) && 1 == $settings[$key]['link_image']) {
                        if ('' == $settings[$key]['gravatar_alignment']) {
                            $alignment = 'alignnone';
                        } else {
                            $alignment = $settings[$key]['gravatar_alignment'];
                        }
                        $image_html = '<a href="' . esc_attr(bp_get_activity_user_link()) . '"><span class="' . esc_attr($alignment) . '">' . $image_html . '</span></a>';
                    }
                }
                echo '
				<article itemscope="itemscope" itemtype="http://schema.org/Event">';
                if (isset($settings[$key]['image_position']) && 'before-title' == $settings[$key]['image_position']) {
                    echo $image_html;
                }
                if ('before_title' == $fontawesome_position) {
                    thememix_featured_content_span_fontawesome($key);
                }
                echo '
					<h2 class="entry-title">';
                echo '
						<a href="' . esc_url($url) . '" title="' . esc_attr($group->name) . '">';
                if ('inline_before_title' == $fontawesome_position) {
                    thememix_featured_content_span_fontawesome($key, true);
                    echo ' ';
                }
                echo esc_html($group->name);
                if ('inline_after_title' == $fontawesome_position) {
                    echo ' ';
                    thememix_featured_content_span_fontawesome($key, true);
                }
                echo '</a>';
                echo '
					</h2>';
                if ('after_title' == $fontawesome_position) {
                    thememix_featured_content_span_fontawesome($key);
                }
                if (isset($settings[$key]['image_position']) && 'after-title' == $settings[$key]['image_position']) {
                    echo $image_html;
                }
                if (bp_activity_has_content()) {
                    bp_activity_content_body();
                }
                if (isset($settings[$key]['image_position']) && 'after-content' == $settings[$key]['image_position']) {
                    echo $image_html;
                }
                echo '
				</article>';
                $processed_activities[] = $activity_id;
                $done = true;
            }
        }
    }
}
开发者ID:ThemeMix,项目名称:thememix-pro-genesis,代码行数:73,代码来源:buddypress-groups.php


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