Search Results for 'group_id'
-
Search Results
-
I wrote the following function, but i still can’t create a group. I’ve made sure that the function is getting called, so that is not the issue
function start_a_new_group($profile_id, $status) {
if ( !function_exists( ‘groups_create_group’ ) ) {
require_once ‘/bp-groups/bp-groups-functions.php’;
}$defaults = array(
‘group_id’ => $profile_id,
‘creator_id’ => get_current_user_id(),
‘name’ => ”,
‘description’ => ”,
‘slug’ => ”,
‘status’ => $status,
‘enable_forum’ => 0,
‘date_created’ => bp_core_current_time()
);
return groups_create_group($defaults);
}Wordpress version 5.8.2
Buddypress verion 9.1.1
Theme is Twenty TwentyAny ideas?
I have this:
while ( bp_members() ) :
bp_the_member();The bp_the_members is returning null and cause the database error for each member:
[php7:notice] [pid 2304654] [client 127.0.0.1:51798] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘) AND is_confirmed = 1 AND (is_admin = 0 AND is_mod = 0 AND is_banned = 0) ORDER’ at line 1 for query SELECT user_id FROM wp_bp_groups_members WHERE group_id IN () AND is_confirmed = 1 AND (is_admin = 0 AND is_mod = 0 AND is_banned = 0) ORDER BY date_modified DESC made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/PSUOutreachMarketing-Challenge/members-search.php’), get_footer, locate_template, load_template, require_once(‘/themes/PSUOutreachMarketing/footer.php’), dynamic_sidebar, WP_Widget->display_callback, WP_Widget_Text->widget, apply_filters(‘widget_text_content’), WP_Hook->apply_filters, do_shortcode, preg_replace_callback, do_shortcode_tag, GFForms::parse_shortcode, GFForms::get_form, GFFormDisplay::get_form, GFFormsModel::get_field_value, GF_Field_Checkbox->get_value_submission, GFFormsModel::get_parameter_value, gf_apply_filters, apply_filters(‘gform_field_value’), WP_Hook->apply_filters, populate_fields, get_all_team_members, bp_group_has_members, BP_Groups_Group_Members_Template->__construct, groups_get_group_members, BP_User_Query->__construct, BP_User_Query->prepare_user_ids_query, BP_Group_Member_Query->get_include_ids, BP_Group_Member_Query->get_group_member_ids, referer:This line:
if ( bp_has_members( ( 0 < count( $my_ids ) )?’include=’.implode(‘,’, $my_ids ):bp_ajax_querystring( ‘members’ ) ) ) :
is returning a comma separated string list of IDs I want to display.Any ideas what is going wrong?
Wordpress Version: 5.8
Buddypress Version: 9.1.1
Link: no link because this is only from localhost.So i have these lines of code which displays all exisiting groups from the website and if i select one, it will link/integrate it to a course i selected (LMS).
<?php
$groups = groups_get_groups(array(‘show_hidden’ => true));
$attached_group = (array) \TUTOR_BP\BuddyPressGroups::get_group_ids_by_course(get_the_ID());?>
<div class=”tutor-option-field-row”>
<div class=”tutor-option-field-label”>
<label for=””>
<?php _e(‘BuddyPress Groups’, ‘tutor-pro’); ?>
</label>
</div>
<div class=”tutor-option-field tutor-field-number”>
<select name=”_tutor_bp_course_attached_groups[]” class=”tutor_select2″ multiple=”multiple”>
<?php
foreach ($groups[‘groups’] as $group){
$selected = in_array($group->id, $attached_group) ? ‘selected=”selected”‘ : ”;
echo “<option value='{$group->id}’ {$selected} > {$group->name} </option>”;
}
?>
</select>
<p class=”desc”><?php _e(‘Assign this course to BuddyPress Groups’, ‘tutor-pro’); ?></p>
</div>
</div>However from the <select> options i only want to display the groups i have created. how to do this? any help will be appreciated!
Hello guys,
Can someone please help me?
I have this code:
function jwa_get_top_dino_users( $post ){ global $wpdb; $post_id = $post->ID; $results = $wpdb->get_results( "SELECT * FROM " . jwa_get_table_name() . " where dino_id = '$post_id' ORDER BY boost_sum DESC LIMIT 10" ); $data = "<div class='jwa-grid-row jwa-single-post'> <div class='col-box-12'> <div class='jwa-grid-row'> <div class='col-box-6'> <img src='".get_the_post_thumbnail_url( $post, 'full' )."' class='img-box' style='float: right; margin-right: 30px;' alt='".esc_html( get_the_title( $post ) )."' /> </div> <div class='col-box-6 jwa-single-post-data'> <div class='jwa-sub-title'><strong>The most powerful ".get_the_title( $post )."</strong>:</div>"; $n = 1; foreach ( $results as $key => $value ) { // code... $user_id = $value->user_id; // custom type post id $dino_id = $value->dino_id; // custom type post id $level_boost = $value->level_boost; // user levels $health_boost = $value->health_boost; $damage_boost = $value->damage_boost; $speed_boost = $value->speed_boost; // $username = bp_core_get_username( $user_id ); $username = get_user_by( 'id', $user_id )->display_name ; $data .= "<div style='margin-left: 10px; padding-bottom: 5px'>$n. ".jwa_strong( $username )."</div>"; $n++; }Is it possible to display the $username of the users that are only members of two specific groups?
bp-groups&gid=2 and bp-groups&gid=5Thanks in advance 🙂
EDIT:
I have found the following code, but I don’t know how to apply:
$this_id = bp_get_group_id(); echo "group id is: " . $this_id; // make sure there is a value here. $has_members_str = "group_id=" . $this_id; if ( bp_group_has_members( $has_members_str ) )I am having problem in my Buddypress Group where group admins cannot send invites.
Group admin can enter the Invite Members page, select members to invite, then clicked on Send Invites link with number of members to invite. Then a form appears to enter optional messages. Upon clicking the Send button there, a red alert shows that “Invitation failed for (number) users”. On buddypress version 6, the message was “You are not allowed to send invitations for this group”.This happens on multilingual installation of WordPress (using WPML) and not selecting the default (English) language. If I choose English, the problem does not happen. I do translate some of the words there for non english version, but could it be the source of the problem?
Upon debugging into function bp_nouveau_ajax_send_group_invites(), it seems that function bp_get_current_group_id() and $_POST[group_id] both returns group_id = 0
Any idea on how i could fix this?
current version:
wordpress: 5.6
buddypress: 7.1.0Hi, i feel like im doing this properly but i never get the right result. i have a custom meta called “featured” in activity meta. For testing purposes the meta values are 1,2,3,4 my goal is to have an activity loop order activities by the meta value. i’ve checked the documentation and i came up with this.
<?php get_header(); ?> <?php get_template_part('page-parts/general-title-section'); ?> <?php get_template_part('page-parts/general-before-wrap'); $atts = array( 'title' => 'Latest Activity',// title of the section. 'pagination' => 1,// show or not. 'load_more' => 0, 'display_comments' => 'threaded', 'include' => false, // pass an activity_id or string of IDs comma-separated 'exclude' => false, // pass an activity_id or string of IDs comma-separated 'in' => false, // comma-separated list or array of activity IDs among which to search 'sort' => 'DESC', // sort DESC or ASC 'page' => 1, // which page to load 'per_page' => 5, // how many per page. 'max' => false, // max number to return. 'count_total' => true, // Scope - pre-built activity filters for a user (friends/groups/favorites/mentions). 'scope' => false, // Filtering 'user_id' => false, // user_id to filter on 'object' => false, // object to filter on e.g. groups, profile, status, friends 'action' => false, // action to filter on e.g. activity_update, new_forum_post, profile_updated 'primary_id' => false, // object ID to filter on e.g. a group_id or forum_id or blog_id etc. 'secondary_id' => false, // secondary object ID to filter on e.g. a post_id. // Searching 'search_terms' => false, // specify terms to search on. 'use_compat' => bp_use_theme_compat_with_current_theme(), 'allow_posting' => false, // experimental, some of the themes may not support it. 'container_class' => 'activity',// default container, 'hide_on_activity' => 1,// hide on user and group activity pages. 'for' => '', // 'logged','displayed','author'. 'role' => '', // use one or more role here(e.g administrator,editor etc). 'for_group' => '',// group slug. ); $atts['meta_query']= array( array( 'key' => 'featured', 'value' => '0', 'type' => 'numeric', 'compare' => '!=', ), 'meta_type' => 'numeric', 'orderby' => 'meta_value_num', 'meta_key' => 'featured', 'order' => 'DESC' ); ?> <div id="buddypress"> <?php do_action( 'bp_before_activity_loop' ); if ( bp_has_activities( $atts ) ) : ?> <div class="<?php echo esc_attr( $atts['container_class'] ); ?> <?php if ( ! $atts['display_comments'] ) : ?> hide-activity-comments<?php endif; ?>"> <ul id="activity-stream" class="activity-list item-list"> <?php while ( bp_activities() ) : bp_the_activity(); ?> <?php bp_get_template_part( 'buddypress/activity/entry' ); ?> <?php endwhile; ?> <?php if ( $atts['load_more'] && bp_activity_has_more_items() ) : ?> <li class="load-more"> <a href="<?php bp_activity_load_more_link() ?>"><?php _e( 'Load More', 'buddypress' ); ?></a> </li> <?php endif; ?> </ul> <?php if ( $atts['pagination'] && ! $atts['load_more'] ) : ?> <div class="pagination"> <div class="pag-count"><?php bp_activity_pagination_count(); ?></div> <div class="pagination-links"><?php bp_activity_pagination_links(); ?></div> </div> <?php endif; ?> </div> <?php else : ?> <div id="message" class="info"> <p><?php _e( 'Sorry, there was no activity found. Please try a different filter.', 'buddypress' ); ?></p> </div> <?php endif; ?> ?> </div> <?php do_action( 'bp_after_activity_loop' ); ?> <?php get_template_part('page-parts/general-after-wrap'); ?> <?php get_footer(); ?>everything here works except for the order. for some reason it always orders by activity ID. am i missing something here? Thanks in advance im going crazy with this.
This does not seem to work in buddypress (I’m on 5.5). Can anyone spot the problem? It’s a REALLY important feature because adding users to groups from the Groups screen is super-slow if you have to do a lot of names.
My guess is that the group_id is not making it back from the popup, but I’m not smart enough to know if that’s true or how to fix it.
When attempting Group Creation, I get the following error:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function badgeos_add_schools_to_group(), 1 passed in /{…}/edgeubadges.com/wp-includes/class-wp-hook.php on line 289 and exactly 3 expected in /{…}/edgeubadges.com/wp-content/plugins/badgeos-group-management-add-on/includes/badgeos-group-management-functions.php:102 Stack trace: #0 /{…}/edgeubadges.com/wp-includes/class-wp-hook.php(289): badgeos_add_schools_to_group(19) #1 /{…}/edgeubadges.com/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array) #2 /{…}/edgeubadges.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #3 /{…}/edgeubadges.com/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php(194): do_action(‘groups_create_g…’, 19, Object(BP_Groups_Member), Object(BP_Groups_Group)) #4 /{…}/edgeubadges.com/wp-content/plugins/buddypress/bp-groups/actions/create.php(85): groups in /{…}/edgeubadges.com/wp-content/plugins/badgeos-group-management-add-on/includes/badgeos-group-management-functions.php on line 102
There has been a critical error on your website.—–
—————————Looking at the code, the line it tells me has a function that wants three arguments passed to it: $group_id, $member, and $group. We were previously able to create groups, but have not been able to since moving to a different web server.
Any ideas on what is causing this problem? Is there a server setting, or a WP/BOP setting that I have missed?
WP version: 5.4.1
BP version: 5.1.2 (same problem happened with 5.2.0 on test site)
Site: https://www.edgeubadges.com