本文整理汇总了PHP中bp_group_invites函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_group_invites函数的具体用法?PHP bp_group_invites怎么用?PHP bp_group_invites使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_group_invites函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: invite_anyone_create_screen_content
function invite_anyone_create_screen_content($event)
{
if (function_exists('bp_post_get_permalink')) {
// ugly ugly ugly hack to check for pre-1.2 versions of BP
add_action('wp_footer', 'invite_anyone_add_old_css');
?>
<?php
if (bp_has_groups()) {
while (bp_groups()) {
bp_the_group();
?>
<?php
do_action('bp_before_group_send_invites_content');
?>
<?php
if ($event != 'create') {
?>
<form action="<?php
bp_group_send_invite_form_action();
?>
" method="post" id="send-invite-form">
<?php
}
?>
<div class="left-menu">
<p><?php
_e("Search for members to invite:", 'bp-invite-anyone');
?>
<span class="ajax-loader"></span></p>
<ul class="first acfb-holder">
<li>
<input type="text" name="send-to-input" class="send-to-input" id="send-to-input" />
</li>
</ul>
<p><?php
_e('Select members from the directory:', 'bp-invite-anyone');
?>
<span class="ajax-loader"></span></p>
<div id="invite-anyone-member-list">
<ul>
<?php
bp_new_group_invite_member_list();
?>
</ul>
<?php
wp_nonce_field('groups_invite_uninvite_user', '_wpnonce_invite_uninvite_user');
?>
</div>
</div>
<div class="main-column">
<div id="message" class="info">
<p><?php
_e('Select people to invite.', 'bp-invite-anyone');
?>
</p>
</div>
<?php
do_action('bp_before_group_send_invites_list');
?>
<?php
/* The ID 'friend-list' is important for AJAX support. */
?>
<ul id="invite-anyone-invite-list" class="item-list">
<?php
if (bp_group_has_invites()) {
?>
<?php
while (bp_group_invites()) {
bp_group_the_invite();
?>
<li id="<?php
bp_group_invite_item_id();
?>
">
<?php
bp_group_invite_user_avatar();
?>
<h4><?php
bp_group_invite_user_link();
?>
</h4>
<span class="activity"><?php
bp_group_invite_user_last_active();
//.........这里部分代码省略.........
示例2: _e
_e('Select people to invite from your friends list.', 'vibe');
?>
</p>
</div>
<?php
/* The ID 'friend-list' is important for AJAX support. */
?>
<ul id="friend-list" class="item-list" role="main">
<?php
if (bp_group_has_invites()) {
?>
<?php
while (bp_group_invites()) {
bp_group_the_invite();
?>
<li id="<?php
bp_group_invite_item_id();
?>
">
<?php
bp_group_invite_user_avatar();
?>
<h4><?php
bp_group_invite_user_link();
?>
示例3: test_bp_group_has_invites_template_structure
/**
* @group bp_group_has_invites
* @group BP_Groups_Invite_Template
*/
public function test_bp_group_has_invites_template_structure()
{
$now = time();
$u1 = $this->factory->user->create(array('last_activity' => gmdate('Y-m-d H:i:s', $now - 60)));
$u2 = $this->factory->user->create(array('last_activity' => gmdate('Y-m-d H:i:s', $now - 600)));
$u3 = $this->factory->user->create(array('last_activity' => gmdate('Y-m-d H:i:s', $now - 6000)));
$u4 = $this->factory->user->create(array('last_activity' => gmdate('Y-m-d H:i:s', $now - 60000)));
$g = $this->factory->group->create(array('creator_id' => $u1));
$m2 = $this->add_user_to_group($u2, $g, array('date_modified' => gmdate('Y-m-d H:i:s', $now - 60 * 60 * 24), 'is_confirmed' => 0, 'inviter_id' => $u1, 'invite_sent' => true));
$m3 = $this->add_user_to_group($u3, $g, array('date_modified' => gmdate('Y-m-d H:i:s', $now - 60 * 60 * 12), 'is_confirmed' => 0, 'inviter_id' => $u1, 'invite_sent' => true));
$m4 = $this->add_user_to_group($u4, $g, array('date_modified' => gmdate('Y-m-d H:i:s', $now - 60 * 60 * 36), 'is_confirmed' => 1, 'inviter_id' => $u1, 'invite_sent' => true));
// Populate the global
bp_group_has_invites(array('group_id' => $g, 'user_id' => $u1));
global $invites_template;
$found_users = array(0 => $u2, 1 => $u3);
// Invites array
$this->assertEquals($found_users, $invites_template->invites);
// Make sure user is set when loop starts
$counter = 0;
while (bp_group_invites()) {
bp_group_the_invite();
$this->assertEquals($g, $invites_template->invite->group_id);
$this_user = new BP_Core_User($found_users[$counter]);
foreach (get_object_vars($this_user) as $k => $v) {
// Doesn't matter if the backpat provides *more*
// details than the old method, so we skip cases
// where the BP_Core_User value is empty
if (empty($v)) {
continue;
}
$this->assertEquals($v, $invites_template->invite->user->{$k});
}
$counter++;
}
}