<?php

/*--------------------------------------------------------------
Create theme convertor menu
--------------------------------------------------------------*/

if ( ! function_exists( 'gp_theme_convertor_menu' ) ) {
	function gp_theme_convertor_menu() {
		add_submenu_page( 'options-general.php', __( 'Theme Convertor', 'gp_lang' ), __( 'Theme Convertor', 'gp_lang' ), 'administrator', 'theme-convertor', 'gp_theme_convertor_page' );
	}
}
add_action( 'admin_menu', 'gp_theme_convertor_menu' );


/*--------------------------------------------------------------
Theme convertor page
--------------------------------------------------------------*/		
					
if ( ! function_exists( 'gp_theme_convertor_page' ) ) {
	
	function gp_theme_convertor_page() {

		global $wpdb;
					
		if ( 'POST' == $_SERVER['REQUEST_METHOD'] && ! empty( $_POST['action'] ) && $_POST['action'] == 'gp_reviewit_convert' ) {

			$convert_post_templates = $wpdb->query( $wpdb->prepare( 
				"
					INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value)
					SELECT $wpdb->posts.ID, %s, %s
					FROM $wpdb->posts
					WHERE $wpdb->posts.post_status = 'publish'
					AND $wpdb->posts.post_type = %s
					LIMIT %d
				",
				'_wp_page_template',
				'hub-template.php',
				'review',
				$_POST['reviewit_limit']
			) );

			$convert_reviews = $wpdb->query( $wpdb->prepare( 
				"
					UPDATE $wpdb->posts
					SET post_type = %s
					WHERE post_type = %s
					LIMIT %d
				", 
				'page',
				'review',
				$_POST['reviewit_limit']
			) );
		
			$convert_categories = $wpdb->query( $wpdb->prepare( 
				"
					UPDATE $wpdb->term_taxonomy
					SET taxonomy =  %s
					WHERE taxonomy = %s
				", 
				'gp_hubs',
				'review_categories'
			) );

		} elseif ( 'POST' == $_SERVER['REQUEST_METHOD'] && ! empty( $_POST['action'] ) && $_POST['action'] == 'gp_score_convert' ) {

			$templates = $wpdb->get_results(
				"
					SELECT *		
					FROM $wpdb->posts p
					INNER JOIN $wpdb->postmeta pm
					ON p.ID = pm.post_id
					WHERE p.post_type = 'post'
					AND pm.meta_key = 'ghostpool_post_type'
					AND pm.meta_value = 'Review'
					LIMIT " . $_POST['score_limit'] . "
				"
			);
			if ( count( $templates ) > 0 ) {
				foreach ( $templates as $template ) {
					$convert_post_templates = $wpdb->query( $wpdb->prepare( 
						"
							INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value)
							SELECT $wpdb->posts.ID, %s, %s
							FROM $wpdb->posts
							WHERE ID = %d
						",
						'_wp_page_template',
						'hub-template.php',
						$template->ID
					) );
				}
			}
			
			$reviews = $wpdb->get_results(
				"
					SELECT *		
					FROM $wpdb->posts p
					INNER JOIN $wpdb->postmeta pm
					ON p.ID = pm.post_id
					WHERE p.post_type = 'post'
					AND pm.meta_key = 'ghostpool_post_type'
					AND pm.meta_value = 'Review'
					LIMIT " . $_POST['score_limit'] . "
				"
			);
			if ( count( $reviews ) > 0 ) {
				foreach ( $reviews as $review ) {
					$convert_reviews = $wpdb->query( $wpdb->prepare( 
						"
							UPDATE $wpdb->posts
							SET post_type = %s
							WHERE post_type = %s
							AND ID = %d
						",
						'page',
						'post',
						$review->ID
					) );
				}
			}
					
			if ( isset( $_POST['score_cat_ids'] ) ) {		
				$cats = explode( ',', $_POST['score_cat_ids'] );
			} else {
				$cats = '';
			}
			if ( $cats != '' ) {
				foreach ( $cats as $cat ) {
					$convert_categories = $wpdb->query( $wpdb->prepare( 
						"
							UPDATE $wpdb->term_taxonomy
							SET taxonomy =  %s
							WHERE term_id = %d
						", 
						'gp_hubs',
						$cat
					) );
				}		
			}
						
		}
					
		if ( 'POST' == $_SERVER['REQUEST_METHOD'] && ! empty( $_POST['action'] ) && ( $_POST['action'] == 'gp_reviewit_convert' OR $_POST['action'] == 'gp_score_convert' ) ) {
						
			if ( $convert_post_templates != '' OR $convert_reviews != '' OR $convert_categories != '' ) {	
				$convert_message = '<div class="updated"><p>' . __( "Your reviews were successfully converted.", "gp_lang" ) . '</p></div>';
			} else {
				$convert_message = '<div class="error"><p>' . __( "Your reviews could not be converted, this is probably because you have already converted them or you do not have any reviews on this site.", "gp_lang" ) . '</p></div>';
			}		
	
			// Create child pages
			if ( $convert_post_templates != '' OR $convert_reviews != '' OR $convert_categories != '' ) {	

				global $post;
		
				$args = array(
					'post_type' => 'page',
					'posts_per_page' => -1,
					'meta_query' => array(
						array(
							'key' => '_wp_page_template',
							'value' => 'hub-template.php'
						)
					)
				);
		
				$the_pages = new WP_Query( $args );

				if ( $the_pages->have_posts() ) : while ( $the_pages->have_posts() ) : $the_pages->the_post();

					// Hub Page	
					if ( ! empty( $post->post_content ) ) {
						$review_page_content = $post->post_content;
					} else {
						$review_page_content = '';
					}
										
					$new_page_content = '
				[vc_row css=".vc_custom_1407855744612{margin-bottom: 0px !important;}"][vc_column width="7/12" css=".vc_custom_1407855616904{margin-bottom: 0px !important;}"][news widget_title="Latest News" per_page="10" featured_image="enabled" image_width="140" image_height="140" hard_crop="enabled" image_alignment="image-align-left" content_display="excerpt" excerpt_length="100" read_more_link="enabled" pages="enabled" format="blog-standard" size="blog-standard-size" orderby="date" order="desc" filter="enabled" filter_date="1" filter_title="1" filter_comments="1" see_all="enabled" see_all_text="See All News" title_position="title-next-to-thumbnail" column_type="multiple-columns"][/vc_column][vc_column width="5/12"][vc_row_inner][vc_column_inner width="1/1"][images image_location="upload-images" number="8" see_all_text="See All Images" widget_title="Latest Images" image_width="357" image_height="300" hard_crop="enabled" get_images_from="child-page" see_all="enabled"][/vc_column_inner][/vc_row_inner][vc_row_inner css=".vc_custom_1407855701457{margin-bottom: 0px !important;}"][vc_column_inner width="1/1"][videos per_page="5" featured_image="enabled" image_width="75" image_height="75" hard_crop="enabled" image_alignment="image-align-left" content_display="excerpt" excerpt_length="0" meta_date="1" read_more_link="enabled" see_all_text="See All Videos" pages="disabled" widget_title="Latest Videos" size="blog-small-size"][/vc_column_inner][/vc_row_inner][/vc_column][/vc_row]';
					$new_page = array(
						'ID'             => get_the_ID(),
						'post_title'     => get_the_title( get_the_ID() ),
						'post_type'      => 'page',
						'post_content'   => $new_page_content,
						'post_excerpt'   => $review_page_content,
						'post_status'    => 'publish',
						'comment_status' => 'closed'
					);
					$hub_page_id = wp_insert_post( $new_page );
					update_post_meta( $hub_page_id, '_wp_page_template', 'hub-template.php' );	
					update_post_meta( $hub_page_id, '_gp_hub_page', 'enabled' );		

					$prefix = $wpdb->prefix;
					$table_name_1 = $prefix . 'gdsr_data_article';
					$table_name_2 = $prefix . 'gdsr_multis_data';
					$table_1_check = mysql_query( 'SELECT 1 FROM $table_name_1' );
					$table_2_check = mysql_query( 'SELECT 1 FROM $table_name_2' );

					if ( isset( $_POST['reviewit_site_multi_id'] ) ) {
						$site_multi_id = $_POST['reviewit_site_multi_id'];
					} else {
						$site_multi_id = '';
					}
					if ( isset ( $_POST['reviewit_user_multi_id'] ) ) {
						$user_multi_id = $_POST['reviewit_user_multi_id'];
					} else {
						$user_multi_id = '';
					}
									
					// Add site rating
					$site_rating_row = '';
					$multi_site_rating_row = '';
					if ( mysql_query( "DESCRIBE $table_name_1" ) ) {
						$site_rating_row = $wpdb->get_row( "SELECT * FROM $table_name_1 WHERE review > 0 AND post_id = $hub_page_id" );
					}
					if ( mysql_query( "DESCRIBE $table_name_2" ) && $site_multi_id != '' ) {
						if ( $site_multi_id != '' ) {
							$multi_site_rating_row = $wpdb->get_row( "SELECT * FROM $table_name_2 WHERE average_review > 0 AND post_id = $hub_page_id AND multi_id = $site_multi_id" );
						}
					}
					$site_rating = '';
					if ( $site_rating_row != '' ) {
						$site_rating = $site_rating_row->review;
						add_post_meta( $hub_page_id, '_gp_old_site_rating', $site_rating );
					} elseif ( $multi_site_rating_row != '' ) {
						$site_rating = $multi_site_rating_row->average_review;
						add_post_meta( $hub_page_id, '_gp_old_site_rating', $site_rating );
					}					
		
					// Add user votes
					$user_votes_row = '';
					$visitor_votes_row = '';
					$user_multi_votes_row = '';
					$visitor_multi_votes_row = '';
					if ( mysql_query( "DESCRIBE $table_name_1" ) ) {
						$user_votes_row = $wpdb->get_row( "SELECT * FROM $table_name_1 WHERE user_voters > 0 AND post_id = $hub_page_id" );
						$visitor_votes_row = $wpdb->get_row( "SELECT * FROM $table_name_1 WHERE visitor_voters > 0 AND post_id = $hub_page_id" );
					}
					if ( mysql_query( "DESCRIBE $table_name_2" ) && $user_multi_id != '' ) {
						$user_multi_votes_row = $wpdb->get_row( "SELECT * FROM $table_name_2 WHERE total_votes_users > 0 AND post_id = $hub_page_id AND multi_id = $user_multi_id" );
						$visitor_multi_votes_row = $wpdb->get_row( "SELECT * FROM $table_name_2 WHERE total_votes_visitors > 0 AND post_id = $hub_page_id AND multi_id = $user_multi_id" );
					}	
					$user_votes = '';
					if ( $user_votes_row != '' OR $visitor_votes_row != '' ) {
						$user_votes = ( $user_votes_row->user_voters + $visitor_votes_row->visitor_voters );
						add_post_meta( $hub_page_id, '_gp_user_votes', $user_votes );
					} elseif ( $user_multi_votes_row != '' OR $visitor_multi_votes_row != '' ) {
						$user_votes = ( $user_multi_votes_row->total_votes_users + $visitor_multi_votes_row->total_votes_visitors );
						add_post_meta( $hub_page_id, '_gp_user_votes', $user_votes );
					}
				
					// Add user rating
					$user_rating_row = '';
					$visitor_rating_row = '';
					$user_multi_rating_row = '';
					$visitor_multi_rating_row = '';
					if ( mysql_query( "DESCRIBE $table_name_1" ) ) {
						$user_rating_row = $wpdb->get_row( "SELECT * FROM $table_name_1 WHERE user_votes > 0 AND post_id = $hub_page_id" );
						$visitor_rating_row = $wpdb->get_row( "SELECT * FROM $table_name_1 WHERE visitor_votes > 0 AND post_id = $hub_page_id" );
					}	
					if ( mysql_query( "DESCRIBE $table_name_2" ) && $user_multi_id != '' ) {
						$user_multi_rating_row = $wpdb->get_row( "SELECT * FROM $table_name_2 WHERE average_rating_users > 0 AND post_id = $hub_page_id AND multi_id = $user_multi_id" );
						$visitor_multi_rating_row = $wpdb->get_row( "SELECT * FROM $table_name_2 WHERE average_rating_visitors > 0 AND post_id = $hub_page_id AND multi_id = $user_multi_id" );
					}
					if ( $user_rating_row != '' OR $visitor_rating_row != '' ) {
						$user_rating = ( $user_rating_row->user_votes + $visitor_rating_row->visitor_votes ) / $user_votes;
						add_post_meta( $hub_page_id, '_gp_user_rating', $user_rating );
					} elseif ( $user_multi_rating_row != '' OR $visitor_multi_rating_row != '' ) {
						$user_rating = ( $user_multi_rating_row->average_rating_users + $visitor_multi_rating_row->average_rating_visitors );
						add_post_meta( $hub_page_id, '_gp_user_rating', $user_rating );
					}
							
					$args = array(
						'post_parent' => get_the_ID(),
						'post_type'   => 'page'
					);
					$child_pages = get_children( $args );

					if ( empty( $child_pages ) ) {

						// Review Page
						$new_page = array(
							'post_type'      => 'page',
							'post_title'     => 'Review',
							'post_content'   => $review_page_content,
							'post_status'    => 'publish',
							'post_parent'    => $hub_page_id
						);		
						$review_page_id = wp_insert_post( $new_page );
						update_post_meta( $review_page_id, '_wp_page_template', 'review-template.php' );		
						update_post_meta( $review_page_id, '_gp_hub_page', 'enabled' );
						if ( $site_rating ) {
							add_post_meta( $review_page_id, '_gp_old_site_rating', $site_rating );
						}
						
						$comment_count = $wpdb->query( $wpdb->prepare( 
							"	
								SELECT comment_count FROM $wpdb->posts WHERE ID = %s
							",
							$hub_page_id
						) );
				
						$wpdb->query( $wpdb->prepare( 
							"
								UPDATE $wpdb->comments
								SET comment_post_ID = %s
								WHERE comment_post_ID = %s
							", 
							$review_page_id,
							$hub_page_id
						) );
				
						$wpdb->query( $wpdb->prepare( 
							"		
								UPDATE $wpdb->posts
								SET comment_count = comment_count + %d
								WHERE ID = %s
							",
							$comment_count,
							$review_page_id
						) );

						$wpdb->query( $wpdb->prepare( 
							"		
								UPDATE $wpdb->posts
								SET comment_count = comment_count - %d
								WHERE ID = %s
								AND comment_count > 0
							",
							$comment_count,
							$hub_page_id
						) );
								
						// News Page
						$new_page = array(
							'post_type'      => 'page',
							'post_title'     => 'News',
							'post_status'    => 'publish',
							'comment_status' => 'closed',
							'post_parent'    => $hub_page_id
						);
						$new_page_id = wp_insert_post( $new_page );
						update_post_meta( $new_page_id, '_wp_page_template', 'news-template.php' );			
						update_post_meta( $new_page_id, '_gp_hub_page', 'enabled' );	

						// Images Page
						$new_page = array(
							'post_type'      => 'page',
							'post_title'     => 'Images',
							'post_status'    => 'publish',
							'comment_status' => 'closed',
							'post_parent'    => $hub_page_id
						);
						$new_page_id = wp_insert_post( $new_page );
						update_post_meta( $new_page_id, '_wp_page_template', 'images-template.php' );		
						update_post_meta( $new_page_id, '_gp_hub_page', 'enabled' );		

						// Videos Page
						$new_page = array(
							'post_type'      => 'page',
							'post_title'     => 'Videos',
							'post_status'    => 'publish',
							'comment_status' => 'closed',
							'post_parent'    => $hub_page_id
						);
						$new_page_id = wp_insert_post( $new_page );
						update_post_meta( $new_page_id, '_wp_page_template', 'videos-template.php' );		
						update_post_meta( $new_page_id, '_gp_hub_page', 'enabled' );		

						// Write A Review Page
						$new_page = array(
							'post_type'      => 'page',
							'post_title'     => 'Write A Review',
							'post_status'    => 'publish',
							'comment_status' => 'closed',
							'post_parent'    => $hub_page_id
						);
						$new_page_id = wp_insert_post( $new_page );
						update_post_meta( $new_page_id, '_wp_page_template', 'write-a-review-template.php' );		

						// User Reviews Page
						$new_page = array(
							'post_type'      => 'page',
							'post_title'     => 'User Reviews',
							'post_status'    => 'publish',
							'comment_status' => 'closed',
							'post_parent'    => $hub_page_id
						);
						$new_page_id = wp_insert_post( $new_page );
						update_post_meta( $new_page_id, '_wp_page_template', 'user-reviews-template.php' );			
						update_post_meta( $new_page_id, '_gp_hub_page', 'enabled' );
				
					}
	
				endwhile; endif; wp_reset_postdata(); 
		
			}
		
		} ?>

		<div class="wrap">

			<h2><?php _e( 'Theme Convertor', 'gp_lang' ); ?></h2>
		
			<?php if ( isset( $convert_message ) ) { echo html_entity_decode( $convert_message ); } ?>
		
			<div class="update-nag"><p><strong><?php _e( 'WARNING: Please backup all your data before converting your reviews as this process cannot be reversed. Use this convertor at your own risk.', 'gp_lang' ); ?></strong></p></div>

			<p><?php _e( 'If you are using either the ReviewIt or Score theme you can use the theme convertor to transform your current reviews into the review format used with the Gauge theme.', 'gp_lang' ); ?></p>
				
			<h3 class="title"><?php _e( 'Convert From ReviewIt', 'gp_lang'); ?></h3>
	
			<p><strong><?php _e( 'What\'s converted?', 'gp_lang' ); ?></strong></p>
	
			<ul class="ul-square">
				<li><?php _e( 'Reviews are converted to standard pages and assigned the "Hub" page template (they become a hub page)', 'gp_lang' ); ?></li>
				<li><?php _e( 'Child pages (review, news, images, videos, write a review and user reviews) are assigned to each hub page (previously your review page)', 'gp_lang' ); ?></li>
				<li><?php _e( 'Review categories converted to hub categories', 'gp_lang' ); ?></li>
				<li><?php _e( 'Site ratings, user ratings and user votes are transferred', 'gp_lang' ); ?></li>
				<li><?php _e( 'Review tags transferred to new hub pages', 'gp_lang' ); ?></li>
				<li><?php _e( 'Review page comments transferred to new review page', 'gp_lang' ); ?></li>
			</ul>
		
			<p><strong><?php _e( 'What\'s NOT converted?', 'gp_lang' ); ?></strong></p>
			<ul class="ul-square">
				<li><?php _e( 'Multi site and user rating criteria are not transferred, but the average multi site ratings are', 'gp_lang' ); ?></li>
				<li><?php _e( 'Review tabs will not be transferred to the new hub page - this is because Gauge has an improved tab system', 'gp_lang' ); ?></li>
				<li><?php _e( 'Articles are not transferred to the new News tab', 'gp_lang' ); ?></li>
				<li><?php _e( 'Images are not transferred to the new Images tab', 'gp_lang' ); ?></li>
			</ul>

			<p><strong><?php _e( 'After you have converted', 'gp_lang' ); ?></strong></p>
			<ul class="ul-square">
				<li><?php _e( 'Go to', 'gp_lang' ); ?> <a href="' . admin_url( 'admin.php?page=_options&tab=6' ) . '"><?php _e( 'Theme Options -> Hubs', 'gp_lang' ); ?></a> <?php _e( 'and change the names in Hub Fields to the review tags you created with the ReviewIt theme (e.g. Release Dates, Genres, Starring etc.)', 'gp_lang' ); ?></li>
				<li><?php _e( 'You will need to associate posts with each hub page', 'gp_lang' ); ?></li>
				<li><?php _e( 'You will need to attach/upload images to new Images page for each hub page', 'gp_lang' ); ?></li>
			</ul>

			<form method="post" action="" enctype="multipart/form-data" role="form">
				<table class="form-table">
					<tbody>
						<tr>
							<th scope="row"><label><?php _e( 'Number of reviews to convert at a time', 'gp_lang' ); ?></label></th>
							<td>
								<input type="number" step="1" min="1" name="reviewit_limit" id="reviewit-limit" class="small-text" value="<?php if ( isset( $_POST['reviewit_limit'] ) ) { echo absint( $_POST['reviewit_limit'] ); } else { echo '50'; } ?>" />
								<p class="description"><?php _e( 'Enter a lower number if you get an error when converting.', 'gp_lang' ); ?></p>
							</td>
						</tr>
						<tr>
							<th scope="row"><label><?php _e( 'Site Multi Set ID', 'gp_lang' ); ?></label></th>
							<td>
								<input type="text" name="reviewit_site_multi_id" id="reviewit-site-multi-id" class="small-text" value="<?php if ( isset( $_POST['reviewit_site_multi_id'] ) ) { echo absint( $_POST['reviewit_site_multi_id'] ); } ?>" />
								<p class="description"><?php _e( 'The GD Star multi set ID used for your site ratings.', 'gp_lang' ); ?></p>
							</td>							
						</tr>
						<tr>
							<th scope="row"><label><?php _e( 'User Multi Set ID', 'gp_lang' ); ?></label></th>
							<td>
								<input type="text" name="reviewit_user_multi_id" id="reviewit-user-multi-id" class="small-text" value="<?php if ( isset( $_POST['reviewit_user_multi_id'] ) ) { echo absint( $_POST['reviewit_user_multi_id'] ); } ?>" />
								<p class="description"><?php _e( 'The GD Star multi set ID used for your user ratings.', 'gp_lang' ); ?></p>
							</td>							
						</tr>						
					</tbody>
				</table>
				<p><input type="submit" value="<?php _e( 'Convert From ReviewIt', 'gp_lang' ); ?>" tabindex="40" id="reviewit-convert-submit" name="submit" class="button" /></p>
				<input type="hidden" name="action" value="gp_reviewit_convert" />
			</form>
		
		
			<hr>


			<h3 class="title"><?php _e( 'Convert From Score', 'gp_lang'); ?></h3>
	
			<p><strong><?php _e( 'What\'s converted?', 'gp_lang' ); ?></strong></p>
	
			<ul class="ul-square">
				<li><?php _e( 'Reviews are converted to standard pages and assigned the "Hub" page template (they become a hub page)', 'gp_lang' ); ?></li>
				<li><?php _e( 'Child pages (review, news, images, videos, write a review and user reviews) are assigned to each hub page (previously your review page)', 'gp_lang' ); ?></li>
				<li><?php _e( 'Review categories converted to hub categories', 'gp_lang' ); ?></li>
				<li><?php _e( 'Site ratings, user ratings and user votes are transferred', 'gp_lang' ); ?></li>
				<li><?php _e( 'Review page comments transferred to new review page', 'gp_lang' ); ?></li>
			</ul>
		
			<p><strong><?php _e( 'What\'s NOT converted?', 'gp_lang' ); ?></strong></p>
			<ul class="ul-square">
				<li><?php _e( 'Review tabs will not be transferred to the new hub page - this is because Gauge has an improved tab system', 'gp_lang' ); ?></li>
				<li><?php _e( 'Articles are not transferred to the new News tab', 'gp_lang' ); ?></li>
				<li><?php _e( 'Images are not transferred to the new Images tab', 'gp_lang' ); ?></li>
				<li><?php _e( 'Videos are not transferred to the new Videos tab', 'gp_lang' ); ?></li>
			</ul>

			<p><strong><?php _e( 'After you have converted', 'gp_lang' ); ?></strong></p>
			<ul class="ul-square">
				<li><?php _e( 'You will need to associate posts with each hub page', 'gp_lang' ); ?></li>
				<li><?php _e( 'You will need to attach/upload images to new Images page for each hub page', 'gp_lang' ); ?></li>
				<li><?php _e( 'You will need to associate video posts with each hub page', 'gp_lang' ); ?></li>
			</ul>

			<form method="post" action="" enctype="multipart/form-data" role="form">
				<table class="form-table">
					<tbody>
						<tr>
							<th scope="row"><label><?php _e( 'Number of reviews to convert at a time', 'gp_lang' ); ?></label></th>
							<td>
								<input type="number" step="1" min="1" name="score_limit" id="score-limit" class="small-text" value="<?php if ( isset( $_POST['score_limit'] ) ) { echo absint( $_POST['score_limit'] ); } else { echo '50'; } ?>" />
								<p class="description"><?php _e( 'Enter a lower number if you get an error when converting.', 'gp_lang' ); ?></p>
							</td>
						</tr>
						<tr>
							<th scope="row"><label><?php _e( 'Review Category IDs', 'gp_lang' ); ?></label></th>
							<td>
								<input type="text" name="score_cat_ids" id="score-site-cat-ids" value="<?php if ( isset( $_POST['score_cat_ids'] ) ) { echo absint( $_POST['score_cat_ids'] ); } ?>" />
								<p class="description"><?php _e( 'The post category IDs that you have assigned your reviews to, separating each with a comma (e.g. 23,45,82). Note: You need to specify child category IDs also as they are not imported with their parent categories.', 'gp_lang' ); ?></p>
							</td>							
						</tr>			
					</tbody>
				</table>
				<p><input type="submit" value="<?php _e( 'Convert From Score', 'gp_lang' ); ?>" tabindex="40" id="score-convert-submit" name="submit" class="button" /></p>
				<input type="hidden" name="action" value="gp_score_convert" />
			</form>

		</div>
	
		<?php
	
	}
}

?>