boinc/html/user/sample_index.php

126 lines
3.7 KiB
PHP
Raw Normal View History

<?php
// This file is part of BOINC.
// http://boinc.berkeley.edu
2016-11-11 20:36:27 +00:00
// Copyright (C) 2008 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// This is a template for your web site's front page.
// You are encouraged to customize this file,
2016-11-11 20:36:27 +00:00
// and to create a graphical identity for your web site.
// by customizing the header/footer functions in html/project/project.inc
// and picking a Bootstrap theme
2016-11-11 20:36:27 +00:00
require_once("../inc/db.inc");
require_once("../inc/util.inc");
require_once("../inc/news.inc");
require_once("../inc/cache.inc");
require_once("../inc/uotd.inc");
require_once("../inc/sanitize_html.inc");
require_once("../inc/text_transform.inc");
require_once("../project/project.inc");
2016-11-11 20:36:27 +00:00
require_once("../inc/bootstrap.inc");
2016-11-11 20:36:27 +00:00
$config = get_config();
$no_computing = parse_config($config, "<no_computing>");
$no_web_account_creation = parse_bool($config, "no_web_account_creation");
$stopped = web_stopped();
$user = get_logged_in_user(false);
2016-11-11 20:36:27 +00:00
// The panel at the top of the page
//
function panel_contents() {
}
2016-11-11 20:36:27 +00:00
function top() {
global $stopped, $master_url, $user;
if ($stopped) {
2014-04-18 06:31:51 +00:00
echo "
2016-11-11 20:36:27 +00:00
<p class=\"lead text-center\">".PROJECT." is temporarily shut down for maintenance.</p>
2014-04-18 06:31:51 +00:00
";
}
//panel(null, 'panel_contents');
}
2016-11-11 20:36:27 +00:00
function left(){
global $no_computing, $no_web_account_creation, $master_url;
panel(
tra("What is %1?", PROJECT),
2016-11-11 20:36:27 +00:00
function() {
global $no_computing, $no_web_account_creation, $master_url;
if ($no_computing) {
echo "
XXX is a research project that uses volunteers
to do research in XXX.
2016-11-11 20:36:27 +00:00
";
} else {
echo "
<p>
XXX is a research project, based at <a href=#>YYY</a>,
that uses Internet-connected
computers to do research in XXX.
You can contribute to our research
by running a free program on your computer.
</p>
2016-11-11 20:36:27 +00:00
";
}
echo "
<ul>
<li> <a href=#>Our research</a>
<li> <a href=#>Our team</a>
</ul>
";
echo "</ul>";
if ($no_computing) {
2016-11-11 20:36:27 +00:00
echo "
<a href=\"create_account_form.php\">Create an account</a>
2016-11-11 20:36:27 +00:00
";
} else {
echo '<center><a href="join.php" class="btn btn-success"><font size=+2>'.tra('Join %1', PROJECT).'</font></a></center>
';
2016-11-11 20:36:27 +00:00
}
}
);
global $stopped;
if (!$stopped) {
$profile = get_current_uotd();
if ($profile) {
panel('User of the Day',
function() use ($profile) {
show_uotd($profile);
}
);
2016-11-11 20:36:27 +00:00
}
}
}
function right() {
panel('News',
function() {
include("motd.php");
show_news(0, 5);
}
);
}
page_head(null, null, true);
2016-11-11 20:36:27 +00:00
grid('top', 'left', 'right');
page_tail(false, "", true);
?>