goba Mon Sep 3 12:05:03 2001 EDT Modified files: /phpdoc make_chm.README make_chm.bat make_chm.php make_chm_fancy.php Log: Moving to new file naming scheme introduced by Jouni with PDF generation: php_manual_LANG.chm Also many WS fixes in make_chm_fancy.php, more to come in make_chm.php Modifying all files to reflect the new file naming scheme
Index: phpdoc/make_chm.README diff -u phpdoc/make_chm.README:1.7 phpdoc/make_chm.README:1.8 --- phpdoc/make_chm.README:1.7 Fri Aug 10 06:40:24 2001 +++ phpdoc/make_chm.README Mon Sep 3 12:05:03 2001 @@ -22,10 +22,10 @@ The html manual. You have two alternatives: a) Download the actual html manual from - http://snaps.php.net/manual/lang/ + http://www.php.net/download-docs.php and untar the distribution into a directory a) Build the html manual yourself using Jade and the other - tools needed (look into the README or README.win32 + tools needed (look into the README and/or README.win32 file to see how to build it yourself) The .chm manual generator files (from cvs.php.net): @@ -79,7 +79,7 @@ Put the html manual (~2100 files) under the subdir specified above in PHP_HELP_COMPILE_DIR (eg. html). -Now You need to decide what method to use (normal or fancy). +Now you need to decide what method to use (normal or fancy). The fancy manual .chm takes ~240k more space. This is not significant, as the .chm files are ~2.1Megs in size. @@ -94,7 +94,7 @@ This can take a while, the fancy manual takes ~6 minutes on a 750MHz Pentium with 128MB RAM, running Windows 98SE. -After this process, you will have manual-lang-date.chm in your language... +After this process, you will have php_manual_lang.chm... ======================================================================= The fancy design improvemenets and the .css file is based on @@ -104,4 +104,4 @@ Thomas Schöfbeck ([EMAIL PROTECTED]). Contact them or the phpdoc list ([EMAIL PROTECTED]) if you have any questions or suggestions... -Last modified $Date: 2001/08/10 10:40:24 $ \ No newline at end of file +Last modified $Date: 2001/09/03 16:05:03 $ \ No newline at end of file Index: phpdoc/make_chm.bat diff -u phpdoc/make_chm.bat:1.6 phpdoc/make_chm.bat:1.7 --- phpdoc/make_chm.bat:1.6 Sun Jun 24 12:14:40 2001 +++ phpdoc/make_chm.bat Mon Sep 3 12:05:03 2001 @@ -1,55 +1,55 @@ -@echo off - -rem !! Please read the make_chm.README file for information -rem !! about how to build a manual_lang.chm file. - -rem Path of the PHP CGI executable -set PHP_PATH=D:\progra~1\php404\php.exe - -rem Path of the Help Compiler command line tool -set PHP_HELP_COMPILER=D:\progra~1\helpwo~1\hhc.exe - -rem The language of the manual to compile -set PHP_HELP_COMPILE_LANG=en - -rem The source directory with the original DSSSL made HTML -set PHP_HELP_COMPILE_DIR=html - -rem The index file in this directory (manual.html or index.html) -set PHP_HELP_COMPILE_INDEX=index.html - -rem The directory, where the fancy files need to be copied -set PHP_HELP_COMPILE_FANCYDIR=fancy - -rem ========================================================== -rem !!!!! DO NOT MODIFY ANYTHING BELOW THIS LINE !!!!! -rem ========================================================== - -echo. - -if a%1a == anormala goto skipfancy - -echo Now generating the fancy manual in %PHP_HELP_COMPILE_FANCYDIR% dir... -IF NOT EXIST %PHP_HELP_COMPILE_FANCYDIR%\NUL md %PHP_HELP_COMPILE_FANCYDIR% -%PHP_PATH% -q make_chm_fancy.php - -goto normal - -:skipfancy -set PHP_HELP_COMPILE_FANCYDIR= -echo Skipping fancy manual generation... - -:normal - -echo Now running the toc and project file generator script... -%PHP_PATH% -q make_chm.php - -echo Compiling the actual helpfile (manual-%PHP_HELP_COMPILE_LANG%-date.chm)... -%PHP_HELP_COMPILER% manual-%PHP_HELP_COMPILE_LANG%.hhp - -echo. -echo Cleaning up the directory -del manual-%PHP_HELP_COMPILE_LANG%.hh? - -echo Done! -echo. +@echo off + +rem !! Please read the make_chm.README file for information +rem !! about how to build a "php_manual_lang.chm" file. + +rem Path of the PHP CGI executable +set PHP_PATH=D:\progra~1\php404\php.exe + +rem Path of the Help Compiler command line tool +set PHP_HELP_COMPILER=D:\progra~1\helpwo~1\hhc.exe + +rem The language of the manual to compile +set PHP_HELP_COMPILE_LANG=en + +rem The source directory with the original DSSSL made HTML +set PHP_HELP_COMPILE_DIR=html + +rem The index file in this directory (manual.html or index.html) +set PHP_HELP_COMPILE_INDEX=index.html + +rem The directory, where the fancy files need to be copied +set PHP_HELP_COMPILE_FANCYDIR=fancy + +rem ========================================================== +rem !!!!! DO NOT MODIFY ANYTHING BELOW THIS LINE !!!!! +rem ========================================================== + +echo. + +if a%1a == anormala goto skipfancy + +echo Now generating the fancy manual in %PHP_HELP_COMPILE_FANCYDIR% dir... +IF NOT EXIST %PHP_HELP_COMPILE_FANCYDIR%\NUL md %PHP_HELP_COMPILE_FANCYDIR% +%PHP_PATH% -q make_chm_fancy.php + +goto normal + +:skipfancy +set PHP_HELP_COMPILE_FANCYDIR= +echo Skipping fancy manual generation... + +:normal + +echo Now running the toc and project file generator script... +%PHP_PATH% -q make_chm.php + +echo Compiling the actual helpfile (php_manual_%PHP_HELP_COMPILE_LANG%.chm)... +%PHP_HELP_COMPILER% php_manual_%PHP_HELP_COMPILE_LANG%.hhp + +echo. +echo Cleaning up the directory +rem del php_manual_%PHP_HELP_COMPILE_LANG%.hh? + +echo Done! +echo. Index: phpdoc/make_chm.php diff -u phpdoc/make_chm.php:1.12 phpdoc/make_chm.php:1.13 --- phpdoc/make_chm.php:1.12 Thu Jun 21 19:25:22 2001 +++ phpdoc/make_chm.php Mon Sep 3 12:05:03 2001 @@ -6,8 +6,7 @@ // SEE make_chm.README FOR INFORMATION!!! $fancydir = getenv("PHP_HELP_COMPILE_FANCYDIR"); -if(empty($fancydir)) -{ +if (empty($fancydir)) { $fancydir = getenv("PHP_HELP_COMPILE_DIR"); } $language = getenv("PHP_HELP_COMPILE_LANG"); @@ -41,8 +40,8 @@ { global $fancydir, $language, $manual_title, $fancyindex, $indexfile, $original_index, $header; - $toc = fopen("manual-$language.hhc", "w"); - $index = fopen("manual-$language.hhk", "w"); + $toc = fopen("php_manual_$language.hhc", "w"); + $index = fopen("php_manual_$language.hhk", "w"); fputs($toc, $header); fputs($index, $header); @@ -57,31 +56,27 @@ SiteMapObj($manual_title, $indexfile, " ", $toc, 21); IndexObj($manual_title, $indexfile, $index); - if($fancyindex) - { + if ($fancyindex) { preg_match('|CLASS=\"title\" ><A NAME=\"manual\" >(.*)</A|U', $ijoin, $match); - if(empty($match[1])) - { + if (empty($match[1])) { // fallback - $match[1]="Table of Contents"; + $match[1] = "Table of Contents"; } SiteMapObj($match[1], $original_index, " ", $toc, 21); IndexObj($match[1], $original_index, $index); } preg_match('|<A HREF="preface.html" >(.*)</A >|U', $ijoin, $match); - if(empty($match[1])) - { + if (empty($match[1])) { // fallback - $match[1]="Preface"; + $match[1] = "Preface"; } SiteMapObj($match[1], "preface.html", " ", $toc); IndexObj($match[1], "preface.html", $index); fputs($toc, "\n <UL>"); preg_match('|<A HREF="preface.html#about" >(.*)</A >|U', $ijoin, $match); - if(empty($match[1])) - { + if (empty($match[1])) { // fallback $match[1]="About this Manual"; } @@ -93,15 +88,12 @@ $not_closed = 0; - for($i = 0; $i < count ($index_a); $i++) - { + for ($i = 0; $i < count ($index_a); $i++) { /* Chapters */ - if(ereg(">[IVX]+\.\ <A", $index_a[$i]) && !ereg("HREF=\"ref\.[a-z0-9]+\.html", $index_a[$i+1])) - { + if (ereg(">[IVX]+\.\ <A", $index_a[$i]) && +!ereg("HREF=\"ref\.[a-z0-9]+\.html", $index_a[$i+1])) { $new_list = 1; - if($not_closed == 1) - { + if ($not_closed == 1) { fputs($toc, "\n </UL>\n"); } @@ -116,10 +108,8 @@ } /* Sub chapters */ - else if(ereg(">([0-9]+|[IVXL]+|[A-Z])\.\ <A", $index_a[$i])) - { - if($new_list == 1) - { + elseif (ereg(">([0-9]+|[IVXL]+|[A-Z])\.\ <A", $index_a[$i])) { + if ($new_list == 1) { $new_list = 0; $not_closed = 1; fputs($toc, "\n <UL>\n"); @@ -144,10 +134,9 @@ $cjoin = join("", file("$fancydir/copyright.html")); $cjoin = preg_replace("/[\r|\n]{1,2}/", " ", $cjoin); preg_match('|<A NAME="copyright" ></A ><P ><B >(.*)</B|U', $cjoin, $match); - if(empty($match[1])) - { + if (empty($match[1])) { // fallback - $match[1]="Copyright"; + $match[1] = "Copyright"; } SiteMapObj($match[1], "copyright.html", " ", $toc, 17); IndexObj($match[1], "copyright.html", $index); @@ -159,51 +148,39 @@ fclose($toc); } - - - - - - function MakeProjectFile() { global $fancydir, $language, $manual_title, $fancyindex, $indexfile, $original_index; // define language array (manual code -> HTML Help Code) - // Japanese is not on my list, I don't know why... $languages = array( + "cs" => "0x405 Czech", + "de" => "0x407 German (Germany)", + "en" => "0x809 Enlish (United Kingdom)", + "es" => "0xc0a Spanish (International Sort)", + "fr" => "0x40c French (France)", + "hu" => "0x40e Hungarian", + "it" => "0x410 Italian (Italy)", + "ja" => "0x411 Japanese", + "kr" => "0x412 Korean", + "nl" => "0x413 Dutch (Netherlands)", + "pt_BR" => "0x416 Portuguese (Brazil)" + ); - "cs" => "0x405 Czech", - "de" => "0x407 German (Germany)", - "en" => "0x809 Enlish (United Kingdom)", - "es" => "0xc0a Spanish (International Sort)", - "fr" => "0x40c French (France)", - "hu" => "0x40e Hungarian", - "it" => "0x410 Italian (Italy)", - "ja" => "0x411 Japanese", - "kr" => "0x412 Korean", - "nl" => "0x413 Dutch (Netherlands)", - "pt_BR" => "0x416 Portuguese (Brazil)" - - ); - - if(file_exists("$fancydir/fancy-index.html")) - { + if (file_exists("$fancydir/fancy-index.html")) { $fancyindex = TRUE; $indexfile = "fancy-index.html"; - } - else - { + } else { $indexfile = $original_index; } // Start writing the project file - $project = fopen("manual-$language.hhp", "w"); + $project = fopen("php_manual_$language.hhp", "w"); fputs($project, "[OPTIONS]\n"); fputs($project, "Compatibility=1.1 or later\n"); - fputs($project, "Compiled file=manual-$language-" . date("Ymd") . ".chm\n"); - fputs($project, "Contents file=manual-$language.hhc\n"); - fputs($project, "Index file=manual-$language.hhk\n"); + fputs($project, "Compiled file=php_manual_$language.chm\n"); + fputs($project, "Contents file=php_manual_$language.hhc\n"); + fputs($project, "Index file=php_manual_$language.hhk\n"); fputs($project, "Default Font=Arial,10,0\n"); fputs($project, "Default Window=phpdoc\n"); fputs($project, "Default topic=$fancydir\\$indexfile\n"); @@ -214,30 +191,25 @@ fputs($project, "Language=" . $languages[$language] . "\n"); // now try to find out how the manual named in the actual language - // this must be in the manual.html file as the title (DSSSL generated) + // this must be in the index.html file as the title (DSSSL generated) $content = join("", file("$fancydir/$original_index")); - if(preg_match("|>(.*)</TITLE|U", $content, $found)) - { + if (preg_match("|>(.*)</TITLE|U", $content, $found)) { $manual_title = $found[1]; - } - else - { + } else { $manual_title = "PHP Manual"; } fputs($project, "Title=$manual_title\n"); // define the phpdoc window style (adds more functionality) - fputs($project, "\n[WINDOWS]\nphpdoc=\"$manual_title\",\"manual-$language.hhc\",\"manual-$language.hhk\"," . + fputs($project, +"\n[WINDOWS]\nphpdoc=\"$manual_title\",\"php_manual_$language.hhc\",\"php_manual_$language.hhk\"," + . "\"$fancydir\\$indexfile\",\"$fancydir\\$indexfile\",,,,,0x23520,,0x386e,,,,,,,,0\n"); // write out all the filenames as in $fancydir fputs($project, "\n[FILES]\n"); $handle=opendir($fancydir); - while(false!==($file = readdir($handle))) - { - if($file != "." && $file != "..") - { + while (false !== ($file = readdir($handle))) { + if ($file != "." && $file != "..") { fputs($project, "$fancydir\\$file\n"); } } @@ -249,17 +221,13 @@ { global $fancydir; - /* should not be needed because if the documentation is valid xhtml $name would already - * be html encoded. - */ -// $name = htmlentities($name); + $name = str_replace('"', '"', $name); fputs($toc, "\n$tabs<LI> <OBJECT type=\"text/sitemap\"> $tabs <param name=\"Name\" value=\"$name\"> $tabs <param name=\"Local\" value=\"$fancydir\\$local\">"); - if($imgnum != "auto") - { + if ($imgnum != "auto") { fputs($toc, "\n$tabs <param name=\"ImageNumber\" value=\"$imgnum\">"); } fputs($toc, "\n$tabs </OBJECT>\n"); @@ -269,10 +237,7 @@ { global $fancydir; - /* should not be needed because if the documentation is valid xhtml $name would already - * be html encoded. - */ -// $name = htmlentities($name); + $name = str_replace('"', '"', $name); fputs($index, "\n<LI><OBJECT type=\"text/sitemap\"> <param name=\"Local\" value=\"$fancydir\\$local\"> @@ -285,30 +250,23 @@ global $fancydir; fputs($toc, " <UL>"); $content = file ("$fancydir/$filename"); - for($i = 0; $i < count ($content); $i++) - { - if(ereg ("><DT", $content[$i]) && + for ($i = 0; $i < count ($content); $i++) { + if (ereg ("><DT", $content[$i]) && ereg ("><A", $content[$i+1]) && - ereg ("HREF=\"([a-z0-9-]+\.)+html(\#[0-9a-z\.-]+)?\"", $content[$i+2])) - { + ereg ("HREF=\"([a-z0-9-]+\.)+html(\#[0-9a-z\.-]+)?\"", +$content[$i+2])) { + preg_match ("/HREF=\"(([0-9a-z-]+\.)+html)(\#[0-9a-z\.-]+)?\"/", $content[$i+2], $matches); $param["html"] = $matches[1]; - if(isset($matches[3])) - { + if (isset($matches[3])) { $param["html"] .= $matches[3]; } - if(ereg ("CLASS=\"literal\"", $content[$i+4])) - { - preg_match ("/>([^<]+)/", $content[$i+5], $matches); - } - else if($content[$i+2] == $content[$i+4]) - { - preg_match ("/>([^<]+)/", $content[$i+7], $matches); - } - else - { - preg_match ("/>([^<]+)/", $content[$i+3], $matches); + if (ereg ("CLASS=\"literal\"", $content[$i+4])) { + preg_match ("/>([^<]+)/", $content[$i+5], $matches); + } elseif($content[$i+2] == $content[$i+4]) { + preg_match ("/>([^<]+)/", $content[$i+7], $matches); + } else { + preg_match ("/>([^<]+)/", $content[$i+3], $matches); } $param["title"] = $matches[1]; SiteMapObj($param["title"], $param["html"], " ", $toc); @@ -316,6 +274,5 @@ } } fputs($toc, " </UL>\n"); -} -?> - \ No newline at end of file +} +?> \ No newline at end of file Index: phpdoc/make_chm_fancy.php diff -u phpdoc/make_chm_fancy.php:1.6 phpdoc/make_chm_fancy.php:1.7 --- phpdoc/make_chm_fancy.php:1.6 Sun Jun 24 12:17:23 2001 +++ phpdoc/make_chm_fancy.php Mon Sep 3 12:05:03 2001 @@ -1,103 +1,113 @@ <?php - set_time_limit(0); - - $htmldir = getenv("PHP_HELP_COMPILE_DIR"); - $fancydir = getenv("PHP_HELP_COMPILE_FANCYDIR"); - $language = getenv("PHP_HELP_COMPILE_LANG"); - $original_index = getenv("PHP_HELP_COMPILE_INDEX"); +// This script takes much time to run +set_time_limit(0); - $counter = 0; - - $handle=opendir($htmldir); - while (false!==($filename = readdir($handle))) { +// Get ENV vars from the system +$htmldir = getenv("PHP_HELP_COMPILE_DIR"); +$fancydir = getenv("PHP_HELP_COMPILE_FANCYDIR"); +$language = getenv("PHP_HELP_COMPILE_LANG"); +$original_index = getenv("PHP_HELP_COMPILE_INDEX"); + +// How many files are processed +$counter = 0; + +// Open the directory, and do the work on all HTML files +$handle = opendir($htmldir); +while (false !== ($filename = readdir($handle))) { if (strpos($filename, ".html") && ($filename != "fancy-index.html")) { - fancy_design($filename); - } - } - closedir($handle); - - // Look for chm-index-file (snap-downloader, cvs-usr with/without lang-support) - if ( false == ($content = join("", file("make_chm_index_$language.html"))) ) - if ( false == ($content = join("", file("$language/make_chm_index_$language.html"))) ) - $content = join("", file("en/make_chm_index_en.html")); + fancy_design($filename); + } +} +closedir($handle); - - // make GENTIME the actual date/time - $content = preg_replace("/\\[GENTIME\\]/", date("D M d H:i:s Y"), $content); - $fp = fopen("$fancydir/fancy-index.html", "w"); - fputs($fp, $content); - fclose($fp); - - copy("make_chm_style.css", "$fancydir/style.css"); - copy("make_chm_spc.gif", "$fancydir/spacer.gif"); +// Look for CHM index file (snap-downloader, cvs-usr with/without lang-support) +if (false == ($content = join("", file("make_chm_index_$language.html")))) { + if (false == ($content = join("", +file("$language/make_chm_index_$language.html")))) { + $content = join("", file("en/make_chm_index_en.html")); + } +} - $counter += 3; - - echo "\nConverting ready...\n"; - echo "Total number of files written in $fancydir directory: $counter\n\n"; - - function fancy_design($fname) { - +// Make GENTIME the actual date/time +$content = preg_replace("/\\[GENTIME\\]/", date("D M d H:i:s Y"), $content); +$fp = fopen("$fancydir/fancy-index.html", "w"); +fputs($fp, $content); +fclose($fp); + +copy("make_chm_style.css", "$fancydir/style.css"); +copy("make_chm_spc.gif", "$fancydir/spacer.gif"); + +// Three files added (fancy-index.html, style.css and spacer.gif) +$counter += 3; + +echo "\nConverting ready...\n"; +echo "Total number of files written in $fancydir directory: $counter\n\n"; + +/***********************************************************************/ +/* End of script lines, one main function follows */ +/***********************************************************************/ + +// Convert one file from HTML => fancy HTML +function fancy_design($fname) +{ global $htmldir, $fancydir, $counter, $original_index; - // get the contents of the file from $htmldir + // Get the contents of the file from $htmldir $content = join("", file("$htmldir/$fname")); - - // css file linking + + // CSS file linking $content = preg_replace("|</HEAD|", '<LINK REL="stylesheet" HREF="style.css"></HEAD', $content); - // no margins around + // No margins around $content = preg_replace("/<BODY/", '<BODY TOPMARGIN="0" LEFTMARGIN="0"', $content); - + // HR dropout $content = preg_replace("/<HR\\s+ALIGN=\"LEFT\"\\s+WIDTH=\"100%\">/", '', $content); - // whole page table and backgrounds + // Whole page table and backgrounds $wpbegin = '<TABLE BORDER="0" WIDTH="100%" HEIGHT="100%" CELLSPACING="0" CELLPADDING="0"><TR><TD COLSPAN="3">'; $bnavt = '<TABLE BGCOLOR="#CCCCFF" BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%">'; $lnavt = '<TR BGCOLOR="#333366"><TD><IMG SRC="spacer.gif" BORDER="0" WIDTH="1" HEIGHT="1"><BR></TD></TR>'; $space = '<IMG SRC="spacer.gif" WIDTH="10" HEIGHT="1">'; - - // navheader backgound + + // Navheader backgound $content = preg_replace("/<DIV\\s+CLASS=\"NAVHEADER\"\\s+><TABLE(.*)CELLPADDING=\"0\"(.*)<\\/TABLE\\s+><\\/DIV\\s+>/Us", - $wpbegin . '<DIV CLASS="NAVHEADER">' . $bnavt . '<TR><TD><TABLE\\1CELLPADDING="3"\\2</TABLE></TD></TR>' . $lnavt . '</TABLE></DIV></TD></TR><TR><TD>' . $space . '</TD><TD HEIGHT="100%" VALIGN="TOP" WIDTH="100%"><BR>', $content); + $wpbegin . '<DIV CLASS="NAVHEADER">' . $bnavt . +'<TR><TD><TABLE\\1CELLPADDING="3"\\2</TABLE></TD></TR>' . $lnavt . +'</TABLE></DIV></TD></TR><TR><TD>' . $space . '</TD><TD HEIGHT="100%" VALIGN="TOP" +WIDTH="100%"><BR>', $content); - // navfooter backgound + // Navfooter backgound $content = preg_replace("/<DIV\\s+CLASS=\"NAVFOOTER\"\\s+><TABLE(.*)CELLPADDING=\"0\"(.*)<\\/TABLE\\s+><\\/DIV\\s+>/Us", - '<BR></TD><TD>' . $space . '</TD></TR><TR><TD COLSPAN="3"><DIV CLASS="NAVFOOTER">' . $bnavt . $lnavt . '<TR><TD><TABLE\\1CELLPADDING="3"\\2</TABLE></TD></TR></TABLE></DIV></TD></TR></TABLE>', $content); - - // fix copyright page fault... + '<BR></TD><TD>' . $space . '</TD></TR><TR><TD COLSPAN="3"><DIV +CLASS="NAVFOOTER">' . $bnavt . $lnavt . +'<TR><TD><TABLE\\1CELLPADDING="3"\\2</TABLE></TD></TR></TABLE></DIV></TD></TR></TABLE>', + $content); + + // Fix copyright page fault... if ($fname == "copyright.html") { - $content = preg_replace("/&copy;/", "©", $content); - $content = preg_replace("/<A\\s+HREF=\"$original_index#(authors|translators)\"/U", "<A HREF=\"fancy-index.html\"", $content); - $content = preg_replace("|(</TH\\s+></TR\\s+>)|", "\\1<TR><TH COLSPAN=\"3\" ALIGN=\"center\"> </TH></TR>", $content); - $content = preg_replace("|( </TD\\s+></TR\\s+>)|", "\\1<TR><TD COLSPAN=\"3\" ALIGN=\"center\"> </TD></TR>", $content); + $content = preg_replace("/&copy;/", "©", $content); + $content = +preg_replace("/<A\\s+HREF=\"$original_index#(authors|translators)\"/U", "<A +HREF=\"fancy-index.html\"", $content); + $content = preg_replace("|(</TH\\s+></TR\\s+>)|", "\\1<TR><TH COLSPAN=\"3\" +ALIGN=\"center\"> </TH></TR>", $content); + $content = preg_replace("|( </TD\\s+></TR\\s+>)|", "\\1<TR><TD +COLSPAN=\"3\" ALIGN=\"center\"> </TD></TR>", $content); } - - // fix the original manual index to look far better... + + // Fix the original manual index to look far better... elseif ($fname == "$original_index") { - preg_match('|CLASS=\"title\"\\s+><A\\s+NAME=\"manual\"\\s+>(.*)</A\\s+></H1|U', $content, $match); - $indexchange = '<TABLE BORDER="0" WIDTH="100%" HEIGHT="100%" CELLSPACING="0" CELLPADDING="0"><TR><TD COLSPAN="3"><DIV CLASS="NAVHEADER"><TABLE BGCOLOR="#CCCCFF" BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><TR><TD><TABLE - WIDTH="100%" BORDER="0" CELLPADDING="3" CELLSPACING="0"><TR><TH COLSPAN="3">'.$match[1].'</TH></TR><TR><TD COLSPAN="3" ALIGN="center"> </TD></TR></TABLE></TD></TR><TR BGCOLOR="#333366"><TD><IMG SRC="spacer.gif" BORDER="0" WIDTH="1" HEIGHT="1"><BR></TD></TR></TABLE> - </DIV></TD></TR><TR><TD><IMG SRC="spacer.gif" WIDTH="10" HEIGHT="1"></TD><TD HEIGHT="100%" VALIGN="TOP" WIDTH="100%"><BR>'; - $content = preg_replace("/(<DIV\\s+CLASS=\"BOOK\")/", "$indexchange\\1", $content); - $content = preg_replace("/(<DIV\\s+CLASS=\"author\").*<HR>/Us", "", $content); - preg_match('|<DIV\\s+CLASS="TOC"\\s+><DL\\s+><DT\\s+><B\\s+>(.*)</B\\s+>|U', $content, $match); - $content = preg_replace("|(CLASS=\"title\"\\s+><A\\s+NAME=\"manual\"\\s+>).*(</A)|U", "\\1$match[1]\\2", $content); - $content = preg_replace("|<DT\\s+><B\\s+>(.*)</B\\s+></DT\\s+>|U", "", $content); - + +preg_match('|CLASS=\"title\"\\s+><A\\s+NAME=\"manual\"\\s+>(.*)</A\\s+></H1|U', +$content, $match); + $indexchange = '<TABLE BORDER="0" WIDTH="100%" HEIGHT="100%" CELLSPACING="0" +CELLPADDING="0"><TR><TD COLSPAN="3"><DIV CLASS="NAVHEADER"><TABLE BGCOLOR="#CCCCFF" +BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><TR><TD><TABLE + WIDTH="100%" BORDER="0" CELLPADDING="3" CELLSPACING="0"><TR><TH +COLSPAN="3">'.$match[1].'</TH></TR><TR><TD COLSPAN="3" +ALIGN="center"> </TD></TR></TABLE></TD></TR><TR BGCOLOR="#333366"><TD><IMG +SRC="spacer.gif" BORDER="0" WIDTH="1" HEIGHT="1"><BR></TD></TR></TABLE> + </DIV></TD></TR><TR><TD><IMG SRC="spacer.gif" WIDTH="10" HEIGHT="1"></TD><TD +HEIGHT="100%" VALIGN="TOP" WIDTH="100%"><BR>'; + $content = preg_replace("/(<DIV\\s+CLASS=\"BOOK\")/", "$indexchange\\1", +$content); + $content = preg_replace("/(<DIV\\s+CLASS=\"author\").*<HR>/Us", "", $content); + preg_match('|<DIV\\s+CLASS="TOC"\\s+><DL\\s+><DT\\s+><B\\s+>(.*)</B\\s+>|U', +$content, $match); + $content = +preg_replace("|(CLASS=\"title\"\\s+><A\\s+NAME=\"manual\"\\s+>).*(</A)|U", +"\\1$match[1]\\2", $content); + $content = preg_replace("|<DT\\s+><B\\s+>(.*)</B\\s+></DT\\s+>|U", "", +$content); } - // print out that new file to $fancydir + // Print out that new file to $fancydir $fp = fopen("$fancydir/$fname", "w"); fputs($fp, $content); fclose($fp); - - // print out a message to see the progress + + // Print out a message to see the progress echo "$fancydir/$fname ready...\n"; $counter++; - } +} // fancy_design() function end ?>