• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP bp_get_activity_root_slug函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: bp_reshare_replace_activity_delete_link

function bp_reshare_replace_activity_delete_link($link)
{
    // if activity type is a reshare, then we replace the delete link behavior
    if (bp_get_activity_type() == 'reshare_update') {
        $class = 'delete-reshare';
        $action_url = wp_nonce_url(bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/?delete_reshare=' . bp_get_activity_id(), '_reshare_delete');
        $link = '<a href="' . $action_url . '" class="button item-button bp-secondary-action ' . $class . ' confirm" rel="nofollow">' . __('Delete', 'bp-reshare') . '</a>';
    }
    return apply_filters('bp_reshare_replace_activity_delete_link', $link);
}
开发者ID:KristianI,项目名称:bp-reshare,代码行数:10,代码来源:bp-reshare-filters.php


示例2: 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


示例3: bp_get_sitewide_activity_feed_link

/**
 * Returns the sitewide activity feed link
 *
 * @since 1.0.0
 *
 * @uses home_url()
 * @uses bp_get_activity_root_slug()
 * @uses apply_filters() To call the 'bp_get_sitewide_activity_feed_link' hook
 *
 * @return string The sitewide activity feed link
 */
function bp_get_sitewide_activity_feed_link()
{
    return apply_filters('bp_get_sitewide_activity_feed_link', home_url(bp_get_activity_root_slug() . '/feed/'));
}
开发者ID:hornetalcala,项目名称:trunk,代码行数:15,代码来源:bp-activity-template.php


示例4: column_comment

 /**
  * Content column, and "quick admin" rollover actions.
  *
  * Called "comment" in the CSS so we can re-use some WP core CSS.
  *
  * @param array $item A singular item (one full row)
  * @see WP_List_Table::single_row_columns()
  * @since 1.6
  */
 function column_comment($item)
 {
     // Determine what type of item (row) we're dealing with
     if ($item['is_spam']) {
         $item_status = 'spam';
     } else {
         $item_status = 'all';
     }
     // Preorder items: Reply | Edit | Spam | Delete Permanently
     $actions = array('reply' => '', 'edit' => '', 'spam' => '', 'unspam' => '', 'delete' => '');
     // Build actions URLs
     $base_url = network_admin_url('admin.php?page=bp-activity&amp;aid=' . $item['id']);
     $spam_nonce = esc_html('_wpnonce=' . wp_create_nonce('spam-activity_' . $item['id']));
     $delete_url = $base_url . "&amp;action=delete&amp;{$spam_nonce}";
     $edit_url = $base_url . '&amp;action=edit';
     $ham_url = $base_url . "&amp;action=ham&amp;{$spam_nonce}";
     $spam_url = $base_url . "&amp;action=spam&amp;{$spam_nonce}";
     // Rollover actions
     // Reply - javascript only; implemented by AJAX.
     if ('spam' != $item_status) {
         $actions['reply'] = sprintf('<a href="#" class="reply hide-if-no-js">%s</a>', __('Reply', 'buddypress'));
         // Edit
         $actions['edit'] = sprintf('<a href="%s">%s</a>', $edit_url, __('Edit', 'buddypress'));
     }
     // Spam/unspam
     if ('spam' == $item_status) {
         $actions['unspam'] = sprintf('<a href="%s">%s</a>', $ham_url, __('Not Spam', 'buddypress'));
     } else {
         $actions['spam'] = sprintf('<a href="%s">%s</a>', $spam_url, __('Spam', 'buddypress'));
     }
     // Delete
     $actions['delete'] = sprintf('<a href="%s" onclick="%s">%s</a>', $delete_url, "javascript:return confirm('" . esc_js(__('Are you sure?', 'buddypress')) . "'); ", __('Delete Permanently', 'buddypress'));
     // Start timestamp
     echo '<div class="submitted-on">';
     // Other plugins can filter which actions are shown
     $actions = apply_filters('bp_activity_admin_comment_row_actions', array_filter($actions), $item);
     /* translators: 2: activity admin ui date/time */
     printf(__('Submitted on <a href="%1$s">%2$s at %3$s</a>', 'buddypress'), bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $item['id'] . '/', date_i18n(get_option('date_format'), strtotime($item['date_recorded'])), date_i18n(get_option('time_format'), strtotime($item['date_recorded'])));
     // End timestamp
     echo '</div>';
     // Get activity content - if not set, use the action
     if (!empty($item['content'])) {
         $content = apply_filters_ref_array('bp_get_activity_content_body', array($item['content']));
     } else {
         $content = apply_filters_ref_array('bp_get_activity_action', array($item['action']));
     }
     echo $content . ' ' . $this->row_actions($actions);
 }
开发者ID:adisonc,项目名称:MaineLearning,代码行数:57,代码来源:bp-activity-admin.php


示例5: bp_dtheme_activity_template_loader

/**
 * Load the activity loop template when activity is requested via AJAX,
 *
 * @return string JSON object containing 'contents' (output of the template loop for the Activity component) and 'feed_url' (URL to the relevant RSS feed).
 * @since BuddyPress (1.2)
 */
function bp_dtheme_activity_template_loader()
{
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    $scope = '';
    if (!empty($_POST['scope'])) {
        $scope = $_POST['scope'];
    }
    // We need to calculate and return the feed URL for each scope
    switch ($scope) {
        case 'friends':
            $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/friends/feed/';
            break;
        case 'groups':
            $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/groups/feed/';
            break;
        case 'favorites':
            $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/favorites/feed/';
            break;
        case 'mentions':
            $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/feed/';
            bp_activity_clear_new_mentions(bp_loggedin_user_id());
            break;
        default:
            $feed_url = home_url(bp_get_activity_root_slug() . '/feed/');
            break;
    }
    // Buffer the loop in the template to a var for JS to spit out.
    ob_start();
    locate_template(array('activity/activity-loop.php'), true);
    $result['contents'] = ob_get_contents();
    $result['feed_url'] = apply_filters('bp_dtheme_activity_feed_url', $feed_url, $scope);
    ob_end_clean();
    exit(json_encode($result));
}
开发者ID:raminjan,项目名称:logicalbones_hug,代码行数:43,代码来源:ajax.php


示例6: bp_activity_get_permalink

/**
 * Get the permalink for a single activity item.
 *
 * When only the $activity_id param is passed, BP has to instantiate a new
 * BP_Activity_Activity object. To save yourself some processing overhead,
 * be sure to pass the full $activity_obj parameter as well, if you already
 * have it available.
 *
 * @since BuddyPress (1.2.0)
 *
 * @uses bp_get_root_domain()
 * @uses bp_get_activity_root_slug()
 * @uses apply_filters_ref_array() To call the 'bp_activity_get_permalink' hook.
 *
 * @param int $activity_id The unique id of the activity object.
 * @param object $activity_obj Optional. The activity object.
 * @return string $link Permalink for the activity item.
 */
function bp_activity_get_permalink($activity_id, $activity_obj = false)
{
    if (empty($activity_obj)) {
        $activity_obj = new BP_Activity_Activity($activity_id);
    }
    if (isset($activity_obj->current_comment)) {
        $activity_obj = $activity_obj->current_comment;
    }
    if ('new_blog_post' == $activity_obj->type || 'new_blog_comment' == $activity_obj->type || 'new_forum_topic' == $activity_obj->type || 'new_forum_post' == $activity_obj->type) {
        $link = $activity_obj->primary_link;
    } else {
        if ('activity_comment' == $activity_obj->type) {
            $link = bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $activity_obj->item_id . '/';
        } else {
            $link = bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $activity_obj->id . '/';
        }
    }
    return apply_filters_ref_array('bp_activity_get_permalink', array($link, &$activity_obj));
}
开发者ID:eresyyl,项目名称:mk,代码行数:37,代码来源:bp-activity-functions.php


示例7: site_url

									<ul class="submenu">
									<?php 
    if ('activity' != bp_dtheme_page_on_front() && bp_is_active('activity')) {
        ?>
										<li<?php 
        if (bp_is_activity_component() && !bp_is_user_activity()) {
            ?>
 class="selected"<?php 
        }
        ?>
>
											<a href="<?php 
        echo site_url();
        ?>
/<?php 
        echo bp_get_activity_root_slug();
        ?>
/" title="<?php 
        _e('Activity', 'framemarket');
        ?>
"><?php 
        _e('Activity', 'framemarket');
        ?>
</a>
										</li>
									<?php 
    }
    ?>

									<li<?php 
    if (bp_is_members_component() || bp_is_user()) {
开发者ID:JeffreyBue,项目名称:jb,代码行数:31,代码来源:header.php


示例8: bp_activity_get_permalink

/**
 * Get the permalink for a single activity item.
 *
 * When only the $activity_id param is passed, BP has to instantiate a new
 * BP_Activity_Activity object. To save yourself some processing overhead,
 * be sure to pass the full $activity_obj parameter as well, if you already
 * have it available.
 *
 * @since 1.2.0
 *
 * @uses bp_get_root_domain()
 * @uses bp_get_activity_root_slug()
 * @uses apply_filters_ref_array() To call the 'bp_activity_get_permalink' hook.
 *
 * @param int         $activity_id  The unique id of the activity object.
 * @param object|bool $activity_obj Optional. The activity object.
 * @return string $link Permalink for the activity item.
 */
function bp_activity_get_permalink($activity_id, $activity_obj = false)
{
    $bp = buddypress();
    if (empty($activity_obj)) {
        $activity_obj = new BP_Activity_Activity($activity_id);
    }
    if (isset($activity_obj->current_comment)) {
        $activity_obj = $activity_obj->current_comment;
    }
    $use_primary_links = array('new_blog_post', 'new_blog_comment', 'new_forum_topic', 'new_forum_post');
    if (!empty($bp->activity->track)) {
        $use_primary_links = array_merge($use_primary_links, array_keys($bp->activity->track));
    }
    if (false !== array_search($activity_obj->type, $use_primary_links)) {
        $link = $activity_obj->primary_link;
    } else {
        if ('activity_comment' == $activity_obj->type) {
            $link = bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $activity_obj->item_id . '/';
        } else {
            $link = bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $activity_obj->id . '/';
        }
    }
    /**
     * Filters the activity permalink for the specified activity item.
     *
     * @since 1.2.0
     *
     * @param array $array Array holding activity permalink and activity item object.
     */
    return apply_filters_ref_array('bp_activity_get_permalink', array($link, &$activity_obj));
}
开发者ID:humanmade,项目名称:BuddyPress,代码行数:49,代码来源:bp-activity-functions.php


示例9: bp_activity_screen_single_activity_permalink

/**
 * Reset the logged-in user's new mentions data when he visits his mentions screen
 *
 * @since BuddyPress (1.2)
 *
 * @global object $bp BuddyPress global settings
 * @uses bp_is_activity_component()
 * @uses bp_activity_get_specific()
 * @uses bp_current_action()
 * @uses bp_action_variables()
 * @uses bp_do_404()
 * @uses bp_is_active()
 * @uses groups_get_group()
 * @uses groups_is_user_member()
 * @uses apply_filters_ref_array() To call the 'bp_activity_permalink_access' hook
 * @uses do_action() To call the 'bp_activity_screen_single_activity_permalink' hook
 * @uses bp_core_add_message()
 * @uses is_user_logged_in()
 * @uses bp_core_redirect()
 * @uses site_url()
 * @uses esc_url()
 * @uses bp_get_root_domain()
 * @uses bp_get_activity_root_slug()
 * @uses bp_core_load_template()
 * @uses apply_filters() To call the 'bp_activity_template_profile_activity_permalink' hook
 */
function bp_activity_screen_single_activity_permalink()
{
    global $bp;
    // No displayed user or not viewing activity component
    if (!bp_is_activity_component()) {
        return false;
    }
    if (!bp_current_action() || !is_numeric(bp_current_action())) {
        return false;
    }
    // Get the activity details
    $activity = bp_activity_get_specific(array('activity_ids' => bp_current_action(), 'show_hidden' => true, 'spam' => 'ham_only'));
    // 404 if activity does not exist
    if (empty($activity['activities'][0]) || bp_action_variables()) {
        bp_do_404();
        return;
    } else {
        $activity = $activity['activities'][0];
    }
    // Default access is true
    $has_access = true;
    // If activity is from a group, do an extra cap check
    if (isset($bp->groups->id) && $activity->component == $bp->groups->id) {
        // Activity is from a group, but groups is currently disabled
        if (!bp_is_active('groups')) {
            bp_do_404();
            return;
        }
        // Check to see if the group is not public, if so, check the
        // user has access to see this activity
        if ($group = groups_get_group(array('group_id' => $activity->item_id))) {
            // Group is not public
            if ('public' != $group->status) {
                // User is not a member of group
                if (!groups_is_user_member(bp_loggedin_user_id(), $group->id)) {
                    $has_access = false;
                }
            }
        }
    }
    // Allow access to be filtered
    $has_access = apply_filters_ref_array('bp_activity_permalink_access', array($has_access, &$activity));
    // Allow additional code execution
    do_action('bp_activity_screen_single_activity_permalink', $activity, $has_access);
    // Access is specifically disallowed
    if (false === $has_access) {
        // User feedback
        bp_core_add_message(__('You do not have access to this activity.', 'buddypress'), 'error');
        // Redirect based on logged in status
        is_user_logged_in() ? bp_core_redirect(bp_loggedin_user_domain()) : bp_core_redirect(site_url('wp-login.php?redirect_to=' . esc_url(bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . bp_current_action() . '/')));
    }
    bp_core_load_template(apply_filters('bp_activity_template_profile_activity_permalink', 'members/single/activity/permalink'));
}
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:79,代码来源:bp-activity-screens.php


示例10: about_screen

        /**
         * Output the about screen
         *
         * @since BuddyPress (1.7)
         */
        public function about_screen()
        {
            global $wp_rewrite;
            $is_new_install = !empty($_GET['is_new_install']);
            $pretty_permalinks_enabled = !empty($wp_rewrite->permalink_structure);
            list($display_version) = explode('-', bp_get_version());
            ?>

		<div class="wrap about-wrap">
			<h1><?php 
            printf(__('Welcome to BuddyPress %s', 'buddypress'), $display_version);
            ?>
</h1>
			<div class="about-text">
				<?php 
            if ($is_new_install) {
                ?>
					<?php 
                printf(__('BuddyPress %s is our safest, fastest, most flexible version ever.', 'buddypress'), $display_version);
                ?>
				<?php 
            } else {
                ?>
					<?php 
                printf(__('Thank you for updating! BuddyPress %s is our safest, fastest, most flexible version ever.', 'buddypress'), $display_version);
                ?>
				<?php 
            }
            ?>
			</div>
			<div class="bp-badge"><?php 
            printf(__('Version %s', 'buddypress'), $display_version);
            ?>
</div>

			<h2 class="nav-tab-wrapper">
				<a class="nav-tab nav-tab-active" href="<?php 
            echo esc_url(bp_get_admin_url(add_query_arg(array('page' => 'bp-about'), 'index.php')));
            ?>
">
					<?php 
            _e('What&#8217;s New', 'buddypress');
            ?>
				</a><a class="nav-tab" href="<?php 
            echo esc_url(bp_get_admin_url(add_query_arg(array('page' => 'bp-credits'), 'index.php')));
            ?>
">
					<?php 
            _e('Credits', 'buddypress');
            ?>
				</a>
			</h2>

			<?php 
            if ($is_new_install) {
                ?>
			<h3><?php 
                _e('Getting Started', 'buddypress');
                ?>
</h3>

				<div class="feature-section">
					<h4><?php 
                _e('Your Default Setup', 'buddypress');
                ?>
</h4>
					<p><?php 
                printf(__('BuddyPress&#8217;s powerful features help your users connect and collaborate. To help get your community started, we&#8217;ve activated two of the most commonly used tools in BP: <strong>Extended Profiles</strong> and <strong>Activity Streams</strong>. See these components in action at the %1$s and %2$s directories, and be sure to spend a few minutes <a href="%3$s">configuring user profiles</a>. Want to explore more of BP&#8217;s features? Visit the <a href="%4$s">Components panel</a>.', 'buddypress'), $pretty_permalinks_enabled ? '<a href="' . trailingslashit(bp_get_root_domain() . '/' . bp_get_members_root_slug()) . '">' . __('Members', 'buddypress') . '</a>' : __('Members', 'buddypress'), $pretty_permalinks_enabled ? '<a href="' . trailingslashit(bp_get_root_domain() . '/' . bp_get_activity_root_slug()) . '">' . __('Activity', 'buddypress') . '</a>' : __('Activity', 'buddypress'), bp_get_admin_url(add_query_arg(array('page' => 'bp-profile-setup'), 'users.php')), bp_get_admin_url(add_query_arg(array('page' => 'bp-components'), $this->settings_page)));
                ?>
</p>

					<h4><?php 
                _e('Community and Support', 'buddypress');
                ?>
</h4>
					<p><?php 
                _e('Looking for help? The <a href="http://codex.buddypress.org/">BuddyPress Codex</a> has you covered, with dozens of user-contributed guides on how to configure and use your BP site. Can&#8217;t find what you need? Stop by <a href="http://buddypress.org/support/">our support forums</a>, where a vibrant community of BuddyPress users and developers is waiting to share tips, show off their sites, talk about the future of BuddyPress, and much more.', 'buddypress');
                ?>
</p>
				</div>

			<?php 
            }
            ?>

			<div class="changelog">
				<h3><?php 
            _e('Improved Theme Integration', 'buddypress');
            ?>
</h3>

				<div class="feature-section">
					<h4><?php 
            _e('Hey, Good Lookin&#8217;', 'buddypress');
            ?>
//.........这里部分代码省略.........
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:101,代码来源:bp-core-admin.php


示例11: _expand_macro

 private function _expand_macro($macro)
 {
     $value = false;
     $user = wp_get_current_user();
     switch ($macro) {
         case 'BP_ACTIVITY_SLUG':
             if (function_exists('bp_get_activity_root_slug')) {
                 $value = bp_get_activity_root_slug();
             }
             break;
         case 'BP_GROUPS_SLUG':
             if (function_exists('bp_get_groups_slug')) {
                 $value = bp_get_groups_slug();
             }
             break;
         case 'BP_MEMBERS_SLUG':
             if (function_exists('bp_get_members_slug')) {
                 $value = bp_get_members_slug();
             }
             break;
     }
     return apply_filters('logout_redirect-macro_value', $value, $macro);
 }
开发者ID:brycefrees,项目名称:dunia,代码行数:23,代码来源:logout-redirect.php


示例12: wdfb_expand_buddypress_macros

/**
 * Expands some basic supported BuddyPress macros.
 */
function wdfb_expand_buddypress_macros($str)
{
    if (!defined('BP_VERSION')) {
        return $str;
    }
    if (function_exists('bp_get_activity_root_slug')) {
        $str = preg_replace('/\\bBP_ACTIVITY_SLUG\\b/', bp_get_activity_root_slug(), $str);
    }
    if (function_exists('bp_get_groups_slug')) {
        $str = preg_replace('/\\bBP_GROUPS_SLUG\\b/', bp_get_groups_slug(), $str);
    }
    if (function_exists('bp_get_members_slug')) {
        $str = preg_replace('/\\bBP_MEMBERS_SLUG\\b/', bp_get_members_slug(), $str);
    }
    return $str;
}
开发者ID:m-godefroid76,项目名称:devrestofactory,代码行数:19,代码来源:wdfb_utilities.php


示例13: buddyreshare_activity_filter_action_url

/**
 * Filters the reshare action url if the delete action is possible
 *
 * @package BP Reshare
 * @since    1.0
 * 
 * @param  string $action_url
 * @uses   buddyreshare_can_unshare() to check if the context is good to allow delete action
 * @uses   wp_nonce_url() for security reason
 * @uses   bp_get_root_domain() to get the blog's url
 * @uses   bp_get_activity_root_slug() to get the activity slug
 * @uses   buddyreshare_get_component_slug() to get the component's slug
 * @uses   bp_get_activity_id() to get the activity id [description]
 * @return string $action_url
 */
function buddyreshare_activity_filter_action_url($action_url = '')
{
    if (buddyreshare_can_unshare()) {
        $action_url = wp_nonce_url(bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/' . buddyreshare_get_component_slug() . '/delete/' . bp_get_activity_id() . '/', 'buddyreshare_delete');
    }
    return $action_url;
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:22,代码来源:filters.php


示例14: bpcustom_activity_template_loader

function bpcustom_activity_template_loader()
{
    global $bp;
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    bpcustom_setup_components();
    $action = bpcustom_get_current_action();
    $scope = $action;
    // We need to calculate and return the feed URL for each scope
    switch ($scope) {
        case 'friends':
            $feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/friends/feed/';
            break;
        case 'groups':
            $feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/groups/feed/';
            break;
        case 'favorites':
            $feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/favorites/feed/';
            break;
        case 'mentions':
            $feed_url = $bp->loggedin_user->domain . bp_get_activity_slug() . '/mentions/feed/';
            bp_activity_clear_new_mentions($bp->loggedin_user->id);
            break;
        default:
            $feed_url = home_url(bp_get_activity_root_slug() . '/feed/');
            break;
    }
    /* Buffer the loop in the template to a var for JS to spit out. */
    ob_start();
    locate_template(array('members/single/activity.php'), true);
    $result = array();
    $result['contents'] = ob_get_contents();
    $result['feed_url'] = apply_filters('bp_dtheme_activity_feed_url', $feed_url, $scope);
    ob_end_clean();
    echo json_encode($result);
}
开发者ID:wesavetheworld,项目名称:bp-default-ajaxed-profile-tab,代码行数:38,代码来源:functions.php


示例15: about_screen

        /**
         * Output the about screen.
         *
         * @since BuddyPress (1.7.0)
         */
        public function about_screen()
        {
            global $wp_rewrite;
            $is_new_install = !empty($_GET['is_new_install']);
            $pretty_permalinks_enabled = !empty($wp_rewrite->permalink_structure);
            $image_base = buddypress()->plugin_url . 'bp-core/images/bp20/';
            list($display_version) = explode('-', bp_get_version());
            ?>

		<div class="wrap about-wrap">
			<h1><?php 
            printf(__('Welcome to BuddyPress %s', 'buddypress'), $display_version);
            ?>
</h1>
			<div class="about-text">
				<?php 
            if ($is_new_install) {
                ?>
					<?php 
                printf(__('It&#8217;s a great time to use BuddyPress! With a focus on speed, admin tools, and developer enhancements, %s is our leanest and most powerful version yet.', 'buddypress'), $display_version);
                ?>
				<?php 
            } else {
                ?>
					<?php 
                printf(__('Thanks for updating! With a focus on speed, admin tools, and developer enhancements, BuddyPress %s is our leanest and most powerful version yet.', 'buddypress'), $display_version);
                ?>
				<?php 
            }
            ?>
			</div>

			<div class="bp-badge"></div>

			<h2 class="nav-tab-wrapper">
				<a class="nav-tab nav-tab-active" href="<?php 
            echo esc_url(bp_get_admin_url(add_query_arg(array('page' => 'bp-about'), 'index.php')));
            ?>
">
					<?php 
            _e('What&#8217;s New', 'buddypress');
            ?>
				</a><a class="nav-tab" href="<?php 
            echo esc_url(bp_get_admin_url(add_query_arg(array('page' => 'bp-credits'), 'index.php')));
            ?>
">
					<?php 
            _e('Credits', 'buddypress');
            ?>
				</a>
			</h2>

			<?php 
            if ($is_new_install) {
                ?>
			<h3><?php 
                _e('Getting Started', 'buddypress');
                ?>
</h3>

				<div class="feature-section">
					<h4><?php 
                _e('Your Default Setup', 'buddypress');
                ?>
</h4>

					<?php 
                if (bp_is_active('members') && bp_is_active('activity') && current_user_can($this->capability)) {
                    ?>
						<p><?php 
                    printf(__('BuddyPress&#8217;s powerful features help your users connect and collaborate. To help get your community started, we&#8217;ve activated two of the most commonly used tools in BP: <strong>Extended Profiles</strong> and <strong>Activity Streams</strong>. See these components in action at the %1$s and %2$s directories, and be sure to spend a few minutes <a href="%3$s">configuring user profiles</a>. Want to explore more of BP&#8217;s features? Visit the <a href="%4$s">Components panel</a>.', 'buddypress'), $pretty_permalinks_enabled ? '<a href="' . trailingslashit(bp_get_root_domain() . '/' . bp_get_members_root_slug()) . '">' . __('Members', 'buddypress') . '</a>' : __('Members', 'buddypress'), $pretty_permalinks_enabled ? '<a href="' . trailingslashit(bp_get_root_domain() . '/' . bp_get_activity_root_slug()) . '">' . __('Activity', 'buddypress') . '</a>' : __('Activity', 'buddypress'), bp_get_admin_url(add_query_arg(array('page' => 'bp-profile-setup'), 'users.php')), bp_get_admin_url(add_query_arg(array('page' => 'bp-components'), $this->settings_page)));
                    ?>
</p>

					<?php 
                } else {
                    ?>
						<p><?php 
                    printf(__('BuddyPress&#8217;s powerful features help your users connect and collaborate. Want to explore BP&#8217;s features? Visit the <a href="%s">Components panel</a>.', 'buddypress'), bp_get_admin_url(add_query_arg(array('page' => 'bp-components'), $this->settings_page)));
                    ?>
</p>

					<?php 
                }
                ?>

					<h4><?php 
                _e('Community and Support', 'buddypress');
                ?>
</h4>
					<p><?php 
                _e('Looking for help? The <a href="http://codex.buddypress.org/">BuddyPress Codex</a> has you covered, with dozens of user-contributed guides on how to configure and use your BP site. Can&#8217;t find what you need? Stop by <a href="http://buddypress.org/support/">our support forums</a>, where a vibrant community of BuddyPress users and developers is waiting to share tips, show off their sites, talk about the future of BuddyPress, and much more.', 'buddypress');
                ?>
</p>
				</div>
//.........这里部分代码省略.........
开发者ID:danielcoats,项目名称:schoolpress,代码行数:101,代码来源:bp-core-admin.php


示例16: humcore_get_deposit_activity_unfavorite_link

/**
 * Return the deposit activity unfavorite link.
 *
 * @global object $activities_template {@link BP_Activity_Template}
 * @uses wp_nonce_url()
 * @uses home_url()
 * @uses bp_get_activity_root_slug()
 * @uses apply_filters() To call the 'humcore_get_deposit_activity_unfavorite_link' hook.
 *
 * @return string The activity unfavorite link.
 */
function humcore_get_deposit_activity_unfavorite_link($activity_id)
{
    global $activities_template;
    return apply_filters('humcore_get_deposit_activity_unfavorite_link', wp_nonce_url(home_url(bp_get_activity_root_slug() . '/unfavorite/' . $activity_id . '/'), 'unmark_favorite'));
}
开发者ID:MartinPaulEve,项目名称:humcore,代码行数:16,代码来源:template.php


示例17: bp_site_name

>

<channel>
	<title><?php 
bp_site_name();
?>
 | <?php 
_e('Site Wide Activity', 'buddypress');
?>
</title>
	<atom:link href="<?php 
self_link();
?>
" rel="self" type="application/rss+xml" />
	<link><?php 
echo bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/feed';
?>
</link>
	<description><?php 
_e('Site Wide Activity Feed', 'buddypress');
?>
</description>
	<pubDate><?php 
echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false);
?>
</pubDate>
	<generator>http://buddypress.org/?v=<?php 
echo BP_VERSION;
?>
</generator>
	<language><?php 
开发者ID:hornetalcala,项目名称:trunk,代码行数:31,代码来源:bp-activity-sitewide-feed.php


示例18: printf

>

<channel>
	<?php 
/* translators: Mentions RSS title - "[Site Name] | [Displayed User Name] | Mentions" */
?>
	<title><?php 
printf('%1$s | %2$s | %3$s', bp_get_site_name(), bp_get_displayed_user_fullname(), __('Mentions', 'buddypress'));
?>
</title>
	<atom:link href="<?php 
self_link();
?>
" rel="self" type="application/rss+xml" />
	<link><?php 
echo home_url(bp_get_activity_root_slug() . '/#mentions/');
?>
</link>
	<?php 
/* translators: Mentions RSS title - "[Site Name] | [Displayed User Name] | Mentions" */
?>
	<description><?php 
printf(__('%s - Mentions', 'buddypress'), bp_get_displayed_user_fullname());
?>
</description>
	<pubDate><?php 
echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false);
?>
</pubDate>
	<generator>http://buddypress.org/?v=<?php 
echo BP_VERSION;
开发者ID:adisonc,项目名称:MaineLearning,代码行数:31,代码来源:bp-activity-mentions-feed.php


示例19: bp_get_sitewide_activity_feed_link

/**
 * Returns the sitewide activity feed link
 *
 * @since 1.0.0
 *
 * @uses home_url()
 * @uses bp_get_activity_root_slug()
 * @uses apply_filters() To call the 'bp_get_sitewide_activity_feed_link' hook
 *
 * @return string The sitewide activity feed link
 */
function bp_get_sitewide_activity_feed_link()
{
    return apply_filters('bp_get_sitewide_activity_feed_link', bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/feed/');
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:15,代码来源:bp-activity-template.php


示例20: kleo_pmpro_restrict_rules

 /**
  * Applies restrictions based on the Theme options -> Memberships
  * @return void
  * @since 2.0
  */
 function kleo_pmpro_restrict_rules()
 {
     //if PMPRO is not activated
     if (!function_exists('pmpro_url')) {
         return;
     }
     //if buddypress is not activated
     if (!function_exists('bp_is_active')) {
         return;
     }
     //full current url
     $actual_link = kleo_full_url();
     //our request uri
     $home_url = home_url();
     //WPML support
     if (defined('ICL_SITEPRESS_VERSION')) {
         global $sitepress;
         $home_url = $sitepress->language_url(ICL_LANGUAGE_CODE);
     }
     $home_url = str_replace("www.", "", $home_url);
     $uri = str_replace(untrailingslashit($home_url), "", $actual_link);
     //restriction match array
     $final = array();
     $allowed_chars = apply_filters('kleo_pmpro_allowed_chars', "a-z 0-9~%.:_\\-");
     $restrict_options = kleo_memberships();
     $members_slug = str_replace('/', '\\/', bp_get_members_root_slug());
     /*-----------------------------------------------------------------------------------*/
     /* Preg match rules
     	/*-----------------------------------------------------------------------------------*/
     //members directory restriction rule
     $final["/^\\/" . $members_slug . "\\/?\$/"] = array('name' => 'members_dir', 'type' => $restrict_options['members_dir']['type'], 'levels' => isset($restrict_options['members_dir']['levels']) ? $restrict_options['members_dir']['levels'] : array());
     //members single profile restriction rule
     $final["/^\\/" . $members_slug . "\\/[" . $allowed_chars . "\\/]+\\/?\$/"] = array('name' => 'view_profiles', 'type' => $restrict_options['view_profiles']['type'], 'levels' => isset($restrict_options['view_profiles']['levels']) ? $restrict_options['view_profiles']['levels'] : array());
     if (function_exists('bp_get_groups_root_slug')) {
         $groups_slug = str_replace('/', '\\/', bp_get_groups_root_slug());
         //groups directory restriction rule
         $final["/^\\/" . $groups_slug . "\\/?\$/"] = array('name' => 'groups_dir', 'type' => $restrict_options['groups_dir']['type'], 'levels' => isset($restrict_options['groups_dir']['levels']) ? $restrict_options['groups_dir']['levels'] : array());
         //groups single page restriction rule
         $final["/^\\/" . $groups_slug . "\\/[" . $allowed_chars . "\\/]+\\/?\$/"] = array('name' => 'view_groups', 'type' => $restrict_options['view_groups']['type'], 'levels' => isset($restrict_options['view_groups']['levels']) ? $restrict_options['view_groups']['levels'] : array());
     }
     if (function_exists('bp_get_activity_root_slug')) {
         $activity_slug = str_replace('/', '\\/', bp_get_activity_root_slug());
         //activity page restriction rule
         $final["/^\\/" . $activity_slug . "\\/?\$/"] = array('name' => 'show_activity', 'type' => $restrict_options['show_activity']['type'], 'levels' => isset($restrict_options['show_activity']['levels']) ? $restrict_options['show_activity']['levels'] : array());
     }
     /* You can add extra restrictions using this filter */
     $final = apply_filters('kleo_pmpro_match_rules', $final);
     //no redirection for super-admin
     if (is_super_admin()) {
         return false;
     } elseif (is_user_logged_in()) {
         //restrict media
         if (preg_match("/^\\/" . $members_slug . "\\/" . bp_get_loggedin_user_username() . "\\/media\\/?/", $uri) || preg_match("/^\\/" . $members_slug . "\\/" . bp_get_loggedin_user_username() . "\\/album\\/?/", $uri)) {
             kleo_check_access('add_media', $restrict_options);
         } elseif ( 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP bp_get_activity_secondary_avatar函数代码示例发布时间:2022-05-24
下一篇:
PHP bp_get_activity_is_favorite函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap