Skip to:
Content

BuddyPress.org

Changeset 1017


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

Minor cleanups, mods, and todos.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r974 r1017  
    3636                id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    3737                item_id int(11) NOT NULL,
    38                 secondary_item_id int(11),
     38                secondary_item_id int(11) NOT NULL,
    3939                user_id int(11) NOT NULL,
    4040                component_name varchar(75) NOT NULL,
     
    5252                id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    5353                item_id int(11) NOT NULL,
    54                 secondary_item_id int(11),
     54                secondary_item_id int(11) NOT NULL,
    5555                content longtext NOT NULL,
    5656                primary_link varchar(150) NOT NULL,
     
    152152    if ( $bp['current_userid'] ) {
    153153        /* Check to see if the current user has their activity table set up. If not, set them up. */
    154         if ( !$wpdb->get_var("show tables like '%" . $bp['activity']['table_name_current_user'] . "%'") || get_usermeta( $bp['current_userid'], 'bp-activity-db-version' ) < BP_ACTIVITY_VERSION  )
     154        if ( !$wpdb->get_var("SHOW TABLES LIKE '%" . $bp['activity']['table_name_current_user'] . "%'") || get_usermeta( $bp['current_userid'], 'bp-activity-db-version' ) < BP_ACTIVITY_VERSION  )
    155155            bp_activity_user_install();
    156156    }
     
    158158    if ( is_site_admin() && $current_blog->blog_id == 1 ) {
    159159        /* Check to see if the site wide activity table is set up. */
    160         if ( !$wpdb->get_var("show tables like '%" . $bp['activity']['table_name_sitewide'] . "%'") || get_site_option( 'bp-activity-db-version' ) < BP_ACTIVITY_VERSION  )
     160        if ( !$wpdb->get_var("SHOW TABLES LIKE '%" . $bp['activity']['table_name_sitewide'] . "%'") || get_site_option( 'bp-activity-db-version' ) < BP_ACTIVITY_VERSION  )
    161161            bp_activity_sitewide_install();
    162162    }
  • trunk/bp-blogs.php

    r974 r1017  
    110110    if ( is_site_admin() ) {
    111111        /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    112         if ( ( $wpdb->get_var("show tables like '%" . $bp['blogs']['table_name'] . "%'") == false ) || ( get_site_option('bp-blogs-db-version') < BP_BLOGS_DB_VERSION )  )
     112        if ( ( $wpdb->get_var("SHOW TABLES LIKE '%" . $bp['blogs']['table_name'] . "%'") == false ) || ( get_site_option('bp-blogs-db-version') < BP_BLOGS_DB_VERSION )  )
    113113            bp_blogs_install();
    114114    }
  • trunk/bp-core.php

    r1012 r1017  
    5555require_once( 'bp-core/bp-core-activation.php' );
    5656
    57 /* Define the slug for member pages and the members directory (e.g. domain.com/[members] ) */
     57/* Define the slug for member pages and the members directory (e.g. example.com/[members] ) */
    5858define( 'MEMBERS_SLUG', apply_filters( 'bp_members_slug', 'members' ) );
    5959
     
    103103    $bp['current_userid'] = $current_userid;
    104104   
    105     /* The domain for the user currently logged in. eg: http://domain.com/members/andy */
     105    /* The domain for the user currently logged in. eg: http://example.com/members/andy */
    106106    $bp['loggedin_domain'] = bp_core_get_user_domain($current_user->ID);
    107107   
     
    109109    $bp['current_domain'] = bp_core_get_user_domain($current_userid);
    110110   
    111     /* The component being used eg: http://andy.domain.com/ [profile] */
     111    /* The component being used eg: http://andy.example.com/ [profile] */
    112112    $bp['current_component'] = $current_component; // type: string
    113113   
    114     /* The current action for the component eg: http://andy.domain.com/profile/ [edit] */
     114    /* The current action for the component eg: http://andy.example.com/profile/ [edit] */
    115115    $bp['current_action'] = $current_action; // type: string
    116116   
    117     /* The action variables for the current action eg: http://andy.domain.com/profile/edit/ [group] / [6] */
     117    /* The action variables for the current action eg: http://andy.example.com/profile/edit/ [group] / [6] */
    118118    $bp['action_variables'] = $action_variables; // type: array
    119119   
    120     /* Only used where a component has a sub item, e.g. groups: http://andy.domain.com/groups/ [my-group] / home - manipulated in the actual component not in catch uri code.*/
     120    /* Only used where a component has a sub item, e.g. groups: http://andy.example.com/groups/ [my-group] / home - manipulated in the actual component not in catch uri code.*/
    121121    $bp['current_item'] = ''; // type: string
    122122
    123     /* The default component to use if none are set and someone visits: http://andy.domain.com/ */
     123    /* The default component to use if none are set and someone visits: http://andy.example.com/ */
    124124    $bp['default_component'] = 'profile';
    125125   
     
    197197                user_id int(11) NOT NULL,
    198198                item_id int(11) NOT NULL,
    199                 secondary_item_id int(11),
     199                secondary_item_id int(11) NOT NULL,
    200200                component_name varchar(75) NOT NULL,
    201201                component_action varchar(75) NOT NULL,
     
    241241    if ( is_site_admin() ) {
    242242        /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    243         if ( ( $wpdb->get_var("show tables like '%" . $bp['core']['table_name_notifications'] . "%'") == false ) || ( get_site_option('bp-core-db-version') < BP_CORE_DB_VERSION )  )
     243        if ( ( $wpdb->get_var("SHOW TABLES LIKE '%" . $bp['core']['table_name_notifications'] . "%'") == false ) || ( get_site_option('bp-core-db-version') < BP_CORE_DB_VERSION )  )
    244244            bp_core_install();
    245245    }
     
    263263    if ( is_site_admin() ) {
    264264        /* Add the administration tab under the "Site Admin" tab for site administrators */
    265         add_submenu_page( 'wpmu-admin.php', __("BuddyPress", 'buddypress'), __("BuddyPress", 'buddypress'), 1, "bp_core_admin_settings", "bp_core_admin_settings" );
     265        add_submenu_page( 'wpmu-admin.php', __('BuddyPress', 'buddypress'), __('BuddyPress', 'buddypress'), 1, 'bp_core_admin_settings', 'bp_core_admin_settings' );
    266266    }
    267267}
     
    272272 *
    273273 * Checks to see if a component's URL should be in the root, not under a member page:
    274  * eg: http://domain.com/groups/the-group NOT http://domain.com/members/andy/groups/the-group
     274 * eg: http://example.com/groups/the-group NOT http://example.com/members/andy/groups/the-group
    275275 *
    276276 * @package BuddyPress Core
     
    326326 *
    327327 * Returns the domain for the passed user:
    328  * e.g. http://domain.com/members/andy/
     328 * e.g. http://example.com/members/andy/
    329329 *
    330330 * @package BuddyPress Core
     
    338338    if ( !$user_id ) return;
    339339   
    340     $ud = get_userdata($user_id);
     340    $ud = get_userdata( $user_id );
    341341   
    342342    return $bp['root_domain'] . '/' . MEMBERS_SLUG . '/' . $ud->user_login . '/';
     
    347347 *
    348348 * Returns the domain for the root blog.
    349  * eg: http://domain.com/ OR https://domain.com
     349 * eg: http://example.com/ OR https://example.com
    350350 *
    351351 * @package BuddyPress Core
     
    367367 *
    368368 * Returns the user id for the user that is currently being viewed.
    369  * eg: http://andy.domain.com/ or http://domain.com/andy/
     369 * eg: http://andy.example.com/ or http://example.com/andy/
    370370 *
    371371 * @package BuddyPress Core
     
    527527 *
    528528 * Example of a root component:
    529  *  Groups: http://domain.com/groups/group-name
    530  *          http://community.domain.com/groups/group-name
    531  *          http://domain.com/wpmu/groups/group-name
     529 *  Groups: http://example.com/groups/group-name
     530 *          http://community.example.com/groups/group-name
     531 *          http://example.com/wpmu/groups/group-name
    532532 *
    533533 * Example of a component that is NOT a root component:
    534  *  Friends: http://domain.com/members/andy/friends
    535  *           http://community.domain.com/members/andy/friends
    536  *           http://domain.com/wpmu/members/andy/friends
     534 *  Friends: http://example.com/members/andy/friends
     535 *           http://community.example.com/members/andy/friends
     536 *           http://example.com/wpmu/members/andy/friends
    537537 *
    538538 * @package BuddyPress Core
     
    670670 *
    671671 * Returns a HTML formatted link for a user with the user's full name as the link text.
    672  * eg: <a href="http://andy.domain.com/">Andy Peatling</a>
     672 * eg: <a href="http://andy.example.com/">Andy Peatling</a>
    673673 * Optional parameters will return just the name, or just the URL, or disable "You" text when
    674674 * user matches the logged in user.
  • trunk/bp-core/bp-core-catchuri.php

    r959 r1017  
    1515 *
    1616 * The URI's are broken down as follows:
    17  *   - http:// domain.com / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
    18  *   - OUTSIDE ROOT: http:// domain.com / sites / buddypress / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
     17 *   - http:// example.com / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
     18 *   - OUTSIDE ROOT: http:// example.com / sites / buddypress / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
    1919 *
    2020 *  Example:
    21  *    - http://domain.com/members/andy/profile/edit/group/5/
     21 *    - http://example.com/members/andy/profile/edit/group/5/
    2222 *    - $current_component: string 'profile'
    2323 *    - $current_action: string 'edit'
  • trunk/bp-forums/bp-forums-admin.php

    r887 r1017  
    6666                    <td>
    6767                        <input name="target_uri" type="text" id="target_uri" value="<?php echo attribute_escape( $fetch_options['target_uri'] ); ?>" size="60" /><br />
    68                         <?php _e( 'The URL of the location you installed bbPress. For example, http://domain.com/forums/', 'buddypress' ); ?>
     68                        <?php _e( 'The URL of the location you installed bbPress. For example, http://example.com/forums/', 'buddypress' ); ?>
    6969                    </td>
    7070                </tr>
  • trunk/bp-friends.php

    r974 r1017  
    7474    if ( is_site_admin() ) {
    7575        /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    76         if ( ( $wpdb->get_var("show tables like '%" . $bp['friends']['table_name'] . "%'") == false ) || ( get_site_option('bp-friends-db-version') < BP_FRIENDS_DB_VERSION )  )
     76        if ( ( $wpdb->get_var("SHOW TABLES LIKE '%" . $bp['friends']['table_name'] . "%'") == false ) || ( get_site_option('bp-friends-db-version') < BP_FRIENDS_DB_VERSION )  )
    7777            friends_install();
    7878    }
  • trunk/bp-groups.php

    r974 r1017  
    152152    if ( is_site_admin() ) {
    153153        /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    154         if ( ( $wpdb->get_var("show tables like '%" . $bp['groups']['table_name'] . "%'") == false ) || ( get_site_option('bp-groups-db-version') < BP_GROUPS_DB_VERSION )  )
     154        if ( ( $wpdb->get_var("SHOW TABLES LIKE '%" . $bp['groups']['table_name'] . "%'") == false ) || ( get_site_option('bp-groups-db-version') < BP_GROUPS_DB_VERSION )  )
    155155            groups_install();
    156156           
    157         if ( ( function_exists('bp_wire_install') && $wpdb->get_var("show tables like '%" . $bp['groups']['table_name_wire'] . "%'") == false ) || ( get_site_option('bp-groups-db-version') < BP_GROUPS_DB_VERSION ) )
     157        if ( ( function_exists('bp_wire_install') && $wpdb->get_var("SHOW TABLES LIKE '%" . $bp['groups']['table_name_wire'] . "%'") == false ) || ( get_site_option('bp-groups-db-version') < BP_GROUPS_DB_VERSION ) )
    158158            groups_wire_install();
    159159    }
  • trunk/bp-messages.php

    r974 r1017  
    126126    if ( is_site_admin() ) {
    127127        /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    128         if ( ( $wpdb->get_var( "show tables like '%" . $bp['messages']['table_name'] . "%'" ) == false ) || ( get_site_option('bp-messages-db-version') < BP_MESSAGES_DB_VERSION ) )
     128        if ( ( $wpdb->get_var( "SHOW TABLES LIKE '%" . $bp['messages']['table_name'] . "%'" ) == false ) || ( get_site_option('bp-messages-db-version') < BP_MESSAGES_DB_VERSION ) )
    129129            messages_install();
    130130    }
  • 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    }
  • trunk/bp-xprofile/bp-xprofile-admin.php

    r850 r1017  
    1111function xprofile_admin( $message = '', $type = 'error' ) {
    1212    global $bp;
    13    
     13
     14    $type = preg_replace( '|[^a-z]|i', '', $type );
     15
    1416    $groups = BP_XProfile_Group::get_all();
    15    
     17
    1618    if ( isset($_GET['mode']) && isset($_GET['group_id']) && $_GET['mode'] == "add_field" ) {
    1719        xprofile_admin_manage_field($_GET['group_id']);
     
    4547        ?>
    4648            <div id="message" class="<?php echo $type; ?> fade">
    47                 <p><?php echo $message; ?></p>
     49                <p><?php echo wp_specialchars( $message ); ?></p>
    4850            </div>
    4951        <?php }
     
    6365            </script>
    6466           
    65             <?php if ( function_exists('wp_nonce_field') )
    66                 wp_nonce_field('xprofile_reorder_fields');
    67            
    68             for ( $i = 0; $i < count($groups); $i++ ) {
     67            <?php
     68            wp_nonce_field('xprofile_reorder_fields');
     69           
     70            for ( $i = 0; $i < count($groups); $i++ ) { // TODO: foreach
    6971            ?>
    7072                <p>
     
    121123               
    122124        <?php } else { ?>
    123             <div id="message" class="error"><p>You have no groups.</p></div>
     125            <div id="message" class="error"><p><?php _e('You have no groups.', 'buddypress' ); ?></p></div>
    124126            <p><a href="admin.php?page=xprofile_settings&amp;mode=add_group"><?php _e( 'Add New Group', 'buddypress' ) ?></a></p>
    125127        <?php } ?>
     
    184186    }
    185187   
    186     unset($_GET['mode']);
     188    unset($_GET['mode']); // TODO: wtf?
    187189    xprofile_admin( $message, $type );
    188190}
     
    261263    xprofile_admin($message, $type);
    262264}
    263 
    264 ?>
Note: See TracChangeset for help on using the changeset viewer.