-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.php
317 lines (293 loc) · 10.1 KB
/
index.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
<?php
// BOINC web site home page.
// to maintain translations: if you change anything here:
// - in dev/html, run ops/build_po.php
// - upload the resulting en.po to app.transifex.com/boinc/boinc/web/
// as BOINC-Web.pot
// - later, download all translations as zip;
// install in ~/boinc-site/translations
if (isset($_SERVER) && array_key_exists('SERVER_NAME', $_SERVER)) {
$host = $_SERVER["SERVER_NAME"];
if ($host == "bossa.berkeley.edu") {
Header("Location: https://github.com/davidpanderson/bossa/wiki");
exit();
}
if ($host == "bolt.berkeley.edu") {
Header("Location: https://github.com/davidpanderson/bolt/wiki");
exit();
}
}
require_once("../inc/util.inc");
require_once("../inc/language_names.inc");
require_once("../inc/news.inc");
require_once("../inc/forum.inc");
require_once("../inc/rss.inc");
require_once("../inc/project_news.inc");
function show_participant() {
$i = rand(0, 99)+1;
echo "
<br>
<font size=+1>Computing power:</font>
<a href=computing.php>View</a>
";
return;
show_totals();
echo '
<p> </p>
<p>
';
include("piecharts/$i.html");
echo '<p><a href=chart_list.php>'.tra("Top 100 volunteers").'</a>';
}
function show_totals() {
$fn = "boinc_state.xml";
if (!file_exists($fn) || filemtime($fn) < time()-86400) {
$uid = time();
$x = file_get_contents("https://www.boincstats.com/xml/boincState?uid=$uid");
if ($x) {
$f = fopen($fn, "w");
fwrite($f, $x);
} else return;
}
$x = file_get_contents($fn);
$users = parse_element($x, "<participants_active>");
$hosts = parse_element($x, "<hosts_active>");
$dusers = parse_element($x, "<participants_day>");
if ((int)$dusers > 0) $dusers = "+".$dusers;
$dhosts = parse_element($x, "<hosts_day>");
if ((int)$dhosts > 0) $dhosts = "+".$dhosts;
$credit_day = parse_element($x, "<credit_day>");
$users = number_format($users);
$hosts = number_format($hosts);
$petaflops = number_format($credit_day/200000000, 3);
echo
tra("24-hour average:")." $petaflops ".tra("PetaFLOPS.")."
<br>
".tra("Active:")." $users ".tra("volunteers,")." $hosts ".tra("computers").".
<br>
".tra("Daily change:")." $dusers ".tra("volunteers,")." $dhosts ".tra("computers").".
";
}
function show_news_items() {
panel(
tra("News"),
function() {
if (!file_exists("stop_web")) {
show_news(0, 3);
} else {
echo "<p>".tra("We're down for maintenance; please try later.");
}
}
);
}
// get project news items, show newest 3 and link to the rest
// This uses https://vcnews.info,
// which runs on AWS and was created by Kevin Reed.
// This may not be there forever.
//
function show_project_news() {
$items = get_rss_feed_cached("https://api.vcnews.info/rss", 3600);
if (!$items) return;
panel(
tra("News from BOINC Projects"),
function() use ($items) {
show_rss_items($items, 3, 'rss_filter', 200);
echo "<a href=project_news.php>... more</a>";
}
);
}
function show_links() {
echo '
</p>
<div class="container-fluid">
<div class="row">
<div class="col-sm-4">
<font size=+2>
'.tra("Learn").'
</font>
<br><a href="projects.php">'.tra("Science projects").'</a>
<br><a href="pubs.php">'.tra("Science publications").'</a>
<br><a href="https://github.com/BOINC/boinc/wiki/User-manual"><span class=nobr>'.tra("User manual").'</span></a>
<br><a " href="addons.php"><span class=nobr>'.tra("Add-ons").'</span></a>
<br><a btn-primary href=https://github.com/BOINC/boinc/wiki/WebResources><span class=nobr>'.tra("Web resources").'</span></a>
<p>
</div><div class="col-sm-4">
<font size=+2>
'.tra("Communicate").'
</font>
<br><a href="forum_index.php">'.tra("Message boards").'</a>
<br><a href="https://github.com/BOINC/boinc/wiki/BOINC-Help">'.tra("Help").'</a>
<br><a href="https://github.com/BOINC/boinc/wiki/EmailLists">'.tra("Email lists").'</a>
<br><a href="https://github.com/BOINC/boinc/wiki/Reporting-client-Bugs">'.tra("Report bugs").'</a>
<br><a href=https://www.reddit.com/r/BOINC/ title="BOINC on Reddit"><img src=images/reddit.png height=28></a>
<p>
</div><div class="col-sm-4">
<font size=+2>
'.tra("Help").'
</font>
<br><a href="https://github.com/BOINC/boinc/wiki/TranslateIntro">'.tra("Translate").'</a>
<br><a href="https://github.com/BOINC/boinc/wiki/AlphaInstructions">'.tra("Test").'</a>
<br><a href="https://github.com/BOINC/boinc/wiki/BoincPr">'.tra("Publicize").'</a>
</div>
</div>
</div>
';
echo sprintf('
<p>
<a href=computing.php>%s</a>
·
<a href=cert_dev.php>%s</a>
·
<a href=poll_results.php>%s</a>
',
tra('Computing power'),
tra('Certificate'),
tra('Poll')
);
echo sprintf('
<hr>
<font size=+2>%s:</font> <br>
<ul>
<li><a href=https://github.com/BOINC/boinc/wiki/Computing-with-boinc>%s</a> and <a href=https://github.com/BOINC/boinc/wiki/Maintain-your-boinc-project>%s</a> %s.
<br>
<li>
<a href=https://boinc.berkeley.edu/central/>
Run Autodock Vina jobs with BOINC Central and Raccoon2</a>
</ul>
<p>
<font size=+2>%s:</font> <br>
<ul>
<li>
<a href=https://github.com/BOINC/boinc/wiki/>
Visit the BOINC github repo </a>
</ul>
',
tra("Scientists"),
tra("Create"),
tra("maintain"),
tra("a BOINC project"),
tra("Programmers")
);
echo '
<p>
';
echo sprintf('
<hr>
<a href=https://github.com/BOINC/boinc/wiki/Contact-BOINC>%s</a>
·
<a href="https://github.com/BOINC/boinc/wiki/BoincPapers">%s</a>
·
<a href=logo.php>%s</a>
·
<a href=https://github.com/BOINC/boinc/wiki/BOINC-events>%s</a>
·
<a href=https://continuum-hypothesis.com/boinc_history.php>History</a>
',
tra('Contact'),
tra('Papers'),
tra("Graphics"),
tra("Events")
);
}
function intro() {
echo "<ul><li>";
echo tra("BOINC lets you help cutting-edge science research using your computer. The BOINC app, running on your computer, downloads scientific computing jobs and runs them invisibly in the background. It's easy and safe.");
echo "</p><p>\n ";
echo "<li>";
echo tra("About 30 science projects use BOINC.");
echo " ";
echo tra('They investigate diseases, study climate change, discover pulsars, and do many other types of scientific research.');
echo '
</p><p>
';
echo "<li>";
echo tra("The BOINC and Science United projects are located at the University of California, Berkeley and are supported by the National Science Foundation.");
echo "</ul><center>
<a href=https://berkeley.edu><img hspace=8 width=120 src=images/ucbseal.png alt=\"UCB logo\"></a>
<a href=https://nsf.gov><img hspace=8 width=120 src=images/NSF_4-Color_bitmap_Logo.png alt=\"NSF logo\"></a>
</center>
";
}
function call_to_action() {
$spacer = '<br style="margin-bottom: 10px" />';
echo "<font size=+2>".tra("START COMPUTING!")."</font></p>";
echo tra('To contribute to science areas (biomedicine, physics, astronomy, and so on) use %1. Your computer will help current and future projects in the areas you choose.',
'<a href=https://scienceunited.org style="color:orange">Science United</a>'
);
echo '
</p><p>
<center>
';
echo sprintf('<a class="btn " style= "background-color:mediumseagreen; color:white; font-size:24px; text-decoration:none" href="%s">%s</a>',
'https://scienceunited.org/su_join.php',
tra("Join %1", "Science United")
);
echo "</center></p>";
echo tra("Or %1download BOINC%2 and choose specific projects.",
'',''
);
echo ' ';
echo tra("This will let you participate in competitions and systems like Gridcoin.");
echo '<p><center>';
echo sprintf('<a class="btn " style= "background-color:dodgerblue; color:white; font-size:20px; text-decoration:none" href="%s">%s</a>',
'download.php',
tra("Download BOINC")
);
echo '</center>';
}
function show_nsf() {
echo "
<img hspace=8 width=120 src=images/NSF_4-Color_bitmap_Logo.png alt=\"NSF logo\">
BOINC is supported by the
<a href=\"https://nsf.gov\">National Science Foundation</a>
through awards SCI-0221529, SCI-0438443, SCI-0506411,
PHY/0555655, and OCI-0721124.
";
}
header("Content-type: text/html; charset=utf-8");
$rh_col_width = 390;
function left() {
panel(
null,
function() {
intro();
},
"panel-primary",
"bg-primary"
);
panel(
null,
function() {
call_to_action();
},
"panel-primary",
"bg-primary"
);
show_project_news();
}
function right() {
panel(
null,
function() {
show_links();
}
);
show_news_items();
}
page_head(tra("Compute for Science"), null, true, '',
'
<link rel="shortcut icon" href="logo/favicon.gif">
<link href="https://plus.google.com/117150698502685192946" rel="publisher" />
<meta name=description content="BOINC is an open-source software platform for computing using volunteered resources">
<meta name=keywords content="distributed scientific computing supercomputing grid SETI@home public computing volunteer computing ">
<title>BOINC</title>
',
true
);
echo "<p>";
grid(null, 'left', 'right');
//show_nsf();
echo "<br>";
page_tail(true, true);
?>