bb_upgrade_190

The BuddyPress bb upgrade 190 function.

Description

bb_upgrade_190(); 

Usage

  1. if ( !function_exists( 'bb_upgrade_190' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-upgrade.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bb_upgrade_190(); 
  7.  

Defined (1)

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

/bp-forums/bbpress/bb-admin/includes/functions.bb-upgrade.php  
  1. function bb_upgrade_190() { 
  2. if ( ( $dbv = bb_get_option_from_db( 'bb_db_version' ) ) && $dbv >= 630 ) 
  3. return; 
  4.  
  5. global $bbdb; 
  6.  
  7. $exists = false; 
  8. foreach ( (array) $bbdb->get_col("DESC $bbdb->topics") as $col ) 
  9. if ( 'topic_resolved' == $col ) 
  10. $exists = true; 
  11. if ( !$exists ) 
  12. return; 
  13.  
  14. $topics = (array) $bbdb->get_results("SELECT topic_id, topic_resolved FROM $bbdb->topics" ); 
  15. foreach ( $topics as $topic ) 
  16. bb_update_topicmeta( $topic->topic_id, 'topic_resolved', $topic->topic_resolved ); 
  17. unset($topics, $topic); 
  18.  
  19. $bbdb->query("ALTER TABLE $bbdb->topics DROP topic_resolved"); 
  20.  
  21. bb_update_option( 'bb_db_version', 630 ); 
  22.  
  23. return 'Done converting topic_resolved: ' . __FUNCTION__;