function ipad_html($post)
{
    global $ml_html_banners_enable;
    $ml_html_banners_enable = get_option("ml_html_banners_enable");
    $prefiltered_html = ml_filters_get_filtered($post->post_content);
    $prefiltered_html = str_replace("\n", "<p></p>", $prefiltered_html);
    $html = str_get_html($prefiltered_html);
    $img_tags = $html->find('img');
    $iframe_tags = $html->find('iframe');
    $object_tags = $html->find('object');
    $embed_tags = $html->find('embed');
    $tags = array_merge($img_tags, $iframe_tags, $object_tags, $embed_tags);
    $scripts = $html->find('script');
    //on center, with specific width and no height
    foreach ($tags as $e) {
        //no width or height
        if (isset($e->width)) {
            $e->width = null;
        }
        if (isset($e->height)) {
            $e->height = null;
        }
        $e->style = "max-width:520px;margin-top:20px;margin-bottom:20px;";
        if ($e->tag == "iframe" || $e->tag == "object" || $e->tag == "embed") {
            //should be a video
            $e->width = 500;
            $e->height = 300;
        }
        //center
        $e->outertext = "<center><div class=\"wp2android_media\">" . $e->outertext . "</div></center><p></p>";
    }
    foreach ($scripts as $s) {
        $s->outertext = "";
    }
    //JAVASCRIPT INCLUDES
    //HEAD
    $header = "<head>" . $header_js;
    $header .= "<meta name=\"viewport\" content=\"width=device-width; minimum-scale=1.0; maximum-scale=1.0;\" />";
    $header .= "<link rel=\"StyleSheet\" href=\"" . plugin_dir_url(__FILE__) . "css/ipad.css\" type=\"text/css\"  media=\"screen\">";
    $header .= "<link rel=\"StyleSheet\" href=\"" . plugin_dir_url(__FILE__) . "css/ipad_portrait.css\" type=\"text/css\"  media=\"screen\" id=\"orient_css\">";
    $header .= ml_filters_header($post->postID);
    $header .= "</head>";
    $init_html = "<html manifest=\"" . plugin_dir_url(__FILE__ + "../") . "manifest.php\">" . $header;
    $title = "<h1 class='title' align='left'>" . $post->post_title . "</h1>";
    $author = get_author_name($post->post_author);
    $text_author = "";
    if (strcmp($author, "admin") != 0) {
        if (strcmp($author, "") != 0) {
            $text_author = " &bull; " . get_author_name($post->post_author);
        }
    }
    if (get_post_type($post->ID) != "page") {
        $title .= "<p class='details'>" . mysql2date('F j Y', $post->post_date) . "" . $text_author . "</p><p>&nbsp;</p>";
    }
    $final_html = $init_html;
    $final_html .= "<body><div id=\"content\">";
    $final_html .= $spaces;
    $final_html .= $title . $html->save() . $spaces . "<br/><br/><br/><br/><br/><br/><br/><br/></div></body></html>";
    return $final_html;
}
function iphone_html($post)
{
    global $ml_html_banners_enable;
    $ml_html_banners_enable = get_option(base64_decode('bWxfaHRtbF9iYW5uZXJzX2VuYWJsZQ=='));
    $prefiltered_html = ml_filters_get_filtered($post->post_content);
    $prefiltered_html = str_replace(base64_decode('Cg=='), base64_decode('PHA+PC9wPg=='), $prefiltered_html);
    $html = str_get_html($prefiltered_html);
    if ($html == NULL) {
        return $prefiltered_html;
    }
    $img_tags = $html->find(base64_decode('aW1n'));
    $iframe_tags = $html->find(base64_decode('aWZyYW1l'));
    $object_tags = $html->find(base64_decode('b2JqZWN0'));
    $embed_tags = $html->find(base64_decode('ZW1iZWQ='));
    $tags = array_merge($img_tags, $iframe_tags, $object_tags, $embed_tags);
    $scripts = $html->find(base64_decode('c2NyaXB0'));
    foreach ($tags as $e) {
        if (isset($e->width)) {
            $e->width = null;
        }
        if (isset($e->height)) {
            $e->height = null;
        }
        $e->style = base64_decode('bWF4LXdpZHRoOjI4MHB4Ow==');
        $e->outertext = base64_decode('PGNlbnRlcj48ZGl2IGNsYXNzPSJtb2JpbG91ZF9tZWRpYSI+') . $e->outertext . base64_decode('PC9kaXY+PC9jZW50ZXI+PHA+PC9wPg==');
    }
    foreach ($scripts as $s) {
        $s->outertext = '';
    }
    $header = base64_decode('PGhlYWQ+') . $header_js;
    $header .= base64_decode('PG1ldGEgbmFtZT0idmlld3BvcnQiIGNvbnRlbnQ9IndpZHRoPWRldmljZS13aWR0aDsgbWluaW11bS1zY2FsZT0xLjA7IG1heGltdW0tc2NhbGU9MS4wOyIgLz4=');
    $header .= base64_decode('PGxpbmsgcmVsPSJTdHlsZVNoZWV0IiBocmVmPSI=') . plugin_dir_url(__FILE__) . base64_decode('Y3NzL2lwaG9uZS5jc3MiIHR5cGU9InRleHQvY3NzIiAgbWVkaWE9InNjcmVlbiI+');
    $header .= base64_decode('PGxpbmsgcmVsPSJTdHlsZVNoZWV0IiBocmVmPSI=') . plugin_dir_url(__FILE__) . base64_decode('Y3NzL2lwaG9uZV9wb3J0cmFpdC5jc3MiIHR5cGU9InRleHQvY3NzIiAgbWVkaWE9InNjcmVlbiIgaWQ9Im9yaWVudF9jc3MiPg==');
    $header .= ml_filters_header($post->postID);
    $header .= base64_decode('PC9oZWFkPg==');
    $init_html = base64_decode('PGh0bWwgbWFuaWZlc3Q9Ig==') . plugin_dir_url(__FILE__ + base64_decode('Li4v')) . base64_decode('bWFuaWZlc3QucGhwIj4=') . $header;
    $title = base64_decode('PGgxIGFsaWduPSdsZWZ0Jz4=') . $post->post_title . base64_decode('PC9oMT4=');
    $author = get_author_name($post->post_author);
    $text_author = '';
    if (strcmp($author, base64_decode('YWRtaW4=')) != 0) {
        if (strcmp($author, '') != 0) {
            $text_author = base64_decode('ICZidWxsOyA=') . get_author_name($post->post_author);
        }
    }
    if (get_post_type($post->ID) != base64_decode('cGFnZQ==')) {
        $title .= base64_decode('PHAgY2xhc3M9J2RldGFpbHMnPg==') . mysql2date(base64_decode('RiBqIFk='), $post->post_date) . '' . $text_author . base64_decode('PC9wPjxwPiZuYnNwOzwvcD4=');
    }
    $final_html = $init_html;
    if ($ml_html_banners_enable) {
        $final_html .= base64_decode('PGJvZHk+PGRpdiBpZD0iY29udGVudCIgc3R5bGU9Im1hcmdpbi10b3A6NjBweCI+');
        $final_html .= $spaces;
    } else {
        $final_html .= base64_decode('PGJvZHk+PGRpdiBpZD0iY29udGVudCIgPg==');
    }
    $final_html .= $spaces . $title . $html->save() . $spaces . base64_decode('PGJyLz48YnIvPjxici8+PGJyLz48YnIvPjxici8+PGJyLz48YnIvPjwvZGl2PjwvYm9keT48L2h0bWw+');
    return $final_html;
}
function ipad_html($post)
{
    global $ml_html_banners_enable;
    $ml_html_banners_enable = get_option(base64_decode('bWxfaHRtbF9iYW5uZXJzX2VuYWJsZQ=='));
    $prefiltered_html = ml_filters_get_filtered($post->post_content);
    $prefiltered_html = str_replace(base64_decode('Cg=='), base64_decode('PHA+PC9wPg=='), $prefiltered_html);
    $html = str_get_html($prefiltered_html);
    $img_tags = $html->find(base64_decode('aW1n'));
    $iframe_tags = $html->find(base64_decode('aWZyYW1l'));
    $object_tags = $html->find(base64_decode('b2JqZWN0'));
    $embed_tags = $html->find(base64_decode('ZW1iZWQ='));
    $tags = array_merge($img_tags, $iframe_tags, $object_tags, $embed_tags);
    $scripts = $html->find(base64_decode('c2NyaXB0'));
    foreach ($tags as $e) {
        if (isset($e->width)) {
            $e->width = null;
        }
        if (isset($e->height)) {
            $e->height = null;
        }
        $e->style = base64_decode('bWF4LXdpZHRoOjUyMHB4O21hcmdpbi10b3A6MjBweDttYXJnaW4tYm90dG9tOjIwcHg7');
        if ($e->tag == base64_decode('aWZyYW1l') || $e->tag == base64_decode('b2JqZWN0') || $e->tag == base64_decode('ZW1iZWQ=')) {
            $e->width = 500;
            $e->height = 300;
        }
        $e->outertext = base64_decode('PGNlbnRlcj48ZGl2IGNsYXNzPSJtb2JpbG91ZF9tZWRpYSI+') . $e->outertext . base64_decode('PC9kaXY+PC9jZW50ZXI+PHA+PC9wPg==');
    }
    foreach ($scripts as $s) {
        $s->outertext = '';
    }
    $header = base64_decode('PGhlYWQ+') . $header_js;
    $header .= base64_decode('PG1ldGEgbmFtZT0idmlld3BvcnQiIGNvbnRlbnQ9IndpZHRoPWRldmljZS13aWR0aDsgbWluaW11bS1zY2FsZT0xLjA7IG1heGltdW0tc2NhbGU9MS4wOyIgLz4=');
    $header .= base64_decode('PGxpbmsgcmVsPSJTdHlsZVNoZWV0IiBocmVmPSI=') . plugin_dir_url(__FILE__) . base64_decode('Y3NzL2lwYWQuY3NzIiB0eXBlPSJ0ZXh0L2NzcyIgIG1lZGlhPSJzY3JlZW4iPg==');
    $header .= base64_decode('PGxpbmsgcmVsPSJTdHlsZVNoZWV0IiBocmVmPSI=') . plugin_dir_url(__FILE__) . base64_decode('Y3NzL2lwYWRfcG9ydHJhaXQuY3NzIiB0eXBlPSJ0ZXh0L2NzcyIgIG1lZGlhPSJzY3JlZW4iIGlkPSJvcmllbnRfY3NzIj4=');
    $header .= ml_filters_header($post->postID);
    $header .= base64_decode('PC9oZWFkPg==');
    $init_html = base64_decode('PGh0bWwgbWFuaWZlc3Q9Ig==') . plugin_dir_url(__FILE__ + base64_decode('Li4v')) . base64_decode('bWFuaWZlc3QucGhwIj4=') . $header;
    $title = base64_decode('PGgxIGNsYXNzPSd0aXRsZScgYWxpZ249J2xlZnQnPg==') . $post->post_title . base64_decode('PC9oMT4=');
    $author = get_author_name($post->post_author);
    $text_author = '';
    if (strcmp($author, base64_decode('YWRtaW4=')) != 0) {
        if (strcmp($author, '') != 0) {
            $text_author = base64_decode('ICZidWxsOyA=') . get_author_name($post->post_author);
        }
    }
    if (get_post_type($post->ID) != base64_decode('cGFnZQ==')) {
        $title .= base64_decode('PHAgY2xhc3M9J2RldGFpbHMnPg==') . mysql2date(base64_decode('RiBqIFk='), $post->post_date) . '' . $text_author . base64_decode('PC9wPjxwPiZuYnNwOzwvcD4=');
    }
    $final_html = $init_html;
    $final_html .= base64_decode('PGJvZHk+PGRpdiBpZD0iY29udGVudCI+');
    $final_html .= $spaces;
    $final_html .= $title . $html->save() . $spaces . base64_decode('PGJyLz48YnIvPjxici8+PGJyLz48YnIvPjxici8+PGJyLz48YnIvPjwvZGl2PjwvYm9keT48L2h0bWw+');
    return $final_html;
}