--- trunk/www/working/printable.php 2010/09/20 18:49:07 131 +++ trunk/www/working/printable.php 2010/10/07 09:19:52 145 @@ -1,9 +1,3 @@ - - - - - -

"; -// Read the file into $file -$file = file_get_contents ($thePage); -// Remove text starting from line 1 to -// line containing tag -$eReg="##is"; -$file = preg_replace($eReg,"",$file); -$eReg = "#\n +\n +\n +\n +\n +Clonezilla-SysRescCD - What's New\n + + + + + .*#is"; + $file = preg_replace($eReg,"",$file); -// // // Remove [^] links + + $eReg = "#[^<]*<#"; + $tReg = '<a name=\0"></a>\0'; + $file = preg_replace($eReg,$tReg,$file); + + $file = str_replace('<">','">',$file); + $file = str_replace("<a name=<H2>","<a name=\"",$file); + + $file = str_replace("=<title>","=\"",$file); + $file = str_replace("<title>","<H2>",$file); + $file = str_replace(""," [^]",$file); + + $file = str_replace("","

Date: ",$file); + $file = str_replace("","

",$file); + $file = str_replace("","

",$file); + $file = str_replace("","",$file); + $file = str_replace("","",$file); + //$file = str_replace("","",$file); + $file = str_replace("","",$file); + //$file = str_replace("","",$file); + $file = str_replace("","",$file); + + $eReg = "#^" . ".*" . "<" . "/image" . ">#"; + $file = preg_replace($eReg,"",$file); + + + $eReg = "#<" . "guid" . "[^<]*" . "<" . "/guid" . ">#"; + $file = preg_replace($eReg,"",$file); + + + $eReg = "#<" . "link" . "[^<]*" . "<" . "/link" . ">#"; + + +// $file = preg_replace($eReg,"",$file); +// $indexFile = file_get_contents ("./index.html"); +// $headerTokken = preg_match("#
#is", $indexFile , $matches); +// if( $headerTokken == 0 ) +// echo "Error: Cannot find header in index.html!!!"; +// else{ +// $headerTokken = $matches[0]; +// $headerTokken = preg_replace( "#
.*
#is" , "" , $headerTokken ); +// $headerTokken = str_replace("position: absolute; left: 0px;","position: absolute; left: 40pt;",$headerTokken); +// $headerTokken = str_replace("position: absolute; right: 0px;","position: absolute; right: 40pt;",$headerTokken); +// $headerTokken = preg_replace( "#Well*come#" , "What's New" , $headerTokken ); +// $headerTokken = preg_replace( "#.*

#is" , "
" , $headerTokken ); +// // $headerTokken = preg_replace( "#(.*)

$#is" , "$1
" , $headerTokken ); +// // $headerTokken = str_replace( " style=\"margin:0; padding: 3px; width: 980; position relative;\">" , ">" , $headerTokken ); +// echo $headerTokken; +// } +// // $file = preg_replace( "##" , "\n".$headerTokken , $file ); +// + + echo "

Clonezilla-SysRescCD
What's New

"; + +} else { + + + // Remove RSS + $eReg="#
#"; + $file=preg_replace($eReg,"",$file); + + // Remove link line + $eReg="#
.*
#is"; + $file=preg_replace($eReg,"\n
",$file); + + + // Remove footer + $eReg = "#
.*
#is"; + $file = preg_replace($eReg,"",$file); + $eReg = "#
.*
#is"; + $file = preg_replace($eReg,"",$file); + + $eReg = "#[^<]*

#"; + $file = preg_replace($eReg,"
",$file); + + $eReg = "#

#"; + $file = preg_replace($eReg,"

",$file); + + + $file = str_replace("position: absolute; left: 0px;","position: absolute; left: 40pt;",$file); + $file = str_replace("position: absolute; right: 0px;","position: absolute; right: 40pt;",$file); + + $eReg = "#

Clonezilla-SysRescCD
(.*)

#i"; + $file = preg_replace($eReg,"

Clonezilla-SysRescCD
$1

",$file); + + + // Place top navigation + if(! empty($topNav)){ + $eReg = "#
#"; + $file = preg_replace($eReg, $topNav."\n
", $file); + } + $file = preg_replace( "#id=\"docline-top\"#" , "align=\"center\" class=\"docline-top\"" , $file ); + + // Place bottom navigation + if(! empty($bottomNav)){ + $eReg = "##i"; + $file = preg_replace($eReg, $bottomNav."\n", $file); + } + $file = preg_replace( "#id=\"docline-bottom\"#" , "align=\"center\" class=\"docline-bottom\"" , $file ); + + // Remove extra tags + $file = preg_replace( "#
#" , "" , $file ); + $file = preg_replace( "#
#" , "" , $file ); + +} + + +// Remove [^] links $eReg="#\[]*>\^\]#i"; $file = preg_replace($eReg,"",$file); @@ -86,38 +256,31 @@ preg_replace($eReg,"

Clonezilla-SysRescCD

",$file); -// Remove RSS -$eReg="#
#"; -$file=preg_replace($eReg,"",$file); - -// Remove link line -$eReg="#
.*
#is"; -$file=preg_replace($eReg,"\n
",$file); - - -// Remove footer -$eReg = "#
.*
#is"; -$file = preg_replace($eReg,"",$file); -$eReg = "#
.*
#is"; -$file = preg_replace($eReg,"",$file); -// -$eReg = "#[^<]*

#"; -$file = preg_replace($eReg,"
",$file); -// -$eReg = "#

#"; -$file = preg_replace($eReg,"

",$file); -// -// -$file = str_replace("position: absolute; left: 0px;","position: absolute; left: 40pt;",$file); -$file = str_replace("position: absolute; right: 0px;","position: absolute; right: 40pt;",$file); -$eReg = "#

Clonezilla-SysRescCD
(.*)

#i"; -$file = preg_replace($eReg,"

Clonezilla-SysRescCD
$1

",$file); +$file = preg_replace( "#href=\"\"#i" , "href=\"printable.php?index.html\"" , $file ); +// Convert href="XXX.html#YYY" to href="printable.php?XXX.html#YYY" +$eReg = "@href=\"([^hf][^t][^t]?[^p][^s]?[^\"]*)\"@i"; +//$eReg = "@href=\"([:alpha:]]\.html#?[^\"]*\")@i"; +$file = preg_replace( $eReg, "href=\"printable.php?$1\"" , $file ); + +// Convert href="#YYY" to href="printable.php?XXX.html#YYY" +// Because of previous conversion, the link is now: +// href="printable.php?#YYY" +$eReg = "@href=\"printable.php\?(#[^\"]*)\"@i"; +$file = preg_replace( $eReg, "href=\"printable.php?".$pageUrlName."$1\"" , $file ); echo $file; + // echo "
// "; + ?> + +
+WARNING
+This is the BETA version of Clonezilla-SysRescCD
+To acces our current stable version, please click here +