]> git.pld-linux.org Git - projects/buildlogs.git/blobdiff - obsolete/buildlogs/index.php
- fixed few undefined variables
[projects/buildlogs.git] / obsolete / buildlogs / index.php
index a715e06500ca6fee41846ac4c94b8a001b6581ef..655180d7f159ae072770fdff7c268779e5fdb47d 100644 (file)
 <?php
-$buildlogs_server = "buildlogs.pld.org.pl";
+$buildlogs_server = "buildlogs.pld-linux.org";
 $url = "index.php";
 $addr = array(
-       "/nest/i386",
-       "/nest/i586",
-       "/nest/i686",
-       "/nest/ppc",
+       "/ac/i386",
+       "/ac/i586",
+       "/ac/i686",
+       "/ac/athlon",
+       "/ac/alpha",    
+       "/ac/sparc",
+       "/ac/ppc",
        "/ra/i386",
        "/ra/i586",
        "/ra/i686",
-       "/ra/alpha",
+       "/ra/alpha",    
        "/ra/sparc",
-       "/ra/ppc"
+       "/ra/ppc",
+       "/nest/i386",
+       "/nest/i586",
+       "/nest/i686",
+       "/nest/athlon",
+       "/nest/ppc"
 );
-$qa_base = "http://ftp.pld.org.pl/.stat/builder";
+$qa_base = "http://ftp.pld-linux.org/.stat/builder";
 $qa_addr = array(
-       "/kenny/rpmqa-nest-i386.txt",
-       "/kenny/rpmqa-nest-i586.txt",
-       "/kenny/rpmqa-nest-i686.txt",
+       "/ep/rpmqa-ac-i386.txt",
+       "/ep/rpmqa-ac-i386.txt",
+       "/ep/rpmqa-ac-i386.txt",
+       "",
+       "/alpha/rpmqa-ac-alpha.txt",    
+       "/newboss/rpmqa-ac-sparc.txt",
        "",
        "/ep/rpmqa-ra-i386.txt",
        "/ep/rpmqa-ra-i586.txt",
        "/ep/rpmqa-ra-i686.txt",
-       "/mifgate/rpmqa-ra-alpha.txt",
+       "/mifgate/rpmqa-ra-alpha.txt",  
+       "/team/rpmqa-ra-sparc.txt",
+       "",
+       "/kenny/rpmqa-nest-i386.txt",
+       "/kenny/rpmqa-nest-i586.txt",
+       "/kenny/rpmqa-nest-i686.txt",
        "",
        ""
 );
 $local = 1; /* $local=0 for FTP */ 
-$root_directory = "/home/services/ftp/pub/logs";
+$root_directory = "/home/services/ftp/pub/pld-buildlogs";
+$ftp_conn = 0;
 /* It should be set */
 
+$langs["en_US"]["charset"]="ISO-8859-1";
+$langs["pl_PL"]["charset"]="ISO-8859-2";
+
+$lang="en_US";
+if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"]))
+{
+  $rows=explode(";",$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
+  $rows=explode(",",$rows[0]);
+  $lang_detected=rtrim($rows[0]);
+} else if (preg_match("/opera/i",$_SERVER["HTTP_USER_AGENT"]))
+{
+  $lang_detected=preg_replace("/.*\[(.*)\].*/i","\\1",$_SERVER["HTTP_USER_AGENT"]);
+}
+
+// FIXME - some array
+$lang_detected=preg_replace("/^pl$/i","pl_PL",$lang_detected);
+
+if (isset($lang_detected) && isset($langs[$lang_detected]))
+{
+  $lang=$lang_detected;
+}
+
+if (isset($_GET["lang"]))$_SESSION["lang"]=$_GET["lang"];
+if (isset($_SESSION["lang"]))$lang=$_SESSION["lang"];
+
+putenv("LANG=$lang");
+setlocale(LC_ALL,$lang);
+bindtextdomain("messages","locale");
+textdomain("messages");
+
+if (isset($_GET["idx"]))$idx=$_GET["idx"];
+if (isset($_GET["ok"]))$ok=$_GET["ok"];
+else $ok="";
+if (isset($_GET["ns"]))$ns=$_GET["ns"];
+else $ns="";
+if (isset($_GET["cnt"]))$cnt=$_GET["cnt"];
+if (isset($_GET["action"]))$action=$_GET["action"];
+else $action="";
+if (isset($_GET["off"]))$off=$_GET["off"];
+if (isset($_GET["id"]))$id=$_GET["id"];
+
+if (isset($_POST["str"]))$str=$_POST["str"];
+if (isset($_POST["idx"]))$idx=$_POST["idx"];
+if (isset($_POST["action"]))$action=$_POST["action"];
 
 function myheader()
 {
+echo '<' . '?xml version="1.0" encoding="' . _("ISO-8859-1") .'"?' . ">\n";
+echo '<' . '?xml-stylesheet href="#internalStyle" type="text/css"?' . ">\n";
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <title>PLD Build Logs</title>
-  <style TYPE="text/css"><!--
+  <?php echo '<meta http-equiv="Content-type" content="text/html; charset=' . _("ISO-8859-1") .'"/>' ."\n";?>
+  <style type="text/css"><!--
 A { text-decoration: none; }
 A:hover { text-decoration: underline; }
 H1 { font-family: arial,helvetica,sans-serif; 
@@ -65,7 +129,7 @@ TH { font-family: arial,helvetica,sans-serif;
 
 function start_pre()
 {
-       echo "<table cellpadding=10><tr><td bgcolor=\"#000000\">".
+       echo "<table cellpadding=\"10\"><tr><td bgcolor=\"#000000\">".
                "<font color=\"#cccccc\"><pre>";
 }
 
@@ -85,88 +149,94 @@ function mydie($msg)
        echo "Fatal error: $msg";
 }
 
-function open_ftp()
+function open_ftp($pidx="", $pok="")
 {
        global $idx, $addr, $buildlogs_server, $ok;
        global $ftp_conn, $big_url, $url, $ns;
        global $off, $cnt;
        
-       if (!isset($idx) || !isset($addr[$idx]))
+       if ($pidx==="")$pidx=$idx;
+       if ($pok==="")$pok=$ok;
+
+       if (!isset($pidx) || !isset($addr[$pidx]))
                return false;
-       
-       if ($ok != 1)
-               $ok = 0;
+
+       if ($pok != 1)
+               $pok = 0;
        if ($ns != 1)
                $ns = 0;
-               
-       if ($ok == 1) {
-               $a = "$addr[$idx]/OK";
+
+       if ($pok == 1) {
+               $a = "$addr[$pidx]/OK";
        } else {
-               $a = "$addr[$idx]/FAIL";
+               $a = "$addr[$pidx]/FAIL";
        }
-       
+
        if (!isset($off))
                $off = 0;
        if (!isset($cnt))
                $cnt = 16;
-               
-       $big_url = "$url?idx=$idx&ok=$ok&ns=$ns";
-       
+
+       $big_url = "$url?idx=$idx&amp;ok=$ok&amp;ns=$ns&amp;cnt=$cnt";
+
        $ftp = ftp_connect($buildlogs_server);
-       
+
        if ($ftp == false) {
-               mydie("cannot connect to $buildlogs_server");
+               mydie(_("cannot connect to")." $buildlogs_server");
                return false;
        }
 
        if (ftp_login($ftp, "anonymous", 
                      "buildlogs-iface@pld-linux.org") == false) {
                ftp_quit($ftp);
-               mydie("cannot ftp login to $buildlogs_server");
+               mydie(_("cannot ftp login to")." $buildlogs_server");
                return false;
        }
 
        $list = ftp_nlist($ftp, $a);
        if ($list == false) {
                ftp_quit($ftp);
-               mydie("cannot list $a");
+               mydie(_("cannot list")." $a");
                return false;
        }
 
        $ftp_conn = $ftp;
-       
+
        return $list;
 }
 
-function directory_list()
+function directory_list($pidx="",$pok="")
 {
        global $idx, $addr, $buildlogs_server, $ok;
        global $root_directory, $big_url, $url, $ns;
        global $off, $cnt;
-       
-       if (!isset($idx) || !isset($addr[$idx]))
+
+       if ($pidx==="")$pidx=$idx;
+       if ($pok==="")$pok=$ok;
+       if (!isset($pidx) || !isset($addr[$pidx]))
                return false;
-       
-       if ($ok != 1)
-               $ok = 0;
+
+       if ($pok != 1)
+               $pok = 0;
        if ($ns != 1)
                $ns = 0;
-               
-       if ($ok == 1) {
-               $a = "$addr[$idx]/OK";
+
+       if ($pok == 1) {
+               $a = "$addr[$pidx]/OK";
        } else {
-               $a = "$addr[$idx]/FAIL";
+               $a = "$addr[$pidx]/FAIL";
        }
-       
+
        if (!isset($off))
                $off = 0;
        if (!isset($cnt))
                $cnt = 16;
-               
-       $big_url = "$url?idx=$idx&ok=$ok&ns=$ns";
-       
+
+       $big_url = "$url?idx=$idx&amp;ok=$ok&amp;ns=$ns&amp;cnt=$cnt";
+
        $dir = opendir("$root_directory$a");
        $i = 0;
+       $list = array ();
        while ($file = readdir($dir)) {
                if (($file != ".") && ($file != "..")) {
                        $list[$i] = "$a/$file";
@@ -180,44 +250,49 @@ function directory_list()
 function list_logs()
 {
        global $idx, $addr, $ok;
-       global $ftp_conn, $big_url, $ns;
-       global $off, $cnt;
-
-       $list = open_ftp();
+       global $ftp_conn, $big_url, $ns, $qa_addr;
+       global $off, $cnt, $local, $root_directory;
 
+       if ($local) {
+               $list = directory_list();
+       } else {
+               $list = open_ftp();
+       }
        if ($list == false)
                return;
-       
+
        if ($ok == 1) {
-               echo "<h1>Listing of $addr[$idx]/OK "
-                       ."(<a href=\"$big_url&ok=0\">fail</a>)</h1>";
+               echo "<h1>"._("Listing of")." $addr[$idx]/OK "
+                       ."(<a href=\"$big_url&amp;ok=0\">"._("fail")."</a>)</h1>\n";
        } else {
-               echo "<h1>Listing of $addr[$idx]/FAIL "
-                       ."(<a href=\"$big_url&ok=1\">ok</a>)</h1>";
+               echo "<h1>"._("Listing of")." $addr[$idx]/FAIL "
+                       ."(<a href=\"$big_url&amp;ok=1\">"._("ok")."</a>)</h1>\n";
        }
-       
-       echo "<div align=center><table border=0 cellspacing=1 ".
-               "cellpadding=3 bgcolor=#000000 width=90%>\n";
-       echo "<tr><th bgcolor=#CCCCFF align=left width=60%>Log File ".
-                       "[<a href=\"$big_url&ns=1\">sort</a>]</th>".
-                "<th bgcolor=#CCCCFF align=right width=15%>Size</th> ".
-                "<th bgcolor=#CCCCFF align=left>Age ".
-                        "[<a href=\"$big_url&ns=0\">sort</a>]</th>".
-                "</th></tr>";
-       
-       function cmp($f1, $f2) {
-               global $ftp_conn;
 
+       echo "<div align=\"center\"><table cols=\"4\" border=\"0\" cellspacing=\"1\" ".
+               "cellpadding=\"3\" bgcolor=\"#000000\" width=\"90%\">\n";
+       echo "<tr><th bgcolor=\"#CCCCFF\" align=\"right\" width=\"1%\">"._("No.")."</th>".
+                "<th bgcolor=\"#CCCCFF\" align=\"left\" width=\"80%\">"._("Log File").
+                       "[<a href=\"$big_url&amp;ns=1\">"._("sort")."</a>]</th>".
+                "<th bgcolor=\"#CCCCFF\" align=\"right\" width=\"15%\">"._("Size")."</th> ".
+                "<th bgcolor=\"#CCCCFF\" align=\"left\">"._("Age").
+                        "[<a href=\"$big_url&amp;ns=0\">"._("sort")."</a>]</th>".
+                "</tr>";
+
+       function cmp($f1, $f2) {
+               global $ftp_conn, $root_directory, $local;
+               if ($local)
+                       return filemtime("$root_directory$f2") - filemtime("$root_directory$f1");
                return ftp_mdtm($ftp_conn, $f2) - ftp_mdtm($ftp_conn, $f1);
        }
 
        if ($ns != 1) {
                $ns = 0;
-               usort($list, cmp);
+               usort($list, "cmp");
        } else {
                sort($list);
        }
-       
+
        $now = time();
        for ($i = $off; $i < $cnt + $off; $i++) {
                if (!isset($list[$i]))
@@ -225,212 +300,93 @@ function list_logs()
                $h = bin2hex(mhash(MHASH_MD5, $list[$i]));
                $f = preg_replace("/.*\/([^\/]*)$/", "\\1", $list[$i]);
                $f = preg_replace("/\.(bz2|gz)$/", "", $f);
-               $s = ftp_size($ftp_conn, $list[$i]);
-               $t = $now - ftp_mdtm($ftp_conn, $list[$i]);
+               if ($local) {
+                       $s = filesize("$root_directory$list[$i]");
+                       $t = $now - filemtime("$root_directory$list[$i]");
+               } else {
+                       $s = ftp_size($ftp_conn, $list[$i]);
+                       $t = $now - ftp_mdtm($ftp_conn, $list[$i]);
+               }
                $t /= 60;
                if ($t >= 60) {
                        $t /= 60;
                        if ($t >= 24) {
                                $t /= 24;
-                               $t = round($t) . " days";
+                               $t = round($t);
+                               $t = $t . "&nbsp;" . ngettext("day","days",$t);
                        } else {
-                               $t = round($t) . " hour";
+                               $t = round($t);
+                               $t = $t . "&nbsp;" . ngettext("hour","hours",$t);
                        }
                } else {
-                       $t = round($t) . " minutes";
+                       $t = round($t);
+                       $t = $t . "&nbsp;" . ngettext("minute","minutes",$t);
                }
-               $u = "$big_url&cnt=$cnt&off=$off&id=$h";
-               echo "<tr><td bgcolor=#CCCCCC><a ".
-                       "href=\"$u\">".
-                    "$f</a> ".
-                    "[<a href=\"$u&action=text\">text</a> | ".
-                     "<a href=\"$u&action=tail\">tail</a>]".
-                    "</td><td bgcolor=#CCCCCC align=right>".
-                    "$s</td><td bgcolor=#CCCCCC>$t</td></tr>\n";
+               $u = "$big_url&amp;off=$off&amp;id=$h";
+               echo "<tr><td bgcolor=\"#CCCCCC\" align=\"right\">".($i+1).".</td>".
+                    "<td bgcolor=\"#CCCCCC\"><a href=\"$u\">$f</a> ".
+                    "[<a href=\"$u&amp;action=text\">"._("text")."</a> | ".
+                     "<a href=\"$u&amp;action=tail\">"._("tail")."</a>]".
+                    "</td><td bgcolor=\"#CCCCCC\" align=\"right\">".
+                    "$s</td><td bgcolor=\"#CCCCCC\">$t</td></tr>\n";
        }
        echo "</table></div>\n";
 
-       $back = "&lt;&lt;&lt; Page back";
-       $forward = "Page forward &gt;&gt;&gt;";
+       $backarr = "&lt;&lt;&lt;&nbsp;";
+       $back = _("Page back");
+       $forward = _("Page forward");
+       $forwardarr = "&nbsp;&gt;&gt;&gt;";
 
-       echo "<p align=center><table width=90%><tr><td align=left width=25%>";
+       echo "<p><table width=\"90%\" align=\"center\"><tr><td align=\"left\" width=\"1%\">";
 
        if ($off > 0) {
                $noff = $off - $cnt;
                if ($noff < 0)  
                        $noff = 0;
-               echo "<a href=\"$big_url&cnt=$cnt&off=$noff\">$back</a>\n";
-       } else {
-               echo "$back\n";
-       }
-       
-       echo "</td><td width=50% align=center>";
-       
-       echo "[<a href=\"$big_url&action=qa\">View rpm -qa of ".
-               "builder</a>]\n";
-               
-       echo "</td><td align=right width=25%>";
-       if ($off + $cnt < count($list)) {
-               $noff = $off + $cnt;
-               if ($noff < 0)  
-                       $noff = 0;
-               echo "<a href=\"$big_url&cnt=$cnt&off=$noff\">$forward</a>\n";
+               $hrefurl = "<a href=\"$big_url&amp;off=$noff\">";
+               echo "$hrefurl$backarr</a></td><td align=\"left\">$hrefurl$back</a>";
        } else {
-               echo "$forward\n";
+               echo "$backarr</td><td align=\"left\">$back";
        }
-       echo "</td></tr></table></p>";
 
-       ftp_quit($ftp_conn);
-       $ftp_conn = 0;
-}
-
-function local_list_logs()
-{
-       global $idx, $addr, $ok;
-       global $root_directory, $big_url, $ns;
-       global $off, $cnt;
+       echo "</td>\n<td align=\"center\">";
 
-       $list = directory_list();
-
-       if ($list == false)
-               return;
-       
-       if ($ok == 1) {
-               echo "<h1>Listing of $addr[$idx]/OK "
-                       ."(<a href=\"$big_url&ok=0\">fail</a>)</h1>";
-       } else {
-               echo "<h1>Listing of $addr[$idx]/FAIL "
-                       ."(<a href=\"$big_url&ok=1\">ok</a>)</h1>";
-       }
-       
-       echo "<div align=center><table border=0 cellspacing=1 ".
-               "cellpadding=3 bgcolor=#000000 width=90%>\n";
-       echo "<tr><th bgcolor=#CCCCFF align=left width=60%>Log File ".
-                       "[<a href=\"$big_url&ns=1\">sort</a>]</th>".
-                "<th bgcolor=#CCCCFF align=right width=15%>Size</th> ".
-                "<th bgcolor=#CCCCFF align=left>Age ".
-                        "[<a href=\"$big_url&ns=0\">sort</a>]</th>".
-                "</th></tr>";
-       
-       function cmp($f1, $f2) {
-               global $root_directory;
-               
-       return filemtime("$root_directory$f2") - filemtime("$root_directory$f1");
-       }
-
-       if ($ns != 1) {
-               $ns = 0;
-               usort($list, cmp);
+       if ($qa_addr[$idx] != "") {
+               echo "[<a href=\"$big_url&amp;action=qa\">"._("View <quot>rpm&nbsp;-qa</quot> of builder")."</a>]";
        } else {
-               sort($list);
-       }
-       
-       $now = time();
-       for ($i = $off; $i < $cnt + $off; $i++) {
-               if (!isset($list[$i]))
-                       continue;
-               $h = bin2hex(mhash(MHASH_MD5, $list[$i]));
-               $f = preg_replace("/.*\/([^\/]*)$/", "\\1", $list[$i]);
-               $f = preg_replace("/\.(bz2|gz)$/", "", $f);
-               $s = filesize("$root_directory$list[$i]");
-               $t = $now - filemtime("$root_directory$list[$i]");
-               $t /= 60;
-               if ($t >= 60) {
-                       $t /= 60;
-                       if ($t >= 24) {
-                               $t /= 24;
-                               $t = round($t) . " days";
-                       } else {
-                               $t = round($t) . " hour";
-                       }
-               } else {
-                       $t = round($t) . " minutes";
-               }
-               $u = "$big_url&cnt=$cnt&off=$off&id=$h";
-               echo "<tr><td bgcolor=#CCCCCC><a ".
-                       "href=\"$u\">".
-                    "$f</a> ".
-                    "[<a href=\"$u&action=text\">text</a> | ".
-                     "<a href=\"$u&action=tail\">tail</a>]".
-                    "</td><td bgcolor=#CCCCCC align=right>".
-                    "$s</td><td bgcolor=#CCCCCC>$t</td></tr>\n";
+               echo "&nbsp;";
        }
-       echo "</table></div>\n";
-
-       $back = "&lt;&lt;&lt; Page back";
-       $forward = "Page forward &gt;&gt;&gt;";
-
-       echo "<p align=center><table width=90%><tr><td align=left width=25%>";
 
-       if ($off > 0) {
-               $noff = $off - $cnt;
-               if ($noff < 0)  
-                       $noff = 0;
-               echo "<a href=\"$big_url&cnt=$cnt&off=$noff\">$back</a>\n";
-       } else {
-               echo "$back\n";
-       }
-       
-       echo "</td><td width=50% align=center>";
-       
-       echo "[<a href=\"$big_url&action=qa\">View rpm -qa of ".
-               "builder</a>]\n";
-               
-       echo "</td><td align=right width=25%>";
+       echo "</td>\n<td align=right>";
        if ($off + $cnt < count($list)) {
                $noff = $off + $cnt;
                if ($noff < 0)  
                        $noff = 0;
-               echo "<a href=\"$big_url&cnt=$cnt&off=$noff\">$forward</a>\n";
+               $hrefurl = "<a href=\"$big_url&amp;off=$noff\">";
+               echo "$hrefurl$forward</a></td><td align=right width=1%>$hrefurl$forwardarr</a>";
        } else {
-               echo "$forward\n";
+               echo "$forward</td><td align=right width=1%>$forwardarr";
        }
-       echo "</td></tr></table></p>";
-}
-
-function file_name()
-{
-       global $idx, $addr, $ok;
-       global $ftp_conn, $big_url, $ns, $id;
-       global $buildlogs_server;
-
-       if (!isset($id))
-               return false;
-               
-       $list = open_ftp();
-
-       if ($list == false)
-               return false;
-
-       $f = false;
-       for ($i = 0; $i < count($list); $i++) {
-               $h = bin2hex(mhash(MHASH_MD5, $list[$i]));
-               if ($h == $id) {
-                       $f = $list[$i];
-               }
-       }
-
-       if ($f == false) {
-               mydie("cannot find specified file: $id");
+       echo "</td>\n</tr></table></p>";
+       if ($local == 0) {
                ftp_quit($ftp_conn);
-               return false;
+               $ftp_conn = 0;
        }
-
-       return $f;
 }
 
-
-function local_file_name()
+function file_name()
 {
        global $idx, $addr, $ok;
-       global $root_directory, $big_url, $ns, $id;
-       global $buildlogs_server;
+       global $ftp_conn, $root_directory, $big_url, $ns, $id;
+       global $buildlogs_server, $local;
 
        if (!isset($id))
                return false;
-               
-       $list = directory_list();
-
+       if ($local) {
+               $list = directory_list();
+       } else {
+               $list = open_ftp();
+       }
        if ($list == false)
                return false;
 
@@ -443,19 +399,20 @@ function local_file_name()
        }
 
        if ($f == false) {
-               mydie("cannot find specified file: $id");
+               mydie(_("cannot find specified file:")." $id");
+               if ($local == 0)
+                       ftp_quit($ftp_conn);
                return false;
        }
 
        return $f;
 }
 
-
 function dump_log($tail)
 {
        global $idx, $addr, $ok, $url;
-       global $ftp_conn, $big_url, $ns, $id, $cnt, $off;
-       global $buildlogs_server;
+       global $ftp_conn, $root_directory, $big_url, $ns, $id, $cnt, $off;
+       global $buildlogs_server, $local, $qa_addr;
 
        $f = file_name();
 
@@ -464,159 +421,79 @@ function dump_log($tail)
 
        $df = preg_replace("/.*\/([^\/]*)$/", "\\1", $f);
        $df = preg_replace("/\.(bz2|gz)$/", "", $df);
-       
+
        echo "<h1>$df</h1>";
 
-       echo "<table border=0 cellpadding=3 cellspacing=1 bgcolor=#000000>";
+       echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"#000000\">";
 
        function one_item($h, $t) {
-               echo "<tr><td bgcolor=#ccccff>$h:</td>".
-                        "<td bgcolor=#cccccc>$t</td></tr>";
+               echo "<tr><td bgcolor=\"#ccccff\">$h:</td>".
+                        "<td bgcolor=\"#cccccc\">$t</td></tr>";
        }
 
        function href($h, $c) {
                return "<a href=\"$h\">$c</a>";
        }
-       
-       one_item("Status", ($ok == 1 ?  
-                               "<font color=green><b>OK</b></font>" : 
-                               "<font color=red><b>Failed</b></a>"));
-       one_item("Source URL"
+
+       one_item(_("Status"), ($ok == 1 ?  
+                               "<font color=green><b>"._("OK")."</b></font>" : 
+                               "<font color=red><b>"._("Failed")."</b></a>"));
+       one_item(_("Source URL")
                 href("ftp://$buildlogs_server$f", 
                      "ftp://$buildlogs_server$f"));
 
-       $bu = "$big_url&cnt=$cnt&off=$off";
-       
-       one_item("text/plain URL"
-                href("$bu&id=$id&action=text",
-                     "View!"));
+       $bu = "$big_url&amp;off=$off";
+
+       one_item(_("text/plain URL")
+                href("$bu&amp;id=$id&amp;action=text",
+                     _("View!")));
        if ($tail) {
-               one_item("full text"
-                        href("$bu&&id=$id",
+               one_item(_("full text")
+                        href("$bu&amp;id=$id",
                              "View!"));
        }
-       
-       one_item("rpm -qa of builder", href("$bu&action=qa", "View!"));
-       one_item("Date", date("Y/m/d H:i:s", ftp_mdtm($ftp_conn, $f)));
+
+       if ($qa_addr[$idx] != "") {
+               one_item(_("rpm -qa of builder"), href("$bu&amp;action=qa", _("View!")));
+       } else {
+               one_item(_("rpm -qa of builder"), _("Not available"));
+        }
+       if ($local) {
+               one_item("Data", date("Y/m/d H:i:s", filemtime("$root_directory$f")));
+       } else {
+               one_item("Data", date("Y/m/d H:i:s", ftp_mdtm($ftp_conn, $f)));
+       }
        /*
        echo "<tr><td>Here:</td><td>" . 
-               "<a href=\"$url?idx=$idx&ok=$ok&id=$id\">".
+               "<a href=\"$url?idx=$idx&amp;ok=$ok&amp;id=$id\">".
                "http://" . getenv("SERVER_NAME") .
-               getenv("SCRIPT_NAME") . "?idx=$idx&ok=$ok&id=$id</a>" .
+               getenv("SCRIPT_NAME") . "?idx=$idx&amp;ok=$ok&amp;id=$id</a>" .
             "</td></tr>"; */
 
-       echo "</table><h2>Content:</h2>";
-       
-       ftp_quit($ftp_conn);
-       $ftp_conn = 0;
-       
-       
-       # what can I say beside PHP suxx? how the fuck should I create
-       # bidirectional pipe? gotta use wget
-       
-       if (preg_match("/\.bz2$/", $f)) {
-               $filter = "| bzcat 2>&1";
-       } elseif (preg_match("/\.gz$/", $f)) {
-               $filter = "| zcat 2>&1";
-       } else {
-               $filter = "";
-       }
-
-       $cmd = "wget -q -O - ftp://$buildlogs_server$f 2>&1 $filter";
-       if ($tail)
-               $cmd = "$cmd | tail -n 100";
-       $fd = popen($cmd, "r");
-       start_pre();
-       while (($s = fgets($fd, 1000)) != false) {
-               $s = htmlspecialchars($s);
-               echo $s;
-       }
-       end_pre();
-       pclose($fd);
-
-?>
-       <table width=100%>
-        <tr>
-         <td align=left>
-          [<a href="<?php echo $bu; ?>">Back to list of logs</a>]
-         </td>
-         <td align=right>
-          [<a href="<?php echo "$bu&action=qa" 
-               ?>">View rpm -qa of builder</a>]
-         </td>
-        </tr>
-<?php
-
-}
-
-
-function local_dump_log($tail)
-{
-       global $idx, $addr, $ok, $url;
-       global $root_directory, $big_url, $ns, $id, $cnt, $off;
-       global $buildlogs_server;
-
-       $f = local_file_name();
-
-       if ($f == false)
-               return;
-
-       $df = preg_replace("/.*\/([^\/]*)$/", "\\1", $f);
-       $df = preg_replace("/\.(bz2|gz)$/", "", $df);
-       
-       echo "<h1>$df</h1>";
-
-       echo "<table border=0 cellpadding=3 cellspacing=1 bgcolor=#000000>";
+       echo "</table><h2>"._("Content:")."</h2>";
 
-       function one_item($h, $t) {
-               echo "<tr><td bgcolor=#ccccff>$h:</td>".
-                        "<td bgcolor=#cccccc>$t</td></tr>";
-       }
-
-       function href($h, $c) {
-               return "<a href=\"$h\">$c</a>";
+       if ($local == 0) {
+               ftp_quit($ftp_conn);
+               $ftp_conn = 0;
        }
-       
-       one_item("Status", ($ok == 1 ?  
-                               "<font color=green><b>OK</b></font>" : 
-                               "<font color=red><b>Failed</b></a>"));
-       one_item("Source URL", 
-                href("ftp://$buildlogs_server$f", 
-                     "ftp://$buildlogs_server$f"));
 
-       $bu = "$big_url&cnt=$cnt&off=$off";
-       
-       one_item("text/plain URL", 
-                href("$bu&id=$id&action=text",
-                     "View!"));
-       if ($tail) {
-               one_item("full text", 
-                        href("$bu&&id=$id",
-                             "View!"));
-       }
-       
-       one_item("rpm -qa of builder", href("$bu&action=qa", "View!"));
-       one_item("Date", date("Y/m/d H:i:s", filemtime("$root_directory$f")));
-       /*
-       echo "<tr><td>Here:</td><td>" . 
-               "<a href=\"$url?idx=$idx&ok=$ok&id=$id\">".
-               "http://" . getenv("SERVER_NAME") .
-               getenv("SCRIPT_NAME") . "?idx=$idx&ok=$ok&id=$id</a>" .
-            "</td></tr>"; */
 
-       echo "</table><h2>Content:</h2>";
-       
        # what can I say beside PHP suxx? how the fuck should I create
        # bidirectional pipe? gotta use wget
-       
+
        if (preg_match("/\.bz2$/", $f)) {
-               $cmd = "bzcat $root_directory$f";
+               $filter = "bzcat";
        } elseif (preg_match("/\.gz$/", $f)) {
-               $cmd = "zcat $root_directory$f";
+               $filter = "zcat";
        } else {
-               $cmd = "cat $root_directory$f";
+               $filter = "cat";
        }
 
+       if ($local) {
+               $cmd = "$filter $root_directory$f";
+       } else {
+               $cmd = "wget -q -O - ftp://$buildlogs_server$f 2>&1 | $filter 2>&1";
+       }
        if ($tail)
                $cmd = "$cmd | tail -n 100";
        $fd = popen($cmd, "r");
@@ -629,25 +506,26 @@ function local_dump_log($tail)
        pclose($fd);
 
 ?>
-       <table width=100%>
+       <table width="100%">
         <tr>
          <td align=left>
-          [<a href="<?php echo $bu; ?>">Back to list of logs</a>]
+          [<a href="<?php echo $bu; ?>"><?=_("Back to list of logs")?></a>]
          </td>
          <td align=right>
-          [<a href="<?php echo "$bu&action=qa" 
-               ?>">View rpm -qa of builder</a>]
+          [<a href="<?php echo "$bu&amp;action=qa" 
+               ?>"><?=_("View rpm -qa of builder")?></a>]
          </td>
         </tr>
+       </table>
 <?php
 
 }
 
 function dump_text()
 {
-       global $ftp_conn;
-       global $buildlogs_server;
-       
+       global $ftp_conn, $root_directory;
+       global $buildlogs_server, $local;
+
        header("Content-type: text/plain");
 
        $f = file_name();
@@ -656,100 +534,86 @@ function dump_text()
                return;
 
        echo "# src  : ftp://$buildlogs_server$f\n";
-       echo "# date : " .  
-               date("Y/m/d H:i:s", ftp_mdtm($ftp_conn, $f)) . "\n";
-
-       ftp_quit($ftp_conn);
-       $ftp_conn = 0;
-       
-       if (preg_match("/\.bz2$/", $f)) {
-               $filter = "| bzcat 2>&1";
-       } elseif (preg_match("/\.gz$/", $f)) {
-               $filter = "| zcat 2>&1";
+       if ($local) {
+               echo "# date   : " .  
+                       date("Y/m/d H:i:s", filemtime("$root_directory$f")) . "\n";
        } else {
-               $filter = "";
+               echo "# date   : " .  
+                       date("Y/m/d H:i:s", ftp_mdtm($ftp_conn, $f)) . "\n";
+               ftp_quit($ftp_conn);
+               $ftp_conn = 0;
        }
 
-       $cmd = "wget -q -O - ftp://$buildlogs_server$f 2>&1 $filter";
-       $fd = popen($cmd, "r");
-       while (($s = fgets($fd, 1000)) != false) {
-               echo $s;
-       }
-       pclose($fd);
-}
-
-
-function local_dump_text()
-{
-       global $root_directory;
-       global $buildlogs_server;
-       
-       header("Content-type: text/plain");
-
-       $f = local_file_name();
-
-       if ($f == false)
-               return;
-
-       echo "# src  : ftp://$buildlogs_server$f\n";
-       echo "# date : " .  
-               date("Y/m/d H:i:s", filemtime("$root_directory$f")) . "\n";
-
        if (preg_match("/\.bz2$/", $f)) {
-               $cmd = "bzcat";
+               $filter = "bzcat";
        } elseif (preg_match("/\.gz$/", $f)) {
-               $cmd = "zcat";
+               $filter = "zcat";
        } else {
-               $cmd = "cat";
+               $filter = "cat";
        }
 
-       $fd = popen("$cmd $root_directory$f", "r");
+       if ($local) {
+               $cmd = "$filter $root_directory$f";
+       } else {
+               $cmd = "wget -q -O - ftp://$buildlogs_server$f 2>&1 | $filter 2>&1";
+       }
+       $fd = popen($cmd, "r");
        while (($s = fgets($fd, 1000)) != false) {
                echo $s;
        }
        pclose($fd);
 }
 
-
 function list_archs()
 {
-       global $addr, $url, $idx;
+       global $addr, $url, $idx, $cnt,$ok,$ns;
 
-       echo "<table width=100% border=0>\n";
-       echo "<tr><td bgcolor=#cccccc nowrap=1>Failed</td><td bgcolor=#cccccc>Ok</td></tr>\n";
+       if (!isset($cnt))
+               $cnt = 16;
+
+       $big_url = "$url?idx=$idx&amp;ok=$ok&amp;ns=$ns&amp;cnt=$cnt";
+
+       echo "<table width=\"100%\" border=\"0\">\n";
+       echo "<tr><td bgcolor=\"#cccccc\" nowrap=\"nowrap\">"._("Failed")."</td><td bgcolor=\"#cccccc\">"._("Ok")."</td></tr>\n";
        for ($i = 0; $i < count($addr); $i++)
-               echo "<tr><td nowrap=1>".
-                    "<a href=\"$url?idx=$i&ok=0\">$addr[$i]</a></td><td nowrap=1>".
-                    "[<a href=\"$url?idx=$i&ok=1\">OK</a>]</td>".
-                    #"<td>[<a href=\"$url?idx=$i&action=qa\">qa</a>]</td>".
+               echo "<tr><td nowrap=\"nowrap\">".
+                    "<a href=\"$url?idx=$i&amp;ok=0&amp;cnt=$cnt\">$addr[$i]</a></td><td nowrap=\"nowrap\">".
+                    "[<a href=\"$url?idx=$i&amp;ok=1&amp;cnt=$cnt\">OK</a>]</td>".
+                    #"<td>[<a href=\"$url?idx=$i&amp;action=qa\">qa</a>]</td>".
                     "</tr>\n";
        echo "</table><hr />\n";
-       echo "<div align=\"center\"><a href=\"$url\">main()</a><hr />\n";
-       echo "<a href=\"http://www.pld-linux.org/\"><img src=powpld.png ".
-               "alt=\"Powered by PLD Linux\" border=0></a><br />\n" .
+       
+       echo "<div align=\"center\">";
+       echo "<a href=\"$big_url&amp;action=adv_search\">"._("Advanced Search")."</a><br />\n";
+       
+       echo "<a href=\"$url\">main()</a><hr />\n";
+       echo "<a href=\"http://www.pld-linux.org/\"><img src=\"powpld.png\" ".
+               "alt=\""._("Powered by PLD Linux")."\" border=\"0\" /></a><br />\n" .
             "<small>(c) 2002 ".
-            "<a href=\"mailto:feedback@pld.org.pl\">PLD&nbsp;Team</a>\n".
+            "<a href=\"mailto:feedback@pld-linux.org\">PLD&nbsp;Team</a>\n".
             "</small></div>\n";
-       
+
        # smile ;)
-       echo "<div align=center><small>";
+       echo "<div align=\"center\"><small>";
        $pow = array("vim", "php", "brain", "power", "electricity",
-                    "coffee", "ufo", "pinguin", "GNOME", "ELF", "DWARF",
+                    "coffee", "ufo", "penguin", "GNOME", "ELF", "DWARF",
                     "voodoo magic", "Linux", "x-files", "X", "foobar",
                     "/dev/null", "/dev/zero", "/dev/drzewo", 
                     "Leppe'", "matrix", "Neo", "PDP-11",
                     "Ken", "GNU antilope", "PDP-7", "ITS", "Multics",
-                    "foobarbaz", "ed", "Unix conspiracy", 
+                    "foobarbaz", "ed", "Joe", "Unix conspiracy", 
                     "overclock", "The Right Thing",
                     "The Bad Thing", "Star Treck", "NSA", "NASA",
                     "achelon", "VAX", "Real Programmer",
                     "Real Operating System", "Real Computer",
                     "computron", "bogon", "quantum bogodynamics",
                     "BOFH", "/dev/ill", "nasi tu byli",
-                    "Paranoid Android", "Lunatic Corp"
+                    "Paranoid Android", "Lunatic Corp", "Parallel thinking",
+                    "sfistak", "Linus", "The Golden Path", "Dark Side of the Force",
+                    "Przewodniczacego Lepper-a", "KDE", "Microsoft Windows 2003"
                     # feel free to add sth if you change this file ;)
                     );
-       echo "Powered by ";
+       echo _("Powered by")." ";
        $max = 1;
        for ($i = 0; $i < $max; $i++) {
                $x = rand(0, count($pow) - 1);
@@ -757,31 +621,29 @@ function list_archs()
                else echo $pow[$x] . ($i == $max - 1 ? "." : ", ");
                $pow[$x] = "";
        }
-               
        echo "</small></div>";
-       
+
        global $qa_addr;
 
-       if ($qa_addr[$idx] != "") {
+       if (isset($qa_addr[$idx]) && $qa_addr[$idx] != "") {
        echo "<form action=\"index.php\" method=\"post\">";
        echo "<input type=hidden name=idx value=$idx />";
        echo "<input type=hidden name=action value=sqa />";
-       echo "<input type=text size=14 name=str /><br/>";
-       echo "<input type=submit name=submit value=\"Search rpmqa!\" />";
+       echo "<input type=text size=14 name=str /><br />";
+       echo "<input type=submit name=submit value=\""._("Search rpmqa!")."\" />";
        echo "</form>";
        }
-
 }
 
 function get_qa()
 {
        global $idx, $qa_addr, $qa_base;
-       
+
        if (!isset($idx) || !isset($qa_addr[$idx]))
                return false;
 
        $a = $qa_addr[$idx];
-       
+
        if ($qa_addr[$idx] == "")
                return false;
        else
@@ -793,12 +655,12 @@ function search_qa()
        global $url, $idx, $qa_addr, $str;
 
        $f = get_qa();
-       echo "<h1>Search results for '$str' in $qa_addr[$idx]</h1>";
+       echo "<h1>"._("Search results for")." '$str' "._("in")." $qa_addr[$idx]</h1>";
 
        start_pre();
 
        if ($f == 0) {
-               echo "Sorry, cannot open.";
+               echo _("Sorry, cannot open.");
        } else {
                while (($s = fgets($f, 1000)) != false) {
                        if (stristr($s, $str))
@@ -812,45 +674,280 @@ function search_qa()
 function dump_qa($plain)
 {
        global $url, $idx, $qa_addr;
-       
+
        $a = $qa_addr[$idx];
 
        $f = get_qa();
-       
+
        if ($plain) {
                header("Content-type: text/plain"); 
-               echo "# rpm -qa of $a\n";
+               echo _("# rpm -qa of")." $a\n";
        } else {
-               echo "<h1>rpm -qa of $a</h1>";
-               echo "<a href=\"$url?idx=$idx&action=qatxt\">text/plain "
-                       ."version</a>";
+               echo "<h1>"._("rpm -qa of")." $a</h1>";
+               echo "<a href=\"$url?idx=$idx&amp;action=qatxt\">"._("text/plain version")."</a>";
                start_pre();
        }
 
        if ($f == 0) {
-               echo "Sorry, cannot open.";
+               echo _("Sorry, cannot open.");
        } else {
                while (($s = fgets($f, 1000)) != false) {
                        echo $s;
                }
        }
-       
+
        if (!$plain)
                end_pre();
 }
 
+
+function adv_search()
+{
+  global $addr, $url, $local, $_POST, $off, $cnt, $root_directory;
+
+  $big_url = "$url?idx=$idx&amp;ok=$ok&amp;ns=$ns&amp;cnt=$cnt";
+
+  echo "<form action=\"index.php?action=adv_search\" method=\"post\">";
+
+  echo "<div align=\"center\">";
+  echo "<table border=\"0\">\n";
+  echo "<tr>\n";
+  echo "<td>"._("Package name")."</td>\n";
+  echo "<td><input type=\"text\" size=\"20\" name=\"name\" value=\"".$_POST[name]."\"/></td>\n";
+  echo "</tr>\n";
+
+  echo "<tr>\n";
+  echo "<td>"._("Days")."</td>\n";
+  echo "<td>"._("From").": <input type=\"text\" size=\"20\" name=\"age1\" value=\"".$_POST["age1"]."\" /></td>\n";
+  echo "<td>"._("To").": <input type=\"text\" size=\"20\" name=\"age2\" value=\"".$_POST["age2"]."\" /></td>\n";
+  echo "</tr>\n";
+
+  echo "<tr>\n";
+  echo "<td>"._("Size")."</td>\n";
+  echo "<td>"._("From").": <input type=\"text\" size=\"20\" name=\"size1\" value=\"".$_POST["size1"]."\" /></td>\n";
+  echo "<td>"._("To").": <input type=\"text\" size=\"20\" name=\"size2\" value=\"".$_POST["size2"]."\" /></td>\n";
+  echo "</tr>\n";
+
+  echo "<tr>\n";
+  echo "<td>"._("Search logs:")."</td>\n";
+  echo "</tr>\n";
+
+  echo "<tr>\n";
+  echo "<td>"._("Failed")."</td>\n";
+  echo "<td>"._("OK")."</td>\n";
+  echo "</tr>\n";
+
+  for ($i = 0; $i < count($addr); $i++)
+  {
+    echo "<tr>\n";
+    $name="as0_".$i;
+    $check=" checked=\"on\"";
+    echo "<td><input name=$name type=\"checkbox\"$check>".$addr[$i]."</input></td>\n";
+    $name="as1_".$i;
+    $check=" checked=\"on\"";
+    echo "<td><input name=$name type=\"checkbox\"$check>".$addr[$i]."</input></td>\n";
+    echo "</tr>\n";
+  }
+       
+  echo "<tr>\n";
+  echo "<td><input type=submit name=submit value=\""._("Search!")."\" /></td>";
+  echo "</tr>\n";
+
+  echo "</table>\n";
+
+//     if (isset($_POST["name"]) || isset($_POST["age1"]) || isset($_POST["age2"]) ||
+//       isset($_POST["size1"]) || isset($_POST["size2"]))
+  if (($_POST["name"]!="") || ($_POST["age1"]!="") || ($_POST["age2"]!="") ||
+    ($_POST["size1"]!="") || ($_POST["size2"]!=""))
+  {
+    unset($list);
+    $now = time();
+    for ($i = 0; $i < count($addr); $i++)
+    
+      for ($j=0;$j<2;$j++)
+       {
+          unset($tmp_list);
+          if (isset($_POST["as".$j."_".$i]))
+         {
+           if ($local) {
+               $tmp_list = directory_list($i,$j);
+           } else {
+               $tmp_list = open_ftp($i,$j);
+           }
+           if (is_array($tmp_list))
+           {
+             while (list($k,$name)=each($tmp_list))
+             {
+               $s = filesize("$root_directory$name");
+               $t = $now - filemtime("$root_directory$name");
+               $t/=(24*3600);
+               if (($_POST["name"]!="") && (!preg_match("/".$_POST["name"]."/i",$name)))continue;
+               if (($_POST["age1"]) && ($_POST["age1"]>$t))continue;
+               if (($_POST["age2"]) && ($_POST["age2"]<$t))continue;
+
+               if (($_POST["size1"]) && ($_POST["size1"]>$s))continue;
+               if (($_POST["size2"]) && ($_POST["size2"]<$s))continue;
+
+               $list[$i."_".$j."_".$k]=$name;
+             }
+           }
+         }
+        }
+       
+       if (sizeof($list)==0)
+       {
+         echo _("Nothing found");
+       } else
+       {
+
+       echo "<table border=\"0\" cellspacing=\"1\" ".
+               "cellpadding=3 bgcolor=\"#000000\" width=\"90%\">\n";
+       echo "<tr><th bgcolor=\"#CCCCFF\" align=\"left\" width=\"10%\">"._("Builder").
+            "[<a href=\"$big_url&amp;ns=2\">"._("sort")."</a>]</th>";
+       echo "<th bgcolor=\"#CCCCFF\" align=\"left\" width=\"60%\">"._("Log File").
+                       "[<a href=\"$big_url&amp;ns=1\">"._("sort")."</a>]</th>".
+                "<th bgcolor=\"#CCCCFF\" align=\"right\" width=\"15%\">"._("Size")."</th> ".
+                "<th bgcolor=\"#CCCCFF\" align=\"left\">"._("Age").
+                        "[<a href=\"$big_url&amp;ns=0\">"._("sort")."</a>]</th>".
+                "</th></tr>";
+
+       function cmp1($f1, $f2) {
+               global $ftp_conn, $root_directory, $local;
+               if ($local)
+                       return filemtime("$root_directory$f2") - filemtime("$root_directory$f1");
+               return ftp_mdtm($ftp_conn, $f2) - ftp_mdtm($ftp_conn, $f1);
+       }
+
+       function cmp2($f1, $f2) {
+         list($p11,$p12,$p13)=explode("_",$f1);
+         list($p21,$p22,$p23)=explode("_",$f2);
+         return strcmp($f2,$f1);
+       }
+
+       if ($ns == 1)
+       {
+         usort($list, "cmp1");
+//     } else if ($ns == 2)
+//     {
+//       uksort($list, "cmp2");
+       } else
+       {
+         asort($list);
+       }
+
+        $counter=0;
+       while (list($k,$name)=each($list))
+       {
+       if (($counter<$off) || ($counter>$off+$cnt-1))
+       {
+         $counter++;
+         continue;
+       }
+
+         $counter++;
+         list($i,$j,$k)=explode("_",$k);
+
+               $h = bin2hex(mhash(MHASH_MD5, $name));
+               $f = preg_replace("/.*\/([^\/]*)$/", "\\1", $name);
+               $f = preg_replace("/\.(bz2|gz)$/", "", $f);
+               if ($local) {
+                       $s = filesize("$root_directory$name");
+                       $t = $now - filemtime("$root_directory$name");
+               } else {
+                       $s = ftp_size($ftp_conn, $list[$i]);
+                       $t = $now - ftp_mdtm($ftp_conn, $list[$i]);
+               }
+               $t /= 60;
+               if ($t >= 60) {
+                       $t /= 60;
+                       if ($t >= 24) {
+                               $t /= 24;
+                               $t = round($t);
+                               $t = $t . "&nbsp;" . ngettext("day","days",$t);
+                       } else {
+                               $t = round($t);
+                               $t = $t . "&nbsp;" . ngettext("hour","hours",$t);
+                       }
+               } else {
+                       $t = round($t);
+                       $t = $t . "&nbsp;" . ngettext("minute","minutes",$t);
+               }
+                $big_url = "$url?idx=$i&amp;ok=$j&amp;ns=$ns&amp;cnt=$cnt";
+               $u = "$big_url&amp;off=$off&amp;id=$h";
+
+               $builder=$addr[$i]."/".(($j=="1")?"OK":"FAIL");
+               echo "<tr>";
+               echo "<td bgcolor=#CCCCCC><a href=\"$u\">$builder</a></td>";
+               echo "<td bgcolor=#CCCCCC><a href=\"$u\">$f</a> ".
+                    "[<a href=\"$u&amp;action=text\">"._("text")."</a> | ".
+                     "<a href=\"$u&amp;action=tail\">"._("tail")."</a>]".
+                    "</td><td bgcolor=#CCCCCC align=right>".
+                    "$s</td><td bgcolor=#CCCCCC>$t</td></tr>\n";
+       }
+       echo "</table></div>\n";
+
+       $backarr = "&lt;&lt;&lt;&nbsp;";
+       $back = _("Page back");
+       $forward = _("Page forward");
+       $forwardarr = "&nbsp;&gt;&gt;&gt;";
+
+// FIXME
+/*
+       echo "<p><table width=\"90%\" align=\"center\"><tr><td align=left width=1%>";
+
+       if ($off > 0) {
+               $noff = $off - $cnt;
+               if ($noff < 0)  
+                       $noff = 0;
+               $hrefurl = "<a href=\"$big_url&amp;off=$noff\">";
+               echo "$hrefurl$backarr</a></td><td align=left>$hrefurl$back</a>";
+       } else {
+               echo "$backarr</td><td align=left>$back";
+       }
+
+    echo "</td>\n<td align=\"center\">";
+    echo "</td>\n<td align=\"right\">";
+
+    if ($off + $cnt < count($list))
+    {
+      $noff = $off + $cnt;
+      if ($noff < 0)   
+        $noff = 0;
+      $hrefurl = "<a href=\"$big_url&amp;off=$noff\">";
+      echo "$hrefurl$forward</a></td><td align=\"right\" width=\"1%\">$hrefurl$forwardarr</a>";
+    }
+    else
+    {
+      echo "$forward</td><td align=\"right\" width=\"1%\">$forwardarr";
+    }
+
+    echo "</td>\n</tr></table></p>";
+*/
+    }
+    if ($local == 0)
+    {
+      ftp_quit($ftp_conn);
+      $ftp_conn = 0;
+    }
+  } else
+  {
+    echo _("Enter something!");
+  }
+  echo "</form>\n";
+}
+
 function welcome()
 {
 ?>
-<table border=0 width=100%><tr><td width=20%>&nbsp;</td><td>
-<h1>Zdrastwuj!</h1>
-<p>Welcome to PLD Build Logs WWW interface.</p><p>
-Feel free to email bug reports, complaints and feature requests 
+<table border="0" width="100%"><tr><td width="20%">&nbsp;</td><td>
+<h1><?=_("Welcome!")?></h1>
+<p><?=_("Welcome to PLD Build Logs WWW interface.")?></p><p>
+<?=_("Feel free to email bug reports, complaints and feature requests ")?>
 <!-- ech... niech strace... -->
-<a href="mailto:malekith /at/ pld-linux org">to us</a>. Positive opinions are also 
-<a href="mailto:malekith /at/ pld-linux org">welcome</a> ;)</p>
-<p>Version: $Id: index.php,v 1.9 2002/05/11 14:15:08 malekith Exp $</p>
-</td><td width=20%>&nbsp;</td></tr>
+<a href="mailto:feedback@pld-linux.org"><?=_("to us")?></a>. <?=_("Positive opinions are also")?> 
+<a href="mailto:feedback@pld-linux.org"><?=_("welcome")?></a> ;)</p>
+<p>Version: $Id: index.php,v 1.62 2003/06/07 17:18:35 blues Exp $</p>
+</td><td width="20%">&nbsp;</td></tr>
 </table>
 <?php
 }
@@ -863,26 +960,30 @@ header("Pragma: no-cache");
 //phpinfo();
 if ($local) {
        if ($action == "text") {
-               local_dump_text();
+               dump_text();
+       } else if ($action == "adv_search") {
+               myheader();
+               adv_search();
+               trailer();
        } else if ($action == "qatxt") {
                dump_qa(1);
        } else {
                myheader();
-               echo "<table cellpadding=10 width=100%><tr><td valign=top width=10%>";
+               echo "<table cellpadding=\"10\" width=\"100%\"><tr><td valign=\"top\" width=\"10%\">";
                list_archs();
-               echo "</td><td valign=top>";
+               echo "</td><td valign=\"top\">";
                flush();
                if ($action == "qa")
                        dump_qa(0);
                else if ($action == "sqa")
                        search_qa();
                else if (isset($id))
-                       local_dump_log($action == "tail");
+                       dump_log($action == "tail");
                else if (isset($idx))
-                       local_list_logs();
+                       list_logs();
                else 
                        welcome();
-               echo "</tr></table>";
+               echo "</td></tr></table>";
                trailer();
        }
 }
@@ -894,9 +995,9 @@ else {
                dump_qa(1);
        } else {
                myheader();
-               echo "<table cellpadding=10 width=100%><tr><td valign=top width=10%>";
+               echo "<table cellpadding=\"10\" width=\"100%\"><tr><td valign=top width=\"10%\">";
                list_archs();
-               echo "</td><td valign=top>";
+               echo "</td><td valign=\"top\">";
                flush();
                if ($action == "qa")
                        dump_qa(0);
@@ -906,7 +1007,7 @@ else {
                        list_logs();
                else 
                        welcome();
-               echo "</tr></table>";
+               echo "</td></tr></table>";
                trailer();
        }
 }
This page took 0.224736 seconds and 4 git commands to generate.