'; echo '

'.__('Import Bunny’s Technorati Tags').'

'; echo '

'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

'; } function footer() { echo ''; } function greet() { echo '
'; echo '

'.__('Howdy! This imports tags from Bunny’s Technorati Tags into WordPress tags.').'

'; echo '

'.__('This is suitable for Bunny’s Technorati Tags version 0.6.').'

'; echo '

'.__('All existing Bunny’s Technorati Tags will be removed after import.').'

'; echo '

'.__('Don’t be stupid - backup your database before proceeding!').'

'; echo '
'; wp_nonce_field('import-btt'); echo '

'; echo '
'; echo '
'; } function dispatch() { if ( empty($_GET['step']) ) $step = 0; else $step = absint($_GET['step']); // load the header $this->header(); switch ( $step ) { case 0 : $this->greet(); break; case 1 : check_admin_referer('import-btt'); $this->check_post_keyword( true ); break; case 2 : check_admin_referer('import-btt'); $this->check_post_keyword( false ); break; case 3: $this->done(); break; } // load the footer $this->footer(); } function check_post_keyword($precheck = true) { global $wpdb; echo '
'; echo '

'.__('Reading Bunny’s Technorati Tags…').'

'; // import Bunny's Keywords tags $metakeys = $wpdb->get_results("SELECT post_id, meta_id, meta_key, meta_value FROM $wpdb->postmeta WHERE $wpdb->postmeta.meta_key = 'tags'"); if ( !is_array($metakeys)) { echo '

' . __('No Tags Found!') . '

'; return false; } else { $count = count($metakeys); echo '

' . sprintf( __ngettext('Done! %s post with tags were read.', 'Done! %s posts with tags were read.', $count), $count ) . '

'; echo ''; } echo '
'; wp_nonce_field('import-btt'); echo '

'; echo '
'; echo '
'; } function done() { echo '
'; echo '

'.__('Import Complete!').'

'; echo '
'; } function BunnyTags_Import() { } } // create the import object $btt_import = new BunnyTags_Import(); // add it to the import page! register_importer('btt', 'Bunny’s Technorati Tags', __('Import Bunny’s Technorati Tags into WordPress tags.'), array($btt_import, 'dispatch')); ?>