2 $buildlogs_server = "buildlogs.pld-linux.org";
27 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-SRPMS.txt",
28 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-i386.txt",
29 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-i586.txt",
30 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-i686.txt",
31 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-athlon.txt",
32 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-amd64.txt",
33 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-alpha.txt",
34 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-sparc.txt",
35 "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-ppc.txt",
36 "http://ftp.pld-linux.org/dists/ra/.stat/builder/liniowiec/rpmqa-ra-i386.txt",
37 "http://ftp.pld-linux.org/dists/ra/.stat/builder/liniowiec/rpmqa-ra-i586.txt",
38 "http://ftp.pld-linux.org/dists/ra/.stat/builder/liniowiec/rpmqa-ra-i686.txt",
39 "http://ftp.pld-linux.org/dists/ra/.stat/builder/fly/rpmqa-ra-alpha.txt",
40 "http://ftp.pld-linux.org/dists/ra/.stat/builder/ares/rpmqa-ra-sparc.txt",
41 "http://ftp.pld-linux.org/dists/ra/.stat/builder/an2/rpmqa-ra-ppc.txt",
42 "http://ftp.nest.pld-linux.org/.stat/builder/kenny/rpmqa-nest-i386.txt",
43 "http://ftp.nest.pld-linux.org/.stat/builder/kenny/rpmqa-nest-i686.txt",
45 "http://ftp.nest.pld-linux.org/.stat/builder/alpha/rpmqa-nest-alpha.txt",
46 "http://ftp.nest.pld-linux.org/.stat/builder/an2/rpmqa-nest-ppc.txt"
48 $local = 1; /* $local=0 for FTP */
49 $root_directory = "/home/services/ftp/pub/pld-buildlogs";
51 /* It should be set */
53 $langs["en_US"]["charset"]="ISO-8859-1";
54 $langs["pl_PL"]["charset"]="ISO-8859-2";
57 if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"]))
59 $rows=explode(";",$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
60 $rows=explode(",",$rows[0]);
61 $lang_detected=rtrim($rows[0]);
62 } else if (preg_match("/opera/i",$_SERVER["HTTP_USER_AGENT"]))
64 $lang_detected=preg_replace("/.*\[(.*)\].*/i","\\1",$_SERVER["HTTP_USER_AGENT"]);
68 $lang_detected=preg_replace("/^pl$/i","pl_PL",$lang_detected);
70 if (isset($lang_detected) && isset($langs[$lang_detected]))
75 if (isset($_GET["lang"]))$_SESSION["lang"]=$_GET["lang"];
76 if (isset($_SESSION["lang"]))$lang=$_SESSION["lang"];
79 setlocale(LC_ALL,$lang);
80 bindtextdomain("messages","locale");
81 textdomain("messages");
83 if (isset($_GET["idx"]))$idx=$_GET["idx"];
84 if (isset($_GET["ok"]))$ok=$_GET["ok"];
86 if (isset($_GET["ns"]))$ns=$_GET["ns"];
88 if (isset($_GET["cnt"]))$cnt=$_GET["cnt"];
89 if (isset($_GET["action"]))$action=$_GET["action"];
91 if (isset($_GET["off"]))$off=$_GET["off"];
92 if (isset($_GET["id"]))$id=$_GET["id"];
94 if (isset($_POST["str"]))$str=$_POST["str"];
95 if (isset($_POST["idx"]))$idx=$_POST["idx"];
96 if (isset($_POST["action"]))$action=$_POST["action"];
100 echo '<' . '?xml version="1.0" encoding="' . _("ISO-8859-1") .'"?' . ">\n";
101 echo '<' . '?xml-stylesheet href="#internalStyle" type="text/css"?' . ">\n";
103 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
104 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
105 <html xmlns="http://www.w3.org/1999/xhtml">
107 <title>PLD Build Logs</title>
108 <?php echo '<meta http-equiv="Content-type" content="text/html; charset=' . _("ISO-8859-1") .'"/>' ."\n";?>
109 <style type="text/css"><!--
110 A { text-decoration: none; }
111 A:hover { text-decoration: underline; }
112 H1 { font-family: arial,helvetica,sans-serif;
115 H2 { font-family: arial,helvetica,sans-serif;
118 BODY,TD { font-family: arial,helvetica,sans-serif;
120 TH { font-family: arial,helvetica,sans-serif;
126 <!-- Diffrent color for visited link doesn't make much sense here...
127 this page is autogenerated and it might be misleading after some
128 build log changes. -->
129 <body bgcolor="#ffffff" text="#000000" link="#5f26cd" vlink="#5f26cd">
135 echo "<table cellpadding=\"10\"><tr><td bgcolor=\"#000000\">".
136 "<font color=\"#cccccc\"><pre>";
141 echo "</pre></font></td></tr></table>\n";
146 echo "</body></html>";
152 echo "Fatal error: $msg";
155 function open_ftp($pidx="", $pok="")
157 global $idx, $addr, $buildlogs_server, $ok;
158 global $ftp_conn, $big_url, $url, $ns;
161 if ($pidx==="")$pidx=$idx;
162 if ($pok==="")$pok=$ok;
164 if (!isset($pidx) || !isset($addr[$pidx]))
173 $a = "$addr[$pidx]/OK";
175 $a = "$addr[$pidx]/FAIL";
183 $big_url = "$url?idx=$idx&ok=$ok&ns=$ns&cnt=$cnt";
185 $ftp = ftp_connect($buildlogs_server);
188 mydie(_("cannot connect to")." $buildlogs_server");
192 if (ftp_login($ftp, "anonymous",
193 "buildlogs-iface@pld-linux.org") == false) {
195 mydie(_("cannot ftp login to")." $buildlogs_server");
199 $list = ftp_nlist($ftp, $a);
200 if ($list == false) {
202 mydie(_("cannot list")." $a");
211 function directory_list($pidx="",$pok="")
213 global $idx, $addr, $buildlogs_server, $ok;
214 global $root_directory, $big_url, $url, $ns;
217 if ($pidx==="")$pidx=$idx;
218 if ($pok==="")$pok=$ok;
219 if (!isset($pidx) || !isset($addr[$pidx]))
228 $a = "$addr[$pidx]/OK";
230 $a = "$addr[$pidx]/FAIL";
238 $big_url = "$url?idx=$idx&ok=$ok&ns=$ns&cnt=$cnt";
240 $dir = opendir("$root_directory$a");
243 while ($file = readdir($dir)) {
244 if (($file != ".") && ($file != "..")) {
245 $list[$i] = "$a/$file";
255 global $idx, $addr, $ok;
256 global $ftp_conn, $big_url, $ns, $qa_addr;
257 global $off, $cnt, $local, $root_directory;
260 $list = directory_list();
268 echo "<h1>"._("Listing of")." $addr[$idx]/OK "
269 ."(<a href=\"$big_url&ok=0\">"._("fail")."</a>)</h1>\n";
271 echo "<h1>"._("Listing of")." $addr[$idx]/FAIL "
272 ."(<a href=\"$big_url&ok=1\">"._("ok")."</a>)</h1>\n";
275 echo "<div align=\"center\"><table cols=\"4\" border=\"0\" cellspacing=\"1\" ".
276 "cellpadding=\"3\" bgcolor=\"#000000\" width=\"90%\">\n";
277 echo "<tr><th bgcolor=\"#CCCCFF\" align=\"right\" width=\"1%\">"._("No.")."</th>".
278 "<th bgcolor=\"#CCCCFF\" align=\"left\" width=\"80%\">"._("Log File").
279 "[<a href=\"$big_url&ns=1\">"._("sort")."</a>]</th>".
280 "<th bgcolor=\"#CCCCFF\" align=\"right\" width=\"15%\">"._("Size")."</th> ".
281 "<th bgcolor=\"#CCCCFF\" align=\"left\">"._("Age").
282 "[<a href=\"$big_url&ns=0\">"._("sort")."</a>]</th>".
285 function cmp($f1, $f2) {
286 global $ftp_conn, $root_directory, $local;
288 return filemtime("$root_directory$f2") - filemtime("$root_directory$f1");
289 return ftp_mdtm($ftp_conn, $f2) - ftp_mdtm($ftp_conn, $f1);
300 for ($i = $off; $i < $cnt + $off; $i++) {
301 if (!isset($list[$i]))
303 $h = bin2hex(mhash(MHASH_MD5, $list[$i]));
304 $f = preg_replace("/.*\/([^\/]*)$/", "\\1", $list[$i]);
305 $f = preg_replace("/\.(bz2|gz)$/", "", $f);
307 $s = filesize("$root_directory$list[$i]");
308 $t = $now - filemtime("$root_directory$list[$i]");
310 $s = ftp_size($ftp_conn, $list[$i]);
311 $t = $now - ftp_mdtm($ftp_conn, $list[$i]);
319 $t = $t . " " . ngettext("day","days",$t);
322 $t = $t . " " . ngettext("hour","hours",$t);
326 $t = $t . " " . ngettext("minute","minutes",$t);
328 $u = "$big_url&off=$off&id=$h";
329 echo "<tr><td bgcolor=\"#CCCCCC\" align=\"right\">".($i+1).".</td>".
330 "<td bgcolor=\"#CCCCCC\"><a href=\"$u\">$f</a> ".
331 "[<a href=\"$u&action=text\">"._("text")."</a> | ".
332 "<a href=\"$u&action=tail\">"._("tail")."</a>]".
333 "</td><td bgcolor=\"#CCCCCC\" align=\"right\">".
334 "$s</td><td bgcolor=\"#CCCCCC\">$t</td></tr>\n";
336 echo "</table></div>\n";
338 $backarr = "<<< ";
339 $back = _("Page back");
340 $forward = _("Page forward");
341 $forwardarr = " >>>";
343 echo "<p><table width=\"90%\" align=\"center\"><tr><td align=\"left\" width=\"1%\">";
349 $hrefurl = "<a href=\"$big_url&off=$noff\">";
350 echo "$hrefurl$backarr</a></td><td align=\"left\">$hrefurl$back</a>";
352 echo "$backarr</td><td align=\"left\">$back";
355 echo "</td>\n<td align=\"center\">";
357 if ($qa_addr[$idx] != "") {
358 echo "[<a href=\"$big_url&action=qa\">"._("View <quot>rpm -qa</quot> of builder")."</a>]";
363 echo "</td>\n<td align=right>";
364 if ($off + $cnt < count($list)) {
368 $hrefurl = "<a href=\"$big_url&off=$noff\">";
369 echo "$hrefurl$forward</a></td><td align=right width=1%>$hrefurl$forwardarr</a>";
371 echo "$forward</td><td align=right width=1%>$forwardarr";
373 echo "</td>\n</tr></table></p>";
382 global $idx, $addr, $ok;
383 global $ftp_conn, $root_directory, $big_url, $ns, $id;
384 global $buildlogs_server, $local;
389 $list = directory_list();
397 for ($i = 0; $i < count($list); $i++) {
398 $h = bin2hex(mhash(MHASH_MD5, $list[$i]));
405 mydie(_("cannot find specified file:")." $id");
414 function dump_log($tail)
416 global $idx, $addr, $ok, $url;
417 global $ftp_conn, $root_directory, $big_url, $ns, $id, $cnt, $off;
418 global $buildlogs_server, $local, $qa_addr;
425 $df = preg_replace("/.*\/([^\/]*)$/", "\\1", $f);
426 $df = preg_replace("/\.(bz2|gz)$/", "", $df);
430 echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"#000000\">";
432 function one_item($h, $t) {
433 echo "<tr><td bgcolor=\"#ccccff\">$h:</td>".
434 "<td bgcolor=\"#cccccc\">$t</td></tr>";
437 function href($h, $c) {
438 return "<a href=\"$h\">$c</a>";
441 one_item(_("Status"), ($ok == 1 ?
442 "<font color=green><b>"._("OK")."</b></font>" :
443 "<font color=red><b>"._("Failed")."</b></a>"));
444 one_item(_("Source URL"),
445 href("ftp://$buildlogs_server$f",
446 "ftp://$buildlogs_server$f"));
448 $bu = "$big_url&off=$off";
450 one_item(_("text/plain URL"),
451 href("$bu&id=$id&action=text",
454 one_item(_("full text"),
455 href("$bu&id=$id",
459 if ($qa_addr[$idx] != "") {
460 one_item(_("rpm -qa of builder"), href("$bu&action=qa", _("View!")));
462 one_item(_("rpm -qa of builder"), _("Not available"));
465 one_item("Data", date("Y/m/d H:i:s", filemtime("$root_directory$f")));
467 one_item("Data", date("Y/m/d H:i:s", ftp_mdtm($ftp_conn, $f)));
470 echo "<tr><td>Here:</td><td>" .
471 "<a href=\"$url?idx=$idx&ok=$ok&id=$id\">".
472 "http://" . getenv("SERVER_NAME") .
473 getenv("SCRIPT_NAME") . "?idx=$idx&ok=$ok&id=$id</a>" .
476 echo "</table><h2>"._("Content:")."</h2>";
484 # what can I say beside PHP suxx? how the fuck should I create
485 # bidirectional pipe? gotta use wget
487 if (preg_match("/\.bz2$/", $f)) {
489 } elseif (preg_match("/\.gz$/", $f)) {
496 $cmd = "$filter $root_directory$f";
498 $cmd = "wget -q -O - ftp://$buildlogs_server$f 2>&1 | $filter 2>&1";
501 $cmd = "$cmd | tail -n 100";
502 $fd = popen($cmd, "r");
504 while (($s = fgets($fd, 1000)) != false) {
505 $s = htmlspecialchars($s);
515 [<a href="<?php echo $bu; ?>"><?=_("Back to list of logs")?></a>]
518 [<a href="<?php echo "$bu&action=qa"
519 ?>"><?=_("View rpm -qa of builder")?></a>]
529 global $ftp_conn, $root_directory;
530 global $buildlogs_server, $local;
532 header("Content-type: text/plain");
539 echo "# src : ftp://$buildlogs_server$f\n";
542 date("Y/m/d H:i:s", filemtime("$root_directory$f")) . "\n";
545 date("Y/m/d H:i:s", ftp_mdtm($ftp_conn, $f)) . "\n";
550 if (preg_match("/\.bz2$/", $f)) {
552 } elseif (preg_match("/\.gz$/", $f)) {
559 $cmd = "$filter $root_directory$f";
561 $cmd = "wget -q -O - ftp://$buildlogs_server$f 2>&1 | $filter 2>&1";
563 $fd = popen($cmd, "r");
564 while (($s = fgets($fd, 1000)) != false) {
570 function list_archs()
572 global $addr, $url, $idx, $cnt,$ok,$ns;
577 $big_url = "$url?idx=$idx&ok=$ok&ns=$ns&cnt=$cnt";
579 echo "<table width=\"100%\" border=\"0\">\n";
580 echo "<tr><td bgcolor=\"#cccccc\" nowrap=\"nowrap\">"._("Failed")."</td><td bgcolor=\"#cccccc\">"._("Ok")."</td></tr>\n";
581 for ($i = 0; $i < count($addr); $i++)
582 echo "<tr><td nowrap=\"nowrap\">".
583 "<a href=\"$url?idx=$i&ok=0&cnt=$cnt\">$addr[$i]</a></td><td nowrap=\"nowrap\">".
584 "[<a href=\"$url?idx=$i&ok=1&cnt=$cnt\">OK</a>]</td>".
585 #"<td>[<a href=\"$url?idx=$i&action=qa\">qa</a>]</td>".
587 echo "</table><hr />\n";
589 echo "<div align=\"center\">";
590 echo "<a href=\"$big_url&action=adv_search\">"._("Advanced Search")."</a><br />\n";
592 echo "<a href=\"$url\">main()</a><hr />\n";
593 echo "<a href=\"http://www.pld-linux.org/\"><img src=\"powpld.png\" ".
594 "alt=\""._("Powered by PLD Linux")."\" border=\"0\" /></a><br />\n" .
596 "<a href=\"mailto:feedback@pld-linux.org\">PLD Team</a>\n".
600 echo "<div align=\"center\"><small>";
601 $pow = array("vim", "php", "brain", "power", "electricity",
602 "coffee", "ufo", "penguin", "GNOME", "ELF", "DWARF",
603 "voodoo magic", "Linux", "x-files", "X", "foobar",
604 "/dev/null", "/dev/zero", "/dev/drzewo",
605 "Leppe'", "matrix", "Neo", "PDP-11",
606 "Ken", "GNU antilope", "PDP-7", "ITS", "Multics",
607 "foobarbaz", "ed", "Joe", "Unix conspiracy",
608 "overclock", "The Right Thing",
609 "The Bad Thing", "Star Treck", "NSA", "NASA",
610 "achelon", "VAX", "Real Programmer",
611 "Real Operating System", "Real Computer",
612 "computron", "bogon", "quantum bogodynamics",
613 "BOFH", "/dev/ill", "nasi tu byli",
614 "Paranoid Android", "Lunatic Corp", "Parallel thinking",
615 "sfistak", "Linus", "The Golden Path", "Dark Side of the Force",
616 "Przewodniczacego Lepper-a", "KDE", "Microsoft Windows 2003"
617 # feel free to add sth if you change this file ;)
619 echo _("Powered by")." ";
621 for ($i = 0; $i < $max; $i++) {
622 $x = rand(0, count($pow) - 1);
623 if ($pow[$x] == "") $i--;
624 else echo $pow[$x] . ($i == $max - 1 ? "." : ", ");
627 echo "</small></div>";
631 if (isset($qa_addr[$idx]) && $qa_addr[$idx] != "") {
632 echo "<form action=\"index.php\" method=\"post\">";
633 echo "<input type=hidden name=idx value=$idx />";
634 echo "<input type=hidden name=action value=sqa />";
635 echo "<input type=text size=14 name=str /><br />";
636 echo "<input type=submit name=submit value=\""._("Search rpmqa!")."\" />";
643 global $idx, $qa_addr;
645 if (!isset($idx) || !isset($qa_addr[$idx]))
650 if ($qa_addr[$idx] == "")
653 return fopen("$qa_addr[$idx]", "r");
658 global $url, $idx, $qa_addr, $str;
661 echo "<h1>"._("Search results for")." '$str' "._("in")." $qa_addr[$idx]</h1>";
666 echo _("Sorry, cannot open.");
668 while (($s = fgets($f, 1000)) != false) {
669 if (stristr($s, $str))
677 function dump_qa($plain)
679 global $url, $idx, $qa_addr;
686 header("Content-type: text/plain");
687 echo _("# rpm -qa of")." $a\n";
689 echo "<h1>"._("rpm -qa of")." $a</h1>";
690 echo "<a href=\"$url?idx=$idx&action=qatxt\">"._("text/plain version")."</a>";
695 echo _("Sorry, cannot open.");
697 while (($s = fgets($f, 1000)) != false) {
707 function adv_search()
709 global $addr, $url, $local, $_POST, $off, $cnt, $root_directory;
711 $big_url = "$url?idx=$idx&ok=$ok&ns=$ns&cnt=$cnt";
713 echo "<form action=\"index.php?action=adv_search\" method=\"post\">";
715 echo "<div align=\"center\">";
716 echo "<table border=\"0\">\n";
718 echo "<td>"._("Package name")."</td>\n";
719 echo "<td><input type=\"text\" size=\"20\" name=\"name\" value=\"".$_POST[name]."\"/></td>\n";
723 echo "<td>"._("Days")."</td>\n";
724 echo "<td>"._("From").": <input type=\"text\" size=\"20\" name=\"age1\" value=\"".$_POST["age1"]."\" /></td>\n";
725 echo "<td>"._("To").": <input type=\"text\" size=\"20\" name=\"age2\" value=\"".$_POST["age2"]."\" /></td>\n";
729 echo "<td>"._("Size")."</td>\n";
730 echo "<td>"._("From").": <input type=\"text\" size=\"20\" name=\"size1\" value=\"".$_POST["size1"]."\" /></td>\n";
731 echo "<td>"._("To").": <input type=\"text\" size=\"20\" name=\"size2\" value=\"".$_POST["size2"]."\" /></td>\n";
735 echo "<td>"._("Search logs:")."</td>\n";
739 echo "<td>"._("Failed")."</td>\n";
740 echo "<td>"._("OK")."</td>\n";
743 for ($i = 0; $i < count($addr); $i++)
747 $check=" checked=\"on\"";
748 echo "<td><input name=$name type=\"checkbox\"$check>".$addr[$i]."</input></td>\n";
750 $check=" checked=\"on\"";
751 echo "<td><input name=$name type=\"checkbox\"$check>".$addr[$i]."</input></td>\n";
756 echo "<td><input type=submit name=submit value=\""._("Search!")."\" /></td>";
761 // if (isset($_POST["name"]) || isset($_POST["age1"]) || isset($_POST["age2"]) ||
762 // isset($_POST["size1"]) || isset($_POST["size2"]))
763 if (($_POST["name"]!="") || ($_POST["age1"]!="") || ($_POST["age2"]!="") ||
764 ($_POST["size1"]!="") || ($_POST["size2"]!=""))
768 for ($i = 0; $i < count($addr); $i++)
773 if (isset($_POST["as".$j."_".$i]))
776 $tmp_list = directory_list($i,$j);
778 $tmp_list = open_ftp($i,$j);
780 if (is_array($tmp_list))
782 while (list($k,$name)=each($tmp_list))
784 $s = filesize("$root_directory$name");
785 $t = $now - filemtime("$root_directory$name");
787 if (($_POST["name"]!="") && (!preg_match("/".$_POST["name"]."/i",$name)))continue;
788 if (($_POST["age1"]) && ($_POST["age1"]>$t))continue;
789 if (($_POST["age2"]) && ($_POST["age2"]<$t))continue;
791 if (($_POST["size1"]) && ($_POST["size1"]>$s))continue;
792 if (($_POST["size2"]) && ($_POST["size2"]<$s))continue;
794 $list[$i."_".$j."_".$k]=$name;
800 if (sizeof($list)==0)
802 echo _("Nothing found");
806 echo "<table border=\"0\" cellspacing=\"1\" ".
807 "cellpadding=3 bgcolor=\"#000000\" width=\"90%\">\n";
808 echo "<tr><th bgcolor=\"#CCCCFF\" align=\"left\" width=\"10%\">"._("Builder").
809 "[<a href=\"$big_url&ns=2\">"._("sort")."</a>]</th>";
810 echo "<th bgcolor=\"#CCCCFF\" align=\"left\" width=\"60%\">"._("Log File").
811 "[<a href=\"$big_url&ns=1\">"._("sort")."</a>]</th>".
812 "<th bgcolor=\"#CCCCFF\" align=\"right\" width=\"15%\">"._("Size")."</th> ".
813 "<th bgcolor=\"#CCCCFF\" align=\"left\">"._("Age").
814 "[<a href=\"$big_url&ns=0\">"._("sort")."</a>]</th>".
817 function cmp1($f1, $f2) {
818 global $ftp_conn, $root_directory, $local;
820 return filemtime("$root_directory$f2") - filemtime("$root_directory$f1");
821 return ftp_mdtm($ftp_conn, $f2) - ftp_mdtm($ftp_conn, $f1);
824 function cmp2($f1, $f2) {
825 list($p11,$p12,$p13)=explode("_",$f1);
826 list($p21,$p22,$p23)=explode("_",$f2);
827 return strcmp($f2,$f1);
832 usort($list, "cmp1");
833 // } else if ($ns == 2)
835 // uksort($list, "cmp2");
842 while (list($k,$name)=each($list))
844 if (($counter<$off) || ($counter>$off+$cnt-1))
851 list($i,$j,$k)=explode("_",$k);
853 $h = bin2hex(mhash(MHASH_MD5, $name));
854 $f = preg_replace("/.*\/([^\/]*)$/", "\\1", $name);
855 $f = preg_replace("/\.(bz2|gz)$/", "", $f);
857 $s = filesize("$root_directory$name");
858 $t = $now - filemtime("$root_directory$name");
860 $s = ftp_size($ftp_conn, $list[$i]);
861 $t = $now - ftp_mdtm($ftp_conn, $list[$i]);
869 $t = $t . " " . ngettext("day","days",$t);
872 $t = $t . " " . ngettext("hour","hours",$t);
876 $t = $t . " " . ngettext("minute","minutes",$t);
878 $big_url = "$url?idx=$i&ok=$j&ns=$ns&cnt=$cnt";
879 $u = "$big_url&off=$off&id=$h";
881 $builder=$addr[$i]."/".(($j=="1")?"OK":"FAIL");
883 echo "<td bgcolor=#CCCCCC><a href=\"$u\">$builder</a></td>";
884 echo "<td bgcolor=#CCCCCC><a href=\"$u\">$f</a> ".
885 "[<a href=\"$u&action=text\">"._("text")."</a> | ".
886 "<a href=\"$u&action=tail\">"._("tail")."</a>]".
887 "</td><td bgcolor=#CCCCCC align=right>".
888 "$s</td><td bgcolor=#CCCCCC>$t</td></tr>\n";
890 echo "</table></div>\n";
892 $backarr = "<<< ";
893 $back = _("Page back");
894 $forward = _("Page forward");
895 $forwardarr = " >>>";
899 echo "<p><table width=\"90%\" align=\"center\"><tr><td align=left width=1%>";
905 $hrefurl = "<a href=\"$big_url&off=$noff\">";
906 echo "$hrefurl$backarr</a></td><td align=left>$hrefurl$back</a>";
908 echo "$backarr</td><td align=left>$back";
911 echo "</td>\n<td align=\"center\">";
912 echo "</td>\n<td align=\"right\">";
914 if ($off + $cnt < count($list))
919 $hrefurl = "<a href=\"$big_url&off=$noff\">";
920 echo "$hrefurl$forward</a></td><td align=\"right\" width=\"1%\">$hrefurl$forwardarr</a>";
924 echo "$forward</td><td align=\"right\" width=\"1%\">$forwardarr";
927 echo "</td>\n</tr></table></p>";
937 echo _("Enter something!");
945 <table border="0" width="100%"><tr><td width="20%"> </td><td>
946 <h1><?=_("Welcome!")?></h1>
947 <p><?=_("Welcome to PLD Build Logs WWW interface.")?></p><p>
948 <?=_("Feel free to email bug reports, complaints and feature requests ")?>
949 <!-- ech... niech strace... -->
950 <a href="mailto:feedback@pld-linux.org"><?=_("to us")?></a>. <?=_("Positive opinions are also")?>
951 <a href="mailto:feedback@pld-linux.org"><?=_("welcome")?></a> ;)</p>
952 <p>Version: $Id: index.php,v 1.72 2004/03/23 20:03:42 arekm Exp $</p>
953 </td><td width="20%"> </td></tr>
958 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
959 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
960 header("Cache-Control: no-cache, must-revalidate");
961 header("Pragma: no-cache");
965 if ($action == "text") {
967 } else if ($action == "adv_search") {
971 } else if ($action == "qatxt") {
975 echo "<table cellpadding=\"10\" width=\"100%\"><tr><td valign=\"top\" width=\"10%\">";
977 echo "</td><td valign=\"top\">";
981 else if ($action == "sqa")
984 dump_log($action == "tail");
985 else if (isset($idx))
989 echo "</td></tr></table>";
995 if ($action == "text") {
997 } else if ($action == "qatxt") {
1001 echo "<table cellpadding=\"10\" width=\"100%\"><tr><td valign=top width=\"10%\">";
1003 echo "</td><td valign=\"top\">";
1005 if ($action == "qa")
1007 else if (isset($id))
1008 dump_log($action == "tail");
1009 else if (isset($idx))
1013 echo "</td></tr></table>";