<?php
function drk_add_hot_news_meta_boxes(){
    add_meta_box(
        "post_metadata_online_id",
        "Is Hot post",
        "drk_meta_box_hot_news",
        array("news","tutorials","forum"),
        "normal",
        "default"
    );
}

add_action('add_meta_boxes','drk_add_hot_news_meta_boxes');

function drk_meta_box_hot_news( ) {
    global $post;
    $isOnline = get_post_meta($post->ID, '_isHotNews', true);
    ?>
    <input id="_isHotNews" name="_isHotNews" type="checkbox" value="<?php echo $isOnline?>" <?php echo $isOnline == "true" ?  "checked": "" ?>  onclick="setIsHotNews()"/>
    <script>
        function setIsHotNews(){
            if(document.getElementById('_isHotNews').checked){
                document.getElementById('_isHotNews').value = true;
            }else{
                document.getElementById('_isHotNews').value = false;
            }
        }
    </script>
    <?php
}

function drk_save_hot_news_meta_boxes(){
    global $post;
    if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE){
		return;
	}
	update_post_meta($post->ID,"_isHotNews", sanitize_key($_POST["_isHotNews"]));
}
add_action("save_post", "drk_save_hot_news_meta_boxes");