/[clonezilla-sysresccd]/trunk/www/working/printable.php
ViewVC logotype

Contents of /trunk/www/working/printable.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 130 - (show annotations)
Sun Sep 19 19:59:59 2010 UTC (11 years, 2 months ago) by sng
File size: 4127 byte(s)
adapting printable.php to php 5.3
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5 <link rel="alternate" type="application/rss+xml" title="RSS" href="http://clonezilla-sysresccd.hellug.gr/clonezilla-sysresccd.rss">
6 <link rel="shortcut icon" href="favicon.ico">
7 <?php
8 error_reporting(E_ALL);
9 // error_reporting(E_ERROR);
10 ini_set('display_errors', '1');
11
12 //
13 // trunk or demo are the local folders used to develop
14 // this file at my own private apache server
15 //
16 $pageUrlName=basename ($_SERVER['HTTP_REFERER']);
17 if ( $pageUrlName == 'clonezilla-sysresccd.hellug.gr' OR $pageUrlName == "localhost" OR $pageUrlName == "demo" OR $pageUrlName == "trunk" ) $pageUrlName='index.html';
18 $eReg="{#.*}";
19 $onlyURL=preg_replace($eReg,"",$pageUrlName);
20 // echo "pageUrlName = $pageUrlName";
21
22 $thePage = getcwd() . '/' . basename ($_SERVER['HTTP_REFERER']);
23 $thePage = getcwd() . '/' . $pageUrlName;
24 // echo "thePage = $thePage<br><br><br>";
25
26 // Read the file into $file
27 $file = file_get_contents ($thePage);
28
29
30 // Remove text starting from line 1 to
31 // line containing <body> tag
32 $eReg="#<html.*</head>#is";
33 $file = preg_replace($eReg,"",$file);
34 $eReg = "#<!DOCTYPE HTML PUBLIC.*#i";
35 $file = preg_replace($eReg,"",$file);
36 $eReg = "#<body.*#i";
37 $file = preg_replace($eReg,"",$file);
38
39
40 ?>
41 <style type="text/css">
42 body { background : fixed no-repeat; background-color: White; }
43 H1,H2,H3{color: #990000; text-align: left;}
44 H1{margin-top: 4em; margin-bottom: 2em;}
45 H2{margin-top: 2em;}
46 H3{margin-top: 1.5em}
47 li{margin-top: 1em;}
48 :link { color: #0000C0; text-decoration: none; }
49 :visited { color: #0000C0; text-decoration: none; }
50 a:hover { color: #0000C0; text-decoration: underline; }
51 img { display: block; margin:0 auto; }
52 /*p,td,table,tr,li{margin-left: 15pt;}*/
53 .nav{margin-left: 0pt;}
54 .newcode{font-family : "Courier New", Courier, monospace, sans-serif, serif; font-weight: bold; background-color: #F2F2F2; border: solid 1px #DEDEDE;padding: 20pt;}
55 .note{margin-top: 30pt; margin-bottom: 30pt; text-align: center; background-color: #FFEFEF; border: solid 1px; border-color: #FFD5D5;}
56 hr{color: Black; background-color: Black; height: 1px; border: none;}
57 #header {color: #990000; }
58 .newcode{font-family : "Courier New", Courier, monospace; font-weight: bold; background-color: #F2F2F2; border: solid 1px #DEDEDE;padding: 20pt;}
59 .note{margin-top: 30pt; margin-bottom: 30pt; text-align: left; background-color: #FFEFEF; border: double 3px; border-color: #FFD5D5;}
60 .otherpage{border: solid 1px darkgoldenrod; padding: 20pt; background-color: lemonchiffon;}
61 </style>
62 <META NAME="Keywords" CONTENT="multiboot Multi Boot bootable cd rescue clonezilla sysresccd">
63 </head>
64 <body style="margin: 40pt;">
65 <?php
66
67
68 // // // Remove [^] links
69 $eReg="#\[<a href=[^>]*>\^</a>\]#i";
70 $file = preg_replace($eReg,"",$file);
71
72 $eReg = "#<div id=.rss.>.*<!-- docline-top-->#i";
73 $file = preg_replace($eReg,"<!-- docline-top-->",$file);
74
75 $eReg = "{<div id=.lphp.*<H2>Clonezilla-SysRescCD</H2>}";
76 preg_replace($eReg,"<H2>Clonezilla-SysRescCD</H2>",$file);
77
78
79 // Remove RSS
80 $eReg="#<div id=\"lphp\" style=.*</div>#";
81 $file=preg_replace($eReg,"",$file);
82
83 // Remove link line
84 $eReg="#<div id=\"linkline\">.*<div id=\"contarea\">#is";
85 $file=preg_replace($eReg,"<!-- docline-top-->\n<div id=\"contarea\">",$file);
86
87
88 // Remove footer
89 $eReg = "#<div id=\"menu\">.*</div>#is";
90 $file = preg_replace($eReg,"",$file);
91 $eReg = "#<div id=\"footer\">.*</div>#is";
92 $file = preg_replace($eReg,"",$file);
93 //
94 $eReg = "#</H2>[^<]*<H3>#";
95 $file = preg_replace($eReg,"<br>",$file);
96 //
97 $eReg = "#<H2 style=\"margin-top: 0;\">#";
98 $file = preg_replace($eReg,"<H2 style=\"margin-top: 4em;\">",$file);
99 //
100 //
101 $file = str_replace("position: absolute; left: 0px;","position: absolute; left: 40pt;",$file);
102 $file = str_replace("position: absolute; right: 0px;","position: absolute; right: 40pt;",$file);
103
104 $eReg = "#<H2>Clonezilla-SysRescCD<br>(.*)</H3>#i";
105 $file = preg_replace($eReg,"<H1>Clonezilla-SysRescCD<br>$1</H1>",$file);
106
107 echo $file;
108 // echo "</div>
109 // ";
110
111 ?>
112 </body>
113 </html>

Properties

Name Value
svn:executable *

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26