Wed Feb 28 13:13:50 PST 2007
- Previous message: [Slony1-commit] slony1-www style.css
- Next message: [Slony1-commit] slony1-www/content news.txt
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Update of /home/cvsd/slony1/slony1-www
In directory main:/tmp/cvs-serv3404
Modified Files:
index.php
Log Message:
Add download area. My birthday present to Slony ;)
Index: index.php
===================================================================
RCS file: /home/cvsd/slony1/slony1-www/index.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** index.php 20 Feb 2007 12:45:52 -0000 1.7
--- index.php 28 Feb 2007 21:13:48 -0000 1.8
***************
*** 3,7 ****
$target=$_GET["target"];
- //var_dump($target); //debug
switch($target){
--- 3,6 ----
***************
*** 19,22 ****
--- 18,77 ----
echo layout_defaultblock($title,$link,$text);
break;
+ case 'download':
+ $version = "";
+ if ($_GET["version"] == "1.0") $version = "1.0";
+ if ($_GET["version"] == "1.1") $version = "1.1";
+ if ($_GET["version"] == "1.2") $version = "1.2";
+ if ($version == ""){
+ $path = './downloads/';
+ } else {
+ $path = './downloads/'.$version.'/';
+ $sums = @file_get_contents($path.'MD5SUMS');
+ }
+
+ if ($dh = opendir($path)) {
+ $files = array();
+ $mysums = array();
+ while (($file = readdir($dh)) !== false) {
+ if (($version == "") && ($file != ".") && ($file != "..")){
+ array_push($files, $file);
+ } else if ((substr($file, strlen($file) - 4) == '.bz2') ||
+ (substr($file, strlen($file) - 4) == '.rpm')) {
+ array_push($files, $file);
+ $pos = 0;
+ $pos = strpos($sums,$file);
+ if ($pos > 0)
+ array_push($mysums,substr($sums,$pos-34,32));
+ }
+ }
+ closedir($dh);
+ }
+
+ // Sort the files and display
+ //sort($files);
+ echo layout_header();
+ $text = "";
+ if ($version == "") {
+ $text .= "<h1>Please select a Slony version</h1>";
+ $text .= "<table>\n";
+ } else {
+ $text .= "<h1>Slony $version files</h1>";
+ $text .= "<table>\n<tr><td>File</td><td>Type</td><td>MD5SUM</td></tr>\n";
+ }
+ $c = 0;
+ foreach ($files as $file) {
+ $title = $file;
+ $type = "";
+ if (strpos($file,'tar.bz2')>0) $type="Slony tarball";
+ if ((strpos($file,'doc')>0) && ((strpos($file,'tar.bz2')>0))) $type="Documentation";
+ if (strpos($file,'.rpm')>0) $type="Slony RPM";
+
+ $text .= "<tr><td><a href=\"$file\" title=\"$title\">$title</a></td><td>$type</td><td>$mysums[$c]</td></tr>\n";
+ $c++;
+ }
+ $text .= "</table>\n";
+ echo layout_defaultblock('Slony downloads',"/downloads/",$text);
+
+ break;
case 'cvs':
echo layout_header();
- Previous message: [Slony1-commit] slony1-www style.css
- Next message: [Slony1-commit] slony1-www/content news.txt
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list