What is it? BuddyPressDEV.org is the community of BuddyPress' developers that creates and extend this platform.
[ Index ]

PHP Cross Reference of BuddyPress SVN Code

title

Body

[close]

/ -> bp-core.php (summary)

(no description)

File Size: 1564 lines (52 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 13 files
 bp-core/bp-core-activation.php
 bp-core/bp-core-cssjs.php
 bp-core/bp-core-classes.php
 bp-core/deprecated/bp-core-deprecated.php
 bp-core/bp-core-adminbar.php
 bp-core/bp-core-templatetags.php
 bp-core/bp-core-notifications.php
 bp-core/bp-core-settings.php
 bp-core/bp-core-signup.php
 bp-core/bp-core-avatars.php
 bp-core/bp-core-admin.php
 bp-core/bp-core-widgets.php
 bp-core/bp-core-catchuri.php

Defines 50 functions

  bp_core_setup_globals()
  bp_core_setup_root_uris()
  bp_core_install()
  bp_core_check_installed()
  bp_core_add_admin_menu()
  bp_core_is_root_component()
  bp_core_setup_nav()
  bp_core_action_directory_members()
  bp_core_get_user_domain()
  bp_core_get_root_domain()
  bp_core_get_displayed_userid()
  bp_core_new_nav_item()
  bp_core_sort_nav_items()
  bp_core_remove_nav_item()
  bp_core_new_subnav_item()
  bp_core_sort_subnav_items()
  bp_core_remove_subnav_item()
  bp_core_reset_subnav_items()
  bp_core_add_nav_default()
  bp_core_load_template()
  bp_core_add_root_component()
  bp_core_get_random_member()
  bp_core_get_userid()
  bp_core_get_username()
  bp_core_get_userurl()
  bp_core_get_user_email()
  bp_core_get_userlink()
  bp_core_get_user_displayname()
  bp_core_get_userlink_by_email()
  bp_core_get_userlink_by_username()
  bp_core_format_time()
  bp_core_add_message()
  bp_core_setup_message()
  bp_core_render_message()
  bp_core_time_since()
  bp_core_record_activity()
  bp_core_get_last_activity()
  bp_core_get_all_posts_for_user()
  bp_core_get_site_path()
  bp_core_redirect()
  bp_core_referrer()
  bp_core_add_illegal_names()
  bp_core_email_from_name_filter()
  bp_core_email_from_address_filter()
  bp_core_delete_account()
  bp_core_action_search_site()
  bp_core_ucfirst()
  bp_core_strip_username_spaces()
  bp_core_clear_cache()
  bp_core_print_generation_time()

Functions
Functions that are not part of a class:

bp_core_setup_globals()   X-Ref
bp_core_setup_globals()

Sets up default global BuddyPress configuration settings and stores
them in a $bp variable.


bp_core_setup_root_uris()   X-Ref
bp_core_setup_root_uris()

Adds the core URIs that should run in the root of the installation.

For example: http://example.org/search or http://example.org/members


bp_core_install()   X-Ref
bp_core_install()

Installs the core DB tables for BuddyPress.


bp_core_check_installed()   X-Ref
bp_core_check_installed()

Checks to make sure the database tables are set up for the core component.


bp_core_add_admin_menu()   X-Ref
bp_core_add_admin_menu()

Adds the "BuddyPress" admin submenu item to the Site Admin tab.


bp_core_is_root_component( $component_name )   X-Ref
bp_core_is_root_component()

Checks to see if a component's URL should be in the root, not under a member page:
eg: http://domain.com/groups/the-group NOT http://domain.com/members/andy/groups/the-group

return: true if root component, else false.

bp_core_setup_nav()   X-Ref
bp_core_setup_nav()

Sets up the profile navigation item if the Xprofile component is not installed.


bp_core_action_directory_members()   X-Ref
bp_core_action_directory_members()

Listens to the $bp component and action variables to determine if the user is viewing the members
directory page. If they are, it will set up the directory and load the members directory template.


bp_core_get_user_domain( $user_id )   X-Ref
bp_core_get_user_domain()

Returns the domain for the passed user:
e.g. http://domain.com/members/andy/

param: user_id The ID of the user.

bp_core_get_root_domain()   X-Ref
bp_core_get_root_domain()

Returns the domain for the root blog.
eg: http://domain.com/ OR https://domain.com

return: $domain The domain URL for the blog.

bp_core_get_displayed_userid( $user_login )   X-Ref
bp_core_get_displayed_userid()

Returns the user id for the user that is currently being displayed.
eg: http://andy.domain.com/ or http://domain.com/andy/

return: The user id for the user that is currently being displayed, return zero if this is not a user home and just a normal blog.

bp_core_new_nav_item( $args = '' )   X-Ref
bp_core_new_nav_item()

Adds a navigation item to the main navigation array used in BuddyPress themes.


bp_core_sort_nav_items()   X-Ref
bp_core_sort_nav_items()

We can only sort nav items by their position integer at a later point in time, once all
plugins have registered their navigation items.


bp_core_remove_nav_item( $name )   X-Ref
bp_core_remove_nav_item()

Removes a navigation item from the navigation array used in BuddyPress themes.

param: $parent_id The id of the parent navigation item.
param: $slug The slug of the sub navigation item.

bp_core_new_subnav_item( $args = '' )   X-Ref
bp_core_new_subnav_item()

Adds a navigation item to the sub navigation array used in BuddyPress themes.


bp_core_sort_subnav_items()   X-Ref
No description

bp_core_remove_subnav_item( $parent_id, $slug )   X-Ref
bp_core_remove_subnav_item()

Removes a navigation item from the sub navigation array used in BuddyPress themes.

param: $parent_id The id of the parent navigation item.
param: $slug The slug of the sub navigation item.

bp_core_reset_subnav_items($parent_slug)   X-Ref
bp_core_reset_subnav_items()

Clear the subnav items for a specific nav item.

param: $parent_id The id of the parent navigation item.

bp_core_add_nav_default( $parent_id, $function, $slug = false, $user_has_access = true, $admin_only = false )   X-Ref
bp_core_add_nav_default()

Set a default action for a nav item, when a sub nav item has not yet been selected.

param: $parent_id The id of the parent navigation item.
param: $function The function to run when this sub nav item is selected.
param: $slug The slug of the sub nav item to highlight.

bp_core_load_template( $template, $skip_blog_check = false )   X-Ref
bp_core_load_template()

Uses the bp_catch_uri function to load a specific template file with fallback support.

Example:
bp_core_load_template( 'profile/edit-profile' );
Loads:
wp-content/member-themes/[activated_theme]/profile/edit-profile.php

param: $username str Username to check.
return: false on no match
return: int the user ID of the matched user.

bp_core_add_root_component( $slug )   X-Ref
bp_core_add_root_component()

Adds a component to the $bp->root_components global.
Any component that runs in the "root" of an install should be added.
The "root" as in, it can or always runs outside of the /members/username/ path.

Example of a root component:
Groups: http://domain.com/groups/group-name
http://community.domain.com/groups/group-name
http://domain.com/wpmu/groups/group-name

Example of a component that is NOT a root component:
Friends: http://domain.com/members/andy/friends
http://community.domain.com/members/andy/friends
http://domain.com/wpmu/members/andy/friends

param: $slug str The slug of the component

bp_core_get_random_member()   X-Ref
bp_core_get_random_member()

Returns the user_id for a user based on their username.

param: $username str Username to check.
return: false on no match
return: int the user ID of the matched user.

bp_core_get_userid( $username )   X-Ref
bp_core_get_userid()

Returns the user_id for a user based on their username.

param: $username str Username to check.
return: false on no match
return: int the user ID of the matched user.

bp_core_get_username( $uid )   X-Ref
bp_core_get_username()

Returns the username for a user based on their user id.

param: $uid int User ID to check.
return: false on no match
return: str the username of the matched user.

bp_core_get_userurl( $uid )   X-Ref
bp_core_get_userurl()

Returns the URL with no HTML markup for a user based on their user id.

param: $uid int User ID to check.
return: false on no match
return: str The URL for the user with no HTML formatting.

bp_core_get_user_email( $uid )   X-Ref
bp_core_get_user_email()

Returns the email address for the user based on user ID

param: $uid int User ID to check.
return: false on no match
return: str The email for the matched user.

bp_core_get_userlink( $user_id, $no_anchor = false, $just_link = false, $deprecated = false, $with_s = false )   X-Ref
bp_core_get_userlink()

Returns a HTML formatted link for a user with the user's full name as the link text.
eg: <a href="http://andy.domain.com/">Andy Peatling</a>
Optional parameters will return just the name, or just the URL, or disable "You" text when
user matches the logged in user.

[NOTES: This function needs to be cleaned up or split into separate functions]

param: $uid int User ID to check.
param: $no_anchor bool Disable URL and HTML and just return full name. Default false.
param: $just_link bool Disable full name and HTML and just return the URL text. Default false.
param: $no_you bool Disable replacing full name with "You" when logged in user is equal to the current user. Default false.
return: false on no match
return: str The link text based on passed parameters.

bp_core_get_user_displayname( $user_id )   X-Ref
bp_core_get_user_displayname()

Fetch the display name for a user. This will use the "Name" field in xprofile if it is installed.
Otherwise, it will fall back to the normal WP display_name, or user_nicename, depending on what has been set.

return: str The display name for the user in question.

bp_core_get_userlink_by_email( $email )   X-Ref
bp_core_get_userlink_by_email()

Returns the user link for the user based on user email address

param: $email str The email address for the user.
return: str The link to the users home base. False on no match.

bp_core_get_userlink_by_username( $username )   X-Ref
bp_core_get_userlink_by_username()

Returns the user link for the user based on user's username

param: $username str The username for the user.
return: str The link to the users home base. False on no match.

bp_core_format_time( $time, $just_date = false )   X-Ref
bp_core_get_user_email()

Returns the email address for the user based on user ID

param: $uid int User ID to check.
return: false on no match
return: str The email for the matched user.

bp_core_add_message( $message, $type = false )   X-Ref
bp_core_add_message()

Adds a feedback (error/success) message to the WP cookie so it can be displayed after the page reloads.


bp_core_setup_message()   X-Ref
bp_core_setup_message()

Checks if there is a feedback message in the WP cookie, if so, adds a "template_notices" action
so that the message can be parsed into the template and displayed to the user.

After the message is displayed, it removes the message vars from the cookie so that the message
is not shown to the user multiple times.


bp_core_render_message()   X-Ref
bp_core_render_message()

Renders a feedback message (either error or success message) to the theme template.
The hook action 'template_notices' is used to call this function, it is not called directly.


bp_core_time_since( $older_date, $newer_date = false )   X-Ref
bp_core_time_since()

Based on function created by Dunstan Orchard - http://1976design.com

This function will return an English representation of the time elapsed
since a given date.
eg: 2 hours and 50 minutes
eg: 4 days
eg: 4 weeks and 6 days

param: $older_date int Unix timestamp of date you want to calculate the time since for
param: $newer_date int Unix timestamp of date to compare older date to. Default false (current time).
return: str The time since.

bp_core_record_activity()   X-Ref
bp_core_record_activity()

Record user activity to the database. Many functions use a "last active" feature to
show the length of time since the user was last active.
This function will update that time as a usermeta setting for the user every 5 minutes.


bp_core_get_last_activity( $last_activity_date, $string )   X-Ref
bp_core_get_last_activity()

Formats last activity based on time since date given.

param: last_activity_date The date of last activity.
param: $before The text to prepend to the activity time since figure.
param: $after The text to append to the activity time since figure.

bp_core_get_all_posts_for_user( $user_id = null )   X-Ref
bp_core_get_all_posts_for_user()

Fetch every post that is authored by the given user for the current blog.

return: array of post ids.

bp_core_get_site_path()   X-Ref
bp_core_get_site_path()

Get the path of of the current site.


bp_core_redirect( $location, $status = 302 )   X-Ref
bp_core_redirect()

Performs a status safe wp_redirect() that is compatible with bp_catch_uri()

return: An array containing all of the themes.

bp_core_referrer()   X-Ref
bp_core_referrer()

Returns the referrer URL without the http(s)://

return: The referrer URL

bp_core_add_illegal_names()   X-Ref
bp_core_add_illegal_names()

Adds illegal names to WP so that root components will not conflict with
blog names on a subdirectory installation.

For example, it would stop someone creating a blog with the slug "groups".


bp_core_email_from_name_filter()   X-Ref
bp_core_email_from_name_filter()

Sets the "From" name in emails sent to the name of the site and not "WordPress"

return: The blog name for the root blog

bp_core_email_from_address_filter()   X-Ref
bp_core_email_from_name_filter()

Sets the "From" address in emails sent

return: noreply@sitedomain email address

bp_core_delete_account()   X-Ref
bp_core_delete_account()

Allows a user to completely remove their account from the system


bp_core_action_search_site( $slug = false )   X-Ref
bp_core_search_site()

A javascript free implementation of the search functions in BuddyPress

param: $slug The slug to redirect to for searching.

bp_core_ucfirst( $str )   X-Ref
bp_core_ucfirst()

Localization safe ucfirst() support.


bp_core_strip_username_spaces( $username )   X-Ref
bp_core_strip_username_spaces()

Strips spaces from usernames that are created using add_user() and wp_insert_user()


bp_core_clear_cache()   X-Ref
bp_core_clear_cache()
REQUIRES WP-SUPER-CACHE

When wp-super-cache is installed this function will clear cached pages
so that success/error messages are not cached, or time sensitive content.


bp_core_print_generation_time()   X-Ref
bp_core_print_generation_time()

Prints the generation time in the footer of the site.




Generated: Sat Aug 22 14:49:03 2009 Cross-referenced by PHPXref 0.7 Thanks to