completely replaces old.index.php
[silc.git] / public_html / index.php
1 <?php
2 // 
3 // Copyright (c) 2001, Lubomir Sedlacik <salo@silcnet.org>
4 // and other members of the SILC Project (http://silcnet.org)
5 // All rights reserved.
6 // 
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions
9 // are met:
10 // 
11 // 1) Redistributions of source code must retain the above copyright notice,
12 //    this list of conditions and the following disclaimer.
13 // 2) Redistributions in binary form must reproduce the above copyright
14 //    notice, this list of conditions and the following disclaimer in the
15 //    documentation and/or other materials provided with the distribution.
16 // 3) Neither the name of the SILC Project nor the names of its contributors
17 //    may be used to endorse or promote products derived from this software
18 //    without specific prior written permission.
19 // 
20 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21 // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
24 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 // THE POSSIBILITY OF SUCH DAMAGE.
31 // 
32
33 // Read neccessary stuff if accessible
34   if (Is_Readable("config.php")) include("config.php");
35   if (Is_Readable("mirror.php")) include("mirror.php");
36
37 ?>
38 <?xml version="1.0" encoding="iso-8859-1"?>
39 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
40 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
41 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
42 <head>
43  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
44  <meta http-equiv="Content-Language" content="en" />
45  <meta name="description" content="SILC Secure Internet Live Conferencing" />
46  <meta name="keywords" content="SILC silcnet secure chat protocol cipher encrypt encryption SKE private channel conferencing" />
47  <meta content="INDEX, FOLLOW" name="ROBOTS" />
48  <title> SILC Secure Internet Live Conferencing - 
49 <?php
50
51   // sites
52   if ($Country_Code != "")
53     $WWW_Site = $Country_Code.".silcnet.org";
54   else
55     $WWW_Site = "silcnet.org";
56
57   if ($Country_Code != "" && StrToLower($FTP_Archive) == "yes")
58     $FTP_Site = "ftp.".$Country_Code.".silcnet.org";
59   else
60     $FTP_Site = "ftp.silcnet.org";
61
62   if ($Country_Code != "" && StrToLower($CVS_Archive) == "yes"
63                           && $CVS_User && $CVS_Root)
64     $CVS_Site = "cvs.".$Country_Code.".silcnet.org";
65   else {
66     $CVS_Site = "cvs.silcnet.org";
67     $CVS_User = "cvs";
68     $CVS_Root = "/cvs/silc";
69   }
70
71   // find out release dates from release archive files
72   $Date_Toolkit = date("l dS of F Y H:i:s",
73                   filemtime("download/silc-toolkit-".$Latest_Toolkit.".tar.gz"));
74   $Date_Client  = date("l dS of F Y H:i:s",
75                   filemtime("download/silc-client-".$Latest_Client.".tar.gz"));
76   $Date_Server  = date("l dS of F Y H:i:s",
77                   filemtime("download/silc-server-".$Latest_Server.".tar.gz"));
78
79   // remove possibly dangerous characters, only alphanumerical characters are passed
80   function Filter($input) {
81     return EReg_Replace("([^a-zA-Z0-9])*", "", $input);
82   }
83
84   // div();
85   function div($a,$b) {
86     return (int) ($a/$b);
87   }
88
89   $pass = 0;
90   if (Is_Readable("html/".Filter($page).".php")) {
91     echo $page;
92     $pass = 1;
93   }
94   else
95     echo "news";
96 ?>
97  </title>
98  <link href="silc.css" rel="stylesheet" type="text/css" />
99 </head>
100 <body>
101
102 <table width="100%" cellpadding="0" cellspacing ="0" border="0">
103 <tr><td align="center">
104
105 <table width="700" cellpadding="1" cellspacing="0" border="0">
106  <tr>
107   <td class="black">
108     <table width="100%" cellpadding="0" cellspacing="0" border="0">
109      <tr>
110       <td class="white">
111         <img src="img/silc.gif" width="700" height="100" alt=" " />
112       </td>
113      </tr>
114      <tr>
115       <td class="white" align="center">
116         <table cellspacing="3" cellpadding="10" border="0">
117         <tr><td valign="top" class="white">
118         <b>General</b><br />
119         <small class="black">o</small> <a href="?page=news" class="normal">SILC News</a><br />
120         <small class="black">o</small> <a href="?page=about" class="normal">About the SILC</a><br />
121         <small class="black">o</small> <a href="?page=history" class="normal">History of SILC</a><br />
122         <small class="black">o</small> <a href="?page=contribute" class="normal">Contributing</a><br />
123         <small class="black">o</small> <a href="?page=lists" class="normal">SILC Mailing Lists</a><br />
124         </td><td valign="top" class="white">
125         <b>Documentation</b><br />
126         <small class="black">o</small> <a href="?page=docs" class="normal">SILC Documentation</a><br />
127         <small class="black">o</small> <a href="?page=whitepaper" class="normal">SILC White Paper</a><br />
128         <small class="black">o</small> <a href="?page=faq" class="normal">SILC FAQ</a><br />
129         <small class="black">o</small> <a href="?page=features" class="normal">SILC Features</a><br />
130         <small class="black">o</small> <a href="?page=todo" class="normal">TODO List</a><br />
131         </td><td valign="top" class="white">
132         <b>Software</b><br />
133         <small class="black">o</small> <a href="?page=download" class="normal">Download SILC</a><br />
134         <small class="black">o</small> <a href="?page=mirrors" class="normal">Mirrors Worldwide</a><br />
135         <small class="black">o</small> <a href="?page=cvs" class="normal">Anonymous CVS Access</a><br />
136         <small class="black">o</small> <a href="txt/changes.txt" class="normal">ChangeLog</a><br />
137         <small class="black">o</small> <a href="?page=copying" class="normal">The General Public License (GPL)</a><br />
138         </td></tr></table>
139       </td>
140      </tr>
141      <tr><td class="blackline"></td></tr>
142      <tr>
143       <td class="<?php if($pass == 1 && $page == "whitepaper") $color="whitetext"; else $color="greytext"; echo $color; ?>">
144         <table width="100%" cellpadding="10" cellspacing="0" border="0">
145         <tr><td class="<?php echo $color; ?>">
146 <?php
147   // read document, if it is not valid then read opening page
148   if ($pass == 1)
149     include("html/".Filter($page).".php");
150   else
151     include("html/news.php");
152 ?>
153           </td>
154          </tr>
155 <?php
156
157   if ($OS_Type) {
158     switch(StrToLower($OS_Type)) {
159       case "bsd":   $img = "daemon.gif";
160                     $alt = "( daemon powered - IMAGE )";
161                     break;
162       case "linux": $img = "penguin.gif";
163                     $alt = "( penguin powered - IMAGE )";
164                     break;
165     }
166     echo "<tr>";
167     echo "<td align=\"right\" valign=\"bottom\">";
168     echo "&nbsp;<br />";
169     echo "<img src=\"img/".$img."\" alt=\"".$alt."\" />";
170     echo "</td>";
171     echo "</tr>";
172   }
173 ?>
174         </table>
175       </td>
176      </tr>
177     </table>
178   </td>
179  </tr>
180 </table>
181 <small class="blue">
182 webpage by
183 <a href="mailto:salo at silcnet.org" class="small">salo at silcnet.org</a> | 
184 <?php
185   // insert counter
186   include("html/counter.php");
187 ?> | W3C 
188 <a href="http://validator.w3.org/check/referer" class="small">XHTML</a> and 
189 <a href="http://jigsaw.w3.org/css-validator/check/referer" class="small">CSS</a>
190 </small>
191 <br /><br />
192
193 </td></tr></table>
194
195 </body>
196 </html>