Search Results for 'group_id'
-
AuthorSearch Results
-
May 16, 2010 at 11:52 pm #78419
In reply to: Weird double query using WPDB
Marcella
ParticipantThanks guys, upon inspecting a plugin with similar functionality then finding one with the exact functionality came accross this code.
$new_member = new BP_Groups_Member;
$new_member->group_id = $group_id;
$new_member->inviter_id = 0;
$new_member->user_id = $user_id;
$new_member->is_admin = 0;
$new_member->user_title = ”;
$new_member->date_modified = time();
$new_member->is_confirmed = 1;Which is a good insight of how to use a BP class in the future.
There were no actions being called on the WPDB query, would that be a reason why?
Unrelated note here, wouldn’t it be wise to advise plugin devs who utilise jQuery and default UI theme to rename their CSS class selectors as it always annoyingly clashes.
It’s either that or all theme developers have to rename theirs. A duel *slap :p
Thanks for help
May 16, 2010 at 9:48 pm #78403In reply to: Weird double query using WPDB
Anonymous User 96400
InactiveThat’d be
`groups_join_group( $group_id, $user_id );`As for the class, you instantiate it, set all the variables and then call the save() method.
I was asking for the action hooks before. Maybe that’s why it runs 3 times…
May 13, 2010 at 6:00 pm #78036In reply to: Group members not showing up
Kent
ParticipantI was also having this problem in clean installs of WP 2.9.2 + BP 1.2.3. I finally tracked the cause down to this: https://trac.buddypress.org/changeset/2882/trunk. Basically there’s a defect in the script that inserts the initial row into the xprofile fields table (wp_bp_xprofile_fields). A workaround (if you have SQL access) is to run these 2 statements:
ALTER TABLE wp_bp_xprofile_fields modify order_by varchar(15) not null default ”;
INSERT INTO wp_bp_xprofile_fields (id, group_id, parent_id, type, name, description, is_required, can_delete)
VALUES (1, 1, 0, ‘textbox’, ‘Name’, ”, 1, 0);After I executed those statements, it shows my group members.
Note that the changeset also added a default for order_by, so I’m guessing that caused problems as well.May 12, 2010 at 8:05 am #77749In reply to: group membership: double membership bug?
Hans-Juergen Philippi
Participant@3sixty: I experienced exactly the same misbehaviour in my blog = invitation sent, membership requested by the blog member, confirmed twice somehow and… boing, 2 memberships of the same member in a single group.
Is it still there in your blog or could you fix it?I wonder if it was sufficient to simply delete the doubled/second group-member-relation entry from the MySQL wp_bp_groups_members table? Or does this have any negative side effects?
A more gentle alternative could be to set the group_id field of this entry to a non-existing group 999 or so. Shouldn’t do any harm unless the 999th group is created and an uninvited member pops out of nowhere…Cheers,
HansMay 3, 2010 at 11:30 am #76397In reply to: Profile Field selectbox bulk import?
WPChina
ParticipantOk, I did this the “difficult way” by directly adding into the database. I wish there was a much easier way to handle this

Here is the code I used — you need to tweak it for your won requirenents based on how your setup exists:
Code:INSERT INTO `wp_bp_xprofile_fields` (`id`, `group_id`, `parent_id`, `type`, `name`, `description`, `is_required`, `is_default_option`, `field_order`, `option_order`, `order_by`, `can_delete`) VALUES
(number1, 6, 66, ‘option’, ‘CHOICE1’, ”, 0, 0, 0, 2, ”, 1),
(number2, 6, 66, ‘option’, ‘CHOICE2’, ”, 0, 0, 0, 3, ”, 1);April 28, 2010 at 7:09 pm #75775In reply to: How to DIsplay Only Required Fields on Signup
Paul Wong-Gibbs
KeymasterNot bp_profile_fields; function bp_has_profile() does if that’s any use? It only takes user_id and profile_group_id.
April 27, 2010 at 10:22 pm #75561In reply to: Query Group Info from Just the ID
Paul Wong-Gibbs
KeymasterWhat about something like does? You’ll have to dump the var to check what it contains.
$group = new BP_Groups_Group( $group_id );
April 22, 2010 at 3:46 pm #74723In reply to: Duplicating Components
Boone Gorges
KeymasterYes, it should be possible, but it’d be pretty complicated, as the codebase for the groups component is pretty large and complicated. An alternative method might be to add a piece of groupmeta to certain groups flagging them as ‘companies’, and then using that metadata to enable the separate display of company-groups and non-company-groups around the site. Or, what might be easier given the way that bp_has_groups is written (and given the fact that your company filters would largely be on the output of bp_has_groups) is to store an array somewhere of group_ids corresponding to company-groups and non-company-groups, and then feed it as the $include argument to bp_has_groups in your theme template.
April 13, 2010 at 11:38 am #73281Paul Wong-Gibbs
KeymasterSo, yes, by default, the register page only shows group 1 (the “base” group). You only retrieve one group via the profile_group_id= parameter in the bp_has_profile() call.
So, by default, this happens:
What I’m trying to accomplish is to hide groups 3 and 4 on the registration page not to overwhelm the user with a bunch of fields to fill out during sign-up, those fields can be filled out once the user has activated her/his account via “edit profile”.
There have been other threads on the forum regarding showing more than one profile group on the registration page; I found several, but take a look at https://buddypress.org/forums/topic/all-fields-for-registration. It’s probably going to be really difficult to implement unless you have a decent understanding of PHP.
April 13, 2010 at 11:18 am #73280jivany
ParticipantNope, I don’t think so. I was thinking you could remove the ‘profile_group_id=1’ arg from bp_has_profile but that doesn’t seem to allow the registration page to show more groups. I guess it appears that the only “required” fields for registration are the required ones in the Base group.
Might be worth opening a ticket on this one to see if that is the expect behaviour. Alternatively, ping R-a-y or DJPaul and see if they know.
April 13, 2010 at 2:24 am #73233Gene53
ParticipantNope, only getting group 1. I wonder if:
<?php if ( function_exists( 'bp_has_profile' ) ) : if ( bp_has_profile( 'profile_group_id=1' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>can be modified to fetch group 2 also.
LOL, this is driving me nuts…
April 12, 2010 at 10:54 pm #73202jivany
ParticipantOK. I’m thinking you can do something like this. Find this part of the file in register.php:
<?php /***** Extra Profile Details ******/ ?>
<?php if ( bp_is_active( 'xprofile' ) ) : ?>
<div class="register-section" id="profile-details-section">
<h4><?php _e( 'Profile Details', 'buddypress' ) ?></h4>
<?php /* Use the profile field loop to render input fields for the 'base' profile field group */ ?>
<?php if ( function_exists( 'bp_has_profile' ) ) : if ( bp_has_profile( 'profile_group_id=1' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>At this point, add in a line like:
if( (bp_the_profile_group != "3") || (bp_the_profile_group != "4") ) :Then go down to this part of the file:
<?php endwhile; ?>
<input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_group_field_ids() ?>" />
<?php endwhile; endif; endif; ?>
</div><!-- #profile-details-section -->Before the first endwhile line, insert this:
<?php endif; ?>I *think* that should spit out groups 3 & 4 (assuming you have groups 3 & 4 defined in your profile groups). You might need to add in group “1” also to get the Base. The only part I’m not sure about right now is if the number need to be in double quotes or just bare. So it might be:
if( (bp_the_profile_group != 3) || (bp_the_profile_group != 4) ) :I think.
April 11, 2010 at 7:40 am #72710rsqst
ParticipantOk, I think I’m close to knowing what I want; But I don’t seem to be much closer to getting there.
Unfortunately, I think my main problem is that the members loop isn’t flexible enough in its parameters for what I want (I want to add it to a child template and for it to automatically show the users of the current blog AND their xprofile information. Seems simple, but I’m lost).
I could hand code in each of users ID’s and get the exact output I want, but this means I have to make a new template for each blog/”art project”, and it doesn’t update automatically when a new artist is added to a project.
There’s hope in the group members loop (I’m using the BP Groupblog plugin, so when users join a group, they are added to a blog), but I still have to enter in the group_id manually in the template.
<?php if ( bp_group_has_members('group_id=1') ) : ?>
<?php while ( bp_group_members() ) : bp_group_the_member(); ?>
<?php $authorBio = xprofile_get_field_data( 'Bio', $user_id=bp_group_member_id() );
echo 'Authors bio: '. $authorBio; ?>
<?php endwhile; ?>
<?php endif;?>
But as it is, it outputs: 11Authors bio: 10Authors bio: 9Authors bio: 8Authors bio: 7Authors bio: 5Authors bio:
Should I scratch the whole thing and find a new route?
April 9, 2010 at 3:05 pm #72547In reply to: How do I find the Group_ID ?
ella_j_designs
MemberThank you. And what exactly do I do with that bit of code?
April 8, 2010 at 12:45 am #72270In reply to: How do I find the Group_ID ?
r-a-y
KeymasterYou’re right, Brajesh.
Forgot about that function!
April 8, 2010 at 12:16 am #72268In reply to: How do I find the Group_ID ?
Brajesh Singh
ParticipantThe
bp_get_group_id()will only work if you are on group page.In case you are not on group page and want to know the group id, there is a way to find that, but you will have to know the group slug(check the url of group for slug)
$group_id=BP_Groups_Group::get_id_from_slug($slug);where $slug is the group slug.
April 8, 2010 at 12:11 am #72267In reply to: How do I find the Group_ID ?
r-a-y
KeymasterTry:
bp_get_group_id();April 7, 2010 at 11:58 pm #72266In reply to: How do I find the Group_ID ?
danbpfr
Participantsearch your database for wp_bp_groups: the info is there, for sure !
April 7, 2010 at 11:33 pm #72264In reply to: How do I find the Group_ID ?
ella_j_designs
MemberI need the same information…
Anyone?
April 6, 2010 at 8:33 pm #72076rich! @ etiviti
Participantif you want to keep it all using bp functions, look at bp-groups.php
I would set it up hooking on activating the user (or signup if you don’t care about the activation key)
_action( 'bp_core_activated_user'then call (with no pagination passed in and active type)
groups_get_groups(then loop over all the groups and call (which needs the user_id and group_id)
groups_join_group(only downside to join_group is it will call a new activity for joining – but a plus side is it updates the groupmeta counts.
*my standard disclaimer applies – only in theory nothing tested.
April 6, 2010 at 3:20 pm #72027In reply to: Forum Reply Disconnected
rich! @ etiviti
Participantsounds easy enough to do, just need to edit the entry.php theme file and add some function around the reply button if the type is ‘new_forum_post’ or new_forum_topic (note: acomment-comment class invokes the jquery for the activity comment reply)
if the activity action is ‘new_forum_post’ then the secondary_id is the post_id
and i believe if a ‘new_forum_topic’ the primary_id is the forum_id (otherwise on new_forum_post it is the group_id)
post_id or forum_id – you can grab the link to the group forum topic (some buried functions in bb or bp)
(fwiw, i have a working demo of the activity comments on a forum reply post working now: http://etivite.com/groups/test-group/forum/topic/my-test-topic-to-pull-in-activity-stream-comments-on-a-topic-reply/#topic )
April 4, 2010 at 7:25 pm #71721In reply to: How to hide "Base" group in the edit profile panel?
Brajesh Singh
Participanthi Gene
how about this one then
<?php global $bp;
if(bp_get_current_profile_group_id()==1)
bp_core_redirect($bp->displayed_user->domain."profile/edit/group/2");
?>At the top of edit.php and removing the old code.
but please note, the base field will be never editable and will not be shown, when ever user will click on edit base field, he will be redirected to edit the second groups field.
let me know what do you think
April 3, 2010 at 9:14 pm #71625In reply to: How to hide "Base" group in the edit profile panel?
Brajesh Singh
ParticipantSimply, create a child theme, copy the members/single/profile/ edit.php to
yourchild-theme/members/single/profile/edit.php
Now modify it slightly,
Like put his before the first line of edit.php
<?php if(bp_get_current_profile_group_id()==1)
>
<ul class="button-nav">
<?php bp_profile_group_tabs(); ?>
</ul>
<div class="clear"></div>
<?php
locate_template(array("members/single/profile/profile-loop.php"),true);?>
<p><b>Your Username is your identity and We hate to see you changing your identity, so our computer has decided to disable editing it for you.Please Edit all other data in your profile as you wish
</b>
</p>
<?php
else:?>and at the end of Edit.php put this line
<?php endif;?>Now go and check your profile page.
please let me know if it works or not
April 3, 2010 at 5:26 pm #71592In reply to: Profile Fields Questions
jivany
Participant@gian-ava: For your second question, check out this post https://buddypress.org/forums/topic/faq-how-to-code-snippets-and-solutions#post-13243
I haven’t tried this but it would suggest you could do something like:
<?php if ( bp_has_profile('profile_group_id=9') || bp_has_profile('profile_group_id=7') ) : ?>
<?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
<div id="widget1">
<?php if (bp_the_profile_group() == "9") : ?>
// Do whatever you want with group 9
<?php endif; ?>
<?php if (bp_the_profile_group() == "7") : ?>
// Do whatever you want with group 7
<?php endif; ?>
</div>
<? endwhile; ?>
<?php endif; ?>The only part I’m not sure about is if you need the first call to bp_the_profile_group() on the second line (after the start of the while loop).
April 2, 2010 at 9:41 am #71411In reply to: Profile Fields Questions
Gianfranco
ParticipantAnd another thing I am trying know (Question #2) is if it is possible to use a conditional statement to check if more than 1 group has fileds that has been filled in and return something accordingly:
<?php if ( bp_has_profile('profile_group_id=9') || bp_has_profile('profile_group_id=7') ) : ?>
<?php while ( bp_profile_groups() ) : bp_the_profile_group(); if ( bp_profile_group_has_fields() ): //groups loop ?>
<div id="widget1">
(stuff from group 9)
(stuff from group 7)
</div>
<?php endif; endwhile; ?>
<?php endif; ?>After experimenting, I couldn’t make it work.
I need that because in my design I’d like to output a “Personal stuff” widget that has a graphic title and background, and it should display only if some fields from groups 9 and 7 are filles in, otherwise it should’t.
Is that achievable?
That is a guru question, isn’t it?
-
AuthorSearch Results