Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'group_id'

Viewing 25 results - 476 through 500 (of 567 total)
  • Author
    Search Results
  • #78626

    In reply to: New to buddypress

    Aditya Singh
    Participant

    @ray
    I have created an excel parser/loader, that enables a user to import data directly into the table they want to from excel….as long as a user customizes the code-fragment depending on the fields present in the table, it is good to go…Will try to frame this into a plugin after 21st of this month…trying to get my site live by 21st…

    re#4 (extra items in group header)
    what i meant was : lets say I want to add “description2”, “description3”, “description4” besides the default “description”, and I want all of them appear on the group header page….now, I have modified the table structure so that it now has few more fields, i.e. “desc2”, “desc3” and “desc4”.
    Here are my follow-up questions on this:
    a. would it be a bad idea to do this way…i mean i have done it hoping that whenever buddypress is updated, my database will be left untouched…wouldn’t it?
    b. I tried creating the functions for fetching desc2 etc based on function bp_group_description() in the bp-groups-templatetags.php, and calling it finally in group-header.php, but it does not work….am i doing something wrong??

    Now this may be asking a lot but could you tell me what possibly could be going wrong here, or may be show be how this should be done, assuming a person has to
    “fetch the details of a field XYZ in the table bp_groups”
    OR
    in case altering with the table bp_groups is a bad idea, I could create a second meta-table with my parameters that has the group_id of the group whom the values of these fields correspond to….but in this case also, how do i fetch the results?

    Boone Gorges
    Keymaster

    If you just want to display static content on the group’s home page in place of the activity stream, I wouldn’t go hacking activity-loop.php (it’s too far upstream, so to speak). In [your-theme]/groups/single/home.php, there’s a string of conditionals starting around line 28. Play with them to get what you want.

    As for the current group id, you can get that from bp_get_group_id() when inside the bp_has_groups() loop.

    rich! @ etiviti
    Participant

    $bp->groups->current_group->id would be the actual group_id for the group you are viewing (within the group component)

    Now if you needed the group_id from an activity record, then the item_id contains the group_id (whereas the component is $bp->group->id )

    #78419
    Marcella
    Participant

    Thanks 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

    #78403
    Anonymous User 96400
    Inactive

    That’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…

    #78036
    Kent
    Participant

    I 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.

    #77749

    @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,
    Hans

    #76397
    WPChina
    Participant

    Ok, 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);
    #75775
    Paul Wong-Gibbs
    Keymaster

    Not bp_profile_fields; function bp_has_profile() does if that’s any use? It only takes user_id and profile_group_id.

    #75561
    Paul Wong-Gibbs
    Keymaster

    What about something like does? You’ll have to dump the var to check what it contains.


    $group = new BP_Groups_Group( $group_id );

    #74723

    In reply to: Duplicating Components

    Boone Gorges
    Keymaster

    Yes, 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.

    Paul Wong-Gibbs
    Keymaster

    So, 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.

    jivany
    Participant

    Nope, 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.

    Gene53
    Participant

    Nope, 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…

    jivany
    Participant

    OK. 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. ;)

    rsqst
    Participant

    Ok, 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?

    #72547

    Thank you. And what exactly do I do with that bit of code?

    #72270
    r-a-y
    Keymaster

    You’re right, Brajesh.

    Forgot about that function!

    #72268
    Brajesh Singh
    Participant

    The

    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.

    #72267
    r-a-y
    Keymaster

    Try:

    bp_get_group_id();

    #72266
    danbpfr
    Participant

    search your database for wp_bp_groups: the info is there, for sure !

    #72264

    I need the same information…

    Anyone?

    rich! @ etiviti
    Participant

    if 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. :)

    #72027
    rich! @ etiviti
    Participant

    sounds 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 )

    #71721
    Brajesh Singh
    Participant

    hi 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 :)

Viewing 25 results - 476 through 500 (of 567 total)
Skip to toolbar