First release for preview and IE compatibility test.
[www.energie.vellum.cz.git] / common.php
1 <?php
2         error_reporting(E_ALL);
3
4         $viewcvs=ereg_replace("^/~short/","\\0cgi-bin/viewcvs/",$HTTP_SERVER_VARS["SCRIPT_NAME"]);
5         if ($viewcvs==$HTTP_SERVER_VARS["SCRIPT_NAME"])
6                 unset($viewcvs);
7         $cvs_id_split=split(" ",$cvs_id);
8         $cvs_id_split[1]="<a href=\"$viewcvs\">".$cvs_id_split[1]."</a>";
9         $cvs_id_split[5]="<a href=\"mailto:".$cvs_id_split[5]."@".$HTTP_SERVER_VARS["HTTP_HOST"]."\">".$cvs_id_split[5]."</a>";
10         $cvs_id_html=join(" ",$cvs_id_split);
11
12 function addpercents($url)
13 {
14         $r=$c="";
15         foreach(preg_split('//', $url, -1, PREG_SPLIT_NO_EMPTY) as $c)
16                 if (ereg("[a-zA-Z0-9]",$c))
17                         $r.=$c;
18                 else
19                         $r.=sprintf("%%%02X",ord($c));
20         return($r);
21 }
22
23 function footer()
24 {
25         global $cvs_id_html,$viewcvs,$viewcvs,$HTTP_SERVER_VARS;
26         ?>
27 <hr />
28 <table border="0" width="100%">
29 <tr><td align="left"><span class="cvs-id"><?php print($cvs_id_html); ?></span></td><td align="right"><a
30         href="http://validator.w3.org/check/referer"><img src="http://www.w3.org/Icons/valid-xhtml10"
31                 style="border:0;width:88px;height:31px" width="88" height="31" alt="Valid XHTML 1.0!" /></a><a
32         href="http://jigsaw.w3.org/css-validator/validator?warning=2&amp;profile=css2&amp;uri=<?php
33                 print(addpercents("http://".$HTTP_SERVER_VARS["HTTP_HOST"].$HTTP_SERVER_VARS["REQUEST_URI"]));
34                 ?>"><img src="http://jigsaw.w3.org/css-validator/images/vcss"
35                 style="border:0;width:88px;height:31px" width="88" height="31" alt="Valid CSS!" /></a></td></tr>
36 </table>
37 </body></html>
38         <?php
39 }
40
41 ?>
42 <?xml version="1.0" encoding="iso-8859-2"?>
43 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
44 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
45 <head><title>Energie &amp; peníze<?php
46         if (isset($title_tail))
47                 print(": $title_tail");
48 ?></title>
49 <style type="text/css"><!--
50 .cvs-id { font-family: monospace; }<?php
51         if (isset($head_css))
52                 print($head_css);
53         print("--></style>\n");
54         if (isset($head))
55                 print($head);
56 ?>
57 </head><body>