Как скачать сайт WordPress в html

ПРивет всем. Хочу сделать из своего сайта в WordPress електронную книгу в exe формате. Как можно скачать или транформировать сайт в html? В чем проблема. Скачиваю сайт через програму закачки сайтов, скачивает дефолтовый хтмл файл, а все остальные файлы неизвесной кодировки (напр.@cat=9) – тоесть, согласно ІР файла или категории. Программа по компиляции не распознает такие файлы. Может кто-то что либо подскажет?

был такой плагин: http://a-bishop.com/2007/02/20/plaginyi-dlya-wordpress-wp2html-05/

еще похожий:
http://wordpress.org/extend/plugins/save-post-as-text-and-html/

****************************
плагин wp2html.php

<?php
/*
Plugin Name: WP2HTML
Plugin URI: http://a-bishop.spb.ru/wordpress/
Description: Exports blog's entries to the singe HTML file after every update. Adds HTML file to ZIP archive.
Version: 0.5
Author: Alexander Bishop
Author URI: http://a-bishop.spb.ru
*/

function wp2html ($post_ID){
    // get_settings('blogname');
    $file = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
            <html xmlns=\"http://www.w3.org/1999/xhtml\">
            <head>
            <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />
            <title>".get_settings('blogname')."</title><style type=\"text/css\" media=\"screen\">
A { color : #0002CC }
A:HOVER { color : #BF0000 }
BODY {font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; text-align : justify }
H1{ font-size : 160%; font-style : normal; font-weight : bold; text-align : left; text-transform : capitalize;  border : 1px solid         Black;  background-color : #E7E7E7; text-transform : capitalize;  margin-left : 0px;  padding-left : 0.5em;  }
H2{ font-size : 130%; font-style : normal; font-weight : bold; text-align : left; text-transform : capitalize;  background-color : #EEEEEE;  border : 1px solid Gray; text-transform : capitalize;  padding-left : 1em; }
H3{ font-size : 110%; font-style : normal; font-weight : bold; text-align : left;  background-color : #F1F1F1;  border : 1px solid Silver; text-transform : capitalize;  padding-left : 1.5em;}
H4{ font-size : 100%; font-style : normal; font-weight : bold; text-align : left   padding-left : 0.5em; text-transform : capitalize;  border : 1px solid Gray;  background-color : #F4F4F4;  padding-left : 2em;}
H5{ font-size : 100%; font-style : italic; font-weight : bold; text-align : left; text-transform : capitalize;border : 1px solid Gray;  background-color : #F4F4F4;  padding-left : 2.5em;}
H6{ font-size : 100%; font-style : italic; font-weight : normal; text-align : left; text-transform : capitalize;border : 1px solid Gray;  background-color : #F4F4F4;  padding-left : 2.5em;}
SMALL{ font-size : 80% }
BLOCKQUOTE{ margin : 0 1em 0.2em 4em }
HR{ color : Black }
UL{ padding-left : 1em; margin-left: 0}
.epigraph{margin-right:5em; margin-left : 25%;}
DIV{font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; text-align : justify}
</style>
            <style type=\"text/css\" media=\"print\">
A { color : #0002CC }
A:HOVER { color : #BF0000 }
BODY {font-family : \"Times New Roman\", Times, serif; text-align : justify }
H1{ font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-size : 160%; font-style : normal; font-weight : bold; text-align : left; text-transform : capitalize }
H2{ font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-size : 130%; font-style : normal; font-weight : bold; text-align : left; text-transform : capitalize }
H3{ font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-size : 110%; font-style : normal; font-weight : bold; text-align : left }
H4{ font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-size : 100%; font-style : normal; font-weight : bold; text-align : left }
H5,H6{ font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-size : 100%; font-style : italic; font-weight : normal; text-align : left; text-transform : uppercase }
SMALL{ font-size : 80% }
BLOCKQUOTE{ margin : 0 1em 0.2em 4em }
HR{ color : Black }
DIV{font-family : \"Times New Roman\", Times, serif; text-align : justify}
            </style></head><body><h1>".get_settings('blogname')."</h1><ul>";  
    require(dirname(__FILE__).'/../../wp-config.php');
    global $wpdb;
    
    $results = $wpdb->get_results("SELECT ID, post_title, post_content, post_status, post_type FROM $wpdb->posts ORDER BY ID DESC" );
            
    foreach ( $results as $r ) {
        if (($r->post_status == "publish") && ($r->post_type == "post")) $file .= "<li><a href=\"#".$r->ID."\">".$r->post_title."</a></li>";
    }
    $file .= "</ul>";
    foreach ( $results as $r ) {
        if (($r->post_status == "publish") && ($r->post_type == "post")){
            $file .= "<a name=\"".$r->ID."\"></a>";
            $url = get_permalink($r->ID);
            $content = ereg_replace("\r", "<br>", $r->post_content);
            $file .= "<h1>".$r->post_title."</h1><div>".$content."<br><br><a href=".$url.">[Comments]</a></div>";
        }
    }
    $file .= "</body></html>";
    
    $name = "blog"; // HTML file name
    //$dir = "/../../../files/";
    $dir = dirname(__FILE__).'/../'; // Path to HTML. wp-content by default.
    $html = $dir.$name.".html";
    $zip = $dir.$name.".zip";
    
    if(fopen($html, 'a')) unlink($html);
    $f = fopen($html, 'a') or die("Error!!");
    fwrite($f, $file);
    fclose($f);
    
    if(fopen($zip, 'a')) unlink($zip);
//    $command = "zip -j ".$zip." ".$html;
    $command = "gzip -c ".$html." > ".$zip;
//    system("$command > /dev/null");
    system("$command");
    //mail("admin@email.com","error","$command");
}

add_action('publish_post', 'wp2html', 5);
?>

Соника. Спасибо за подсказку. Установил, только не понял, как работают плагины. Собственных настроек у них нет, после установки ничего не изменилось

Anonymous
Отправить
Ответ на: