forked from davidpanderson/science_united
-
Notifications
You must be signed in to change notification settings - Fork 0
/
su_science.php
70 lines (63 loc) · 1.55 KB
/
su_science.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
require_once("../inc/util.inc");
require_once("../inc/su_util.inc");
require_once("../inc/su_graph.inc");
require_once("../inc/keywords.inc");
function keywd_str($kws) {
global $job_keywords;
$x = "";
$last = end($kws);
foreach ($kws as $kw) {
$n = $kw->keyword_id;
$k = $job_keywords[$n];
$x .= $k->name;
if ($kw != $last) {
$x .= ' · ';
}
}
return $x;
}
function show_proj($p) {
echo "<hr>";
echo sprintf('<h4>%s</h4>
<p>
Web site: <a href=%s>%s</a>
<p>%s
<p>Keywords: %s
',
$p->name,
$p->url, $p->url,
$p->description,
keywd_str($p->kws)
);
}
function project_list() {
echo "<h3>Projects</h3>";
$projs = unserialize(file_get_contents("projects.ser"));
shuffle($projs);
foreach ($projs as $p) {
show_proj($p);
}
}
function project_graphs() {
echo "<h3>Computing</h3>";
echo '
<br> <br>
<img src="su_graph.php?type=projects&ndays=40&gpu=0&xsize=600&ysize=400">
<br> <br>
<img src="su_graph.php?type=projects&ndays=40&gpu=1&xsize=600&ysize=400">
';
}
function top() {
echo "<p>";
echo tra("By using Science United, you are supporting these science projects. The choice of projects is determined your preferences.");
echo "<p>";
echo tra("Visit project web sites to learn more.");
}
function main() {
page_head(tra("Science"));
grid('top', 'project_list', 'project_graphs');
page_tail();
}
main();
?>