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


PHP bp_is_activity_component函数代码示例

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


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

示例1: bebop_feeds

function bebop_feeds()
{
    global $bp, $wp_query, $this_bp_feed;
    if (bp_is_activity_component()) {
        $active_extensions = bebop_extensions::bebop_get_active_extension_names();
        $active_extensions[] = 'all_oers';
        foreach ($active_extensions as $extension) {
            if (bp_current_action() == $extension) {
                if ($extension == 'all_oers') {
                    $this_bp_feed = $extension;
                } else {
                    if (bebop_tables::check_option_exists('bebop_' . $extension . '_rss_feed')) {
                        if (bebop_tables::get_option_value('bebop_' . $extension . '_rss_feed') == 'on') {
                            $this_bp_feed = $extension;
                        }
                    }
                }
            }
        }
    }
    if (empty($this_bp_feed)) {
        return false;
    }
    $wp_query->is_404 = false;
    status_header(200);
    include_once 'templates/user/bebop-feed-template.php';
    die;
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:28,代码来源:bebop-feeds.php

示例2: register_plugin_scripts

 function register_plugin_scripts()
 {
     if (bp_is_activity_component() || bp_is_group_home()) {
         wp_enqueue_script('bp-reshare-js', BP_RESHARE_PLUGIN_URL_JS . '/reshare.js', array('jquery'), 0, 1);
         BP_Reshare::localize_script();
     }
 }
开发者ID:KristianI,项目名称:bp-reshare,代码行数:7,代码来源:bp-reshare-component.php

示例3: bp_follow_add_activity_scope_filter

/**
 * Filter the activity loop when we're on a "Following" page
 *
 * This is done:
 *   - On the activity directory and clicking on the "Following" tab
 *   - On a user's "Activity > Following" page
 *
 * @since 1.0.0
 *
 * @param string|array Current activity querystring
 * @param string $object The current object or component
 * @return array
 */
function bp_follow_add_activity_scope_filter($qs, $object)
{
    global $bp;
    // not on the activity object? stop now!
    if ($object != 'activity') {
        return $qs;
    }
    $set = false;
    // activity directory
    // can't use bp_is_activity_directory() yet since that's a BP 2.0 function
    if (!bp_displayed_user_id() && bp_is_activity_component() && !bp_current_action()) {
        // check if activity scope is following before manipulating
        if (isset($_COOKIE['bp-activity-scope']) && 'following' === $_COOKIE['bp-activity-scope']) {
            $set = true;
        }
        // user's activity following page
    } elseif (bp_is_user_activity() && bp_is_current_action('following')) {
        $set = true;
    }
    // not on a user page? stop now!
    if (!$set) {
        return $qs;
    }
    // set internal marker noting that our activity scope is applied
    $bp->follow->activity_scope_set = 1;
    $qs = wp_parse_args($qs);
    $following_ids = bp_get_following_ids(array('user_id' => bp_displayed_user_id() ? bp_displayed_user_id() : bp_loggedin_user_id()));
    // if $following_ids is empty, pass a negative number so no activity can be found
    $following_ids = empty($following_ids) ? -1 : $following_ids;
    $qs['user_id'] = $following_ids;
    return apply_filters('bp_follow_add_activity_scope_filter', $qs, false);
}
开发者ID:wesavetheworld,项目名称:buddypress-followers,代码行数:45,代码来源:activity-scope.php

示例4: lsx_buddypress_page_columns

/**
 * Forces the BP Profile Pages to be 1 Column
 * 
 * @package lsx
 * @subpackage jetpack
 * @category infinite scroll
 */
function lsx_buddypress_page_columns($layout)
{
    if (bp_is_profile_component() || bp_is_settings_component() || bp_is_activity_component() || bp_is_group() || bp_is_messages_component() || bp_is_members_directory() || bp_is_groups_directory() || bp_is_groups_component() || bp_is_members_component()) {
        $layout = '1c';
    }
    return $layout;
}
开发者ID:LinaPeterssonOberg,项目名称:exam,代码行数:14,代码来源:buddypress.php

示例5: load_scripts

 function load_scripts()
 {
     wp_enqueue_script('gwa-user', AGM_PLUGIN_URL . '/js/gwa-user.js');
     if (bp_is_activity_component()) {
         add_thickbox();
     }
 }
开发者ID:hscale,项目名称:webento,代码行数:7,代码来源:agm-geotag_bp.php

示例6: bp_reshare_is_user_profile_reshares

function bp_reshare_is_user_profile_reshares()
{
    if (bp_is_activity_component() && bp_displayed_user_id() && bp_is_current_action('reshares')) {
        return true;
    } else {
        return false;
    }
}
开发者ID:KristianI,项目名称:bp-reshare,代码行数:8,代码来源:bp-reshare-functions.php

示例7: test_member_activity_page

 public function test_member_activity_page()
 {
     $url = home_url($this->u->user_nicename) . '/' . bp_get_activity_slug();
     $this->go_to($url);
     $this->assertTrue(bp_is_user());
     $this->assertTrue(bp_is_my_profile());
     $this->assertEquals($this->u->ID, bp_displayed_user_id());
     $this->assertTrue(bp_is_activity_component());
 }
开发者ID:JeroenNouws,项目名称:BuddyPress,代码行数:9,代码来源:root-profiles.php

示例8: bphelp_pbpp_redirect

function bphelp_pbpp_redirect()
{
    global $bp;
    //IMPORTANT: Do not alter the following line.
    $bphelp_my_redirect_slug = get_option('bphelp-my-redirect-slug', 'register');
    if (bp_is_activity_component() || bp_is_groups_component() || bp_is_group_forum() || bbp_is_single_forum() || bbp_is_single_topic() || bp_is_forums_component() || bp_is_blogs_component() || bp_is_members_component() || bp_is_profile_component()) {
        if (!is_user_logged_in()) {
            bp_core_redirect(get_option('home') . '/' . $bphelp_my_redirect_slug);
        }
    }
}
开发者ID:pausaura,项目名称:agora_nodes,代码行数:11,代码来源:private-bp-pages.php

示例9: bp_reshare_add_reshare_button

function bp_reshare_add_reshare_button()
{
    global $bp;
    if (!is_user_logged_in()) {
        return false;
    }
    $activity_types_resharable = bp_reshare_activity_types();
    if (!in_array(bp_get_activity_type(), $activity_types_resharable)) {
        return false;
    }
    if (bp_reshare_activity_is_hidden()) {
        return false;
    }
    if (bp_reshare_is_user_profile_reshares() && $bp->displayed_user->id != $bp->loggedin_user->id) {
        return false;
    }
    $activity_first_id = bp_get_activity_id();
    if ('reshare_update' == bp_get_activity_type()) {
        $activity_first_id = bp_get_activity_secondary_item_id();
    }
    $rs_count = bp_activity_get_meta($activity_first_id, 'reshared_count');
    $rs_count = !empty($rs_count) ? $rs_count : 0;
    if ($bp->loggedin_user->id == bp_get_activity_user_id() || bp_reshare_user_did_reshared($activity_first_id)) {
        $reshared_class = 'reshared';
    }
    $action_url = wp_nonce_url(bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/?to_reshare=' . $activity_first_id, '_reshare_update');
    if ($_POST['scope'] == 'reshares' || bp_reshare_is_user_profile_reshares() || bp_is_activity_component() && !bp_displayed_user_id() && $_COOKIE['bp-activity-scope'] == 'reshares') {
        $extra_class = 'unshare';
        $action_url = wp_nonce_url(bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/?delete_reshare=' . bp_get_activity_id(), '_reshare_delete');
    }
    ?>
	
	<a href="<?php 
    echo $action_url;
    ?>
" class="button bp-primary-action bp-agu-reshare" id="bp-agu-reshare-<?php 
    bp_activity_id();
    ?>
" rel="<?php 
    echo $activity_first_id;
    ?>
"><span class="bp-agu-reshare-img <?php 
    echo $reshared_class . ' ' . $extra_class;
    ?>
"></span><span class="rs-count"><?php 
    echo $rs_count;
    ?>
</span></a>
	<?php 
}
开发者ID:KristianI,项目名称:bp-reshare,代码行数:50,代码来源:bp-reshare-screens.php

示例10: bp_activity_maybe_load_mentions_scripts

/**
 * Should BuddyPress load the mentions scripts and related assets, including results to prime the
 * mentions suggestions?
 *
 * @since 2.1.0
 *
 * @return bool True if mentions scripts should be loaded.
 */
function bp_activity_maybe_load_mentions_scripts()
{
    $mentions_enabled = bp_activity_do_mentions() && bp_is_user_active();
    $load_mentions = $mentions_enabled && (bp_is_activity_component() || is_admin());
    /**
     * Filters whether or not BuddyPress should load mentions scripts and assets.
     *
     * @since 2.1.0
     *
     * @param bool $load_mentions    True to load mentions assets, false otherwise.
     * @param bool $mentions_enabled True if mentions are enabled.
     */
    return (bool) apply_filters('bp_activity_maybe_load_mentions_scripts', $load_mentions, $mentions_enabled);
}
开发者ID:humanmade,项目名称:BuddyPress,代码行数:22,代码来源:bp-activity-functions.php

示例11: dt_theme_bbpress_title

function dt_theme_bbpress_title(){
	global $bp;
	$doctitle = "";
	$separator = dttheme_option ( 'seo', 'title-delimiter' );
	$id = 0;

	if ( !empty( $bp->displayed_user->fullname ) ) {
		
		$blog_title = preg_replace ( "~(?:\[/?)[^/\]]+/?\]~s", '', get_option ( 'blogname' ));
		$title =  bp_current_component() === "profile" ? __("Profile","dt_themes") : __("Member","dt_themes");
		$subtitle = strip_tags( $bp->displayed_user->fullname );
		$doctitle = $blog_title.' '.$separator.' '.$title.' '.$separator.' '.$subtitle.' '.$separator;

	} elseif( bp_is_members_component() ) {
		$id = $bp->pages->members->id;
	}elseif( bp_is_activity_component() ){
		$id = $bp->pages->activity->id;
	}elseif( bp_current_component() === "groups" ) {
		$id = $bp->pages->groups->id;
	}elseif( bp_current_component() === "register" ) {
		$id = $bp->pages->register->id;
	}elseif( bp_current_component() === "activate" ) {
		$id = $bp->pages->activate->id;
	}
	if( $id > 0 ){
		global $post;
		$args = array (
			"blog_title" => preg_replace ( "~(?:\[/?)[^/\]]+/?\]~s", '', get_option ( 'blogname' ) ),
			"blog_description" => get_bloginfo ( 'description' ),
			"post_title" => ! empty ( $post ) ? $post->post_title : NULL,
			"post_author_nicename" => ! empty ( $nickname ) ? ucwords ( $nickname ) : NULL,
			"post_author_firstname" => ! empty ( $first_name ) ? ucwords ( $first_name ) : NULL,
			"post_author_lastname" => ! empty ( $last_name ) ? ucwords ( $last_name ) : NULL,
			"post_author_dsiplay" => ! empty ( $display_name ) ? ucwords ( $display_name ) : NULL );
		$args = array_filter ( $args );

		$doctitle = get_post_meta ( $id, '_seo_title', true );
		if (empty ( $doctitle )) :
			$options = is_array ( dttheme_option ( 'seo', 'page-title-format' ) ) ? dttheme_option ( 'seo', 'page-title-format' ) : array ();
			foreach ( $options as $option ) :
				if (array_key_exists ( $option, $args ))
					$doctitle .= $args [$option] . ' ' . $separator . ' ';
			endforeach;
		endif;

	}	
	
	return $doctitle;
}
开发者ID:namnguyen2312,项目名称:spa,代码行数:49,代码来源:utils.php

示例12: logged_out_redirect

function logged_out_redirect()
{
    global $bp;
    // BuddyPress components to lock
    if (bp_is_activity_component() || bp_is_groups_component() || bp_is_group_forum() || bp_is_forums_component() || bp_is_blogs_component() || bp_is_page(BP_MEMBERS_SLUG) || bp_is_profile_component()) {
        // Check if user is logged out
        if (!is_user_logged_in()) {
            // Check if a page was selected for redirection
            if (of_get_option('redirect')) {
                $redirect_page = get_permalink(of_get_option('redirect'));
                // If not redirect to login page
            } else {
                $redirect_page = site_url('/wp-login.php');
            }
            wp_redirect($redirect_page);
            exit;
        }
    }
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:19,代码来源:private-bp.php

示例13: bp_checkins_is_activity_or_friends

function bp_checkins_is_activity_or_friends()
{
    if ((int) bp_get_option('bp-checkins-disable-activity-checkins') && (!(int) bp_get_option('bp-checkins-activate-component') || '' == bp_get_option('bp-checkins-activate-component'))) {
        return false;
    }
    if ((int) bp_get_option('bp-checkins-disable-activity-checkins') && bp_is_activity_component() && !bp_is_single_activity()) {
        return false;
    }
    if ((int) bp_get_option('bp-checkins-disable-activity-checkins') && bp_is_group_home()) {
        return false;
    }
    if (!bp_checkins_show_friends_checkins() && bp_displayed_user_id() && bp_is_friends_component()) {
        return false;
    }
    if (bp_is_group_home() || bp_is_activity_component() || bp_displayed_user_id() && bp_is_friends_component()) {
        return true;
    } else {
        return false;
    }
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:20,代码来源:bp-checkins-shared.php

示例14: is_activity

 /**
  * Set up the theme compatibility hooks, if we're looking at an activity page.
  *
  * @since 1.7.0
  */
 public function is_activity()
 {
     // Bail if not looking at a group.
     if (!bp_is_activity_component()) {
         return;
     }
     // Activity Directory.
     if (!bp_displayed_user_id() && !bp_current_action()) {
         bp_update_is_directory(true, 'activity');
         /** This action is documented in bp-activity/bp-activity-screens.php */
         do_action('bp_activity_screen_index');
         add_filter('bp_get_buddypress_template', array($this, 'directory_template_hierarchy'));
         add_action('bp_template_include_reset_dummy_post_data', array($this, 'directory_dummy_post'));
         add_filter('bp_replace_the_content', array($this, 'directory_content'));
         // Single activity.
     } elseif (bp_is_single_activity()) {
         add_filter('bp_get_buddypress_template', array($this, 'single_template_hierarchy'));
         add_action('bp_template_include_reset_dummy_post_data', array($this, 'single_dummy_post'));
         add_filter('bp_replace_the_content', array($this, 'single_dummy_content'));
     }
 }
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:26,代码来源:class-bp-activity-theme-compat.php

示例15: init_scripts

 /**
  * @internal copied from bp-default/functions.php
  */
 public function init_scripts()
 {
     parent::init_scripts();
     // Enqueue various scripts
     wp_enqueue_script('bp-jquery-query');
     wp_enqueue_script('bp-jquery-cookie');
     // Enqueue scrollTo only on activity pages
     if (bp_is_activity_component()) {
         wp_enqueue_script('bp-jquery-scroll-to');
     }
     // Enqueue members widget JS just in case
     if (is_active_widget(false, false, 'bp_core_members_widget') && !is_admin() && !is_network_admin()) {
         wp_enqueue_script('bp-widget-members');
     }
     // Bump this when changes are made to bust cache
     $version = '20120110';
     // the global BuddyPress JS - Ajax will not work without it
     wp_enqueue_script('dtheme-ajax-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array('jquery'), bp_get_version());
     // Add words that we need to use in JS to the end of the page so they can be translated and still used.
     $params = array('my_favs' => __('My Favorites', 'buddypress'), 'accepted' => __('Accepted', 'buddypress'), 'rejected' => __('Rejected', 'buddypress'), 'show_all_comments' => __('Show all comments for this thread', 'buddypress'), 'show_x_comments' => __('Show all %d comments', 'buddypress'), 'show_all' => __('Show all', 'buddypress'), 'comments' => __('comments', 'buddypress'), 'close' => __('Close', 'buddypress'), 'view' => __('View', 'buddypress'), 'mark_as_fav' => __('Favorite', 'buddypress'), 'remove_fav' => __('Remove Favorite', 'buddypress'), 'unsaved_changes' => __('Your profile has unsaved changes. If you leave the page, the changes will be lost.', 'buddypress'));
     wp_localize_script('dtheme-ajax-js', 'BP_DTheme', $params);
 }
开发者ID:shads196770,项目名称:cbox-theme,代码行数:25,代码来源:class.php


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