bb_export

The BuddyPress bb export function.

Description

bb_export(); 

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-admin/export.php  
  1. function bb_export() { 
  2. global $bb; 
  3.  
  4. define( 'BB_EXPORTING', true ); 
  5.  
  6. $bb->use_cache = false; // Turn off hard cache 
  7. $bb->page_topics = 100; 
  8.  
  9. echo "<forums-data version='0.75'>\n"; 
  10.  
  11. $page = 1; 
  12. while ( ( $users =bb_user_search array('page' => $page++) ) ) && !is_wp_error( $users ) ) { 
  13. foreach ( $users as $user ) 
  14. echo bb_export_user( $user->ID ); 
  15. unset($users, $user, $page); 
  16.  
  17. $forums = bb_get_forums(); 
  18. foreach ( $forums as $forum ) 
  19. echo bb_export_forum( $forum->forum_id ); 
  20. unset($forums, $forum); 
  21.  
  22. $page = 1; 
  23. while ( $topics = get_latest_topics( 0, $page++ ) ) { 
  24. foreach ( $topics as $topic ) 
  25. echo bb_export_topic( $topic->topic_id ); 
  26. unset($topics, $topic, $page); 
  27.  
  28.  
  29. echo '</forums-data>';