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


PHP bp_get_root_slug函数代码示例

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


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

示例1: meso_fetch_random_groups

function meso_fetch_random_groups($limit = '', $size = '', $type = '', $block_id = '')
{
    global $wpdb, $bp;
    $fetch_group = "SELECT * FROM " . $wpdb->base_prefix . "bp_groups WHERE status = 'public' ORDER BY rand() LIMIT {$limit}";
    $sql_fetch_group = $wpdb->get_results($fetch_group);
    ?>
<ul class="random-groups item-list group-in-<?php 
    echo $block_id;
    ?>
">
<?php 
    $no_avatar = 'http://www.gravatar.com/avatar';
    foreach ($sql_fetch_group as $group_fe) {
        $avatar_full = bp_core_fetch_avatar('item_id=' . $group_fe->id . '&class=avatar&object=group&type=' . $type . '&width=' . $size . '&height=' . $size);
        $group_description = stripslashes($group_fe->description);
        ?>
<li>
<div class="item-avatar"><?php 
        echo $avatar_full;
        ?>
</div>
<div class="item">
<div class="item-title">
<a title="<?php 
        echo $group_fe->name . ' - ' . dez_get_short_text($group_description, 150);
        ?>
" href="<?php 
        echo home_url() . '/' . bp_get_root_slug('groups') . '/' . $group_fe->slug;
        ?>
"><?php 
        echo $group_fe->name;
        ?>
</a>
</div>
<div class="item-meta">
<span class="activity">
<?php 
        echo groups_get_groupmeta($group_fe->id, $meta_key = 'total_member_count');
        ?>
 <?php 
        echo bp_get_root_slug('members');
        ?>
</span>
</div>
</div>
</li>
<?php 
    }
    ?>
</ul>
<?php 
}
开发者ID:jun200,项目名称:wordpress,代码行数:52,代码来源:bp-theme-functions.php

示例2: maybe_redirect

 /**
  * Check user access and redirect if access denied
  */
 public function maybe_redirect()
 {
     // always allow access to blog, registration and activation pages
     if (bp_is_blog_page() || bp_is_register_page() || bp_is_activation_page()) {
         return;
     }
     // grab toggle option from registry
     $opt_toggle = $this->get_suboption('toggle');
     // is option toggled on?
     if ($opt_toggle && true == $opt_toggle->get()) {
         // protection is enabled, is user logged in?
         if (!is_user_logged_in()) {
             // not logged in, redirect to registration page
             bp_core_redirect(bp_get_root_domain() . '/' . bp_get_root_slug('register'));
             // exit to avoid any accidental output
             exit;
         }
     }
 }
开发者ID:shads196770,项目名称:cbox-theme,代码行数:22,代码来源:class.php

示例3: meso_schema_breadcrumbs


//.........这里部分代码省略.........
                    }
                    if ($taxlist) {
                        echo $taxlist;
                    }
                }
                echo ' ' . $delimiter . ' ' . __('You are reading &raquo;', 'mesocolumn');
            } else {
                $category = get_the_category();
                if ($category) {
                    foreach ($category as $cat) {
                        echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_category_link($cat->term_id) . '">' . '<span' . $schema_prop_title . '>' . $cat->name . '</span>' . '</a></span>' . $delimiter . ' ';
                    }
                }
                echo __('You are reading &raquo;', 'mesocolumn');
            }
        } elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()) {
            $post_type = get_post_type_object(get_post_type());
            echo $before . $post_type->labels->singular_name . $after;
        } elseif (is_attachment()) {
            $parent = get_post($post->post_parent);
            $cat = get_the_category($parent->ID);
            $cat = $cat[0];
            if ($cat) {
                echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
            }
            echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink($parent) . '">' . '<span' . $schema_prop_title . '>' . $parent->post_title . '</span>' . '</a></span>';
            if ($showCurrent == 1) {
                echo ' ' . $delimiter . ' ' . $before . get_the_title() . $after;
            }
        } elseif (is_page() && !$post->post_parent) {
            if (class_exists('buddypress')) {
                global $bp;
                if (bp_is_groups_component()) {
                    echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('groups') . '">' . '<span' . $schema_prop_title . '>' . bp_get_root_slug('groups') . '</span>' . '</a></span>';
                    if (!bp_is_directory()) {
                        echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('groups') . '/' . bp_current_item() . '">' . '<span' . $schema_prop_title . '>' . bp_current_item() . '</span>' . '</a></span>';
                        if (bp_current_action()) {
                            echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('groups') . '/' . bp_current_item() . '/' . bp_current_action() . '">' . '<span' . $schema_prop_title . '>' . bp_current_action() . '</span>' . '</a></span>';
                        }
                    }
                } else {
                    if (bp_is_members_directory()) {
                        echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('members') . '">' . '<span' . $schema_prop_title . '>' . bp_get_root_slug('members') . '</span>' . '</a></span>';
                    } else {
                        if (bp_is_user()) {
                            echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('members') . '">' . '<span' . $schema_prop_title . '>' . bp_get_root_slug('members') . '</span>' . '</a></span>';
                            echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . bp_core_get_user_domain($bp->displayed_user->id) . '">' . '<span' . $schema_prop_title . '>' . bp_get_displayed_user_username() . '</span>' . '</a></span>';
                            if (bp_current_action()) {
                                echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . bp_core_get_user_domain($bp->displayed_user->id) . bp_current_component() . '">' . '<span' . $schema_prop_title . '>' . bp_current_component() . '</span>' . '</a></span>';
                            }
                        } else {
                            if (bp_is_directory()) {
                                echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . bp_current_component() . '</span>' . '</a></span>';
                            } else {
                                echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . the_title_attribute('echo=0') . '</span>' . '</a></span>';
                            }
                        }
                    }
                }
            } else {
                echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . the_title_attribute('echo=0') . '</span>' . '</a></span>';
            }
        } elseif (is_page() && $post->post_parent) {
            $parent_id = $post->post_parent;
            $breadcrumbs = array();
            while ($parent_id) {
开发者ID:jun200,项目名称:wordpress,代码行数:67,代码来源:hooks-functions.php

示例4: bp_root_slug

/**
 * Output the root slug for a given component.
 *
 * @since 1.5.0
 *
 * @param string $component The component name.
 */
function bp_root_slug($component = '')
{
    echo bp_get_root_slug($component);
}
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:11,代码来源:bp-core-template.php

示例5: bp_tpack_theme_menu


//.........这里部分代码省略.........
		<div style="float: left; width: 37%;">

			<?php 
        /* In BP 1.5+, we remove the "BuddyPress is ready" message dynamically */
        ?>
			<?php 
        if (version_compare(BP_VERSION, '1.3') <= 0) {
            ?>
				<p style="line-height: 180%; border: 1px solid #eee; background: #fff; padding: 5px 10px;"><?php 
            _e('<strong>NOTE:</strong> To remove the "BuddyPress is ready" message you will need to add a "buddypress" tag to your theme. You can do this by editing the <code>style.css</code> file of your active theme and adding the tag to the "Tags:" line in the comment header.', 'bp-tpack');
            ?>
</p>
			<?php 
        }
        ?>

			<h4><?php 
        _e('Navigation Links', 'bp-tpack');
        ?>
</h4>

			<p><?php 
        _e('You may want to add new navigation tabs or links to your theme to link to BuddyPress directory pages. The default set of links are:', 'bp-tpack');
        ?>
</p>
				<ul>
					<?php 
        if (bp_is_active('activity')) {
            ?>
						<li><?php 
            _e('Activity', 'bp-tpack');
            ?>
: <a href="<?php 
            echo get_option('home') . '/' . bp_get_root_slug(BP_ACTIVITY_SLUG) . '/';
            ?>
"><?php 
            echo get_option('home') . '/' . BP_ACTIVITY_SLUG . '/';
            ?>
</a></li>
					<?php 
        }
        ?>

					<li><?php 
        _e('Members', 'bp-tpack');
        ?>
: <a href="<?php 
        echo get_option('home') . '/' . bp_get_root_slug(BP_MEMBERS_SLUG) . '/';
        ?>
"><?php 
        echo get_option('home') . '/' . BP_MEMBERS_SLUG . '/';
        ?>
</a></li>

					<?php 
        if (bp_is_active('groups')) {
            ?>
						<li><?php 
            _e('Groups', 'bp-tpack');
            ?>
: <a href="<?php 
            echo get_option('home') . '/' . bp_get_root_slug(BP_GROUPS_SLUG) . '/';
            ?>
"><?php 
            echo get_option('home') . '/' . BP_GROUPS_SLUG . '/';
            ?>
开发者ID:picassentviu,项目名称:AMMPro,代码行数:67,代码来源:bpt-admin.php

示例6: bp_modify_page_title

/**
 * Filter the page title for BuddyPress pages
 *
 * @global object $bp BuddyPress global settings
 * @param string $title Original page title
 * @param string $sep How to separate the various items within the page title.
 * @param string $seplocation Direction to display title
 * @return string new page title
 * @see wp_title()
 * @since BuddyPress (1.5)
 */
function bp_modify_page_title($title, $sep, $seplocation)
{
    global $bp;
    // If this is not a BP page, just return the title produced by WP
    if (bp_is_blog_page()) {
        return $title;
    }
    // If this is the front page of the site, return WP's title
    if (is_front_page() || is_home()) {
        return $title;
    }
    $title = '';
    // Displayed user
    if (bp_get_displayed_user_fullname() && !is_404()) {
        // Get the component's ID to try and get it's name
        $component_id = $component_name = bp_current_component();
        // Use the actual component name
        if (!empty($bp->{$component_id}->name)) {
            $component_name = $bp->{$component_id}->name;
            // Fall back on the component ID (probably same as current_component)
        } elseif (!empty($bp->{$component_id}->id)) {
            $component_name = $bp->{$component_id}->id;
        }
        // translators: "displayed user's name | canonicalised component name"
        $title = strip_tags(sprintf(__('%1$s | %2$s', 'buddypress'), bp_get_displayed_user_fullname(), ucwords($component_name)));
        // A single group
    } elseif (bp_is_active('groups') && !empty($bp->groups->current_group) && !empty($bp->bp_options_nav[$bp->groups->current_group->slug])) {
        $subnav = isset($bp->bp_options_nav[$bp->groups->current_group->slug][bp_current_action()]['name']) ? $bp->bp_options_nav[$bp->groups->current_group->slug][bp_current_action()]['name'] : '';
        // translators: "group name | group nav section name"
        $title = sprintf(__('%1$s | %2$s', 'buddypress'), $bp->bp_options_title, $subnav);
        // A single item from a component other than groups
    } elseif (bp_is_single_item()) {
        // translators: "component item name | component nav section name | root component name"
        $title = sprintf(__('%1$s | %2$s | %3$s', 'buddypress'), $bp->bp_options_title, $bp->bp_options_nav[bp_current_item()][bp_current_action()]['name'], bp_get_name_from_root_slug(bp_get_root_slug()));
        // An index or directory
    } elseif (bp_is_directory()) {
        if (!bp_current_component()) {
            $title = sprintf(__('%s Directory', 'buddypress'), bp_get_name_from_root_slug());
        } else {
            $title = sprintf(__('%s Directory', 'buddypress'), bp_get_name_from_root_slug());
        }
        // Sign up page
    } elseif (bp_is_register_page()) {
        $title = __('Create an Account', 'buddypress');
        // Activation page
    } elseif (bp_is_activation_page()) {
        $title = __('Activate your Account', 'buddypress');
        // Group creation page
    } elseif (bp_is_group_create()) {
        $title = __('Create a Group', 'buddypress');
        // Blog creation page
    } elseif (bp_is_create_blog()) {
        $title = __('Create a Site', 'buddypress');
    }
    // Some BP nav items contain item counts. Remove them
    $title = preg_replace('|<span>[0-9]+</span>|', '', $title);
    return apply_filters('bp_modify_page_title', $title . ' ' . $sep . ' ', $title, $sep, $seplocation);
}
开发者ID:par-orillonsoft,项目名称:Wishmagnet,代码行数:69,代码来源:bp-core-filters.php

示例7: fetch_random_notfriend

    function fetch_random_notfriend($limit = 6, $size = 120)
    {
        global $wpdb, $bp, $friendList, $initiatorList;
        $current_loggedin_user = $bp->loggedin_user->id;
        $fetch_friend = "SELECT * FROM " . $wpdb->base_prefix . "bp_friends WHERE friend_user_id = '" . $current_loggedin_user . "' AND is_confirmed = '1' ORDER BY rand() LIMIT {$limit}";
        $sql_fetch_friend = $wpdb->get_results($fetch_friend);
        $fetch_initiator = "SELECT * FROM " . $wpdb->base_prefix . "bp_friends WHERE initiator_user_id = '" . $current_loggedin_user . "' AND is_confirmed = '1' ORDER BY rand() LIMIT {$limit}";
        $sql_fetch_initiator = $wpdb->get_results($fetch_initiator);
        ?>
<ul id="random-groups">
<?php 
        if ($sql_fetch_friend) {
            foreach ($sql_fetch_friend as $friend) {
                $array_friend[] = $friend->initiator_user_id;
                $friendList = implode(",", $array_friend);
            }
        }
        if ($sql_fetch_initiator) {
            foreach ($sql_fetch_initiator as $initiator) {
                $array_initiator[] = $initiator->friend_user_id;
                $initiatorList = implode(",", $array_initiator);
            }
        }
        if ($sql_fetch_friend && $sql_fetch_initiator) {
            $listallfriend = $current_loggedin_user . ',' . $friendList . ',' . $initiatorList;
        } else {
            if (!$sql_fetch_friend) {
                $listallfriend = $current_loggedin_user . ',' . $initiatorList;
            } else {
                if (!$sql_fetch_initiator) {
                    $listallfriend = $current_loggedin_user . ',' . $friendList;
                } else {
                    if (!$sql_fetch_friend && !$sql_fetch_initiator) {
                        $listallfriend = $current_loggedin_user . ',9999999999999,99999999999999999999';
                    }
                }
            }
        }
        // echo $friendList;
        $fetch_friend_step2 = "SELECT * FROM " . $wpdb->base_prefix . "users WHERE ID NOT IN ( " . $listallfriend . ") ORDER BY rand() LIMIT {$limit}";
        $sql_fetch_friend_step2 = $wpdb->get_results($fetch_friend_step2);
        foreach ($sql_fetch_friend_step2 as $fof) {
            $avatar_full = bp_core_fetch_avatar('item_id=' . $fof->ID . '&class=av-border&object=user&type=full&width=' . $size . '&height=' . $size);
            ?>
<li><a title="<?php 
            _e("add", TEMPLATE_DOMAIN);
            ?>
 <?php 
            echo $fof->user_nicename;
            ?>
 <?php 
            _e("as friend", TEMPLATE_DOMAIN);
            ?>
" href="<?php 
            echo $bp->root_domain . '/' . bp_get_root_slug('members') . '/' . strtolower($fof->user_nicename) . '/';
            ?>
">
<?php 
            echo $avatar_full;
            ?>
</a></li>
<?php 
        }
        ?>
</ul>
<?php 
    }
开发者ID:m-godefroid76,项目名称:devrestofactory,代码行数:67,代码来源:functions.php

示例8: dpa_get_achievement_activity_feed_link

/**
 * Returns the link of an Achievement's activity stream RSS feed.
 *
 * @since 2.0
 * @global object $bp BuddyPress global settings
 * @return string
 */
function dpa_get_achievement_activity_feed_link()
{
    global $bp;
    return apply_filters('dpa_get_achievement_activity_feed_link', trailingslashit(bp_get_root_domain()) . bp_get_root_slug($bp->achievements->slug) . '/' . apply_filters('dpa_get_achievement_slug', $bp->achievements->current_achievement->slug) . '/' . DPA_SLUG_ACHIEVEMENT_ACTIVITY_RSS . '/');
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:12,代码来源:achievements-templatetags.php

示例9: function_exists

<?php

/**
 * RSS2 feed template for displaying an Achievement's activity stream
 *
 * @author Paul Gibbs <paul@byotos.com>
 * @version 2.0
 * @package Achievements 
 * @subpackage feed
 *
 * $Id$
 */
global $bp;
$slug = function_exists('bp_get_root_slug') ? bp_get_root_slug($bp->achievements->slug) : $bp->achievements->slug;
header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
header('Status: 200 OK');
echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?>';
?>

<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('dpa_myachievements_feed');
?>
>

<channel>
	<title><?php 
开发者ID:nxtclass,项目名称:NXTClass,代码行数:31,代码来源:dpa-myachievements-feed.php

示例10: bp_root_domain

<input type="hidden" name="redirect_to" value="<?php 
                echo bp_root_domain();
                ?>
"/>
<input type="hidden" name="testcookie" value="1" />

<small><a href="<?php 
                echo bp_root_domain();
                ?>
/wp-login.php?action=lostpassword"><?php 
                _e('Lost your password?', TEMPLATE_DOMAIN);
                ?>
</a>&nbsp;|&nbsp;
<a href="<?php 
                echo bp_root_domain() . '/' . bp_get_root_slug('register') . '/';
                ?>
"><?php 
                _e('Create a new account', TEMPLATE_DOMAIN);
                ?>
</a></small>
<?php 
                do_action('bp_sidebar_login_form');
                ?>
</form>
<?php 
                do_action('bp_after_sidebar_login_form');
                ?>


<?php 
开发者ID:hscale,项目名称:webento,代码行数:30,代码来源:page-template-custom-login.php

示例11: directory_before_content

 function directory_before_content()
 {
     if (!preg_match('|^bp_before_directory_([^\\_]+)_content$|', current_filter(), $match)) {
         return;
     }
     $component = $match[1];
     $defaults = array('before_title' => '<h3>', 'after_title' => '</h3>', 'show_create' => is_user_logged_in());
     switch ($component) {
         case 'groups':
             $defaults['directory_title'] = __('Groups Directory', 'buddypress');
             $defaults['create_html'] = ' &nbsp;<a class="button" href="' . bp_get_root_domain() . '/' . bp_get_root_slug('groups') . '/create/">' . __('Create a Group', 'buddypress') . '</a>';
             break;
         case 'forums':
             $defaults['directory_title'] = __('Group Forums Directory', 'buddypress');
             $defaults['create_html'] = ' &nbsp;<a class="button" href="#new-topic" id="new-topic-button">' . __('New Topic', 'buddypress') . '</a>';
             break;
         case 'blogs':
             $defaults['show_create'] &= bp_blog_signup_enabled();
             $defaults['directory_title'] = __('Blogs Directory', 'buddypress');
             $defaults['create_html'] = ' &nbsp;<a class="button" href="' . bp_get_root_domain() . '/' . bp_get_root_slug('blogs') . '/create/">' . __('Create a Blog', 'buddypress') . '</a>';
             break;
     }
     $args = apply_filters('gconnect_directory_title', $defaults, $component);
     extract($args, EXTR_SKIP);
     echo $before_title . $directory_title;
     if ($show_create) {
         echo $create_html;
     }
     echo $after_title;
 }
开发者ID:hscale,项目名称:webento,代码行数:30,代码来源:class.front.php

示例12: fetch_random_groups

        function fetch_random_groups($limit = '', $size = '', $type = '', $block_id = '')
        {
            global $wpdb, $bp;
            $fetch_group = "SELECT * FROM " . $wpdb->base_prefix . "bp_groups WHERE status = 'public' ORDER BY rand() LIMIT {$limit}";
            $sql_fetch_group = $wpdb->get_results($fetch_group);
            ?>

<div id="<?php 
            echo $block_id;
            ?>
" class="avatar-block">
<?php 
            $no_avatar = get_template_directory_uri() . '/_inc/images/default.png';
            foreach ($sql_fetch_group as $group) {
                $avatar_full = bp_core_fetch_avatar('item_id=' . $group->id . '&class=avatar&object=group&type=' . $type . '&width=' . $size . '&height=' . $size);
                $group_description = stripslashes($group->description);
                ?>
<div style="margin: 0px 5px 5px 0px; float: left;" class="item-avatar"><a title="<?php 
                echo $group->name . ' - ' . short_text($group_description, 150);
                ?>
" href="<?php 
                echo home_url() . '/' . bp_get_root_slug('groups') . '/' . $group->slug;
                ?>
">
<?php 
                echo $avatar_full;
                ?>
</a></div>
<?php 
            }
            ?>
</div>
<?php 
        }
开发者ID:hscale,项目名称:webento,代码行数:34,代码来源:widgets-functions.php

示例13: get_template_directory_uri

$tpl_dir = get_template_directory_uri();
$tpl_url = get_site_url();
$mywp_version = get_bloginfo('version');
if (file_exists(WP_CONTENT_DIR . '/themes/wpmu-nelo/style.css')) {
    $theme_data = wp_get_theme('wpmu-nelo', WP_CONTENT_DIR . '/themes');
} else {
    $theme_data = wp_get_theme();
}
$theme_version = $theme_data->get('Version');
if (function_exists('bp_get_root_domain')) {
    $the_privacy_root = bp_get_root_domain();
} else {
    $the_privacy_root = site_url();
}
if (function_exists('bp_get_root_slug')) {
    $member_reg_slug = bp_get_root_slug('register');
}
$wp_dropdown_rd_admin = get_categories('hide_empty=0');
$wp_getcat = array();
foreach ($wp_dropdown_rd_admin as $category_list) {
    $wp_getcat[$category_list->cat_ID] = $category_list->cat_name;
}
$category_bulk_list = array_unshift($wp_getcat, "Choose a category");
$choose_count = array("Select a number", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20");
$options = array(array("name" => __("Do you want to enable <strong>privacy</strong> on all members profile for not logged in user<br /><em>* only logged in user can view members profile and members directory. 'disable' by default</em>", TEMPLATE_DOMAIN), "id" => $shortname . $shortprefix . "privacy_status", "box" => "1", "header-title" => __("Global Privacy Setting", TEMPLATE_DOMAIN), "inblock" => "buddypress", "type" => "select", "std" => "disable", "options" => array("disable", "enable")), array("name" => __("if you enable the <strong>privacy</strong> on all members profile for none logged in user, insert the full url link they will be redirect to for non logged in users<br /><em>*optional - leave empty for default<br />default are buddypress register link<br /> " . site_url() . '/' . (isset($member_reg_slug) ? $member_reg_slug : '') . '/' . "</em>", TEMPLATE_DOMAIN), "id" => $shortname . $shortprefix . "privacy_redirect", "box" => "1", "inblock" => "buddypress", "type" => "text", "std" => ""), array("name" => __("Do you want to enable <strong>friend only privacy</strong> for user profile<br /><em>* only friend can view friend profile. network/super admin were exclude from this condition. 'disable' by default</em>", TEMPLATE_DOMAIN), "id" => $shortname . $shortprefix . "friend_privacy_status", "header-title" => __("Users Privacy Setting", TEMPLATE_DOMAIN), "box" => "1", "bp-only" => $bp_existed, "inblock" => "buddypress", "type" => "select", "std" => "disable", "options" => array("disable", "enable")), array("name" => __("if you enable the <strong>friend privacy</strong> for user profile, insert the full url link they will be redirect when viewing a none friend user<br /><em>*optional - leave empty for default<br />default are buddypress homepage link<br /> " . site_url() . '/' . "</em>", TEMPLATE_DOMAIN), "id" => $shortname . $shortprefix . "friend_privacy_redirect", "box" => "1", "inblock" => "buddypress", "type" => "text", "std" => ""), array("name" => __("Do you want to allowed only <strong>admin and moderators</strong> to create group? <em>* if yes, normal users cannot create group and can only join groups created by admin and moderators. 'no' by default</em>", TEMPLATE_DOMAIN), "id" => $shortname . $shortprefix . "create_group_status", "header-title" => __("Groups Privacy Setting", TEMPLATE_DOMAIN), "box" => "1", "inblock" => "buddypress", "type" => "select", "std" => "no", "options" => array("no", "yes")), array("name" => __("if you enable for the only <strong>admins and editors</strong> to create group, insert the full url link they will be redirect to for non admins and editors users when they click <strong>create group</strong> button<br /><em>*optional - leave empty for default<br />default are buddypress root domain<br /> " . $the_privacy_root . '/' . "</em>", TEMPLATE_DOMAIN), "id" => $shortname . $shortprefix . "create_group_redirect", "box" => "1", "inblock" => "buddypress", "type" => "text", "std" => ""), array("name" => __("Do you want to enable facebook like it in Activity Stream", TEMPLATE_DOMAIN), "description" => __("you can enable facebook like in stream but this is a bandwith hog features 'disable' by default", TEMPLATE_DOMAIN), "id" => $shortname . $shortprefix . "stream_facebook_like_status", "inblock" => "buddypress", "type" => "select", "box" => "1", "std" => "disable", "options" => array("disable", "enable")), array("name" => __("Do you want to enable post author and meta info like post date etc in posts?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_postmeta_status", "inblock" => "post", "box" => "1", "type" => "select", "std" => "enable", "options" => array("enable", "disable")), array("name" => __("Choose your content background colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_container_colour", "inblock" => "layout", "custom" => "colourpicker", "box" => "1", "std" => "", "type" => "text"), array("name" => __("Choose your body <strong>line</strong> colour? *grid lines and separate lines", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_content_line_colour", "inblock" => "layout", "custom" => "colourpicker", "box" => "1", "std" => "", "type" => "text"), array("name" => __("Choose your global body font?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_body_font", "type" => "select", "box" => "2", "inblock" => "font", "std" => "Helvetica, Arial, sans-serif", "options" => array("Helvetica, Arial, sans-serif", "Lucida Grande, Lucida Sans, sans-serif", "Arial, sans-serif", "Cantarell, arial, serif", "Cardo, arial, serif", "Courier New, Courier, monospace", "Crimson Text, arial, serif", "Droid Sans, arial, serif", "Droid Serif, arial, serif", "Garamond, Georgia, serif", "Georgia, arial, serif", "IM Fell DW Pica, arial, serif", "Josefin Sans Std Light, arial, serif", "Lobster, arial, serif", "Lucida Sans Unicode, Lucinda Grande, sans-serif", "Molengo, arial, serif", "Neuton, arial, serif", "Nobile, arial, serif", "OFL Sorts Mill Goudy TT, arial, serif", "Old Standard TT, arial, serif", "Reenie Beanie, arial, serif", "Tahoma, sans-serif", "Tangerine, arial, serif", "Trebuchet MS, sans-serif", "Verdana, sans-serif", "Vollkorn, arial, serif", "Yanone Kaffeesatz, arial, serif", "Just Another Hand, arial, serif", "Terminal Dosis Light, arial, serif", "Ubuntu, arial, serif")), array("name" => __("Choose your global headline font", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_headline_font", "type" => "select", "box" => "2", "inblock" => "font", "std" => "Helvetica, Arial, sans-serif", "options" => array("Helvetica, Arial, sans-serif", "Lucida Grande, Lucida Sans, sans-serif", "Arial, sans-serif", "Cantarell, arial, serif", "Cardo, arial, serif", "Courier New, Courier, monospace", "Crimson Text, arial, serif", "Droid Sans, arial, serif", "Droid Serif, arial, serif", "Garamond, Georgia, serif", "Georgia, arial, serif", "IM Fell DW Pica, arial, serif", "Josefin Sans Std Light, arial, serif", "Lobster, arial, serif", "Lucida Sans Unicode, Lucinda Grande, sans-serif", "Molengo, arial, serif", "Neuton, arial, serif", "Nobile, arial, serif", "OFL Sorts Mill Goudy TT, arial, serif", "Old Standard TT, arial, serif", "Reenie Beanie, arial, serif", "Tahoma, sans-serif", "Tangerine, arial, serif", "Trebuchet MS, sans-serif", "Verdana, sans-serif", "Vollkorn, arial, serif", "Yanone Kaffeesatz, arial, serif", "Just Another Hand, arial, serif", "Terminal Dosis Light, arial, serif", "Ubuntu, arial, serif")), array("name" => __("Choose your font size here?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_font_size", "box" => "2", "inblock" => "font", "type" => "select", "std" => "normal", "options" => array("normal", "small", "bigger", "largest")), array("name" => __("Change your global body font colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_body_font_colour", "inblock" => "font", "custom" => "colourpicker", "box" => "2", "std" => "#1a1a1a", "type" => "text"), array("name" => __("Choose your prefered links colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_content_link_colour", "inblock" => "font", "custom" => "colourpicker", "box" => "2", "std" => "", "type" => "text"), array("name" => __("Choose your prefered links <strong>hover</strong> colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_content_link_hover_colour", "inblock" => "font", "custom" => "colourpicker", "box" => "2", "std" => "", "type" => "text"), array("name" => __("Choose your prefered <strong>post title</strong> links colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_post_title_link_colour", "inblock" => "font", "custom" => "colourpicker", "box" => "2", "std" => "", "type" => "text"), array("name" => __("Choose your prefered navigation and footer colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_nv_footer_colour", "inblock" => "nav", "custom" => "colourpicker", "box" => "3", "std" => "", "type" => "text"), array("name" => __("Choose your navigation font", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_nav_font", "type" => "select", "box" => "3", "inblock" => "nav", "std" => "Helvetica, Arial, sans-serif", "options" => array("Helvetica, Arial, sans-serif", "Lucida Grande, Lucida Sans, sans-serif", "Arial, sans-serif", "Cantarell, arial, serif", "Cardo, arial, serif", "Courier New, Courier, monospace", "Crimson Text, arial, serif", "Droid Sans, arial, serif", "Droid Serif, arial, serif", "Garamond, Georgia, serif", "Georgia, arial, serif", "IM Fell DW Pica, arial, serif", "Josefin Sans Std Light, arial, serif", "Lobster, arial, serif", "Lucida Sans Unicode, Lucinda Grande, sans-serif", "Molengo, arial, serif", "Neuton, arial, serif", "Nobile, arial, serif", "OFL Sorts Mill Goudy TT, arial, serif", "Old Standard TT, arial, serif", "Reenie Beanie, arial, serif", "Tahoma, sans-serif", "Tangerine, arial, serif", "Trebuchet MS, sans-serif", "Verdana, sans-serif", "Vollkorn, arial, serif", "Yanone Kaffeesatz, arial, serif", "Just Another Hand, arial, serif", "Terminal Dosis Light, arial, serif", "Ubuntu, arial, serif")), array("name" => __("Choose your prefered navigation hover background colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_nv_bg_hover_colour", "inblock" => "nav", "custom" => "colourpicker", "box" => "3", "std" => "", "type" => "text"), array("name" => __("Choose your prefered navigation dropdown background colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_nv_dropdown_bg_colour", "inblock" => "nav", "custom" => "colourpicker", "box" => "3", "std" => "", "type" => "text"), array("name" => __("Choose your prefered navigation dropdown <strong>hover</strong> background colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_nv_dropdown_bg_hover_colour", "inblock" => "nav", "custom" => "colourpicker", "box" => "3", "std" => "", "type" => "text"), array("name" => __("Choose your prefered navigation dropdown <strong>separate line</strong> colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_nv_dropdown_line_colour", "inblock" => "nav", "custom" => "colourpicker", "box" => "3", "std" => "", "type" => "text"), array("name" => __("Choose your prefered navigation link text colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_nv_link_colour", "inblock" => "nav", "custom" => "colourpicker", "box" => "3", "std" => "", "type" => "text"), array("name" => __("Choose your prefered navigation link text hover colour?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_nv_link_hover_colour", "inblock" => "nav", "custom" => "colourpicker", "box" => "3", "std" => "", "type" => "text"), array("name" => __("Do you want to used breadcrumb navigation in posts and pages<br />*default: disable", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_breadcrumb_on", "box" => "3", "inblock" => "nav", "type" => "select", "std" => "disable", "options" => array("disable", "enable")), array("name" => sprintf(__("If you want to use an logo image in header:<br />upload your logo <a target=\"_blank\" href=\"%s\">here</a> and copy paste the full image url<br /><br /><em>*this will replace the site title text with logo image</em>", TEMPLATE_DOMAIN), admin_url("upload.php")), "id" => $shortname . $shortprefix . "header_logo_img", "inblock" => "custom-header", "box" => "3", "std" => "", "type" => "text"), array("name" => __("Do you want to used the custom image header *default: disabled", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_header_on", "box" => "3", "inblock" => "custom-header", "type" => "select", "std" => "disable", "options" => array("disable", "enable")), array("name" => __("Insert your desired custom header height?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_image_height", "inblock" => "custom-header", "box" => "3", "std" => "150", "type" => "text"), array("name" => __("Enter a link for your custom image header<br />*default: link to homepage", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_header_link", "box" => "3", "inblock" => "custom-header", "type" => "text", "std" => ""), array("name" => __("Show a login panel and logged in users profile?", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_show_profile", "inblock" => "profile", "box" => "2", "type" => "select", "std" => "no", "options" => array("no", "yes")), array("name" => __("Enter some information about yourself or the site (only displayed if the login panel is enabled)", TEMPLATE_DOMAIN), "id" => $shortname . "_wpmu_profile_text", "inblock" => "profile", "box" => "2", "std" => "", "type" => "textarea"));
function mytheme_wpmu_admin()
{
    global $bp_existed, $themename, $shortname, $options, $shortprefix;
    if (isset($_REQUEST['saved']) && $_REQUEST['saved']) {
        echo '<div id="message" class="updated fade"><p><strong>' . $themename . __(' settings saved.', TEMPLATE_DOMAIN) . '</strong></p></div>';
    }
开发者ID:m-godefroid76,项目名称:devrestofactory,代码行数:31,代码来源:options-functions.php

示例14: site_url

</p>


<?php 
if (!is_user_logged_in()) {
    ?>
<div class="submit-button">
<?php 
    if ($tn_blogsmu_featured_intro_button_text == '') {
        ?>
<a href='<?php 
        echo site_url();
        ?>
/<?php 
        if ($bp_existed == 'true') {
            echo bp_get_root_slug('register') . '/';
        } else {
            ?>
wp-login.php?action=register<?php 
        }
        ?>
'><?php 
        echo stripslashes($tn_blogsmu_featured_intro_button_text);
        ?>
</a>
<?php 
    } else {
        ?>
<a href="<?php 
        echo do_shortcode(stripslashes($tn_blogsmu_featured_intro_button_link));
        ?>
开发者ID:hscale,项目名称:webento,代码行数:31,代码来源:panel-home.php

示例15: bp_core_new_nav_item

/**
 * Adds a navigation item to the main navigation array used in BuddyPress themes.
 *
 * @package BuddyPress Core
 * @global object $bp Global BuddyPress settings object
 */
function bp_core_new_nav_item($args = '')
{
    global $bp;
    $defaults = array('name' => false, 'slug' => false, 'item_css_id' => false, 'show_for_displayed_user' => true, 'site_admin_only' => false, 'position' => 99, 'screen_function' => false, 'default_subnav_slug' => false);
    $r = wp_parse_args($args, $defaults);
    extract($r, EXTR_SKIP);
    // If we don't have the required info we need, don't create this subnav item
    if (empty($name) || empty($slug)) {
        return false;
    }
    // If this is for site admins only and the user is not one, don't create the subnav item
    if ($site_admin_only && !bp_current_user_can('bp_moderate')) {
        return false;
    }
    if (empty($item_css_id)) {
        $item_css_id = $slug;
    }
    $bp->bp_nav[$slug] = array('name' => $name, 'slug' => $slug, 'link' => $bp->loggedin_user->domain . $slug . '/', 'css_id' => $item_css_id, 'show_for_displayed_user' => $show_for_displayed_user, 'position' => $position, 'screen_function' => &$screen_function);
    /***
     * If this nav item is hidden for the displayed user, and
     * the logged in user is not the displayed user
     * looking at their own profile, don't create the nav item.
     */
    if (!$show_for_displayed_user && !bp_user_has_access()) {
        return false;
    }
    /***
     * If the nav item is visible, we are not viewing a user, and this is a root
     * component, don't attach the default subnav function so we can display a
     * directory or something else.
     */
    if (-1 != $position && bp_is_root_component($slug) && !bp_displayed_user_id()) {
        return;
    }
    // Look for current component
    if (bp_is_current_component($slug) && !bp_current_action()) {
        if (!is_object($screen_function[0])) {
            add_action('bp_screens', $screen_function);
        } else {
            add_action('bp_screens', array(&$screen_function[0], $screen_function[1]), 3);
        }
        if (!empty($default_subnav_slug)) {
            /**
             * BuddyPress will attempt to resolve to the most specific URL possible,
             * to avoid search-engine-unfriendly content reduplication. Filter
             * bp_guarantee_unique_uris (and return false) to avoid this behavior
             */
            if (apply_filters('bp_guarantee_unique_uris', true)) {
                bp_core_redirect(bp_displayed_user_domain() . $slug . '/' . apply_filters('bp_default_component_subnav', $default_subnav_slug, $r));
            } else {
                $bp->current_action = apply_filters('bp_default_component_subnav', $default_subnav_slug, $r);
            }
        }
        // Look for current item
    } elseif (bp_is_current_item($slug) && !bp_current_action()) {
        if (!is_object($screen_function[0])) {
            add_action('bp_screens', $screen_function);
        } else {
            add_action('bp_screens', array(&$screen_function[0], $screen_function[1]), 3);
        }
        if (!empty($default_subnav_slug)) {
            /**
             * BuddyPress will attempt to resolve to the most specific URL possible,
             * to avoid search-engine-unfriendly content reduplication. Filter
             * bp_guarantee_unique_uris (and return false) to avoid this behavior
             */
            if (apply_filters('bp_guarantee_unique_uris', true)) {
                bp_core_redirect(bp_get_root_domain() . '/' . bp_get_root_slug(bp_current_component()) . '/' . $slug . '/' . apply_filters('bp_default_component_subnav', $default_subnav_slug, $r));
            } else {
                $bp->current_action = apply_filters('bp_default_component_subnav', $default_subnav_slug, $r);
            }
        }
    }
    do_action('bp_core_new_nav_item', $r, $args, $defaults);
}
开发者ID:newington,项目名称:buddypress,代码行数:81,代码来源:bp-core-buddybar.php


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