datadir = 'inc/database/flatfile/'; // Search past default database path if (file_exists('inc/flatfile/' . POSTS_FILE)) { $db->datadir = 'inc/flatfile/'; } if (function_exists('insertPost')) { function migratePost($newpost) { $post = array(); $post[POST_ID] = $newpost['id']; $post[POST_PARENT] = $newpost['parent']; $post[POST_TIMESTAMP] = $newpost['timestamp']; $post[POST_BUMPED] = $newpost['bumped']; $post[POST_IP] = $newpost['ip']; $post[POST_NAME] = $newpost['name']; $post[POST_TRIPCODE] = $newpost['tripcode']; $post[POST_EMAIL] = $newpost['email']; $post[POST_NAMEBLOCK] = $newpost['nameblock']; $post[POST_SUBJECT] = $newpost['subject']; $post[POST_MESSAGE] = $newpost['message']; $post[POST_PASSWORD] = $newpost['password']; $post[POST_FILE] = $newpost['file']; $post[POST_FILE_HEX] = $newpost['file_hex']; $post[POST_FILE_ORIGINAL] = $newpost['file_original']; $post[POST_FILE_SIZE] = $newpost['file_size']; $post[POST_FILE_SIZE_FORMATTED] = $newpost['file_size_formatted']; $post[POST_IMAGE_WIDTH] = $newpost['image_width']; $post[POST_IMAGE_HEIGHT] = $newpost['image_height']; $post[POST_THUMB] = $newpost['thumb']; $post[POST_THUMB_WIDTH] = $newpost['thumb_width']; $post[POST_THUMB_HEIGHT] = $newpost['thumb_height']; $post[POST_MODERATED] = $newpost['moderated']; $post[POST_STICKIED] = $newpost['stickied']; $post[POST_LOCKED] = $newpost['locked']; $GLOBALS['db']->insertWithAutoId(POSTS_FILE, POST_ID, $post); } function migrateBan($newban) { $ban = array(); $ban[BAN_ID] = $newban['id']; $ban[BAN_IP] = $newban['ip']; $ban[BAN_TIMESTAMP] = $newban['timestamp']; $ban[BAN_EXPIRE] = $newban['expire']; $ban[BAN_REASON] = $newban['reason']; $GLOBALS['db']->insertWithAutoId(BANS_FILE, BAN_ID, $ban); } }