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


PHP bp_do_404函数代码示例

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


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

示例1: bp_settings_screen_capabilities

/**
 * Show the capabilities settings template
 *
 * @since BuddyPress (1.6)
 *
 * @return If we shouldn't be here
 */
function bp_settings_screen_capabilities()
{
    if (bp_action_variables()) {
        bp_do_404();
        return;
    }
    // Load the template
    bp_core_load_template(apply_filters('bp_settings_screen_capabilities', 'members/single/settings/capabilities'));
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:16,代码来源:bp-settings-screens.php

示例2: bp_groups_group_access_protection

/**
 * Protect access to single groups.
 *
 * @since BuddyPress (2.1.0)
 */
function bp_groups_group_access_protection()
{
    if (!bp_is_group()) {
        return;
    }
    $current_group = groups_get_current_group();
    $user_has_access = $current_group->user_has_access;
    $no_access_args = array();
    if (!$user_has_access && 'hidden' !== $current_group->status) {
        // Always allow access to home and request-membership
        if (bp_is_current_action('home') || bp_is_current_action('request-membership')) {
            $user_has_access = true;
            // User doesn't have access, so set up redirect args
        } else {
            if (is_user_logged_in()) {
                $no_access_args = array('message' => __('You do not have access to this group.', 'buddypress'), 'root' => bp_get_group_permalink($current_group) . 'home/', 'redirect' => false);
            }
        }
    }
    // Protect the admin tab from non-admins
    if (bp_is_current_action('admin') && !bp_is_item_admin()) {
        $user_has_access = false;
        $no_access_args = array('message' => __('You are not an admin of this group.', 'buddypress'), 'root' => bp_get_group_permalink($current_group), 'redirect' => false);
    }
    /**
     * Allow plugins to filter whether the current user has access to this group content.
     *
     * Note that if a plugin sets $user_has_access to false, it may also
     * want to change the $no_access_args, to avoid problems such as
     * logged-in users being redirected to wp-login.php.
     *
     * @since BuddyPress (2.1.0)
     *
     * @param bool $user_has_access True if the user has access to the
     *        content, otherwise false.
     * @param array $no_access_args Arguments to be passed to
     *        bp_core_no_access() in case of no access. Note that this
     *        value is passed by reference, so it can be modified by the
     *        filter callback.
     */
    $user_has_access = apply_filters_ref_array('bp_group_user_has_access', array($user_has_access, &$no_access_args));
    // If user has access, we return rather than redirect
    if ($user_has_access) {
        return;
    }
    // Hidden groups should return a 404 for non-members.
    // Unset the current group so that you're not redirected
    // to the default group tab
    if ('hidden' == $current_group->status) {
        buddypress()->groups->current_group = 0;
        buddypress()->is_single_item = false;
        bp_do_404();
        return;
    } else {
        bp_core_no_access($no_access_args);
    }
}
开发者ID:eresyyl,项目名称:mk,代码行数:62,代码来源:bp-groups-actions.php

示例3: bp_activity_action_permalink_router

/**
 * Catch and route requests for single activity item permalinks.
 *
 * @since 1.2.0
 *
 * @uses bp_is_activity_component()
 * @uses bp_is_current_action()
 * @uses bp_action_variable()
 * @uses bp_activity_get_specific()
 * @uses bp_is_active()
 * @uses bp_core_get_user_domain()
 * @uses groups_get_group()
 * @uses bp_get_group_permalink()
 * @uses apply_filters_ref_array() To call the 'bp_activity_permalink_redirect_url' hook.
 * @uses bp_core_redirect()
 * @uses bp_get_root_domain()
 *
 * @return bool False on failure.
 */
function bp_activity_action_permalink_router()
{
    // Not viewing activity.
    if (!bp_is_activity_component() || !bp_is_current_action('p')) {
        return false;
    }
    // No activity to display.
    if (!bp_action_variable(0) || !is_numeric(bp_action_variable(0))) {
        return false;
    }
    // Get the activity details.
    $activity = bp_activity_get_specific(array('activity_ids' => bp_action_variable(0), 'show_hidden' => true));
    // 404 if activity does not exist
    if (empty($activity['activities'][0])) {
        bp_do_404();
        return;
    } else {
        $activity = $activity['activities'][0];
    }
    // Do not redirect at default.
    $redirect = false;
    // Redirect based on the type of activity.
    if (bp_is_active('groups') && $activity->component == buddypress()->groups->id) {
        // Activity is a user update.
        if (!empty($activity->user_id)) {
            $redirect = bp_core_get_user_domain($activity->user_id, $activity->user_nicename, $activity->user_login) . bp_get_activity_slug() . '/' . $activity->id . '/';
            // Activity is something else.
        } else {
            // Set redirect to group activity stream.
            if ($group = groups_get_group(array('group_id' => $activity->item_id))) {
                $redirect = bp_get_group_permalink($group) . bp_get_activity_slug() . '/' . $activity->id . '/';
            }
        }
        // Set redirect to users' activity stream.
    } elseif (!empty($activity->user_id)) {
        $redirect = bp_core_get_user_domain($activity->user_id, $activity->user_nicename, $activity->user_login) . bp_get_activity_slug() . '/' . $activity->id . '/';
    }
    // If set, add the original query string back onto the redirect URL.
    if (!empty($_SERVER['QUERY_STRING'])) {
        $query_frags = array();
        wp_parse_str($_SERVER['QUERY_STRING'], $query_frags);
        $redirect = add_query_arg(urlencode_deep($query_frags), $redirect);
    }
    /**
     * Filter the intended redirect url before the redirect occurs for the single activity item.
     *
     * @since 1.2.2
     *
     * @param array $value Array with url to redirect to and activity related to the redirect.
     */
    if (!($redirect = apply_filters_ref_array('bp_activity_permalink_redirect_url', array($redirect, &$activity)))) {
        bp_core_redirect(bp_get_root_domain());
    }
    // Redirect to the actual activity permalink page.
    bp_core_redirect($redirect);
}
开发者ID:swissspidy,项目名称:BuddyPress,代码行数:75,代码来源:bp-activity-actions.php

示例4: group_hierarchy_override_current_action

/**
 * Catch requests for the groups component and find the requested group
 */
function group_hierarchy_override_current_action($current_action)
{
    global $bp;
    do_action('bp_group_hierarchy_route_requests');
    /** Only process once - hopefully this won't have any side effects */
    remove_action('bp_current_action', 'group_hierarchy_override_current_action');
    /** Abort processing on dashboard pages and when not in groups component */
    if (is_admin() && !strpos(admin_url('admin-ajax.php'), $_SERVER['REQUEST_URI'])) {
        return $current_action;
    }
    if (!bp_is_groups_component()) {
        return $current_action;
    }
    $groups_slug = bp_get_groups_root_slug();
    bp_group_hierarchy_debug('Routing request');
    bp_group_hierarchy_debug('Current component: ' . $bp->current_component);
    bp_group_hierarchy_debug('Current action: ' . $current_action);
    bp_group_hierarchy_debug('Groups slug: ' . $groups_slug);
    bp_group_hierarchy_debug('Are we on a user profile page?: ' . (empty($bp->displayed_user->id) ? 'N' : 'Y'));
    if ($current_action == '') {
        return $current_action;
    }
    if (!empty($bp->displayed_user->id) || in_array($current_action, apply_filters('groups_forbidden_names', array('my-groups', 'create', 'invites', 'send-invites', 'forum', 'delete', 'add', 'admin', 'request-membership', 'members', 'settings', 'avatar', $groups_slug, '')))) {
        bp_group_hierarchy_debug('Not rewriting current action.');
        return $current_action;
    }
    $action_vars = $bp->action_variables;
    $group = new BP_Groups_Hierarchy($current_action);
    if (!$group->id && (!isset($bp->current_item) || !$bp->current_item)) {
        $current_action = '';
        bp_group_hierarchy_debug('Group not found - returning 404.');
        bp_do_404();
        return;
    }
    if ($group->has_children()) {
        $parent_id = $group->id;
        foreach ($bp->action_variables as $action_var) {
            $subgroup_id = BP_Groups_Hierarchy::check_slug($action_var, $parent_id);
            if ($subgroup_id) {
                $action_var = array_shift($action_vars);
                $current_action .= '/' . $action_var;
                $parent_id = $subgroup_id;
            } else {
                // once we find something that isn't a group, we're done
                break;
            }
        }
    }
    bp_group_hierarchy_debug('Action changed to: ' . $current_action);
    $bp->action_variables = $action_vars;
    $bp->current_action = $current_action;
    return $current_action;
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:56,代码来源:bp-group-hierarchy-filters.php

示例5: bp_xprofile_action_settings

/**
 * Handles the saving of xprofile field visibilities
 *
 * @since BuddyPress (1.9)
 */
function bp_xprofile_action_settings()
{
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    // Bail if no submit action
    if (!isset($_POST['xprofile-settings-submit'])) {
        return;
    }
    // Bail if not in settings
    if (!bp_is_user_settings_profile()) {
        return;
    }
    // 404 if there are any additional action variables attached
    if (bp_action_variables()) {
        bp_do_404();
        return;
    }
    // Nonce check
    check_admin_referer('bp_xprofile_settings');
    do_action('bp_xprofile_settings_before_save');
    /** Save ******************************************************************/
    // Only save if there are field ID's being posted
    if (!empty($_POST['field_ids'])) {
        // Get the POST'ed field ID's
        $posted_field_ids = explode(',', $_POST['field_ids']);
        // Backward compatibility: a bug in BP 2.0 caused only a single
        // group's field IDs to be submitted. Look for values submitted
        // in the POST request that may not appear in 'field_ids', and
        // add them to the list of IDs to save.
        foreach ($_POST as $posted_key => $posted_value) {
            preg_match('/^field_([0-9]+)_visibility$/', $posted_key, $matches);
            if (!empty($matches[1]) && !in_array($matches[1], $posted_field_ids)) {
                $posted_field_ids[] = $matches[1];
            }
        }
        // Save the visibility settings
        foreach ($posted_field_ids as $field_id) {
            $visibility_level = 'public';
            if (!empty($_POST['field_' . $field_id . '_visibility'])) {
                $visibility_level = $_POST['field_' . $field_id . '_visibility'];
            }
            xprofile_set_field_visibility_level($field_id, bp_displayed_user_id(), $visibility_level);
        }
    }
    /** Other *****************************************************************/
    do_action('bp_xprofile_settings_after_save');
    // Redirect to the root domain
    bp_core_redirect(bp_displayed_user_domain() . bp_get_settings_slug() . '/profile');
}
开发者ID:eresyyl,项目名称:mk,代码行数:56,代码来源:bp-xprofile-actions.php

示例6: bp_activity_action_permalink_router

/**
 * Allow core components and dependent plugins to register activity actions
 *
 * @since BuddyPress (1.2)
 *
 * @global object $bp BuddyPress global settings
 * @uses bp_is_activity_component()
 * @uses bp_is_current_action()
 * @uses bp_action_variable()
 * @uses bp_activity_get_specific()
 * @uses bp_is_active()
 * @uses bp_core_get_user_domain()
 * @uses groups_get_group()
 * @uses bp_get_group_permalink()
 * @uses apply_filters_ref_array() To call the 'bp_activity_permalink_redirect_url' hook
 * @uses bp_core_redirect()
 * @uses bp_get_root_domain()
 *
 * @return bool False on failure
 */
function bp_activity_action_permalink_router()
{
    global $bp;
    // Not viewing activity
    if (!bp_is_activity_component() || !bp_is_current_action('p')) {
        return false;
    }
    // No activity to display
    if (!bp_action_variable(0) || !is_numeric(bp_action_variable(0))) {
        return false;
    }
    // Get the activity details
    $activity = bp_activity_get_specific(array('activity_ids' => bp_action_variable(0), 'show_hidden' => true));
    // 404 if activity does not exist
    if (empty($activity['activities'][0])) {
        bp_do_404();
        return;
    } else {
        $activity = $activity['activities'][0];
    }
    // Do not redirect at default
    $redirect = false;
    // Redirect based on the type of activity
    if (bp_is_active('groups') && $activity->component == $bp->groups->id) {
        // Activity is a user update
        if (!empty($activity->user_id)) {
            $redirect = bp_core_get_user_domain($activity->user_id, $activity->user_nicename, $activity->user_login) . bp_get_activity_slug() . '/' . $activity->id . '/';
            // Activity is something else
        } else {
            // Set redirect to group activity stream
            if ($group = groups_get_group(array('group_id' => $activity->item_id))) {
                $redirect = bp_get_group_permalink($group) . bp_get_activity_slug() . '/' . $activity->id . '/';
            }
        }
        // Set redirect to users' activity stream
    } else {
        $redirect = bp_core_get_user_domain($activity->user_id, $activity->user_nicename, $activity->user_login) . bp_get_activity_slug() . '/' . $activity->id . '/';
    }
    // If set, add the original query string back onto the redirect URL
    if (!empty($_SERVER['QUERY_STRING'])) {
        $query_frags = array();
        wp_parse_str($_SERVER['QUERY_STRING'], $query_frags);
        $redirect = add_query_arg(urlencode_deep($query_frags), $redirect);
    }
    // Allow redirect to be filtered
    if (!($redirect = apply_filters_ref_array('bp_activity_permalink_redirect_url', array($redirect, &$activity)))) {
        bp_core_redirect(bp_get_root_domain());
    }
    // Redirect to the actual activity permalink page
    bp_core_redirect($redirect);
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:71,代码来源:bp-activity-actions.php

示例7: bp_settings_screen_capabilities

/**
 * Show the capabilities settings template
 *
 * @since BuddyPress (1.6.0)
 */
function bp_settings_screen_capabilities()
{
    if (bp_action_variables()) {
        bp_do_404();
        return;
    }
    /**
     * Filters the template file path to use for the capabilities settings screen.
     *
     * @since BuddyPress (1.6.0)
     *
     * @param string $value Directory path to look in for the template file.
     */
    bp_core_load_template(apply_filters('bp_settings_screen_capabilities', 'members/single/settings/capabilities'));
}
开发者ID:un1coin,项目名称:ovn-space,代码行数:20,代码来源:bp-settings-screens.php

示例8: bp_portfolio_screen_add

/**
 * Sets up and displays the screen output for the sub nav item "portfolio/add"
 */
function bp_portfolio_screen_add()
{
    global $bp;
    if (bp_action_variables()) {
        bp_do_404();
        return;
    }
    messages_remove_callback_values();
    if (isset($_POST['add'])) {
        // Check the nonce
        if (!wp_verify_nonce($_POST['_wpnonce'], 'project_form_nonce')) {
            bp_core_add_message(__('There was an error recording the project, please try again', 'bp-portfolio'), 'error');
            bp_core_load_template(apply_filters('bp_portfolio_template_personal', BP_PORTFOLIO_TEMPLATE . '/personal'));
        }
        if (empty($_POST['title-input']) or empty($_POST['url-input']) or empty($_POST['description'])) {
            bp_core_add_message(__('All fields are required', 'bp-portfolio'), 'error');
        } else {
            // Check the url
            if (!preg_match("/(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/", $_POST['url-input'])) {
                bp_core_add_message(__('Url must be a valid URL.', 'bp-portfolio'), 'error');
                bp_core_load_template(apply_filters('bp_portfolio_template_add', BP_PORTFOLIO_TEMPLATE . '/add'));
            }
            // Check description size
            if (strlen($_POST['description']) > BP_PORTFOLIO_DESC_MAX_SIZE) {
                $_POST['description'] = substr($_POST['description'], 0, BP_PORTFOLIO_DESC_MAX_SIZE);
            }
            // Save the item
            $posts = array('author_id' => bp_loggedin_user_id(), 'title' => $_POST['title-input'], 'description' => $_POST['description'], 'url' => $_POST['url-input']);
            // Is that a capture has been sent ?
            if (isset($_FILES['screenshot-input']) and $_FILES['screenshot-input']['error'] == 0) {
                $posts['screenshot'] = $_FILES['screenshot-input'];
            }
            if ($item = bp_portfolio_save_item($posts)) {
                bp_core_add_message(__('Project has been saved', 'bp-portfolio'));
                bp_core_redirect(bp_core_get_user_domain(bp_loggedin_user_id()) . bp_get_portfolio_slug());
            } else {
                bp_core_add_message(__('There was an error recording the project, please try again', 'bp-portfolio'), 'error');
            }
        }
    }
    do_action('bp_portfolio_add_screen');
    // Displaying Content
    bp_core_load_template(apply_filters('bp_portfolio_template_add', BP_PORTFOLIO_TEMPLATE . '/add'));
}
开发者ID:ncrocfer,项目名称:BP-Portfolio,代码行数:47,代码来源:bp-portfolio-screens.php

示例9: bp_xprofile_action_settings

/**
 * Handles the saving of xprofile field visibilities
 *
 * @since BuddyPress (1.9)
 */
function bp_xprofile_action_settings()
{
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    // Bail if no submit action
    if (!isset($_POST['xprofile-settings-submit'])) {
        return;
    }
    // Bail if not in settings
    if (!bp_is_user_settings_profile()) {
        return;
    }
    // 404 if there are any additional action variables attached
    if (bp_action_variables()) {
        bp_do_404();
        return;
    }
    // Nonce check
    check_admin_referer('bp_xprofile_settings');
    do_action('bp_xprofile_settings_before_save');
    /** Save ******************************************************************/
    // Only save if there are field ID's being posted
    if (!empty($_POST['field_ids'])) {
        // Get the POST'ed field ID's
        $posted_field_ids = explode(',', $_POST['field_ids']);
        // Save the visibility settings
        foreach ($posted_field_ids as $field_id) {
            $visibility_level = 'public';
            if (!empty($_POST['field_' . $field_id . '_visibility'])) {
                $visibility_level = $_POST['field_' . $field_id . '_visibility'];
            }
            xprofile_set_field_visibility_level($field_id, bp_displayed_user_id(), $visibility_level);
        }
    }
    /** Other *****************************************************************/
    do_action('bp_xprofile_settings_after_save');
    // Redirect to the root domain
    bp_core_redirect(bp_displayed_user_domain() . bp_get_settings_slug() . '/profile');
}
开发者ID:danielcoats,项目名称:schoolpress,代码行数:46,代码来源:bp-xprofile-actions.php

示例10: group_handle_screens

 /**
  * Perform actions about rendez-vous (insert/edit/delete/save prefs)
  *
  * @package Rendez Vous
  * @subpackage Groups
  *
  * @since Rendez Vous (1.1.0)
  *
  * @uses  Rendez_Vous_Group->is_rendez_vous()   Checks whether we're on a rendez-vous page of a group
  * @uses  rendez_vous()                         to get the plugin's instance
  * @uses  rendez_vous_handle_actions()          to insert/edit/delete/save prefs about a rendez-vous
  * @uses  bp_get_current_group_id()             to get the group id
  * @uses  Rendez_Vous_Group::group_get_option() to get the needed group metas.
  * @uses  groups_is_user_member()               to check the organizer is still a member of the group
  * @uses  delete_post_meta()                    to remove a rendez-vous from a group
  * @uses  rendez_vous_get_single_link()         to get the rendez-vous link
  * @uses  bp_core_add_message()                 to give a feedback to the user
  * @uses  do_action()                           call 'rendez_vous_groups_component_deactivated' or
  *                                                   'rendez_vous_groups_member_removed' to perform custom actions
  * @uses  bp_core_redirect()                    to safely redirect the user
  * @uses  bp_is_current_component()             to check for a BuddyPress component
  * @uses  bp_current_item()                     to make sure a group item is requested
  * @uses  bp_do_404()                           to set the WP Query to a 404.
  */
 public function group_handle_screens()
 {
     if ($this->is_rendez_vous()) {
         $rendez_vous = rendez_vous();
         $this->screen = rendez_vous_handle_actions();
         $rendez_vous->screens->screen = $this->screen;
         $group_id = bp_get_current_group_id();
         /**
          * Should we remove the rendez-vous from the group ?
          *
          * Although, this is already handled in Rendez_Vous_Group->group_rendez_vous_link()
          * an invited user can click on an email he received where the link is a group rendez-vous link.
          * @see rendez_vous_published_notification()
          *
          * Not checking if notifications are active, because there's also an edge case when the activity
          * has not been deleted yet and the user clicks on the activity link.
          */
         if ('single' == $this->screen && !empty($rendez_vous->item->id)) {
             $message = $action = false;
             // The group doesn't support rendez-vous anymore
             if (!self::group_get_option($group_id, '_rendez_vous_group_activate', false)) {
                 $message = __('The Group, the rendez-vous was attached to, does not support rendez-vous anymore', 'rendez-vous');
                 $action = 'rendez_vous_groups_component_deactivated';
                 // The organizer was removed or left the group
             } else {
                 if (!groups_is_user_member($rendez_vous->item->organizer, $group_id)) {
                     $message = sprintf(__('%s is not a member of the group, the rendez-vous was attached to, anymore. As a result, the rendez-vous was removed from the group.', 'rendez-vous'), bp_core_get_user_displayname($rendez_vous->item->organizer));
                     $action = 'rendez_vous_groups_member_removed';
                 }
             }
             // Bail if everything is ok.
             if (empty($message)) {
                 return;
             }
             // Delete the rendez-vous group id meta
             delete_post_meta($rendez_vous->item->id, '_rendez_vous_group_id');
             $redirect = rendez_vous_get_single_link($rendez_vous->item->id, $rendez_vous->item->organizer);
             bp_core_add_message($message, 'error');
             // fire an action to deal with group activities
             do_action($action, $rendez_vous->item->id, $rendez_vous->item);
             // Redirect to organizer's rendez-vous page
             bp_core_redirect($redirect);
         }
     } else {
         if (bp_is_current_component('groups') && bp_is_current_action($this->slug) && bp_current_item()) {
             bp_do_404();
             return;
         }
     }
 }
开发者ID:socialray,项目名称:surfied-2-0,代码行数:74,代码来源:rendez-vous-groups.php

示例11: bp_core_catch_no_access

/**
 * Catch unauthorized access to certain BuddyPress pages and redirect accordingly.
 *
 * @since 1.5.0
 */
function bp_core_catch_no_access()
{
    global $wp_query;
    $bp = buddypress();
    // If coming from bp_core_redirect() and $bp_no_status_set is true,
    // we are redirecting to an accessible page so skip this check.
    if (!empty($bp->no_status_set)) {
        return false;
    }
    if (!isset($wp_query->queried_object) && !bp_is_blog_page()) {
        bp_do_404();
    }
}
开发者ID:JeroenNouws,项目名称:BuddyPress,代码行数:18,代码来源:bp-core-catchuri.php

示例12: bp_core_catch_no_access

/**
 * Catches invalid access to BuddyPress pages and redirects them accordingly.
 *
 * @package BuddyPress Core
 * @since 1.5
 */
function bp_core_catch_no_access()
{
    global $bp, $bp_no_status_set, $nxt_query;
    // If bp_core_redirect() and $bp_no_status_set is true,
    // we are redirecting to an accessible page, so skip this check.
    if ($bp_no_status_set) {
        return false;
    }
    if (!isset($nxt_query->queried_object) && !bp_is_blog_page()) {
        bp_do_404();
    }
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:18,代码来源:bp-core-catchuri.php

示例13: bp_xprofile_screen_settings

/**
 * Show the xprofile settings template
 *
 * @since BuddyPress (2.0.0)
 */
function bp_xprofile_screen_settings()
{
    // Redirect if no privacy settings page is accessible
    if (bp_action_variables() || !bp_is_active('xprofile')) {
        bp_do_404();
        return;
    }
    /**
     * Filters the template to load for the XProfile settings screen.
     *
     * @since BuddyPress (2.0.0)
     *
     * @param string $template Path to the XProfile change avatar template to load.
     */
    bp_core_load_template(apply_filters('bp_settings_screen_xprofile', '/members/single/settings/profile'));
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:21,代码来源:bp-xprofile-screens.php

示例14: setup_globals


//.........这里部分代码省略.........
         $current_group_class = apply_filters('bp_groups_current_group_class', 'BP_Groups_Group');
         if ($current_group_class == 'BP_Groups_Group') {
             $this->current_group = groups_get_group(array('group_id' => $group_id, 'populate_extras' => true));
         } else {
             /**
              * Filters the current group object being instantiated from previous filter.
              *
              * @since 1.5.0
              *
              * @param object $value Newly instantiated object for the group.
              */
             $this->current_group = apply_filters('bp_groups_current_group_object', new $current_group_class($group_id));
         }
         // When in a single group, the first action is bumped down one because of the
         // group name, so we need to adjust this and set the group name to current_item.
         $bp->current_item = bp_current_action();
         $bp->current_action = bp_action_variable(0);
         array_shift($bp->action_variables);
         // Using "item" not "group" for generic support in other components.
         if (bp_current_user_can('bp_moderate')) {
             bp_update_is_item_admin(true, 'groups');
         } else {
             bp_update_is_item_admin(groups_is_user_admin(bp_loggedin_user_id(), $this->current_group->id), 'groups');
         }
         // If the user is not an admin, check if they are a moderator.
         if (!bp_is_item_admin()) {
             bp_update_is_item_mod(groups_is_user_mod(bp_loggedin_user_id(), $this->current_group->id), 'groups');
         }
         // Is the logged in user a member of the group?
         if (is_user_logged_in() && groups_is_user_member(bp_loggedin_user_id(), $this->current_group->id)) {
             $this->current_group->is_user_member = true;
         } else {
             $this->current_group->is_user_member = false;
         }
         // Should this group be visible to the logged in user?
         if ('public' == $this->current_group->status || $this->current_group->is_user_member) {
             $this->current_group->is_visible = true;
         } else {
             $this->current_group->is_visible = false;
         }
         // If this is a private or hidden group, does the user have access?
         if ('private' == $this->current_group->status || 'hidden' == $this->current_group->status) {
             if ($this->current_group->is_user_member && is_user_logged_in() || bp_current_user_can('bp_moderate')) {
                 $this->current_group->user_has_access = true;
             } else {
                 $this->current_group->user_has_access = false;
             }
         } else {
             $this->current_group->user_has_access = true;
         }
         // Check once if the current group has a custom front template.
         $this->current_group->front_template = bp_groups_get_front_template($this->current_group);
         // Set current_group to 0 to prevent debug errors.
     } else {
         $this->current_group = 0;
     }
     /**
      * Filters the list of illegal groups names/slugs.
      *
      * @since 1.0.0
      *
      * @param array $value Array of illegal group names/slugs.
      */
     $this->forbidden_names = apply_filters('groups_forbidden_names', array('my-groups', 'create', 'invites', 'send-invites', 'forum', 'delete', 'add', 'admin', 'request-membership', 'members', 'settings', 'avatar', $this->slug, $this->root_slug));
     // If the user was attempting to access a group, but no group by that name was found, 404.
     if (bp_is_groups_component() && empty($this->current_group) && bp_current_action() && !in_array(bp_current_action(), $this->forbidden_names)) {
         bp_do_404();
         return;
     }
     /**
      * Filters the preconfigured groups creation steps.
      *
      * @since 1.1.0
      *
      * @param array $value Array of preconfigured group creation steps.
      */
     $this->group_creation_steps = apply_filters('groups_create_group_steps', array('group-details' => array('name' => _x('Details', 'Group screen nav', 'buddypress'), 'position' => 0), 'group-settings' => array('name' => _x('Settings', 'Group screen nav', 'buddypress'), 'position' => 10)));
     // If avatar uploads are not disabled, add avatar option.
     $disabled_avatar_uploads = (int) bp_disable_group_avatar_uploads();
     if (!$disabled_avatar_uploads && $bp->avatar->show_avatars) {
         $this->group_creation_steps['group-avatar'] = array('name' => _x('Photo', 'Group screen nav', 'buddypress'), 'position' => 20);
     }
     if (bp_group_use_cover_image_header()) {
         $this->group_creation_steps['group-cover-image'] = array('name' => _x('Cover Image', 'Group screen nav', 'buddypress'), 'position' => 25);
     }
     // If friends component is active, add invitations.
     if (bp_is_active('friends')) {
         $this->group_creation_steps['group-invites'] = array('name' => _x('Invites', 'Group screen nav', 'buddypress'), 'position' => 30);
     }
     /**
      * Filters the list of valid groups statuses.
      *
      * @since 1.1.0
      *
      * @param array $value Array of valid group statuses.
      */
     $this->valid_status = apply_filters('groups_valid_status', array('public', 'private', 'hidden'));
     // Auto join group when non group member performs group activity.
     $this->auto_join = defined('BP_DISABLE_AUTO_GROUP_JOIN') && BP_DISABLE_AUTO_GROUP_JOIN ? false : true;
 }
开发者ID:JeroenNouws,项目名称:BuddyPress,代码行数:101,代码来源:bp-groups-loader.php

示例15: settings_ui

 function settings_ui()
 {
     if (bp_action_variables()) {
         bp_do_404();
         return;
     }
     // Load the template
     bp_core_load_template(apply_filters('bp_settings_screen_delete_account', 'members/single/plugins'));
 }
开发者ID:prdanielmota,项目名称:faama-site,代码行数:9,代码来源:RTMediaPrivacy.php


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