本文整理汇总了PHP中bp_is_forums_component函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_is_forums_component函数的具体用法?PHP bp_is_forums_component怎么用?PHP bp_is_forums_component使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_is_forums_component函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bphelp_pbpp_redirect
function bphelp_pbpp_redirect()
{
global $bp;
//IMPORTANT: Do not alter the following line.
$bphelp_my_redirect_slug = get_option('bphelp-my-redirect-slug', 'register');
if (bp_is_activity_component() || bp_is_groups_component() || bp_is_group_forum() || bbp_is_single_forum() || bbp_is_single_topic() || bp_is_forums_component() || bp_is_blogs_component() || bp_is_members_component() || bp_is_profile_component()) {
if (!is_user_logged_in()) {
bp_core_redirect(get_option('home') . '/' . $bphelp_my_redirect_slug);
}
}
}
示例2: logged_out_redirect
function logged_out_redirect()
{
global $bp;
// BuddyPress components to lock
if (bp_is_activity_component() || bp_is_groups_component() || bp_is_group_forum() || bp_is_forums_component() || bp_is_blogs_component() || bp_is_page(BP_MEMBERS_SLUG) || bp_is_profile_component()) {
// Check if user is logged out
if (!is_user_logged_in()) {
// Check if a page was selected for redirection
if (of_get_option('redirect')) {
$redirect_page = get_permalink(of_get_option('redirect'));
// If not redirect to login page
} else {
$redirect_page = site_url('/wp-login.php');
}
wp_redirect($redirect_page);
exit;
}
}
}
示例3: bp_has_forum_topic_posts
/**
* Initiate the loop for a single topic's posts.
*
* @param array $args {
* Arguments for limiting the contents of the topic posts loop.
* @type int $topic_id ID of the topic to which the posts belong.
* @type int $per_page Number of items to return per page. Default: 15.
* @type int $max Max items to return. Default: false.
* @type string $order 'ASC' or 'DESC'.
* }
* @return bool True when posts are found corresponding to the args,
* otherwise false.
*/
function bp_has_forum_topic_posts( $args = '' ) {
global $topic_template;
$defaults = array(
'topic_id' => false,
'per_page' => 15,
'max' => false,
'order' => 'ASC'
);
$r = bp_parse_args( $args, $defaults, 'has_forum_topic_posts' );
extract( $r, EXTR_SKIP );
if ( empty( $topic_id ) && bp_is_groups_component() && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) && bp_action_variable( 1 ) )
$topic_id = bp_forums_get_topic_id_from_slug( bp_action_variable( 1 ) );
elseif ( empty( $topic_id ) && bp_is_forums_component() && bp_is_current_action( 'topic' ) && bp_action_variable( 0 ) )
$topic_id = bp_forums_get_topic_id_from_slug( bp_action_variable( 0 ) );
if ( empty( $topic_id ) ) {
return false;
} else {
$topic_template = new BP_Forums_Template_Topic( (int) $topic_id, $per_page, $max, $order );
// Current topic forum_id needs to match current_group forum_id
if ( bp_is_groups_component() && $topic_template->forum_id != groups_get_groupmeta( bp_get_current_group_id(), 'forum_id' ) )
return false;
}
/**
* Filters whether or not there are topics to display.
*
* @since BuddyPress (1.1.0)
*
* @param bool $value Whether or not there are topics.
* @param BP_Forums_Template_Topic $topic_template Topic template global to use when rendering.
*/
return apply_filters( 'bp_has_topic_posts', $topic_template->has_posts(), $topic_template );
}
示例4: bp_is_user_forums
/**
* Is this a user's forums page?
*
* @package BuddyPress
*
* @return bool
*/
function bp_is_user_forums()
{
if (bp_is_user() && bp_is_forums_component()) {
return true;
}
return false;
}
示例5: is_legacy_forum
/**
* Are we looking at something that needs old forum theme compatibility?
*
* @since 1.7.0
*/
public function is_legacy_forum()
{
// Bail if not looking at a group.
if (!bp_is_forums_component()) {
return;
}
// Forum Directory.
if ((!bp_current_action() || 'tag' == bp_current_action() && bp_action_variables()) && !bp_current_item()) {
if (!bp_forums_has_directory()) {
return false;
}
if (!bp_forums_is_installed_correctly()) {
bp_core_add_message(__('The forums component has not been set up yet.', 'buddypress'), 'error');
bp_core_redirect(bp_get_root_domain());
}
bp_update_is_directory(true, 'forums');
do_action('bp_forums_directory_forums_setup');
add_action('bp_template_include_reset_dummy_post_data', array($this, 'directory_dummy_post'));
add_filter('bp_replace_the_content', array($this, 'directory_content'));
}
}
示例6: setup_title
/**
* Set up the title for pages and the <title> element.
*/
public function setup_title()
{
$bp = buddypress();
// Adjust title based on view
if (bp_is_forums_component()) {
if (bp_is_my_profile()) {
$bp->bp_options_title = __('Forums', 'buddypress');
} else {
$bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb', 'alt' => sprintf(__('Profile picture of %s', 'buddypress'), bp_get_displayed_user_fullname())));
$bp->bp_options_title = bp_get_displayed_user_fullname();
}
}
parent::setup_title();
}
示例7: bp_menu
/**
* header: add the buddypress dropdown navigation to the menu
*
* located: header.php do_action( 'bp_menu' )
*
* @package Custom Community
* @since 1.8.3
*/
function bp_menu()
{
global $cap;
if (!defined('BP_VERSION')) {
if ($cap->menue_disable_home == true) {
?>
<ul>
<li id="nav-home"<?php
if (is_home()) {
?>
class="span2 current-menu-item"<?php
}
?>
>
<a href="<?php
echo home_url();
?>
" title="<?php
_e('Home', 'cc');
?>
"><?php
_e('Home', 'cc');
?>
</a>
</li>
</ul>
<?php
}
?>
<?php
} else {
?>
<ul>
<?php
if ($cap->menue_disable_home == true) {
?>
<li id="nav-home"<?php
if (is_front_page()) {
?>
class="span2 current-menu-item"<?php
}
?>
>
<a href="<?php
echo home_url();
?>
" title="<?php
_e('Home', 'cc');
?>
"><?php
_e('Home', 'cc');
?>
</a>
</li>
<?php
}
?>
<?php
if ($cap->menue_enable_community == true) {
?>
<li id="nav-community"<?php
if (bp_is_activity_component() || (bp_is_members_component() || bp_is_user()) || (bp_is_groups_component() || bp_is_group()) || bp_is_forums_component() || bp_is_blogs_component()) {
?>
class="span2 page_item current-menu-item"<?php
}
?>
>
<a href="<?php
echo site_url();
?>
/<?php
echo BP_ACTIVITY_SLUG;
?>
/" title="<?php
_e('Community', 'cc');
?>
"><?php
_e('Community', 'cc');
?>
</a>
<ul class="children">
<?php
if ('activity' != bp_dtheme_page_on_front() && bp_is_active('activity')) {
?>
<li<?php
if (bp_is_activity_component()) {
?>
class="selected"<?php
}
?>
>
<a href="<?php
//.........这里部分代码省略.........
示例8: bp_has_forum_topic_posts
/**
* Initiate the loop for a single topic's posts.
*
* @param array $args {
* Arguments for limiting the contents of the topic posts loop.
* @type int $topic_id ID of the topic to which the posts belong.
* @type int $per_page Number of items to return per page. Default: 15.
* @type int $max Max items to return. Default: false.
* @type string $order 'ASC' or 'DESC'.
* }
* @return bool True when posts are found corresponding to the args,
* otherwise false.
*/
function bp_has_forum_topic_posts($args = '')
{
global $topic_template;
$defaults = array('topic_id' => false, 'per_page' => 15, 'max' => false, 'order' => 'ASC');
$r = bp_parse_args($args, $defaults, 'has_forum_topic_posts');
extract($r, EXTR_SKIP);
if (empty($topic_id) && bp_is_groups_component() && bp_is_current_action('forum') && bp_is_action_variable('topic', 0) && bp_action_variable(1)) {
$topic_id = bp_forums_get_topic_id_from_slug(bp_action_variable(1));
} elseif (empty($topic_id) && bp_is_forums_component() && bp_is_current_action('topic') && bp_action_variable(0)) {
$topic_id = bp_forums_get_topic_id_from_slug(bp_action_variable(0));
}
if (empty($topic_id)) {
return false;
} else {
$topic_template = new BP_Forums_Template_Topic((int) $topic_id, $per_page, $max, $order);
// Current topic forum_id needs to match current_group forum_id
if (bp_is_groups_component() && $topic_template->forum_id != groups_get_groupmeta(bp_get_current_group_id(), 'forum_id')) {
return false;
}
}
return apply_filters('bp_has_topic_posts', $topic_template->has_posts(), $topic_template);
}
示例9: bp_forums_screen_single_topic
function bp_forums_screen_single_topic()
{
global $bp;
if (!bp_is_forums_component() || !bp_is_current_action('topic') || !bp_action_variable(0)) {
return false;
}
do_action('bp_forums_screen_single_topic');
bp_core_load_template(apply_filters('bp_forums_screen_single_topic', 'forums/single/topic'));
}
示例10: apoc_reply_admin_links
/**
* Output custom bbPress admin links
* @version 2.0
*/
function apoc_reply_admin_links($reply_id)
{
// Make sure it's a logged-in user
if (!is_user_logged_in()) {
return false;
}
// Get post id and setup desired links
$links = array();
// Add common quote and reply links except on forum profiles
if (!bp_is_forums_component()) {
$links['quote'] = apoc_quote_button('reply', $reply_id);
$links['reply'] = '<a class="scroll-respond button button-dark" href="#new-post" title="Quick Reply"><i class="fa fa-reply"></i>Reply</a>';
}
// Topic admin links
if (bbp_is_topic($reply_id)) {
$links['edit'] = bbp_get_topic_edit_link(array('id' => $reply_id, 'edit_text' => '<i class="fa fa-pencil"></i>Edit'));
$links['close'] = bbp_get_topic_close_link(array('id' => $reply_id, 'close_text' => '<i class="fa fa-lock"></i>Close', 'open_text' => '<i class="fa fa-unlock"></i>Open'));
$links['stick'] = bbp_get_topic_stick_link(array('id' => $reply_id, 'stick_text' => '<i class="fa fa-thumb-tack"></i>Stick', 'unstick_text' => '<i class="fa fa-level-down"></i>Unstick', 'super_text' => '<i class="fa fa-paperclip"></i>Notice'));
$links['merge'] = bbp_get_topic_merge_link(array('merge_text' => '<i class="fa fa-code-fork"></i>Merge'));
$links['trash'] = bbp_get_topic_trash_link(array('id' => $reply_id, 'trash_text' => '<i class="fa fa-trash"></i>Trash', 'restore_text' => '<i class="fa fa-undo"></i>Restore', 'delete_text' => '<i class="fa fa-remove"></i>Delete', 'sep' => ''));
// Reply admin links
} else {
$links['edit'] = bbp_get_reply_edit_link(array('id' => $reply_id, 'edit_text' => '<i class="fa fa-pencil"></i>Edit'));
$links['move'] = bbp_get_reply_move_link(array('id' => $reply_id, 'split_text' => '<i class="fa fa-arrows"></i>Move'));
$links['split'] = bbp_get_topic_split_link(array('id' => $reply_id, 'split_text' => '<i class="fa fa-code-fork"></i>Split'));
$links['trash'] = bbp_get_reply_trash_link(array('id' => $reply_id, 'trash_text' => '<i class="fa fa-trash"></i>Trash', 'restore_text' => '<i class="fa fa-undo"></i>Restore', 'delete_text' => '<i class="fa fa-remove"></i>Delete', 'sep' => ''));
}
// Get the admin links!
bbp_reply_admin_links(array('id' => $reply_id, 'before' => '', 'after' => '', 'sep' => '', 'links' => $links));
}
示例11: locate_template
<?php
locate_template(array('members/single/member-header.php'), true);
?>
<div id="profile-body">
<?php
do_action('template_notices');
?>
<?php
if (bp_is_user_profile()) {
locate_template(array('members/single/profile.php'), true);
} elseif (bp_is_user_activity()) {
locate_template(array('members/single/activity.php'), true);
} elseif (bp_is_forums_component()) {
locate_template(array('members/single/forums.php'), true);
} elseif (bp_is_user_friends()) {
locate_template(array('members/single/friends.php'), true);
} elseif (bp_is_user_groups()) {
locate_template(array('members/single/groups.php'), true);
} elseif (bp_is_user_messages()) {
locate_template(array('members/single/messages.php'), true);
} elseif (bp_is_user_settings()) {
locate_template(array('members/single/settings.php'), true);
} elseif (bp_is_user_notifications()) {
locate_template(array('members/single/notifications.php'), true);
} else {
locate_template(array('members/single/plugins.php'), true);
}
?>
示例12: do_action
?>
" tabindex="100" />
</form>
<?php
do_action('bp_after_sidebar_login_form');
?>
<?php
}
?>
<?php
/* Show forum tags on the forums directory */
if (bp_is_active('forums') && function_exists('bp_forums_tag_heat_map') && bp_is_forums_component() && bp_is_directory()) {
?>
<div id="forum-directory-tags" class="widget tags">
<h3 class="widgettitle"><?php
_e('Forum Topic Tags', 'bp-magic');
?>
</h3>
<div id="tag-text"><?php
bp_forums_tag_heat_map();
?>
</div>
</div>
<?php
}
?>
示例13: do_action
?>
" tabindex="100" />
<input type="hidden" name="testcookie" value="1" />
</form>
<?php
do_action('bp_after_sidebar_login_form');
?>
<?php
}
?>
<?php
/* Show forum tags on the forums directory */
if (bp_is_forums_component() && bp_is_directory()) {
?>
<div id="forum-directory-tags" class="widget tags">
<h3 class="widgettitle"><?php
_e('Forum Topic Tags', 'buddypress');
?>
</h3>
<?php
if (function_exists('bp_forums_tag_heat_map')) {
?>
<div id="tag-text"><?php
bp_forums_tag_heat_map();
?>
</div>
<?php
示例14: infinity_base_sidebars
/**
* Show sidebars based on page type (including BP components)
*
* @package Infinity
* @subpackage base
*/
function infinity_base_sidebars()
{
if (!current_theme_supports('infinity-sidebar-setup')) {
return;
}
if (is_page()) {
if (function_exists('bp_is_user') && bp_is_user() || function_exists('bp_is_members_component') && bp_is_members_component()) {
if (is_active_sidebar('member-sidebar')) {
dynamic_sidebar('member-sidebar');
} elseif (current_user_can('edit_theme_options')) {
?>
<div class="widget">
<h4>BP Member Sidebar.</h4>
<a href="<?php
echo home_url('/');
?>
nxt-admin/widgets.php" title="Add Widgets">Add Widgets</a>
</div><?php
}
} elseif (function_exists('bp_is_user') && !bp_is_user() && function_exists('bp_is_groups_component') && bp_is_groups_component()) {
if (is_active_sidebar('groups-sidebar')) {
dynamic_sidebar('groups-sidebar');
} elseif (current_user_can('edit_theme_options')) {
?>
<div class="widget">
<h4>BP Group Sidebar.</h4>
<a href="<?php
echo home_url('/');
?>
nxt-admin/widgets.php" title="Add Widgets">Add Widgets</a>
</div><?php
}
} elseif (function_exists('bp_is_user') && !bp_is_user() && function_exists('bp_is_forums_component') && bp_is_forums_component()) {
if (is_active_sidebar('forums-sidebar')) {
dynamic_sidebar('forums-sidebar');
} elseif (current_user_can('edit_theme_options')) {
?>
<div class="widget">
<h4>BP Forums Sidebar.</h4>
<a href="<?php
echo home_url('/');
?>
nxt-admin/widgets.php" title="Add Widgets">Add Widgets</a>
</div><?php
}
} elseif (function_exists('bp_is_user') && !bp_is_user() && function_exists('bp_is_blogs_component') && bp_is_blogs_component()) {
if (is_active_sidebar('blogs-sidebar')) {
dynamic_sidebar('blogs-sidebar');
} elseif (current_user_can('edit_theme_options')) {
?>
<div class="widget">
<h4>BP Blogs Sidebar.</h4>
<a href="<?php
echo home_url('/');
?>
nxt-admin/widgets.php" title="Add Widgets">Add Widgets</a>
</div><?php
}
} elseif (function_exists('bp_is_user') && !bp_is_user() && function_exists('bp_is_activity_component') && bp_is_activity_component()) {
if (is_active_sidebar('activity-sidebar')) {
dynamic_sidebar('activity-sidebar');
} elseif (current_user_can('edit_theme_options')) {
?>
<div class="widget">
<h4>Activity Sidebar</h4>
<a href="<?php
echo home_url('/');
?>
nxt-admin/widgets.php" title="Add Widgets">Add Widgets</a>
</div><?php
}
} elseif (is_front_page()) {
if (is_active_sidebar('home-sidebar')) {
dynamic_sidebar('home-sidebar');
} elseif (current_user_can('edit_theme_options')) {
?>
<div class="widget">
<h4>Home Sidebar.</h4>
<a href="<?php
echo home_url('/');
?>
nxt-admin/widgets.php" title="Add Widgets">Add Widgets</a>
</div><?php
}
} else {
if (is_active_sidebar('page-sidebar')) {
dynamic_sidebar('page-sidebar');
} elseif (current_user_can('edit_theme_options')) {
?>
<div class="widget">
<h4>Page Sidebar.</h4>
<a href="<?php
echo home_url('/');
?>
//.........这里部分代码省略.........
示例15: _e
_e('Groups', 'framemarket');
?>
"><?php
_e('Groups', 'framemarket');
?>
</a>
</li>
<?php
}
?>
<?php
if (bp_is_active('forums') && bp_is_active('groups') && (function_exists('bp_forums_is_installed_correctly') && !(int) bp_get_option('bp-disable-forum-directory')) && bp_forums_is_installed_correctly()) {
?>
<li<?php
if (bp_is_forums_component() && !bp_is_user_forums()) {
?>
class="selected"<?php
}
?>
>
<a href="<?php
echo site_url();
?>
/<?php
echo bp_forums_root_slug();
?>
/" title="<?php
_e('Forums', 'framemarket');
?>
"><?php