echo '<h2>'.__('Import Ultimate Tag Warrior').'</h2>';
echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'<br /><br /></p>';
}
function footer() {
echo '</div>';
}
function greet() {
echo '<div class="narrow">';
echo '<p>'.__('Howdy! This imports tags from Ultimate Tag Warrior 3 into WordPress tags.').'</p>';
echo '<p>'.__('This has not been tested on any other versions of Ultimate Tag Warrior. Mileage may vary.').'</p>';
echo '<p>'.__('To accommodate larger databases for those tag-crazy authors out there, we have made this into an easy 5-step program to help you kick that nasty UTW habit. Just keep clicking along and we will let you know when you are in the clear!').'</p>';
echo '<p><strong>'.__('Don’t be stupid - backup your database before proceeding!').'</strong></p>';
// if we didn't get any tags back, that's all there is folks!
if ( !is_array($tags) ) {
echo '<p>' . __('No Tags Found!') . '</p>';
return false;
}
else {
// if there's an existing entry, delete it
if ( get_option('utwimp_tags') ) {
delete_option('utwimp_tags');
}
add_option('utwimp_tags', $tags);
$count = count($tags);
echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag were read.', 'Done! <strong>%s</strong> tags were read.', $count), $count ) . '<br /></p>';
echo '<p>' . __('The following tags were found:') . '</p>';
echo '<ul>';
foreach ( $tags as $tag_id => $tag_name ) {
echo '<li>' . $tag_name . '</li>';
}
echo '</ul>';
echo '<br />';
echo '<p>' . __('If you don’t want to import any of these tags, you should delete them from the UTW tag management page and then re-run this import.') . '</p>';
echo '<p><h3>'.__('Reading UTW Post Tags…').'</h3></p>';
// read in all the UTW tag -> post settings
$posts = $this->get_utw_posts();
// if we didn't get any tags back, that's all there is folks!
if ( !is_array($posts) ) {
echo '<p>' . __('No posts were found to have tags!') . '</p>';
return false;
}
else {
// if there's an existing entry, delete it
if ( get_option('utwimp_posts') ) {
delete_option('utwimp_posts');
}
add_option('utwimp_posts', $posts);
$count = count($posts);
echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag to post relationships were read.', 'Done! <strong>%s</strong> tags to post relationships were read.', $count), $count ) . '<br /></p>';