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

Annotation of /trunk/www/printable.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 130 - (hide annotations)
Sun Sep 19 19:59:59 2010 UTC (13 years, 6 months ago) by sng
File size: 4127 byte(s)
adapting printable.php to php 5.3
1 sng 28 <!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 sng 130 // error_reporting(E_ERROR);
10 sng 28 ini_set('display_errors', '1');
11    
12 sng 130 //
13     // trunk or demo are the local folders used to develop
14     // this file at my own private apache server
15     //
16 sng 28 $pageUrlName=basename ($_SERVER['HTTP_REFERER']);
17 sng 130 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 sng 28
22 sng 130 $thePage = getcwd() . '/' . basename ($_SERVER['HTTP_REFERER']);
23     $thePage = getcwd() . '/' . $pageUrlName;
24     // echo "thePage = $thePage<br><br><br>";
25 sng 28
26 sng 130 // Read the file into $file
27 sng 28 $file = file_get_contents ($thePage);
28    
29    
30 sng 130 // 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 sng 28
39 sng 130
40 sng 28 ?>
41 sng 130 <style type="text/css">
42 sng 127 body { background : fixed no-repeat; background-color: White; }
43 sng 28 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 sng 130 img { display: block; margin:0 auto; }
52 sng 28 /*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 sng 130 .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 sng 28 </style>
62     <META NAME="Keywords" CONTENT="multiboot Multi Boot bootable cd rescue clonezilla sysresccd">
63     </head>
64 sng 130 <body style="margin: 40pt;">
65 sng 28 <?php
66    
67    
68 sng 130 // // // Remove [^] links
69     $eReg="#\[<a href=[^>]*>\^</a>\]#i";
70     $file = preg_replace($eReg,"",$file);
71 sng 28
72 sng 130 $eReg = "#<div id=.rss.>.*<!-- docline-top-->#i";
73     $file = preg_replace($eReg,"<!-- docline-top-->",$file);
74 sng 28
75 sng 130 $eReg = "{<div id=.lphp.*<H2>Clonezilla-SysRescCD</H2>}";
76     preg_replace($eReg,"<H2>Clonezilla-SysRescCD</H2>",$file);
77 sng 28
78    
79 sng 130 // Remove RSS
80     $eReg="#<div id=\"lphp\" style=.*</div>#";
81     $file=preg_replace($eReg,"",$file);
82 sng 28
83 sng 130 // 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 sng 28
87    
88 sng 130 // 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 sng 28 $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 sng 130 $eReg = "#<H2>Clonezilla-SysRescCD<br>(.*)</H3>#i";
105     $file = preg_replace($eReg,"<H1>Clonezilla-SysRescCD<br>$1</H1>",$file);
106 sng 28
107     echo $file;
108 sng 130 // echo "</div>
109     // ";
110 sng 28
111     ?>
112     </body>
113     </html>

Properties

Name Value
svn:executable *

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26