Changeset 1127
- Timestamp:
- 02/28/2008 12:44:14 AM (18 years ago)
- Location:
- branches/0.8/bb-admin
- Files:
-
- 2 edited
-
class-install.php (modified) (1 diff)
-
export.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.8/bb-admin/class-install.php
r1078 r1127 1363 1363 $installation_log[] = '>>> ' . __('Site address (URL):') . ' ' . $data3['uri']['value']; 1364 1364 bb_update_option('from_email', $data3['keymaster_user_email']['value']); 1365 $installation_log[] = '>>> ' . __(' Adminemail address:') . ' ' . $data3['keymaster_user_email']['value'];1365 $installation_log[] = '>>> ' . __('From email address:') . ' ' . $data3['keymaster_user_email']['value']; 1366 1366 1367 1367 // Create the key master -
branches/0.8/bb-admin/export.php
r1078 r1127 1 1 <?php 2 die('No thieving allowed.');3 2 4 3 require_once('../bb-load.php'); 5 4 require_once('admin-functions.php'); 6 5 7 if ( !bb_current_user_can( 'use_keys' ) ) 6 define('BB_EXPORT_USERS', 1); 7 define('BB_EXPORT_FORUMS', 2); 8 define('BB_EXPORT_TOPICS', 4); 9 10 // Some example usage of the bitwise export levels (can be defined in bb-config.php) 11 //define('BB_EXPORT_LEVEL', BB_EXPORT_USERS); 12 //define('BB_EXPORT_LEVEL', BB_EXPORT_USERS + BB_EXPORT_FORUMS); 13 //define('BB_EXPORT_LEVEL', BB_EXPORT_USERS + BB_EXPORT_FORUMS + BB_EXPORT_TOPICS); 14 15 if ( !defined('BB_EXPORT_LEVEL') ) 16 define('BB_EXPORT_LEVEL', 0); 17 18 if ( !BB_EXPORT_LEVEL || !bb_current_user_can( 'use_keys' ) ) 8 19 bb_die( __('No thieving allowed.') ); 9 20 … … 55 66 $r = array(); 56 67 foreach ( $translate as $prop => $export ) { 57 if ( '?' == $export{0} && !$data[$prop] || false === $export ) { 68 if ( '?' == $export{0} ) { 69 $export = substr($export, 1); 70 if ( !$data[$prop] ) { 71 unset($data[$prop]); 72 continue; 73 } 74 } 75 if ( false === $export ) { 58 76 unset($data[$prop]); 59 $export = substr($export, 1);60 77 continue; 61 78 } … … 116 133 117 134 $translate = array( 118 'forum_name' => '!title', 119 'forum_desc' => '?!content' 135 'forum_name' => '!title', 136 'forum_desc' => '?!content', 137 'forum_parent' => '?parent' 120 138 ); 121 139 … … 247 265 echo "<forums-data version='0.75'>\n"; 248 266 249 $page = 1; 250 while ( ( $users = bb_user_search( array('page' => $page++) ) ) && !is_wp_error( $users ) ) { 251 foreach ( $users as $user ) 252 echo bb_export_user( $user->ID ); 253 $bb_user_cache = array(); // For the sake of memory 254 } 255 unset($users, $user_ids, $user_id); 256 257 $forums = get_forums(); 258 foreach ( $forums as $forum ) 259 echo bb_export_forum( $forum->forum_id ); 260 unset($forums, $forum); 261 262 $page = 1; 263 while ( false && $topics = get_latest_topics( 0, $page++ ) ) { 264 foreach ( $topics as $topic ) 265 echo bb_export_topic( $topic->topic_id ); 266 $bb_topic_cache = array(); 267 } 268 unset($topics, $topic, $page); 267 if (BB_EXPORT_LEVEL & BB_EXPORT_USERS) { 268 $page = 1; 269 while ( ( $users = bb_user_search( array('page' => $page++) ) ) && !is_wp_error( $users ) ) { 270 foreach ( $users as $user ) 271 echo bb_export_user( $user->ID ); 272 $bb_user_cache = array(); // For the sake of memory 273 } 274 unset($users, $user_ids, $user_id, $page); 275 } 276 277 if (BB_EXPORT_LEVEL & BB_EXPORT_FORUMS) { 278 $forums = get_forums(); 279 foreach ( $forums as $forum ) 280 echo bb_export_forum( $forum->forum_id ); 281 unset($forums, $forum); 282 } 283 284 if (BB_EXPORT_LEVEL & BB_EXPORT_TOPICS) { 285 $page = 1; 286 while ( $topics = get_latest_topics( 0, $page++ ) ) { 287 foreach ( $topics as $topic ) 288 echo bb_export_topic( $topic->topic_id ); 289 $bb_topic_cache = array(); 290 } 291 unset($topics, $topic, $page); 292 } 269 293 270 294 do_action( 'bb_export' );
Note: See TracChangeset
for help on using the changeset viewer.