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


PHP bp_get_site_name函数代码示例

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


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

示例1: etivite_bp_activity_hashtags_screen_router

/**
 * Screen router for activity hashtags.
 *
 * Determines if we're on a hashtag page. If so, sends things along their
 * merry way!
 */
function etivite_bp_activity_hashtags_screen_router()
{
    if (!bp_is_activity_component() || !bp_is_current_action(BP_ACTIVITY_HASHTAGS_SLUG)) {
        return false;
    }
    if (!bp_action_variables()) {
        return false;
    }
    // RSS feed support
    if (bp_is_action_variable('feed', 1)) {
        // the cool way (BP 1.8+)
        if (class_exists('BP_Activity_Feed')) {
            global $bp;
            // setup the feed
            $bp->activity->feed = new BP_Activity_Feed(array('id' => 'sitewide-hashtag', 'title' => sprintf(__('%1$s | #%2$s | Hashtag', 'bp-follow'), bp_get_site_name(), urldecode(esc_attr(bp_action_variable(0)))), 'link' => bp_get_activity_hashtags_permalink(esc_attr(bp_action_variable(0))), 'description' => sprintf(__("Activity feed for the hashtag, #%s.", 'buddypress'), urldecode(esc_attr(bp_action_variable(0)))), 'activity_args' => array('search_terms' => '#' . bp_action_variable(0) . '<', 'display_comments' => 'stream')));
            // the ugly way
        } else {
            global $wp_query;
            $wp_query->is_404 = false;
            status_header(200);
            include_once dirname(__FILE__) . '/feeds/bp-activity-hashtags-feed.php';
            die;
        }
    } else {
        // BP 1.7 - add theme compat
        if (class_exists('BP_Theme_Compat')) {
            new BP_Activity_Hashtags_Theme_Compat();
        }
        bp_core_load_template('activity/index');
    }
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:37,代码来源:bp-activity-hashtags.php

示例2: rss_handler

 /**
  * RSS handler for a user's followed sites.
  *
  * When a user lands on /members/USERNAME/activity/followblogs/feed/, this
  * method generates the RSS feed for their followed sites.
  */
 public static function rss_handler()
 {
     // only available in BP 1.8+
     if (!class_exists('BP_Activity_Feed')) {
         return;
     }
     if (!bp_is_user_activity() || !bp_is_current_action(constant('BP_FOLLOW_BLOGS_USER_ACTIVITY_SLUG')) || !bp_is_action_variable('feed', 0)) {
         return;
     }
     // get blog IDs that the user is following
     $following_ids = bp_get_following_ids(array('follow_type' => 'blogs'));
     // if $following_ids is empty, pass a negative number so no blogs can be found
     $following_ids = empty($following_ids) ? -1 : $following_ids;
     $args = array('user_id' => 0, 'object' => 'blogs', 'primary_id' => $following_ids);
     // setup the feed
     buddypress()->activity->feed = new BP_Activity_Feed(array('id' => 'followedsites', 'title' => sprintf(__('%1$s | %2$s | Followed Site Activity', 'bp-follow'), bp_get_site_name(), bp_get_displayed_user_fullname()), 'link' => trailingslashit(bp_displayed_user_domain() . bp_get_activity_slug() . '/' . constant('BP_FOLLOW_BLOGS_USER_ACTIVITY_SLUG')), 'description' => sprintf(__("Activity feed for sites that %s is following.", 'buddypress'), bp_get_displayed_user_fullname()), 'activity_args' => $args));
 }
开发者ID:vikramshaw,项目名称:buddypress-followers,代码行数:23,代码来源:blogs.php

示例3: bp_settings_action_general

/**
 * Handles the changing and saving of user email addresses and passwords.
 *
 * We do quite a bit of logic and error handling here to make sure that users
 * do not accidentally lock themselves out of their accounts. We also try to
 * provide as accurate of feedback as possible without exposing anyone else's
 * information to them.
 *
 * Special considerations are made for super admins that are able to edit any
 * users accounts already, without knowing their existing password.
 *
 * @global BuddyPress $bp
 */
function bp_settings_action_general()
{
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    // Bail if no submit action
    if (!isset($_POST['submit'])) {
        return;
    }
    // Bail if not in settings
    if (!bp_is_settings_component() || !bp_is_current_action('general')) {
        return;
    }
    // 404 if there are any additional action variables attached
    if (bp_action_variables()) {
        bp_do_404();
        return;
    }
    // Define local defaults
    $bp = buddypress();
    // The instance
    $email_error = false;
    // invalid|blocked|taken|empty|nochange
    $pass_error = false;
    // invalid|mismatch|empty|nochange
    $pass_changed = false;
    // true if the user changes their password
    $email_changed = false;
    // true if the user changes their email
    $feedback_type = 'error';
    // success|error
    $feedback = array();
    // array of strings for feedback
    // Nonce check
    check_admin_referer('bp_settings_general');
    // Validate the user again for the current password when making a big change
    if (is_super_admin() || !empty($_POST['pwd']) && wp_check_password($_POST['pwd'], $bp->displayed_user->userdata->user_pass, bp_displayed_user_id())) {
        $update_user = get_userdata(bp_displayed_user_id());
        /** Email Change Attempt ******************************************/
        if (!empty($_POST['email'])) {
            // What is missing from the profile page vs signup -
            // let's double check the goodies
            $user_email = sanitize_email(esc_html(trim($_POST['email'])));
            $old_user_email = $bp->displayed_user->userdata->user_email;
            // User is changing email address
            if ($old_user_email != $user_email) {
                // Run some tests on the email address
                $email_checks = bp_core_validate_email_address($user_email);
                if (true !== $email_checks) {
                    if (isset($email_checks['invalid'])) {
                        $email_error = 'invalid';
                    }
                    if (isset($email_checks['domain_banned']) || isset($email_checks['domain_not_allowed'])) {
                        $email_error = 'blocked';
                    }
                    if (isset($email_checks['in_use'])) {
                        $email_error = 'taken';
                    }
                }
                // Store a hash to enable email validation
                if (false === $email_error) {
                    $hash = wp_hash($_POST['email']);
                    $pending_email = array('hash' => $hash, 'newemail' => $user_email);
                    bp_update_user_meta(bp_displayed_user_id(), 'pending_email_change', $pending_email);
                    $email_text = sprintf(__('Dear %1$s,

You recently changed the email address associated with your account on %2$s.
If this is correct, please click on the following link to complete the change:
%3$s

You can safely ignore and delete this email if you do not want to take this action or if you have received this email in error.

This email has been sent to %4$s.

Regards,
%5$s
%6$s', 'buddypress'), bp_core_get_user_displayname(bp_displayed_user_id()), bp_get_site_name(), esc_url(bp_displayed_user_domain() . bp_get_settings_slug() . '/?verify_email_change=' . $hash), $user_email, bp_get_site_name(), bp_get_root_domain());
                    /**
                     * Filter the email text sent when a user changes emails.
                     *
                     * @since 2.1.0
                     *
                     * @param string  $email_text     Text of the email.
                     * @param string  $new_user_email New user email that the
                     *                                current user has changed to.
                     * @param string  $old_user_email Existing email address
//.........这里部分代码省略.........
开发者ID:mawilliamson,项目名称:wordpress,代码行数:101,代码来源:bp-settings-actions.php

示例4: bp_follow_my_following_feed

/**
 * Add RSS feed support for a user's following activity.
 *
 * eg. example.com/members/USERNAME/activity/following/feed/
 *
 * Only available in BuddyPress 1.8+.
 *
 * @since 1.2.1
 * @author r-a-y
 */
function bp_follow_my_following_feed()
{
    // only available in BP 1.8+
    if (!class_exists('BP_Activity_Feed')) {
        return;
    }
    if (!bp_is_user_activity() || !bp_is_current_action(constant('BP_FOLLOWING_SLUG')) || !bp_is_action_variable('feed', 0)) {
        return false;
    }
    global $bp;
    // setup the feed
    $bp->activity->feed = new BP_Activity_Feed(array('id' => 'myfollowing', 'title' => sprintf(__('%1$s | %2$s | Following Activity', 'bp-follow'), bp_get_site_name(), bp_get_displayed_user_fullname()), 'link' => trailingslashit(bp_displayed_user_domain() . bp_get_activity_slug() . '/' . constant('BP_FOLLOWING_SLUG')), 'description' => sprintf(__("Activity feed for people that %s is following.", 'buddypress'), bp_get_displayed_user_fullname()), 'activity_args' => array('user_id' => bp_get_following_ids(), 'display_comments' => 'threaded')));
}
开发者ID:wesavetheworld,项目名称:buddypress-followers,代码行数:23,代码来源:actions.php

示例5: bp_site_name

/**
 * Output the name of the BP site. Used in RSS headers.
 *
 * @since 1.0.0
 */
function bp_site_name()
{
    echo bp_get_site_name();
}
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:9,代码来源:bp-core-template.php

示例6: groups_action_group_feed

/**
 * Load the activity feed for the current group.
 *
 * @since BuddyPress (1.2.0)
 *
 * @return bool|null False on failure.
 */
function groups_action_group_feed()
{
    // get current group
    $group = groups_get_current_group();
    if (!bp_is_active('activity') || !bp_is_groups_component() || !$group || !bp_is_current_action('feed')) {
        return false;
    }
    // if group isn't public or if logged-in user is not a member of the group, do
    // not output the group activity feed
    if (!bp_group_is_visible($group)) {
        return false;
    }
    // setup the feed
    buddypress()->activity->feed = new BP_Activity_Feed(array('id' => 'group', 'title' => sprintf(__('%1$s | %2$s | Activity', 'buddypress'), bp_get_site_name(), bp_get_current_group_name()), 'link' => bp_get_group_permalink($group), 'description' => sprintf(__("Activity feed for the group, %s.", 'buddypress'), bp_get_current_group_name()), 'activity_args' => array('object' => buddypress()->groups->id, 'primary_id' => bp_get_current_group_id(), 'display_comments' => 'threaded')));
}
开发者ID:eresyyl,项目名称:mk,代码行数:22,代码来源:bp-groups-actions.php

示例7: bp_activity_action_favorites_feed

/**
 * Load a user's favorites feed.
 *
 * @since 1.2.0
 *
 * @uses bp_is_user_activity()
 * @uses bp_is_current_action()
 * @uses bp_is_action_variable()
 * @uses status_header()
 *
 * @return bool False on failure.
 */
function bp_activity_action_favorites_feed()
{
    if (!bp_is_user_activity() || !bp_is_current_action('favorites') || !bp_is_action_variable('feed', 0)) {
        return false;
    }
    // Get displayed user's favorite activity IDs.
    $favs = bp_activity_get_user_favorites(bp_displayed_user_id());
    $fav_ids = implode(',', (array) $favs);
    // Setup the feed.
    buddypress()->activity->feed = new BP_Activity_Feed(array('id' => 'favorites', 'title' => sprintf(__('%1$s | %2$s | Favorites', 'buddypress'), bp_get_site_name(), bp_get_displayed_user_fullname()), 'link' => bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/', 'description' => sprintf(__("Activity feed of %s's favorites.", 'buddypress'), bp_get_displayed_user_fullname()), 'activity_args' => 'include=' . $fav_ids));
}
开发者ID:swissspidy,项目名称:BuddyPress,代码行数:23,代码来源:bp-activity-actions.php

示例8: do_action

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	<?php 
do_action('bp_activity_personal_feed');
?>
>

<channel>
	<?php 
/* translators: Personal activity RSS title - "[Site Name] | [Displayed User Name] | Activity" */
?>
	<title><?php 
printf('%1$s | %2$s | %3$s', bp_get_site_name(), bp_get_displayed_user_fullname(), __('Activity', 'buddypress'));
?>
</title>
	<atom:link href="<?php 
self_link();
?>
" rel="self" type="application/rss+xml" />
	<link><?php 
echo bp_displayed_user_domain() . bp_get_activity_slug() . '/feed';
?>
</link>
	<description><?php 
printf(__('%s - Activity Feed', 'buddypress'), bp_get_displayed_user_fullname());
?>
</description>
	<pubDate><?php 
开发者ID:adisonc,项目名称:MaineLearning,代码行数:31,代码来源:bp-activity-personal-feed.php

示例9: rss_handler

 /**
  * RSS handler for a user's followed sites.
  *
  * When a user lands on /members/USERNAME/activity/followblogs/feed/, this
  * method generates the RSS feed for their followed sites.
  */
 public function rss_handler()
 {
     // only available in BP 1.8+
     if (!class_exists('BP_Activity_Feed')) {
         return;
     }
     if (!bp_is_user_activity() || !bp_is_current_action(constant('BP_FOLLOW_ACTIVITY_USER_ACTIVITY_SLUG')) || !bp_is_action_variable('feed', 0)) {
         return;
     }
     $args = array('user_id' => bp_displayed_user_id(), 'scope' => 'follow');
     // setup the feed
     buddypress()->activity->feed = new BP_Activity_Feed(array('id' => 'followedactivity', 'title' => sprintf(__('%1$s | %2$s | Followed Activity', 'bp-follow'), bp_get_site_name(), bp_get_displayed_user_fullname()), 'link' => esc_url(trailingslashit(bp_displayed_user_domain() . bp_get_activity_slug() . '/' . constant('BP_FOLLOW_ACTIVITY_USER_ACTIVITY_SLUG'))), 'description' => sprintf(__("Feed for activity that %s is following.", 'buddypress'), bp_get_displayed_user_fullname()), 'activity_args' => $args));
 }
开发者ID:wesavetheworld,项目名称:buddypress-followers,代码行数:19,代码来源:activity-module.php

示例10: do_action

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	<?php 
do_action('bp_activity_sitewide_feed');
?>
>

<channel>
	<?php 
/* translators: Sitewide activity RSS title - "[Site Name] | Site Wide Activity" */
?>
	<title><?php 
printf('%1$s | %2$s', bp_get_site_name(), __('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 
开发者ID:adisonc,项目名称:MaineLearning,代码行数:31,代码来源:bp-activity-sitewide-feed.php

示例11: do_action

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	<?php 
do_action('bp_activity_group_feed');
?>
>

<channel>
	<?php 
/* translators: Single group activity RSS title - "[Site Name] | [Group Name] | Group Activity" */
?>
	<title><?php 
printf('%1$s | %2$s | %3$s', bp_get_site_name(), bp_get_current_group_name(), __('Group Activity', 'buddypress'));
?>
</title>
	<atom:link href="<?php 
self_link();
?>
" rel="self" type="application/rss+xml" />
	<link><?php 
echo bp_get_group_permalink($bp->groups->current_group) . bp_get_activity_slug() . '/feed';
?>
</link>
	<description><?php 
printf(__('%s - Group Activity Feed', 'buddypress'), $bp->groups->current_group->name);
?>
</description>
	<pubDate><?php 
开发者ID:adisonc,项目名称:MaineLearning,代码行数:31,代码来源:bp-activity-group-feed.php


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