Skip to:
Content
Pages
Categories
Search
Top
Bottom

Quick buddypress plugin question

  • @alfredojp

    Participant

    If i alter the sql function which creates the intial group table in the mysql database in the buddypress/bp-groups.php file (plugin folder) will it make the change in the database? For instance if i tell it to create another group table, named capo-groups, will it create anothert able in the database?

Viewing 6 replies - 1 through 6 (of 6 total)
  • @stigmartyr

    Member

    If your query is written correctly and your db user has permission to write it should work to your detriment. :D

    @djpaul

    Keymaster

    No. If you want to create your own table (and I’d suggest you carefully consider if you need one), put the creation code into your own plugin.

    @alfredojp

    Participant

    @Stigmartyr
    @DJPaul
    Thank yo both for your input
    I’m pretty good with MySql but not so hot with PHP. I’ve spent two weeks trying to figure out how to add
    another field(s) to the group creation so that a few more fields would be standard for the groups (i already know about that plugin that lets group admin put in fields aftewards), hours and hours and hours on these same forums with little help. I ran across group extension API code ( https://codex.buddypress.org/developer-docs/group-extension-api/ ) but i have no idea how to use it. What do i add or edit so that i can have group fields (at creation) for city, state, country and phone number.

    @stigmartyr

    Member

    @Stigmartyr – no need to thank me, Paul did the heavy lifting.

    I’m not 100% sure but I don’t think that any tables get created when a new group is made, rather the existing tables are populated. Usually any tables to be are created are done initially when the mod is first installed.

    If you’re trying to add more fields to the group profile like Paul said: you probably want to make a plugin that does this. Unfortunately like you I’m merely dangerous with php.

    @stigmartyr

    Member

    Damn the Purple Dynamite, I mentioned myself instead of @alfredojp in my post above ^ and I can’t edit it :(

    @alfredojp

    Participant

    @Stigmartyr
    Well adding another table came from another idea I had which was to basically copy everything that has to do with groups and group creations and group functions so that I could add more fields and have somthing of a database of Capoeria schools instead of just basic groups forums with names like “capoeira rocks socks”. ( http://caradacapoeira.com ). but i decided that that would be chaotic and it would just be better to add fields to the existing group capabilities (fields for location/phone number).

    @DJPaul
    I found this for the front end markup.

    `function bp_extra_group_fields_markup() {
    // Put your form markup here, eg:
    ?>

    <?php
    }
    add_action( ‘groups_custom_group_fields_editable’, ‘bbg_extra_group_fields_markup’ );`

    and this is for profesing the information:
    `function bbg_save_extra_group_details() {
    // Grab the $_POST data and do something with it. Simplified example:
    global $bp;
    if ( isset( $_POST ) )
    groups_update_groupmeta( $bp->groups->current_group->id, ‘country’, $_POST );
    }
    add_action( ‘groups_group_details_edited’, ‘bbg_save_extra_group_details’ );
    add_action( ‘groups_create_group_step_save_group-details’, ‘bbg_save_extra_group_details’ );`

    Please any and all help is welcome.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Quick buddypress plugin question’ is closed to new replies.
Skip to toolbar