Skip to:
Content

BuddyPress.org

Changeset 1017 for trunk/bp-xprofile.php


Ignore:
Timestamp:
02/04/2009 12:29:21 AM (15 years ago)
Author:
matt
Message:

Minor cleanups, mods, and todos.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile.php

    r974 r1017  
    182182    global $wpdb, $bp;
    183183   
    184     if ( is_site_admin() ) {
    185         wp_enqueue_script( 'jquery.tablednd', site_url( MUPLUGINDIR . '/bp-core/js/jquery/jquery.tablednd.js' ), array( 'jquery' ), '0.4' );
    186    
    187         /* Add the administration tab under the "Site Admin" tab for site administrators */
    188         add_submenu_page( 'wpmu-admin.php', __("Profile Fields", 'buddypress'), __("Profile Fields", 'buddypress'), 1, "xprofile_settings", "xprofile_admin" );
    189 
    190         /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    191         if ( ( $wpdb->get_var("show tables like '%" . $bp['profile']['table_name_groups'] . "%'") == false ) || ( get_site_option('bp-xprofile-db-version') < BP_XPROFILE_DB_VERSION )  )
    192             xprofile_install();
    193        
    194         if ( ( function_exists('bp_wire_install') && $wpdb->get_var("show tables like '%" . $bp['profile']['table_name_wire'] . "%'") == false ) || ( get_site_option('bp-xprofile-db-version') < BP_XPROFILE_DB_VERSION )  )
    195             xprofile_wire_install();
    196     }
     184    if ( !is_site_admin() )
     185        return false;
     186
     187    /* Add the administration tab under the "Site Admin" tab for site administrators */
     188    add_submenu_page( 'wpmu-admin.php', __("Profile Fields", 'buddypress'), __("Profile Fields", 'buddypress'), 1, "xprofile_settings", "xprofile_admin" );
     189
     190    /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
     191    if ( ( $wpdb->get_var("SHOW TABLES LIKE '%" . $bp['profile']['table_name_groups'] . "%'") == false ) || ( get_site_option('bp-xprofile-db-version') < BP_XPROFILE_DB_VERSION )  )
     192        xprofile_install();
     193   
     194    if ( ( function_exists('bp_wire_install') && $wpdb->get_var("SHOW TABLES LIKE '%" . $bp['profile']['table_name_wire'] . "%'") == false ) || ( get_site_option('bp-xprofile-db-version') < BP_XPROFILE_DB_VERSION )  )
     195        xprofile_wire_install();
    197196}
    198197add_action( 'admin_menu', 'xprofile_add_admin_menu' );
     
    334333 *
    335334 * This function runs when an action is set for a screen:
    336  * domain.com/members/andy/profile/change-avatar/ [delete-avatar]
     335 * example.com/members/andy/profile/change-avatar/ [delete-avatar]
    337336 *
    338337 * The function will delete the active avatar for a user.
     
    347346    global $bp;
    348347   
    349     if ( $bp['current_action'] != 'delete-avatar' )
     348    if ( 'delete-avatar' != $bp['current_action'] )
    350349        return false;
    351350   
     
    375374        return false;
    376375   
    377     if ( $bp['current_action'] != 'post' )
     376    if ( 'post' != $bp['current_action'] )
    378377        return false;
    379378   
     
    381380        bp_core_add_message( __('Wire message could not be posted. Please try again.', 'buddypress'), 'error' );
    382381    } else {
    383         bp_core_add_message( __('Wire message successfully posted.', 'buddypress') );
    384                
     382        bp_core_add_message( __('Wire message successfully posted.', 'buddypress' ) );
     383
    385384        do_action( 'xprofile_new_wire_post', $wire_post_id );   
    386385    }
Note: See TracChangeset for help on using the changeset viewer.