|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
|
|
<html> |
|
|
<head> |
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
|
|
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://clonezilla-sysresccd.hellug.gr/clonezilla-sysresccd.rss"> |
|
|
<link rel="shortcut icon" href="favicon.ico"> |
|
1 |
<?php |
<?php |
2 |
error_reporting(E_ALL); |
error_reporting(E_ALL); |
3 |
|
// error_reporting(E_ERROR); |
4 |
ini_set('display_errors', '1'); |
ini_set('display_errors', '1'); |
5 |
|
|
6 |
$pageUrlName=basename ($_SERVER['HTTP_REFERER']); |
$curPage = basename( $_SERVER["REQUEST_URI"] ); |
7 |
if ( $pageUrlName == 'clonezilla-sysresccd.hellug.gr' OR $pageUrlName == "localhost" OR $pageUrlName == "demo") $pageUrlName='index.html'; |
// echo "pageURL = $curPage<br><br><br>"; |
8 |
|
if (substr($curPage,0,14) == "printable.php?" ) { |
9 |
$eReg="#.*"; |
// |
10 |
$onlyURL=ereg_replace($eReg,"",$pageUrlName); |
// This means we have a printable.php?xxx.html URL |
11 |
|
// let's get the xxx.html part |
12 |
// echo "pageUrlName = $pageUrlName"; |
// |
13 |
if (substr($onlyURL,strlen($pageUrlName)-3,3) == "php" OR substr($onlyURL,strlen($pageUrlName)-6,6) == "php?el") |
$pageUrlName = substr( $curPage,14,strlen($curPage) ); |
14 |
$thePage = "http://clonezilla-sysresccd.hellug.gr/" . $pageUrlName; |
// echo "pageUrlName = $pageUrlName<br><br><br>"; |
15 |
// $thePage = "http://localhost/" . $pageUrlName; |
} else { |
16 |
else { |
// |
17 |
//echo "Basename = $pageUrlName\n"; |
// trunk or demo are the local folders used to develop |
18 |
|
// this file at my own private apache server |
19 |
|
// |
20 |
|
$pageUrlName=basename ($_SERVER['HTTP_REFERER']); |
21 |
|
if ( $pageUrlName == 'clonezilla-sysresccd.hellug.gr' OR $pageUrlName == "localhost" OR $pageUrlName == "demo" OR $pageUrlName == "trunk" ) $pageUrlName='index.html'; |
22 |
|
$eReg="{#.*}"; |
23 |
|
$onlyURL=preg_replace($eReg,"",$pageUrlName); |
24 |
|
// echo "pageUrlName = $pageUrlName<br><br><br>"; |
25 |
$thePage = getcwd() . '/' . basename ($_SERVER['HTTP_REFERER']); |
$thePage = getcwd() . '/' . basename ($_SERVER['HTTP_REFERER']); |
|
$thePage = getcwd() . '/' . $pageUrlName; |
|
26 |
} |
} |
27 |
|
$thePage = getcwd() . '/' . $pageUrlName; |
28 |
|
// echo "thePage = $thePage<br><br><br>"; |
29 |
|
|
30 |
// echo "$thePage"; |
// Read the file into $file |
31 |
$file = file_get_contents ($thePage); |
$file = file_get_contents ($thePage); |
32 |
|
|
33 |
$eReg="<title>[^<]*</title>"; |
// Get top navigation div |
34 |
$reg=array("0","0","0"); |
$eReg = "#<div id=\"docline-top\">.*#"; |
35 |
ereg($eReg,$file,$reg); |
$numMatch = preg_match($eReg,$file,$matches); |
36 |
// echo "$reg[0]"; |
if($numMatch > 0) |
37 |
|
$topNav = $matches[0]; |
38 |
|
// echo $topNav; |
39 |
|
|
40 |
|
// Get bottom navigation div |
41 |
|
$eReg = "#<div id=\"docline-bottom\">.*#"; |
42 |
|
$numMatch = preg_match($eReg,$file,$matches); |
43 |
|
if($numMatch > 0) |
44 |
|
$bottomNav = $matches[0]; |
45 |
|
// echo $bottomNav; |
46 |
|
|
47 |
|
// Remove text starting from line 1 to |
48 |
|
// line containing <body> tag |
49 |
|
$eReg="#<html.*</head>#is"; |
50 |
|
$file = preg_replace($eReg,"",$file); |
51 |
|
$eReg = "#<!DOCTYPE HTML PUBLIC.*#i"; |
52 |
|
$file = preg_replace($eReg,"",$file); |
53 |
|
$eReg = "#<body.*#i"; |
54 |
|
$file = preg_replace($eReg,"",$file); |
55 |
|
|
56 |
|
|
|
// // Find copyright and last update |
|
|
$eReg="Copyright: .*@.*gr></a>"; |
|
|
if(ereg($eReg,$file,$reg)){ |
|
|
$copr="$reg[0]"; |
|
|
}else{ |
|
|
$eReg="Πνευματικά δικαιώματα: .*@.*gr></a>"; |
|
|
ereg($eReg,$file,$reg); |
|
|
$copr="$reg[0]"; |
|
|
} |
|
|
$eReg="<font size=\"-1\">[^<]*: [0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9]</font>"; |
|
|
ereg($eReg,$file,$reg); |
|
|
$upd="$reg[0]"; |
|
57 |
?> |
?> |
58 |
<style type="text/css"> |
<style type="text/css"> |
59 |
body { background : fixed no-repeat; background-color: White; } |
body { background : fixed no-repeat; background-color: White; } |
60 |
H1,H2,H3{color: #990000; text-align: left;} |
H1,H2,H3{color: #990000; text-align: left;} |
61 |
H1{margin-top: 4em; margin-bottom: 2em;} |
H1{margin-top: 4em; margin-bottom: 2em;} |
65 |
:link { color: #0000C0; text-decoration: none; } |
:link { color: #0000C0; text-decoration: none; } |
66 |
:visited { color: #0000C0; text-decoration: none; } |
:visited { color: #0000C0; text-decoration: none; } |
67 |
a:hover { color: #0000C0; text-decoration: underline; } |
a:hover { color: #0000C0; text-decoration: underline; } |
68 |
|
img { display: block; margin:0 auto; } |
69 |
/*p,td,table,tr,li{margin-left: 15pt;}*/ |
/*p,td,table,tr,li{margin-left: 15pt;}*/ |
70 |
.nav{margin-left: 0pt;} |
.nav{margin-left: 0pt;} |
|
.otherpage{border: solid 1px darkgoldenrod; padding: 20pt; background-color: lemonchiffon;} |
|
71 |
.newcode{font-family : "Courier New", Courier, monospace, sans-serif, serif; font-weight: bold; background-color: #F2F2F2; border: solid 1px #DEDEDE;padding: 20pt;} |
.newcode{font-family : "Courier New", Courier, monospace, sans-serif, serif; font-weight: bold; background-color: #F2F2F2; border: solid 1px #DEDEDE;padding: 20pt;} |
72 |
.note{margin-top: 30pt; margin-bottom: 30pt; text-align: center; background-color: #FFEFEF; border: solid 1px; border-color: #FFD5D5;} |
.note{margin-top: 30pt; margin-bottom: 30pt; text-align: center; background-color: #FFEFEF; border: solid 1px; border-color: #FFD5D5;} |
73 |
hr{color: Black; background-color: Black; height: 1px; border: none;} |
hr{color: Black; background-color: Black; height: 1px; border: none;} |
74 |
#header {color: #990000; } |
#header {color: #990000; } |
75 |
|
.newcode{font-family : "Courier New", Courier, monospace; font-weight: bold; background-color: #F2F2F2; border: solid 1px #DEDEDE;padding: 20pt;} |
76 |
|
.note{margin-top: 30pt; margin-bottom: 30pt; text-align: left; background-color: #FFEFEF; border: double 3px; border-color: #FFD5D5;} |
77 |
|
.otherpage{border: solid 1px darkgoldenrod; padding: 20pt; background-color: lemonchiffon;} |
78 |
|
.docline-top {color: #990000 ; font-weight: bold; display:block;} |
79 |
|
.docline-top a{color: #990000; font-weight: bold;} |
80 |
|
.docline-bottom {color: #990000 ; font-weight: bold; display:block;} |
81 |
|
.docline-bottom a{color: #990000; font-weight: bold;} |
82 |
|
|
83 |
|
@media print { |
84 |
|
.docline-top {display: none;} |
85 |
|
.docline-bottom {display: none;} |
86 |
|
} |
87 |
</style> |
</style> |
88 |
<META NAME="Keywords" CONTENT="multiboot Multi Boot bootable cd rescue clonezilla sysresccd"> |
<META NAME="Keywords" CONTENT="multiboot Multi Boot bootable cd rescue clonezilla sysresccd"> |
89 |
</head> |
</head> |
90 |
<body style="margin-left: 40pt; margin-right: 40pt;"> |
<body style="margin: 40pt;"> |
91 |
<?php |
<?php |
|
$eReg=".*<body[^>]*>"; |
|
|
$file = ereg_replace($eReg,"",$file); |
|
|
$eReg="<.body>.*"; |
|
|
$file = ereg_replace($eReg,"",$file); |
|
|
|
|
|
$eReg= "<" . "!" . "--site-only--" . ">" . ".*" . "<hr style=\"margin: 0;\"><". "!" . "--end-site-only--" . ">"; |
|
|
$file = ereg_replace($eReg,"",$file); |
|
|
$eReg= "<" . "!" . "--site-only--" . ">" . ".*" . "<". "!" . "--end-site-only--" . ">"; |
|
|
$file = ereg_replace($eReg,"",$file); |
|
92 |
|
|
|
// // Remove [^] links |
|
|
$eReg="\[<a [^<]*\^\^*</a>\]"; |
|
|
//$eReg = '\['; |
|
|
$file = ereg_replace($eReg,"",$file); |
|
93 |
|
|
94 |
// search for <!--H1--></H1> |
// Remove [^] links |
95 |
// if found, this is site onepage.php |
$eReg="#\[<a href=[^>]*>\^</a>\]#i"; |
96 |
$eReg="<!--copyright data only here--></H1>"; |
$file = preg_replace($eReg,"",$file); |
|
if(strpos($file,$eReg) === false) $eReg="</H1>"; |
|
|
$toStr="</H1>\n<p><font size=\"-1\">" . $copr . "<br></font>" . $upd . "<br><br></p>"; |
|
|
$file = ereg_replace($eReg,$toStr,$file); |
|
97 |
|
|
98 |
//$eReg= "<div id=\"lphp\"" . ".*" . "<\/div>"; |
$eReg = "#<div id=.rss.>.*<!-- docline-top-->#i"; |
99 |
$eReg = "<div id=.rss.>.*<!-- docline-top-->"; |
$file = preg_replace($eReg,"<!-- docline-top-->",$file); |
|
$file = ereg_replace($eReg,"<!-- docline-top-->",$file); |
|
100 |
|
|
101 |
|
$eReg = "{<div id=.lphp.*<H2>Clonezilla-SysRescCD</H2>}"; |
102 |
|
preg_replace($eReg,"<H2>Clonezilla-SysRescCD</H2>",$file); |
103 |
|
|
|
$eReg = "<div id=.linkline.>.*<div id=.contarea.>"; |
|
|
$file = ereg_replace($eReg,"<div id=\"contarea\">",$file); |
|
104 |
|
|
105 |
|
// Remove RSS |
106 |
|
$eReg="#<div id=\"lphp\" style=.*</div>#"; |
107 |
|
$file=preg_replace($eReg,"",$file); |
108 |
|
|
109 |
$eReg = "<div id=.lphp.*<H2>Clonezilla-SysRescCD</H2>"; |
// Remove link line |
110 |
$file = ereg_replace($eReg,"<H2>Clonezilla-SysRescCD</H2>",$file); |
$eReg="#<div id=\"linkline\">.*<div id=\"contarea\">#is"; |
111 |
|
$file=preg_replace($eReg,"<!-- docline-top-->\n<div id=\"contarea\">",$file); |
112 |
|
|
113 |
|
|
114 |
$eReg = "<div id=.menu.>.*</div>"; |
// Remove footer |
115 |
$file = ereg_replace($eReg,"",$file); |
$eReg = "#<div id=\"menu\">.*</div>#is"; |
116 |
|
$file = preg_replace($eReg,"",$file); |
117 |
|
$eReg = "#<div id=\"footer\">.*</div>#is"; |
118 |
|
$file = preg_replace($eReg,"",$file); |
119 |
|
|
120 |
$eReg = "</H2>[^<]*<H3>"; |
$eReg = "#</H2>[^<]*<H3>#"; |
121 |
$file = ereg_replace($eReg,"<br>",$file); |
$file = preg_replace($eReg,"<br>",$file); |
122 |
|
|
123 |
$eReg = "<H2 style=.margin-top: 0;.>"; |
$eReg = "#<H2 style=\"margin-top: 0;\">#"; |
124 |
$file = ereg_replace($eReg,"<H2 style=\"margin-top: 4em;\">",$file); |
$file = preg_replace($eReg,"<H2 style=\"margin-top: 4em;\">",$file); |
125 |
|
|
126 |
|
|
127 |
$file = str_replace("position: absolute; left: 0px;","position: absolute; left: 40pt;",$file); |
$file = str_replace("position: absolute; left: 0px;","position: absolute; left: 40pt;",$file); |
128 |
$file = str_replace("position: absolute; right: 0px;","position: absolute; right: 40pt;",$file); |
$file = str_replace("position: absolute; right: 0px;","position: absolute; right: 40pt;",$file); |
|
//position: absolute; right: 0px; |
|
129 |
|
|
130 |
|
$eReg = "#<H2>Clonezilla-SysRescCD<br>(.*)</H3>#i"; |
131 |
|
$file = preg_replace($eReg,"<H1>Clonezilla-SysRescCD<br>$1</H1>",$file); |
132 |
|
|
|
$eReg = "</H4></div>.*<div style=.position: absolute; right: 40pt;.><H4>"; |
|
|
$file = ereg_replace($eReg,"<br>",$file); |
|
133 |
|
|
134 |
|
// Place top navigation |
135 |
|
if(! empty($topNav)){ |
136 |
|
$eReg = "#<div id=\"contarea\">#"; |
137 |
|
$file = preg_replace($eReg, $topNav."\n<div id=\"contarea\">", $file); |
138 |
|
} |
139 |
|
$file = preg_replace( "#id=\"docline-top\"#" , "align=\"center\" class=\"docline-top\"" , $file ); |
140 |
|
|
141 |
|
// Place bottom navigation |
142 |
|
if(! empty($bottomNav)){ |
143 |
|
$eReg = "#</body>#i"; |
144 |
|
$file = preg_replace($eReg, $bottomNav."\n</body>", $file); |
145 |
|
} |
146 |
|
$file = preg_replace( "#id=\"docline-bottom\"#" , "align=\"center\" class=\"docline-bottom\"" , $file ); |
147 |
|
|
148 |
|
// Remove extra tags |
149 |
|
$file = preg_replace( "#<div id=\"contarea\">#" , "" , $file ); |
150 |
|
$file = preg_replace( "#<div id=\"content\">#" , "" , $file ); |
151 |
|
|
|
$eReg = "<div id=.footer.>.*</div>"; |
|
|
$file = ereg_replace($eReg,"",$file); |
|
152 |
|
|
153 |
|
$file = preg_replace( "#href=\"\"#i" , "href=\"printable.php?index.html\"" , $file ); |
154 |
|
|
155 |
|
// Convert href="XXX.html#YYY" to href="printable.php?XXX.html#YYY" |
156 |
|
$eReg = "@href=\"([^hf][^t][^t]?[^p][^s]?[^\"]*)\"@i"; |
157 |
|
//$eReg = "@href=\"([:alpha:]]\.html#?[^\"]*\")@i"; |
158 |
|
$file = preg_replace( $eReg, "href=\"printable.php?$1\"" , $file ); |
159 |
|
|
160 |
|
// Convert href="#YYY" to href="printable.php?XXX.html#YYY" |
161 |
|
// Because of previous conversion, the link is now: |
162 |
|
// href="printable.php?#YYY" |
163 |
|
$eReg = "@href=\"printable.php\?(#[^\"]*)\"@i"; |
164 |
|
$file = preg_replace( $eReg, "href=\"printable.php?".$pageUrlName."$1\"" , $file ); |
165 |
|
|
166 |
echo $file; |
echo $file; |
167 |
echo "</div> |
|
168 |
"; |
// echo "</div> |
169 |
|
// "; |
170 |
|
|
171 |
?> |
?> |
172 |
</body> |
</body> |