本文整理汇总了PHP中bp_ajax_querystring函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_ajax_querystring函数的具体用法?PHP bp_ajax_querystring怎么用?PHP bp_ajax_querystring使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_ajax_querystring函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_follow_blog_and_groupblog
/**
* @group groupblog
*/
public function test_follow_blog_and_groupblog()
{
if (!is_multisite()) {
return;
}
// save the current user and override logged-in user
$old_user = get_current_user_id();
$u = $this->factory->user->create();
$this->set_current_user($u);
// create some blogs
$b = $this->factory->blog->create(array('title' => 'Groupblog', 'user_id' => $u));
$b2 = $this->factory->blog->create(array('title' => 'Test blog 1', 'user_id' => $u));
$b3 = $this->factory->blog->create(array('title' => 'Test blog 2', 'user_id' => $u));
// create a group and connect a blog
$g = $this->factory->group->create(array('creator_id' => $u));
groups_update_groupmeta($g, 'groupblog_blog_id', $b);
// follow the groupblog
$f = bp_follow_start_following(array('leader_id' => $b, 'follower_id' => $u, 'follow_type' => 'blogs'));
// follow a regular blog
$f2 = bp_follow_start_following(array('leader_id' => $b2, 'follower_id' => $u, 'follow_type' => 'blogs'));
// add some activity items
$a = $this->factory->activity->create(array('component' => buddypress()->groups->id, 'type' => 'new_groupblog_post', 'user_id' => $u, 'item_id' => $g, 'secondary_item_id' => 1));
$a2 = $this->factory->activity->create(array('component' => buddypress()->blogs->id, 'type' => 'new_blog_post', 'user_id' => $u, 'item_id' => $b3, 'secondary_item_id' => 1));
$a3 = $this->factory->activity->create(array('component' => buddypress()->blogs->id, 'type' => 'new_blog_post', 'user_id' => $u, 'item_id' => $b2, 'secondary_item_id' => 1));
// fake that we're on a user's "Activity > Followed Sites" page
add_filter('bp_ajax_querystring', array($this, 'add_activity_scope_filter'));
// fake that BP groupblog is installed so groupblog filter will kick in
if (!function_exists('bp_groupblog_init')) {
function bp_groupblog_init()
{
}
}
// run the activity loop
global $activities_template;
bp_has_activities(bp_ajax_querystring('activity'));
// grab the activity IDs from the loop
$ids = wp_list_pluck($activities_template->activities, 'id');
// assert!
$this->assertEquals(array($a, $a3), $ids);
// reset everything
$activities_template = null;
$this->set_current_user($old_user);
remove_filter('bp_ajax_querystring', array($this, 'add_activity_scope_filter'));
}
示例2: do_action
<?php
do_action('bp_before_directory_groups_page');
?>
<div id="content">
<div class="padder">
<?php
do_action('bp_before_directory_groups');
?>
<form action="" method="post" id="groups-directory-form" class="dir-form">
<?php
global $huddle_bp_groups, $groups_template;
$huddle_bp_groups = bp_has_groups(bp_ajax_querystring('groups'));
?>
<h3><?php
_e('Groups Directory', 'huddle');
?>
</h3>
<p class="subtitle">
<?php
bp_groups_pagination_count();
?>
<?php
if (is_user_logged_in() && bp_user_can_create_groups()) {
?>
<a class="btn-gray" href="<?php
echo trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create');
示例3: do_action
/**
* BuddyPress - Forums Loop
*
* Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter()
*
* @package BuddyPress
* @subpackage bp-default
*/
?>
<?php
do_action('bp_before_forums_loop');
?>
<?php
if (bp_has_forum_topics(bp_ajax_querystring('forums'))) {
?>
<div id="pag-top" class="pagination">
<div class="pag-count" id="topic-count-top">
<?php
bp_forum_pagination_count();
?>
</div>
<div class="pagination-links" id="topic-pag-top">
<?php
示例4: while
<?php
if (bp_group_has_membership_requests(bp_ajax_querystring('membership_requests'))) {
?>
<div id="pag-top" class="pagination">
<div class="pag-count" id="group-mem-requests-count-top">
<?php
bp_group_requests_pagination_count();
?>
</div>
<div class="pagination-links" id="group-mem-requests-pag-top">
<?php
bp_group_requests_pagination_links();
?>
</div>
</div>
<ul id="request-list" class="item-list">
<?php
while (bp_group_membership_requests()) {
bp_group_the_membership_request();
?>
示例5: do_action
<?php
/**
* The template for displaying course directory loop.
*
* Override this template by copying it to yourtheme/course/course-loop.php
*
* @author VibeThemes
* @package vibe-course-module/templates
* @version 1.8.1
*/
do_action('bp_before_course_loop');
if (bp_course_has_items(bp_ajax_querystring('course'))) {
?>
<div id="pag-top" class="pagination">
<div class="pag-DeCuongKHcount" id="course-dir-count-top">
<?php
bp_course_pagination_count();
?>
</div>
<div class="pagination-links" id="course-dir-pag-top">
<?php
bp_course_item_pagination();
?>
</div>
示例6: do_action
/**
* BuddyPress - Groups Loop
*
* Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter()
*
* @package BuddyPress
* @subpackage bp-legacy
*/
?>
<?php
do_action('bp_before_groups_loop');
?>
<?php
if (bp_has_groups(bp_ajax_querystring('groups'))) {
?>
<div id="pag-top" class="pagination">
<div class="pag-count" id="group-dir-count-top">
<?php
bp_groups_pagination_count();
?>
</div>
<div class="pagination-links" id="group-dir-pag-top">
<?php
示例7: do_action
</div><!-- .left-menu -->
<div class="main-column">
<?php
/**
* Fires before the display of the group send invites list.
*
* @since BuddyPress (1.1.0)
*/
do_action('bp_before_group_send_invites_list');
?>
<?php
if (bp_group_has_invites(bp_ajax_querystring('invite') . '&per_page=10')) {
?>
<div id="pag-top" class="pagination">
<div class="pag-count" id="group-invite-count-top">
<?php
bp_group_invite_pagination_count();
?>
</div>
<div class="pagination-links" id="group-invite-pag-top">
<?php
示例8: while
$post_class = "column dt-sc-one-half";
break;
case "one-third-column":
$columns = 3;
$post_class = "column dt-sc-one-third";
break;
case "one-fourth-column":
$columns = 4;
$post_class = "column dt-sc-one-fourth";
break;
default:
$columns = 4;
$post_class = "column dt-sc-one-fourth";
break;
}
if (bp_has_members(bp_ajax_querystring('members') . '&per_page=' . $dt_per_page)) {
$i = 1;
?>
<?php
do_action('bp_before_directory_members_list');
?>
<?php
while (bp_members()) {
bp_the_member();
$temp_class = "";
if ($i == 1) {
$temp_class = $post_class . " first";
} else {
$temp_class = $post_class;
}
if ($i == $columns) {
示例9: get_current_user_id
* The template for displaying instructor courses in course directory
*
* Override this template by copying it to yourtheme/course/instructor-courses.php
*
* @author VibeThemes
* @package vibe-course-module/templates
* @version 1.8.1
*/
$user_id = get_current_user_id();
$append = '&instructor=' . $user_id;
?>
<?php
do_action('bp_before_course_loop');
$user_id = get_current_user_id();
if (bp_course_has_items(bp_ajax_querystring('course') . $append)) {
// global $items_template; var_dump( $items_template )
?>
<div id="pag-top" class="pagination no-ajax">
<div class="pag-count" id="course-dir-count-top">
<?php
bp_course_pagination_count();
?>
</div>
<div class="pagination-links" id="course-dir-pag-top">
<?php
示例10: do_action
<?php
/**
*
* @package BuddyPress_Skeleton_Component
* @since 1.6
*/
?>
<?php
do_action('bp_before_example_loop');
?>
<?php
if (bp_example_has_items(bp_ajax_querystring('example'))) {
// global $items_template; var_dump( $items_template )
?>
<div id="pag-top" class="pagination">
<div class="pag-count" id="example-dir-count-top">
<?php
bp_example_pagination_count();
?>
</div>
<div class="pagination-links" id="example-dir-pag-top">
<?php
bp_example_item_pagination();
示例11: vibe_get_option
* @package vibe-course-module/templates
* @version 1.8.1
*/
$loop_number = vibe_get_option('loop_number');
isset($loop_number) ? $loop_number : ($loop_number = 5);
?>
<?php
do_action('bp_before_course_loop');
?>
<?php
$user_id = get_current_user_id();
if (bp_course_has_items(bp_ajax_querystring('course') . '&user=' . $user_id . '&per_page=' . $loop_number)) {
// global $items_template; var_dump( $items_template )
?>
<div id="pag-top" class="pagination no-ajax">
<div class="pag-count" id="course-dir-count-top">
<?php
bp_course_pagination_count();
?>
</div>
<div class="pagination-links" id="course-dir-pag-top">
<?php
示例12: do_action
<?php
do_action('dpa_before_achievements_loop');
?>
<?php
if (dpa_has_achievements(bp_ajax_querystring('achievements'))) {
?>
<div class="pagination">
<div class="pag-count" id="achievements-count-top">
<?php
dpa_achievements_pagination_count();
?>
</div>
<div class="pagination-links" id="achievements-pag-top">
<?php
dpa_achievements_pagination_links();
?>
</div>
</div>
<ul id="achievements-list" class="item-list">
<?php
while (dpa_achievements()) {
dpa_the_achievement();
?>
示例13: vibe_get_option
* @package BuddyPress
* @subpackage bp-default
*/
if (!defined('ABSPATH')) {
exit;
}
$loop_number = vibe_get_option('loop_number');
isset($loop_number) ? $loop_number : ($loop_number = 5);
?>
<?php
do_action('bp_before_blogs_loop');
?>
<?php
if (bp_has_blogs(bp_ajax_querystring('blogs') . '&per_page=' . $loop_number)) {
?>
<div id="pag-top" class="pagination">
<div class="pag-count" id="blog-dir-count-top">
<?php
bp_blogs_pagination_count();
?>
</div>
<div class="pagination-links" id="blog-dir-pag-top">
<?php
bp_blogs_pagination_links();
?>
</div>
示例14: bp_has_members
<?php
global $bp_members, $members_template;
if (!$bp_members) {
$bp_members = bp_has_members(bp_ajax_querystring('members'));
}
?>
<?php
do_action('bp_before_members_loop');
?>
<?php
if ($bp_members) {
?>
<div id="pag-top" class="pagination">
<div class="pag-count" id="member-dir-count-top">
<?php
bp_members_pagination_count();
?>
</div>
<div class="pagination-links" id="member-dir-pag-top">
<?php
bp_members_pagination_links();
?>
示例15: framework
/**
* Do widget framework.
*
* @param array $instance The settings for the particular instance of the widget.
*/
public static function framework($instance)
{
global $gs_counter, $processed_activities;
genesis_markup(array('html5' => '<article %s>', 'xhtml' => sprintf('<div class="%s">', implode(' ', get_post_class())), 'context' => 'entry'));
$settings = get_option('widget_featured-content');
if (!isset($settings[3]['buddypress-group']) || 1 != $settings[3]['buddypress-group']) {
GS_Featured_Content::action('thememixfc_before_post_content', $instance);
GS_Featured_Content::action('thememixfc_post_content', $instance);
GS_Featured_Content::action('thememixfc_after_post_content', $instance);
} else {
if (!isset($processed_activities)) {
$processed_activities = array();
}
$group_id = $settings[3]['buddypress-group-group'];
if (bp_has_activities(bp_ajax_querystring('activity') . '&primary_id=' . $group_id)) {
while (bp_activities()) {
bp_the_activity();
$url = trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/');
$fontawesome_position = $settings[3]['fontawesome-position'];
$activity_id = bp_get_activity_id();
if (!in_array($activity_id, $processed_activities) && !isset($done)) {
// Get image HTML
if (isset($settings[3]['show_image']) && 1 == $settings[3]['show_image']) {
$size = $settings[3]['image_size'];
$image_html = bp_get_activity_avatar('type=' . $size);
// Add image link to image HTML
if (isset($settings[3]['link_image']) && 1 == $settings[3]['link_image']) {
$image_html = '<a href="' . esc_attr(bp_get_activity_user_link()) . '">' . $image_html . '</a>';
}
}
echo '
<article itemscope="itemscope" itemtype="http://schema.org/Event">';
if (isset($settings[3]['image_position']) && 'before-title' == $settings[3]['image_position']) {
echo $image_html;
}
if ('before_title' == $fontawesome_position) {
echo thememixfc_span_fontawesome();
}
echo '
<h2 class="entry-title">';
if ('inline_before_title' == $fontawesome_position) {
echo thememixfc_span_fontawesome();
}
echo '
<a href="' . esc_url($url) . '" title="' . esc_attr($group->name) . '">' . esc_html($group->name) . '</a>';
if ('inline_after_title' == $fontawesome_position) {
echo thememixfc_span_fontawesome();
}
echo '
</h2>';
if ('after_title' == $fontawesome_position) {
echo thememixfc_span_fontawesome();
}
if (isset($settings[3]['image_position']) && 'after-title' == $settings[3]['image_position']) {
echo $image_html;
}
if (bp_activity_has_content()) {
bp_activity_content_body();
}
if (isset($settings[3]['image_position']) && 'after-content' == $settings[3]['image_position']) {
echo $image_html;
}
echo '
</article>';
$processed_activities[] = $activity_id;
$done = true;
}
}
}
}
$gs_counter++;
genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>'));
}