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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 28 - (hide annotations)
Wed Mar 17 23:46:34 2010 UTC (11 years, 7 months ago) by sng
File size: 4604 byte(s)
adding www directory
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     ini_set('display_errors', '1');
10    
11     $pageUrlName=basename ($_SERVER['HTTP_REFERER']);
12     if ( $pageUrlName == 'clonezilla-sysresccd.hellug.gr' OR $pageUrlName == "localhost" OR $pageUrlName == "demo") $pageUrlName='index.html';
13    
14     $eReg="#.*";
15     $onlyURL=ereg_replace($eReg,"",$pageUrlName);
16    
17     // echo "pageUrlName = $pageUrlName";
18     if (substr($onlyURL,strlen($pageUrlName)-3,3) == "php" OR substr($onlyURL,strlen($pageUrlName)-6,6) == "php?el")
19     $thePage = "http://clonezilla-sysresccd.hellug.gr/" . $pageUrlName;
20     // $thePage = "http://localhost/" . $pageUrlName;
21     else {
22     //echo "Basename = $pageUrlName\n";
23     $thePage = getcwd() . '/' . basename ($_SERVER['HTTP_REFERER']);
24     $thePage = getcwd() . '/' . $pageUrlName;
25     }
26    
27     // echo "$thePage";
28     $file = file_get_contents ($thePage);
29    
30     $eReg="<title>[^<]*</title>";
31     $reg=array("0","0","0");
32     ereg($eReg,$file,$reg);
33     // echo "$reg[0]";
34    
35    
36     // // Find copyright and last update
37     $eReg="Copyright: .*@.*gr&gt;</a>";
38     if(ereg($eReg,$file,$reg)){
39     $copr="$reg[0]";
40     }else{
41     $eReg="Πνευματικά δικαιώματα: .*@.*gr&gt;</a>";
42     ereg($eReg,$file,$reg);
43     $copr="$reg[0]";
44     }
45     $eReg="<font size=\"-1\">[^<]*: [0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9]</font>";
46     ereg($eReg,$file,$reg);
47     $upd="$reg[0]";
48     ?>
49     <style type="text/css">
50     body { background : url(null) fixed no-repeat; background-color: White; }
51     H1,H2,H3{color: #990000; text-align: left;}
52     H1{margin-top: 4em; margin-bottom: 2em;}
53     H2{margin-top: 2em;}
54     H3{margin-top: 1.5em}
55     li{margin-top: 1em;}
56     :link { color: #0000C0; text-decoration: none; }
57     :visited { color: #0000C0; text-decoration: none; }
58     a:hover { color: #0000C0; text-decoration: underline; }
59     /*p,td,table,tr,li{margin-left: 15pt;}*/
60     .nav{margin-left: 0pt;}
61     .newcode{font-family : "Courier New", Courier, monospace, sans-serif, serif; font-weight: bold; background-color: #F2F2F2; border: solid 1px #DEDEDE;padding: 20pt;}
62     .note{margin-top: 30pt; margin-bottom: 30pt; text-align: center; background-color: #FFEFEF; border: solid 1px; border-color: #FFD5D5;}
63     hr{color: Black; background-color: Black; height: 1px; border: none;}
64     #header {color: #990000; }
65     </style>
66     <META NAME="Keywords" CONTENT="multiboot Multi Boot bootable cd rescue clonezilla sysresccd">
67     </head>
68     <body style="margin-left: 40pt; margin-right: 40pt;">
69     <?php
70     $eReg=".*<body[^>]*>";
71     $file = ereg_replace($eReg,"",$file);
72     $eReg="<.body>.*";
73     $file = ereg_replace($eReg,"",$file);
74    
75     $eReg= "<" . "!" . "--site-only--" . ">" . ".*" . "<hr style=\"margin: 0;\"><". "!" . "--end-site-only--" . ">";
76     $file = ereg_replace($eReg,"",$file);
77     $eReg= "<" . "!" . "--site-only--" . ">" . ".*" . "<". "!" . "--end-site-only--" . ">";
78     $file = ereg_replace($eReg,"",$file);
79    
80     // // Remove [^] links
81     $eReg="\[<a [^<]*\^\^*</a>\]";
82     //$eReg = '\[';
83     $file = ereg_replace($eReg,"",$file);
84    
85     // search for <!--H1--></H1>
86     // if found, this is site onepage.php
87     $eReg="<!--copyright data only here--></H1>";
88     if(strpos($file,$eReg) === false) $eReg="</H1>";
89     $toStr="</H1>\n<p><font size=\"-1\">" . $copr . "<br></font>" . $upd . "<br><br></p>";
90     $file = ereg_replace($eReg,$toStr,$file);
91    
92     //$eReg= "<div id=\"lphp\"" . ".*" . "<\/div>";
93     $eReg = "<div id=.rss.>.*<!-- docline-top-->";
94     $file = ereg_replace($eReg,"<!-- docline-top-->",$file);
95    
96    
97     $eReg = "<div id=.linkline.>.*<div id=.contarea.>";
98     $file = ereg_replace($eReg,"<div id=\"contarea\">",$file);
99    
100    
101     $eReg = "<div id=.lphp.*<H2>Clonezilla-SysRescCD</H2>";
102     $file = ereg_replace($eReg,"<H2>Clonezilla-SysRescCD</H2>",$file);
103    
104    
105     $eReg = "<div id=.menu.>.*</div>";
106     $file = ereg_replace($eReg,"",$file);
107    
108     $eReg = "</H2>[^<]*<H3>";
109     $file = ereg_replace($eReg,"<br>",$file);
110    
111     $eReg = "<H2 style=.margin-top: 0;.>";
112     $file = ereg_replace($eReg,"<H2 style=\"margin-top: 4em;\">",$file);
113    
114    
115     $file = str_replace("position: absolute; left: 0px;","position: absolute; left: 40pt;",$file);
116     $file = str_replace("position: absolute; right: 0px;","position: absolute; right: 40pt;",$file);
117     //position: absolute; right: 0px;
118    
119    
120     $eReg = "</H4></div>.*<div style=.position: absolute; right: 40pt;.><H4>";
121     $file = ereg_replace($eReg,"<br>",$file);
122    
123    
124     $eReg = "<div id=.footer.>.*</div>";
125     $file = ereg_replace($eReg,"",$file);
126    
127    
128     echo $file;
129     echo "</div>
130     ";
131    
132     ?>
133     </body>
134     </html>

Properties

Name Value
svn:executable *

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26