<?php
 
//adding metabox to gallery items
add_action( 'admin_menu', 'wp_pinterest_to_wp_create_meta_box3' );

function wp_pinterest_to_wp_create_meta_box3(){
	add_meta_box( 'wp_pinterest_to_wp_page-meta-boxes3', 'Update Frequency', 'wp_pinterest_to_wp_page_meta_boxes3', 'wp_pinterest_to_wp', 'side', 'high' );
}

function wp_pinterest_to_wp_page_meta_boxes3(){
	
	wp_pinterest_to_wp_page_meta_boxes_pin3();
}

//metabox content 
function wp_pinterest_to_wp_page_meta_boxes_pin3(){
	
	//reading meta values
	global $post;
	$id= $post->ID;
	$gallery_update=get_post_meta($id,'gallery_update',1);
	$gallery_unit=get_post_meta($id,'gallery_unit',1);
	 
	?>
	
	<div class="wp_attachment_details TTWForm" style="width:100%">
	
			<div class="option clearfix">
		       <input     name="wp_pinterest_to_wp_ops[]" id="field-wp_pinterest_to_wp-update" value="OPT_UPDATE" type="checkbox">     
		          <span class="option-title">
		 			 Auto update ?
		          </span>
		   </div>
		   
		   <div id="update_slide">  
		   <div id="field5zzzg-container" class="field f_100">
               <label for="field5zzzg">
                    Update every  
               </label>
               <input value="<?php echo $gallery_update   ?>" id="field5zzzg" max="1000" min="1" name="gallery_update"    required="required" class="ttw-range range"
               type="range">
           </div> 
           
           	<div id="field-camp_type-container" class="field f_100" style="margin-top:10px" >
				<label for="field-camp_type">
					Update Unit  
				</label>
				<select name="gallery_unit" id="update_unit">
					<option  value="1"  <?php  wp_pinterest_to_wp_opt_selected('1',$gallery_unit) ?> >Minutes</option> 
					<option  value="60"  <?php  wp_pinterest_to_wp_opt_selected('60',$gallery_unit) ?> >Hours</option>					 
					<option  value="1440"  <?php  wp_pinterest_to_wp_opt_selected('1440',$gallery_unit) ?> >Days</option>
				</select>
				
			</div>
			</div>
           
           <div style="clear:both"></div>	 
           
     </div>
	
	<?php  
	 
}