2004-06-09 19:09:16 +00:00
|
|
|
<?php
|
2003-08-19 06:45:36 +00:00
|
|
|
|
2008-03-04 23:50:38 +00:00
|
|
|
if (0) {
|
|
|
|
$x = $_SERVER['PHP_SELF'];
|
|
|
|
$path = "/tmp/php_pids/".getmypid();
|
|
|
|
$f = fopen($path, "w");
|
|
|
|
fwrite($f, $x);
|
|
|
|
fclose($f);
|
|
|
|
}
|
2007-11-07 17:23:29 +00:00
|
|
|
|
2006-04-14 22:25:55 +00:00
|
|
|
function search_form() {
|
2007-07-10 17:49:51 +00:00
|
|
|
echo "
|
|
|
|
<form method=get action=http://google.com/search>
|
2006-04-14 22:25:55 +00:00
|
|
|
<input type=hidden name=domains value=http://boinc.berkeley.edu>
|
|
|
|
<input type=hidden name=sitesearch value=http://boinc.berkeley.edu>
|
|
|
|
<nobr>
|
2007-07-10 17:49:51 +00:00
|
|
|
<input class=small name=q size=20>
|
|
|
|
<input class=small type=submit value=Search>
|
2006-04-14 22:25:55 +00:00
|
|
|
</nobr>
|
|
|
|
</form>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
|
2006-02-16 21:35:34 +00:00
|
|
|
function last_mod($datefile) {
|
|
|
|
return gmdate("g:i A \U\T\C, F d Y", filemtime($datefile));
|
2003-08-19 06:45:36 +00:00
|
|
|
}
|
|
|
|
|
2007-02-21 16:26:51 +00:00
|
|
|
function html_tag() {
|
|
|
|
global $language_in_use;
|
|
|
|
if ($language_in_use == 'ar') {
|
|
|
|
echo "<html dir=\"rtl\">";
|
|
|
|
} else {
|
|
|
|
echo "<html>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-04-14 22:25:55 +00:00
|
|
|
function page_head($title) {
|
2007-02-05 03:37:17 +00:00
|
|
|
global $book;
|
|
|
|
global $chap_num;
|
|
|
|
if ($book) {
|
|
|
|
echo "<br><h2>$chap_num. $title</h2>\n";
|
|
|
|
return;
|
|
|
|
}
|
2006-07-28 03:30:09 +00:00
|
|
|
if (defined("CHARSET")) {
|
|
|
|
header("Content-type: text/html; charset=".tr(CHARSET));
|
|
|
|
}
|
|
|
|
|
2007-02-21 16:26:51 +00:00
|
|
|
html_tag();
|
2006-10-18 21:53:22 +00:00
|
|
|
echo "
|
2003-09-23 23:19:41 +00:00
|
|
|
<head>
|
2005-05-31 21:59:29 +00:00
|
|
|
<link rel=\"stylesheet\" type=\"text/css\" href=\"white.css\"/>
|
2007-09-08 21:34:20 +00:00
|
|
|
<link rel=\"shortcut icon\" href=\"logo/favicon.gif\"/>
|
2003-08-19 06:45:36 +00:00
|
|
|
<title>$title</title>
|
2003-09-23 23:19:41 +00:00
|
|
|
</head>
|
2004-12-26 00:19:02 +00:00
|
|
|
<body bgcolor='ffffff'>
|
|
|
|
<table width='100%'>
|
2003-08-19 06:45:36 +00:00
|
|
|
<tr>
|
|
|
|
<td><center><h1>$title</h1></center>
|
2007-07-25 20:58:36 +00:00
|
|
|
<td align=right><a href=index.php><img src=logo/www_logo.gif></a>
|
2006-04-14 22:25:55 +00:00
|
|
|
<br>
|
|
|
|
";
|
|
|
|
search_form();
|
|
|
|
echo "
|
2003-08-19 06:45:36 +00:00
|
|
|
</td>
|
|
|
|
</tr></table>
|
2005-03-29 23:13:28 +00:00
|
|
|
<hr size=1>
|
2003-08-19 06:45:36 +00:00
|
|
|
";
|
|
|
|
}
|
|
|
|
|
2005-05-10 17:04:13 +00:00
|
|
|
function copyright() {
|
2005-05-10 17:16:40 +00:00
|
|
|
$y = date("Y ");
|
2005-05-10 17:04:13 +00:00
|
|
|
echo "
|
2005-05-10 17:16:40 +00:00
|
|
|
Copyright © $y University of California.
|
|
|
|
Permission is granted to copy, distribute and/or modify this document
|
|
|
|
under the terms of the GNU Free Documentation License,
|
2006-04-14 22:25:55 +00:00
|
|
|
Version 1.2 or any later version published by the Free Software Foundation.
|
2005-05-10 17:04:13 +00:00
|
|
|
";
|
|
|
|
}
|
|
|
|
|
2007-02-16 05:04:08 +00:00
|
|
|
function page_tail($translatable=false, $is_main=false) {
|
2007-02-05 03:37:17 +00:00
|
|
|
global $book;
|
|
|
|
if ($book) {
|
|
|
|
return;
|
|
|
|
}
|
2006-04-14 22:25:55 +00:00
|
|
|
$datefile = $_SERVER["SCRIPT_FILENAME"];
|
|
|
|
$d = last_mod($datefile);
|
2003-08-19 06:45:36 +00:00
|
|
|
echo "
|
2005-03-29 23:13:28 +00:00
|
|
|
<hr size=1>
|
2007-02-16 05:04:08 +00:00
|
|
|
";
|
|
|
|
if (!$is_main) {
|
|
|
|
echo "
|
|
|
|
<center>
|
|
|
|
<a href=\"/\">Return to BOINC main page</a>
|
|
|
|
</center><p>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
echo "
|
|
|
|
<font color=888888 size='2'>
|
2006-08-08 20:32:37 +00:00
|
|
|
";
|
|
|
|
if ($translatable) {
|
|
|
|
echo "
|
2007-09-27 21:03:15 +00:00
|
|
|
This page is <a href=trac/wiki/TranslateIntro>translatable</a>.<br>
|
2006-08-08 20:32:37 +00:00
|
|
|
";
|
|
|
|
}
|
|
|
|
echo "
|
2007-02-16 05:04:08 +00:00
|
|
|
Last modified $d.<br>
|
2005-05-10 17:04:13 +00:00
|
|
|
";
|
|
|
|
copyright();
|
|
|
|
echo "
|
2006-04-14 22:25:55 +00:00
|
|
|
</font>
|
2004-12-26 00:14:51 +00:00
|
|
|
</body>
|
|
|
|
</html>
|
2003-08-19 06:45:36 +00:00
|
|
|
";
|
|
|
|
}
|
|
|
|
|
2004-09-05 18:46:19 +00:00
|
|
|
function html_text($x) {
|
2007-07-26 21:50:45 +00:00
|
|
|
return "<pre>".htmlspecialchars($x)."</pre>
|
2004-09-05 18:46:19 +00:00
|
|
|
";
|
|
|
|
}
|
|
|
|
|
2006-05-21 21:11:28 +00:00
|
|
|
function list_start($attrs = 'width=100%') {
|
2006-12-04 17:10:39 +00:00
|
|
|
echo "<p><table $attrs border=0 cellpadding=6>\n";
|
2003-08-19 06:45:36 +00:00
|
|
|
}
|
|
|
|
|
2004-02-09 05:11:05 +00:00
|
|
|
function list_heading($x, $y, $z=null) {
|
|
|
|
echo "
|
|
|
|
<tr>
|
2004-02-12 01:13:47 +00:00
|
|
|
<th valign=top><b>$x</b></th>
|
|
|
|
<th valign=top>$y</th>
|
2004-02-09 05:11:05 +00:00
|
|
|
";
|
|
|
|
if ($z) {
|
2004-02-12 01:13:47 +00:00
|
|
|
echo " <th valign=top>$z</th>\n";
|
2004-02-09 05:11:05 +00:00
|
|
|
}
|
2005-03-05 23:12:31 +00:00
|
|
|
echo " </tr>\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
function list_heading_array($x) {
|
|
|
|
echo "<tr>";
|
|
|
|
foreach ($x as $h) {
|
|
|
|
echo "<th>$h</th>";
|
|
|
|
}
|
|
|
|
echo "</tr>\n";
|
2004-02-09 05:11:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function list_item($x, $y, $z=null) {
|
2006-12-04 17:10:39 +00:00
|
|
|
if (!$x) $x = "<br>";
|
2003-08-19 06:45:36 +00:00
|
|
|
echo "
|
|
|
|
<tr>
|
2007-07-26 21:50:45 +00:00
|
|
|
<td class=fieldname valign=top><b>$x</b></td>
|
2003-08-19 06:45:36 +00:00
|
|
|
<td valign=top>$y</td>
|
2004-02-09 05:11:05 +00:00
|
|
|
";
|
|
|
|
if ($z) {
|
|
|
|
echo " <td valign=top>$z</a>\n";
|
|
|
|
}
|
|
|
|
echo " </tr>\n";
|
2003-08-19 06:45:36 +00:00
|
|
|
}
|
|
|
|
|
2005-03-05 23:12:31 +00:00
|
|
|
function list_item_array($x) {
|
|
|
|
echo "<tr>";
|
|
|
|
foreach ($x as $h) {
|
2005-04-11 19:29:36 +00:00
|
|
|
echo "<td valign=top>$h<br></td>";
|
2005-03-05 23:12:31 +00:00
|
|
|
}
|
|
|
|
echo "</tr>\n";
|
|
|
|
}
|
|
|
|
|
2004-09-05 18:46:19 +00:00
|
|
|
function list_item_func($x, $y) {
|
|
|
|
list_item(html_text($x), $y);
|
|
|
|
}
|
|
|
|
|
2008-01-28 15:48:09 +00:00
|
|
|
function list_bar($x, $note="") {
|
|
|
|
if ($note) {
|
|
|
|
$note = "<br><span class=note>$note</span>";
|
|
|
|
}
|
2004-10-01 22:00:39 +00:00
|
|
|
echo "
|
2008-01-28 15:48:09 +00:00
|
|
|
<tr><td colspan=8 class=heading><center><b>$x</b>$note</center></td></tr>
|
2004-10-01 22:00:39 +00:00
|
|
|
";
|
|
|
|
}
|
|
|
|
|
2003-08-19 06:45:36 +00:00
|
|
|
function list_end() {
|
|
|
|
echo "</table><p>\n";
|
|
|
|
}
|
|
|
|
|
2005-10-23 07:19:03 +00:00
|
|
|
function error_page($x) {
|
|
|
|
page_head("Error");
|
|
|
|
echo $x;
|
|
|
|
page_tail();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
2006-06-03 16:16:13 +00:00
|
|
|
function block_start() {
|
|
|
|
echo "
|
2006-07-17 16:38:53 +00:00
|
|
|
<table width=100% cellpadding=4>
|
|
|
|
<tr>
|
2007-07-26 21:50:45 +00:00
|
|
|
<td class=fieldname width=100%><pre>";
|
2006-06-03 16:16:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function block_end() {
|
2006-07-17 16:38:53 +00:00
|
|
|
echo "</pre></td></tr></table>
|
|
|
|
";
|
2006-06-03 16:16:13 +00:00
|
|
|
}
|
|
|
|
|
2006-07-22 18:24:01 +00:00
|
|
|
function get_str($name) {
|
|
|
|
if (isset($_GET[$name])) {
|
|
|
|
$x = $_GET[$name];
|
|
|
|
$x = trim($x);
|
|
|
|
return mysql_real_escape_string($x);
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2006-11-08 00:35:25 +00:00
|
|
|
function show_link($url) {
|
|
|
|
echo "<br><a href=$url>$url</a>";
|
|
|
|
}
|
|
|
|
|
2008-03-14 21:40:18 +00:00
|
|
|
function parse_element($xml, $tag) {
|
|
|
|
$element = null;
|
|
|
|
$closetag = "</" . substr($tag,1);
|
|
|
|
$x = strstr($xml, $tag);
|
|
|
|
if ($x) {
|
|
|
|
if (strstr($tag, "/>")) return $tag;
|
|
|
|
$y = substr($x, strlen($tag));
|
|
|
|
$n = strpos($y, $closetag);
|
|
|
|
if ($n) {
|
|
|
|
$element = substr($y, 0, $n);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return trim($element);
|
|
|
|
}
|
2003-08-19 06:45:36 +00:00
|
|
|
?>
|