Changeset 2695 for trunk/bp-xprofile.php
- Timestamp:
- 02/12/2010 12:31:49 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile.php
r2678 r2695 12 12 require ( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-cssjs.php' ); 13 13 14 /* Assign the base group and fullname field names to constants to use in SQL statements */15 define ( 'BP_XPROFILE_BASE_GROUP_NAME', get_site_option( 'bp-xprofile-base-group-name' ) );16 define ( 'BP_XPROFILE_FULLNAME_FIELD_NAME', get_site_option( 'bp-xprofile-fullname-field-name' ) );17 18 14 /** 19 15 * xprofile_install() … … 32 28 $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; 33 29 34 if ( '' == get_site_option( 'bp-xprofile-base-group-name') )30 if ( empty( $bp->option['bp-xprofile-base-group-name'] ) ) 35 31 update_site_option( 'bp-xprofile-base-group-name', 'Base' ); 36 32 37 if ( '' == get_site_option( 'bp-xprofile-fullname-field-name') )33 if ( empty( $bp->option['bp-xprofile-fullname-field-name'] ) ) 38 34 update_site_option( 'bp-xprofile-fullname-field-name', 'Name' ); 39 35 … … 76 72 ) {$charset_collate};"; 77 73 78 if ( '' == get_site_option( 'bp-xprofile-db-version') ) {74 if ( empty( $bp->option['bp-xprofile-db-version'] ) ) { 79 75 if ( !$wpdb->get_var( "SELECT id FROM {$bp->profile->table_name_groups} WHERE id = 1" ) ) 80 $sql[] = "INSERT INTO {$bp->profile->table_name_groups} VALUES ( 1, '" . get_site_option( 'bp-xprofile-base-group-name' ). "', '', 0 );";76 $sql[] = "INSERT INTO {$bp->profile->table_name_groups} VALUES ( 1, '" . $bp->option['bp-xprofile-base-group-name'] . "', '', 0 );"; 81 77 82 78 if ( !$wpdb->get_var( "SELECT id FROM {$bp->profile->table_name_fields} WHERE id = 1" ) ) { … … 84 80 id, group_id, parent_id, type, name, is_required, can_delete 85 81 ) VALUES ( 86 1, 1, 0, 'textbox', '" . get_site_option( 'bp-xprofile-fullname-field-name' ). "', 1, 082 1, 1, 0, 'textbox', '" . $bp->option['bp-xprofile-fullname-field-name'] . "', 1, 0 87 83 );"; 88 84 } … … 110 106 global $bp, $wpdb; 111 107 108 /* Assign the base group and fullname field names to constants to use in SQL statements */ 109 define ( 'BP_XPROFILE_BASE_GROUP_NAME', $bp->site_options['bp-xprofile-base-group-name'] ); 110 define ( 'BP_XPROFILE_FULLNAME_FIELD_NAME', $bp->site_options['bp-xprofile-fullname-field-name'] ); 111 112 112 /* For internal identification */ 113 113 $bp->profile->id = 'profile'; … … 129 129 } 130 130 add_action( 'bp_setup_globals', 'xprofile_setup_globals' ); 131 add_action( 'admin_menu', 'xprofile_setup_globals', 2 );132 131 133 132 /** … … 157 156 158 157 /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */ 159 if ( get_site_option('bp-xprofile-db-version')< BP_XPROFILE_DB_VERSION )158 if ( $bp->option['bp-xprofile-db-version'] < BP_XPROFILE_DB_VERSION ) 160 159 xprofile_install(); 161 160 } … … 868 867 global $bp, $wpdb; 869 868 870 if ( (int) get_site_option( 'bp-disable-profile-sync' ))869 if ( (int)$bp->option['bp-disable-profile-sync'] ) 871 870 return true; 872 871
Note: See TracChangeset
for help on using the changeset viewer.