CVS update: /cowiki/dist/

[email protected] 3 Sep 2005 19:52:50 -0000
Newsgroups gmane.comp.php.cowiki.cvs
Message-ID <[email protected]>
User: dgorski 
Date: 2005/09/03 12:52:50

Modified:
   cowiki/dist/index.php

Log:
 Display "interim" (backported) versions

File Changes:

Directory: /cowiki/dist/
========================

File [changed]: index.php
Url: http://cowiki.tigris.org/source/browse/cowiki/dist/index.php?r1=1.7&r2=1.8
Delta lines:  +148 -118
-----------------------
--- index.php	1 May 2005 01:47:16 -0000	1.7
+++ index.php	3 Sep 2005 19:52:48 -0000	1.8
@@ -2,7 +2,7 @@
 
 /**
  *
- * $Id: index.php,v 1.7 2005/05/01 01:47:16 dgorski Exp $
+ * $Id: index.php,v 1.8 2005/09/03 19:52:48 dgorski Exp $
  *
  * This file is part of coWiki. coWiki is free software under the terms of
  * the GNU General Public License (GPL). Read the LICENSE file. If you did
@@ -16,7 +16,7 @@
  * @author      Daniel T. Gorski, <[email protected]>
  * @copyright   (C) Daniel T. Gorski, {@link http://www.develnet.org}
  * @license     http://www.gnu.org/licenses/gpl.html
- * @version     $Revision: 1.7 $
+ * @version     $Revision: 1.8 $
  *
  */
 
@@ -41,44 +41,34 @@
   <meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
 
   <style media="screen" type="text/css">
-  
     body {
       font-family: Arial, Helvetica, sans-serif;
       font-size: 15px;
-      margin:3% 5% 3% 5%;
-    }
-  
-    td, h1 {
-      font-size: 16px;
+      margin:3%;
     }
   
-    a {
-      color: #0000DD;
-    }
+    h1  { font-size: 22px;  }
+    h2  { font-size: 18px;  }
   
-    a:visited {
-      color: #999999;
-    }
+    td  { font-size: 15px;  }
+    a   { color: #0000DD; }
+    a:visited { color: #999; }
   
     hr {
+      color: #CCC;
       width: 100%;
       height: 1px;
-      background-color: #CCCCCC;
+      background-color: #CCC;
       border-width: 0px;
-      margin: 15px 0px 15px 0px;
-    }
-  
-    .mono {
-      font-family: Courier New, Courier, monospace;
     }
   
+    .mono { font-family: Courier New, Courier, monospace; }
   </style>
 </head>
 
 <body>
 
 <table cellpadding="0" cellspacing="0" border="0">
-
   <tr>
     <td style="border-width:1px; border-style:solid; border-color:#BBBBBB;
       background-color:#EEEEEE"><a target="_blank"
@@ -89,72 +79,75 @@
       <h1>Snapshots and nightly builds repository</h1>
     </td>
   </tr>
+</table>
 
-  <tr>
-    <td colspan="3">&nbsp;</td>
-  </tr>
+<p/>
 
-  <tr>
-    <td colspan="3" style="font-size:16px">
+<p>
       For more information about the coWiki web collaboration software
-      project - or the latest stable version
-      - please visit its home at <a
+  project - or the latest stable version - please visit its home at <a
       target="_blank" href="http://www.cowiki.org/">www.cowiki.org</a>.
       <i>Warning:</i> The listed files are (maybe unstable) CVS snapshots.
       Do not whine if they do not work properly for you or if they do
       not match your expectation. The current
       <a target="_blank" href="http://cowiki.tigris.org/source/browse/cowiki/ChangeLog?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup">ChangeLog</a>
       may differ from the latest snapshot due to a time shift.
-    </td>
-  </tr>
+</p>
 
-</table>
+<p>
+  <br/>
+  <b>If you don't know which to take, take the freshest <i>interim</i>
+  snapshot!</b>
+</p>
 
-<hr />
-
-<blockquote>
-  <table cellpadding="0" cellspacing="0" border="0">
+<hr/>
 
+<table cellpadding="0" cellspacing="0" border="0">
+  <tr>
+    <td valign="top">
+      <table cellpadding="0" cellspacing="2" border="0">
 <?php
 
-    // --------------------------------------------------------------------
+    $aData = getFileData('interim');
 
-    $sDir = dirname(realpath(__FILE__)) . '/';
-    $rDir = @opendir($sDir);
+    // Sort entries by mtime
+    $aSortBy = array();
+    foreach($aData as $v) {
+        $aSortBy[] = $v['mtime'];
+    }
+    array_multisort($aSortBy, SORT_DESC, $aData);
 
-    $aData = array();
-    while ($sFileName = @readdir($rDir)) {
+    // --------------------------------------------------------------------
 
-        if ($sFileName == '.' || $sFileName == '..') {
-            continue;
-        }
+    renderRow(
+        $aData,
+        0,
+        1,
+        '<b>Freshest <i>interim</i></b> (latest snapshot)'
+        .' &nbsp; '.$aData[0]['ksize']. '&nbsp;KB'
+    );
 
-        if (substr($sFileName, 0, 6) != 'cowiki') {
-            continue;
-        }
+    renderRow(
+        $aData,
+        1,
+        sizeof($aData) < 7 ? sizeof($aData) : 7,
+        '<br />Withered <i>interim</i> (older)'
+    );
 
-        if (substr($sFileName, -2) != 'gz') {
-            continue;
-        }
+?>
+      </table>
+    </td>
 
-        $sName      = $sFileName;
-        $sFullPath  = $sDir . $sName;
-        $nCtime     = filemtime($sFullPath);
-        $sDate      = strftime('%d. %b %y, %H:%M', $nCtime);
-        $sSize      = number_format(filesize($sFullPath), 0, '.', '.');
-        $sKsize     = number_format(filesize($sFullPath) / 1024 , 0, '.', '.');
+    <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
+    <td bgcolor="#CCCCCC"><img src="http://www.cowiki.org/img/0.gif"
+        width="1" height="1" alt="" border="0"></td>
+    <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
 
-        $aData[] = array(
-                      'name'  => $sName,
-                      'full'  => $FullsName,
-                      'mtime' => $nCtime,
-                      'date'  => $sDate,
-                      'size'  => $sSize,
-                      'ksize' => $sKsize
-                   );
-    }
+    <td valign="top">
+      <table cellpadding="0" cellspacing="2" border="0">
+<?php
 
-    // --------------------------------------------------------------------
+    $aData = getFileData('dev');
 
     // Sort entries by mtime
     $aSortBy = array();
@@ -169,29 +162,37 @@
         $aData,
         0,
         1,
-        '<b>Freshest</b> &nbsp; (latest snapshot)'
+        'Freshest <i>dev</i> (latest snapshot) '
+        .' &nbsp; '.$aData[0]['ksize']. '&nbsp;KB'
     );
 
     renderRow(
         $aData,
         1,
-        sizeof($aData),
-        '<br /><b>Withered</b> &nbsp; (older)'
+        sizeof($aData) < 7 ? sizeof($aData) : 7,
+        '<br />Withered <i>dev</i> (older)'
     );
 
-    // --------------------------------------------------------------------
-
 ?>
-
   </table>
-</blockquote>
+    </td>
+  </tr>
 
-<hr />
+</table>
 
-<table cellpadding="0" cellspacing="0" border="0">
-  <tr>
-    <td style="font-size:16px">
+<hr/>
+<br/>
+
+<h2>Differences between <i>interim</i> and <i>dev</i> versions:</h2>
+
+<p>
+  Please refer to the description about nightly builds on
+  <a target="_blank" href="http://cowiki.org/11.html">www.cowiki.org</a>.
+</p>
+
+<h2>Problems?</h2>
 
+<p>
       If you encounter problems with the latest snapshot, please try an
       older one (withered), and report your problem on the
 
@@ -203,21 +204,57 @@
 
       Please read the <a target="_blank" href="http://www.cowiki.org/16.html">
       bug reporting policy</a> first.
-
       <br /><br />
 
       Thank you for your interest and your efforts ...
-      COPYRIGHT &copy; The coWiki Project, ALL RIGHTS RESERVED
+</p>
 
-    </td>
-  </tr>
-</table>
+<center>
+  <br /><br />
+  COPYRIGHT &copy; The coWiki Project, ALL RIGHTS RESERVED.
+</center>
 
 </body>
 </html>
 
 <?php
 
+    function getFileData($sFilter) {
+        $sDir = dirname(realpath(__FILE__)) . '/';
+        $rDir = @opendir($sDir);
+    
+        $aData = array();
+        while ($sFileName = @readdir($rDir)) {
+    
+            if ($sFileName == '.'
+                || $sFileName == '..'
+                || substr($sFileName, 0, 6) != 'cowiki'
+                || substr($sFileName, -2) != 'gz'
+                || !preg_match('/'.$sFilter.'/', $sFileName)) {
+                continue;
+            }
+    
+            $sName      = $sFileName;
+            $sFullPath  = $sDir . $sName;
+            $nMtime     = filemtime($sFullPath);
+            $sDate      = strftime('%d. %b %Y', $nMtime);
+            $sSize      = number_format(filesize($sFullPath), 0, '.', '.');
+            $sKsize     = number_format(
+                              filesize($sFullPath) / 1024 , 0, '.', '.'
+                          );
+    
+            $aData[] = array(
+                          'name'  => $sName,
+                          'mtime' => $nMtime,
+                          'date'  => $sDate,
+                          'size'  => $sSize,
+                          'ksize' => $sKsize
+                       );
+        }
+
+        return $aData;
+    }
+    
     // --------------------------------------------------------------------
 
     /**
@@ -238,7 +275,7 @@
         }
 
         echo '<tr>';
-        echo    '<td colspan="6" nowrap>';
+        echo    '<td colspan="3" nowrap>';
         echo       $sStr;
         echo    '</td>';
         echo '</tr>';
@@ -247,24 +284,17 @@
 
             echo '<tr>';
             echo    '<td>&nbsp;&nbsp;&nbsp;</td>';
+            
+            echo    '<td nowrap>';
+            echo      $aData[$i]['date'] . '&nbsp;&nbsp;';
+            echo    '</td>';
+                        
             echo    '<td class="mono" nowrap>';
             echo      '<a href="'.$aData[$i]['name'].'">';
             echo        $aData[$i]['name'];
             echo      '</a';
             echo    '</td>';
 
-            echo    '<td>&nbsp;&nbsp;</td>';
-
-            echo    '<td class="mono" nowrap>';
-            echo      '('.$aData[$i]['ksize'] . ' KB)';
-            echo    '</td>';
-
-            echo    '<td>&nbsp;&nbsp;&nbsp;</td>';
-
-            echo    '<td nowrap>';
-            echo      $aData[$i]['date'];
-            echo    '</td>';
-
             echo '</tr>';
         }
     }