Skip to:
Content

BuddyPress.org

Ticket #634: share_friends_profiles_groups.diff

File share_friends_profiles_groups.diff, 4.2 KB (added by nicolagreco, 17 years ago)

Table names as constants

  • bp-friends.php

     
    1919if ( !defined( 'BP_FRIENDS_SLUG' ) )
    2020        define ( 'BP_FRIENDS_SLUG', 'friends' );
    2121
     22/* Define the name of table for the component */
     23if ( !defined( 'BP_FRIENDS_TABLE' ) )
     24        define( 'BP_FRIENDS_TABLE', $wpdb->base_prefix . 'bp_friends' );
     25
    2226require ( 'bp-friends/bp-friends-classes.php' );
    2327require ( 'bp-friends/bp-friends-ajax.php' );
    2428require ( 'bp-friends/bp-friends-cssjs.php' );
     
    6569function friends_setup_globals() {
    6670        global $bp, $wpdb;
    6771       
    68         $bp->friends->table_name = $wpdb->base_prefix . 'bp_friends';
     72        $bp->friends->table_name = BP_FRIENDS_TABLE;
    6973        $bp->friends->image_base = WPMU_PLUGIN_URL . '/bp-friends/images';
    7074        $bp->friends->format_activity_function = 'friends_format_activity';
    7175        $bp->friends->format_notification_function = 'friends_format_notifications';
  • bp-groups.php

     
    1919if ( !defined( 'BP_GROUPS_SLUG' ) )
    2020        define ( 'BP_GROUPS_SLUG', 'groups' );
    2121
     22/* Define the name of table for the component */
     23if ( !defined( 'BP_GROUPS_TABLE' ) )
     24        define( 'BP_GROUPS_TABLE', $wpdb->base_prefix . 'bp_groups' );
     25
     26/* Define the name of the members table for the component */
     27if ( !defined( 'BP_GROUPS_TABLE_MEMBERS' ) )
     28        define( 'BP_GROUPS_TABLE_MEMBERS', $wpdb->base_prefix . 'bp_groups_members' );
     29
     30/* Define the name of the groupmeta table for the component */
     31if ( !defined( 'BP_GROUPS_TABLE_GROUPMETA' ) )
     32        define( 'BP_GROUPS_TABLE_GROUPMETA', $wpdb->base_prefix . 'bp_groups_groupmeta' );
     33
    2234require ( 'bp-groups/bp-groups-classes.php' );
    2335require ( 'bp-groups/bp-groups-ajax.php' );
    2436require ( 'bp-groups/bp-groups-cssjs.php' );
     
    132144        if ( !$no_global )
    133145                global $bp;
    134146       
    135         $bp->groups->table_name = $wpdb->base_prefix . 'bp_groups';
    136         $bp->groups->table_name_members = $wpdb->base_prefix . 'bp_groups_members';
    137         $bp->groups->table_name_groupmeta = $wpdb->base_prefix . 'bp_groups_groupmeta';
     147        $bp->groups->table_name = BP_GROUPS_TABLE;
     148        $bp->groups->table_name_members = BP_GROUPS_TABLE_MEMBERS;
     149        $bp->groups->table_name_groupmeta = BP_GROUPS_TABLE_GROUPMETA;
    138150        $bp->groups->image_base = WPMU_PLUGIN_URL . '/bp-groups/images';
    139151        $bp->groups->format_activity_function = 'groups_format_activity';
    140152        $bp->groups->format_notification_function = 'groups_format_notifications';
  • bp-xprofile.php

     
    1919if ( !defined( 'BP_XPROFILE_SLUG' ) )
    2020        define ( 'BP_XPROFILE_SLUG', 'profile' );
    2121
     22/* Define the name of the data table for the component */
     23if ( !defined( 'BP_XPROFILE_TABLE_DATA' ) )
     24        define( 'BP_XPROFILE_TABLE_DATA', $wpdb->base_prefix . 'bp_xprofile_data' );
     25
     26/* Define the name of the groups table for the component */
     27if ( !defined( 'BP_XPROFILE_TABLE_GROUPS' ) )
     28        define( 'BP_XPROFILE_TABLE_GROUPS', $wpdb->base_prefix . 'bp_xprofile_groups' );
     29
     30/* Define the name of the fields table for the component */
     31if ( !defined( 'BP_XPROFILE_TABLE_FIELDS' ) )
     32        define( 'BP_XPROFILE_TABLE_FIELDS', $wpdb->base_prefix . 'bp_xprofile_fields' );
     33
    2234require ( 'bp-xprofile/bp-xprofile-classes.php' );
    2335require ( 'bp-xprofile/bp-xprofile-filters.php' );
    2436require ( 'bp-xprofile/bp-xprofile-signup.php' );
     
    144156function xprofile_setup_globals() {
    145157        global $bp, $wpdb;
    146158       
    147         $bp->profile->table_name_groups = $wpdb->base_prefix . 'bp_xprofile_groups';
    148         $bp->profile->table_name_fields = $wpdb->base_prefix . 'bp_xprofile_fields';
    149         $bp->profile->table_name_data = $wpdb->base_prefix . 'bp_xprofile_data';
     159        $bp->profile->table_name_groups = BP_XPROFILE_TABLE_GROUPS;
     160        $bp->profile->table_name_fields = BP_XPROFILE_TABLE_FIELDS;
     161        $bp->profile->table_name_data = BP_XPROFILE_TABLE_DATA;
    150162        $bp->profile->format_activity_function = 'xprofile_format_activity';
    151163        $bp->profile->format_notification_function = 'xprofile_format_notifications';
    152164        $bp->profile->image_base = WPMU_PLUGIN_URL . '/bp-xprofile/images';