Skip to:
Content

BuddyPress.org

Changeset 1705


Ignore:
Timestamp:
08/26/2009 04:21:57 PM (16 years ago)
Author:
apeatling
Message:

Added internal ID's to all components.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r1691 r1705  
    11<?php
    22
    3 define ( 'BP_ACTIVITY_DB_VERSION', '1700' );
     3define ( 'BP_ACTIVITY_DB_VERSION', '1721' );
    44
    55/* Define the slug for the component */
     
    4646    $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->base_prefix}bp_activity_sitewide" );
    4747   
     48    /* Rename the old user activity cached table */
     49    $wpdb->query( "RENAME TABLE {$wpdb->base_prefix}bp_activity_user_activity_cached TO {$bp->activity->table_name}" );
     50
    4851    update_site_option( 'bp-activity-db-version', BP_ACTIVITY_DB_VERSION );
    4952}
     
    5255    global $bp, $wpdb, $current_blog;
    5356
    54     $bp->activity->table_name = $wpdb->base_prefix . 'bp_activity_user_activity_cached';
     57    /* Internal identifier */
     58    $bp->activity->id = 'activity';
     59   
     60    $bp->activity->table_name = $wpdb->base_prefix . 'bp_activity';
    5561    $bp->activity->slug = BP_ACTIVITY_SLUG;
    56 
    57     if ( is_site_admin() && get_site_option( 'bp-activity-db-version' ) < BP_ACTIVITY_DB_VERSION  )
     62}
     63add_action( 'plugins_loaded', 'bp_activity_setup_globals', 5 );
     64add_action( 'admin_menu', 'bp_activity_setup_globals', 2 );
     65
     66function bp_activity_check_installed() {   
     67    global $wpdb, $bp;
     68   
     69//  if ( get_site_option('bp-activity-db-version') < BP_ACTIVITY_DB_VERSION )
    5870        bp_activity_install();
    5971}
    60 add_action( 'plugins_loaded', 'bp_activity_setup_globals', 5 );
    61 add_action( 'admin_menu', 'bp_activity_setup_globals', 1 );
     72add_action( 'admin_menu', 'bp_activity_check_installed' );
    6273
    6374function bp_activity_setup_root_component() {
     
    6576    bp_core_add_root_component( BP_ACTIVITY_SLUG );
    6677}
    67 add_action( 'plugins_loaded', 'bp_activity_setup_root_component', 1 );
     78add_action( 'plugins_loaded', 'bp_activity_setup_root_component', 2 );
    6879
    6980function bp_activity_setup_nav() {
  • trunk/bp-blogs.php

    r1687 r1705  
    107107function bp_blogs_setup_globals() {
    108108    global $bp, $wpdb;
    109 
     109   
     110    /* For internal identification */
    110111    $bp->blogs->id = 'blogs';
     112   
    111113    $bp->blogs->table_name = $wpdb->base_prefix . 'bp_user_blogs';
    112114    $bp->blogs->table_name_blog_posts = $wpdb->base_prefix . 'bp_user_blogs_posts';
  • trunk/bp-forums.php

    r1688 r1705  
    1212function bp_forums_setup() {
    1313    global $bp;
    14    
     14
     15    /* For internal identification */
     16    $bp->forums->id = 'forums';
     17       
    1518    $bp->forums->image_base = BP_PLUGIN_URL . '/bp-forums/images';
    1619    $bp->forums->bbconfig = get_site_option( 'bb-config-location' );
  • trunk/bp-friends.php

    r1687 r1705  
    3939function friends_setup_globals() {
    4040    global $bp, $wpdb;
    41    
     41
     42    /* For internal identification */
     43    $bp->friends->id = 'friends';
     44       
    4245    $bp->friends->table_name = $wpdb->base_prefix . 'bp_friends';
    4346    $bp->friends->format_activity_function = 'friends_format_activity';
    4447    $bp->friends->format_notification_function = 'friends_format_notifications';
    45 
    4648    $bp->friends->slug = BP_FRIENDS_SLUG;
    4749
    48     $bp->version_numbers->friends = BP_FRIENDS_VERSION;
    4950}
    5051add_action( 'plugins_loaded', 'friends_setup_globals', 5 );
  • trunk/bp-groups.php

    r1700 r1705  
    9898function groups_setup_globals() {
    9999    global $bp, $wpdb;
    100    
     100
     101    /* For internal identification */
     102    $bp->groups->id = 'groups';
     103       
    101104    $bp->groups->table_name = $wpdb->base_prefix . 'bp_groups';
    102105    $bp->groups->table_name_members = $wpdb->base_prefix . 'bp_groups_members';
  • trunk/bp-messages.php

    r1687 r1705  
    7474function messages_setup_globals() {
    7575    global $bp, $wpdb;
     76
     77    /* For internal identification */
     78    $bp->messages->id = 'messages';
    7679   
    7780    $bp->messages->table_name_threads = $wpdb->base_prefix . 'bp_messages_threads';
     
    8184    $bp->messages->format_activity_function = 'messages_format_activity';
    8285    $bp->messages->format_notification_function = 'messages_format_notifications';
    83     $bp->messages->image_base = BP_PLUGIN_URL . '/bp-messages/images';
    8486    $bp->messages->slug = BP_MESSAGES_SLUG;
    85 
    86     $bp->version_numbers->messages = BP_MESSAGES_VERSION;
    8787}
    8888add_action( 'plugins_loaded', 'messages_setup_globals', 5 );   
  • trunk/bp-wire.php

    r1693 r1705  
    1919function bp_wire_setup_globals() {
    2020    global $bp, $wpdb;
     21
     22    /* For internal identification */
     23    $bp->wire->id = 'wire';
    2124   
    22     $bp->wire->image_base = BP_PLUGIN_URL . '/bp-wire/images';
    2325    $bp->wire->slug = BP_WIRE_SLUG;
    24 
    25     $bp->version_numbers->wire = BP_WIRE_VERSION;
    2626}
    2727add_action( 'plugins_loaded', 'bp_wire_setup_globals', 5 );
Note: See TracChangeset for help on using the changeset viewer.