bp_group_tinychat_activate

The BuddyPress Group Tiny Chat bp group tinychat activate function.

Description

bp_group_tinychat_activate(); 

Usage

  1. if ( !function_exists( 'bp_group_tinychat_activate' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress-group-tiny-chat/loader.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_group_tinychat_activate(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/loader.php  
  1. function bp_group_tinychat_activate() { 
  2. global $wpdb; 
  3.  
  4. if ( !empty($wpdb->charset) ) 
  5. $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; 
  6.  
  7. $sql[] = "CREATE TABLE {$wpdb->base_prefix}bp_group_tinychat ( 
  8. id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,  
  9. group_id bigint(20) NOT NULL,  
  10. user_id bigint(20) NOT NULL,  
  11. message_content text 
  12. ) {$charset_collate};"; 
  13.  
  14. $sql[] = "CREATE TABLE {$wpdb->base_prefix}bp_group_tinychat_online ( 
  15. id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,  
  16. group_id bigint(20) NOT NULL,  
  17. user_id bigint(20) NOT NULL,  
  18. timestamp int(11) NOT NULL 
  19. ) {$charset_collate};"; 
  20.  
  21. require_once( ABSPATH . 'wp-admin/upgrade-functions.php' ); 
  22.  
  23. dbDelta($sql); 
  24.  
  25. update_site_option( 'bp-group-tinychat-db-version', BP_GROUP_tinychat_DB_VERSION );