2002-08-12 20:16:55 +00:00
|
|
|
<?php
|
2008-08-05 22:43:14 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
2016-11-11 20:36:27 +00:00
|
|
|
// Copyright (C) 2008 University of California
|
2008-08-05 22:43:14 +00:00
|
|
|
//
|
|
|
|
// 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/>.
|
2002-08-14 00:27:18 +00:00
|
|
|
|
2011-05-27 19:38:18 +00:00
|
|
|
// 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-29 08:34:26 +00:00
|
|
|
//
|
|
|
|
// If you add text, put it in tra() to make it translatable.
|
2011-05-27 19:38:18 +00:00
|
|
|
|
2016-11-11 20:36:27 +00:00
|
|
|
require_once("../inc/db.inc");
|
2004-06-11 18:50:15 +00:00
|
|
|
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");
|
2006-01-09 08:37:44 +00:00
|
|
|
require_once("../inc/text_transform.inc");
|
2004-06-11 18:50:15 +00:00
|
|
|
require_once("../project/project.inc");
|
2016-11-11 20:36:27 +00:00
|
|
|
require_once("../inc/bootstrap.inc");
|
2002-08-12 20:16:55 +00:00
|
|
|
|
2016-11-11 20:36:27 +00:00
|
|
|
$config = get_config();
|
|
|
|
$no_web_account_creation = parse_bool($config, "no_web_account_creation");
|
2018-05-29 23:13:24 +00:00
|
|
|
$project_id = parse_config($config, "<project_id>");
|
2016-11-11 20:36:27 +00:00
|
|
|
|
|
|
|
$stopped = web_stopped();
|
|
|
|
$user = get_logged_in_user(false);
|
2011-02-09 22:11:34 +00:00
|
|
|
|
2016-11-11 20:36:27 +00:00
|
|
|
// The panel at the top of the page
|
|
|
|
//
|
|
|
|
function panel_contents() {
|
|
|
|
}
|
2002-12-11 00:12:42 +00:00
|
|
|
|
2016-11-11 20:36:27 +00:00
|
|
|
function top() {
|
|
|
|
global $stopped, $master_url, $user;
|
|
|
|
if ($stopped) {
|
2016-11-29 20:59:38 +00:00
|
|
|
echo '
|
|
|
|
<p class="lead text-center">'
|
|
|
|
.tra("%1 is temporarily shut down for maintenance.", PROJECT)
|
|
|
|
.'</p>
|
|
|
|
';
|
2014-04-18 06:31:51 +00:00
|
|
|
}
|
2016-11-22 09:20:07 +00:00
|
|
|
//panel(null, 'panel_contents');
|
2004-06-11 18:50:15 +00:00
|
|
|
}
|
|
|
|
|
2016-11-11 20:36:27 +00:00
|
|
|
function left(){
|
2018-05-29 07:26:26 +00:00
|
|
|
global $user, $no_web_account_creation, $master_url, $project_id;
|
2016-11-11 20:36:27 +00:00
|
|
|
panel(
|
2018-05-21 22:08:24 +00:00
|
|
|
$user?tra("Welcome, %1", $user->name):tra("What is %1?", PROJECT),
|
2016-11-29 08:34:26 +00:00
|
|
|
function() use($user) {
|
2018-05-29 07:26:26 +00:00
|
|
|
global $no_web_account_creation, $master_url, $project_id;
|
2018-05-21 22:08:24 +00:00
|
|
|
if ($user) {
|
|
|
|
$dt = time() - $user->create_time;
|
|
|
|
if ($dt < 86400) {
|
|
|
|
echo tra("Thanks for joining %1", PROJECT);
|
|
|
|
} else if ($user->total_credit == 0) {
|
2018-05-30 00:03:18 +00:00
|
|
|
echo tra("Your computer hasn't completed any tasks yet. If you need help, %1go here%2.",
|
|
|
|
"<a href=https://boinc.berkeley.edu/help.php>",
|
|
|
|
"</a>"
|
|
|
|
);
|
2018-05-21 22:08:24 +00:00
|
|
|
} else {
|
|
|
|
$x = format_credit($user->expavg_credit);
|
2018-06-11 01:57:13 +00:00
|
|
|
echo tra("You've contributed about %1 credits per day to %2 recently.", $x, PROJECT);
|
2018-05-21 22:08:24 +00:00
|
|
|
if ($user->expavg_credit > 1) {
|
2018-05-30 00:03:18 +00:00
|
|
|
echo " ";
|
|
|
|
echo tra("Thanks!");
|
2018-05-21 22:08:24 +00:00
|
|
|
} else {
|
|
|
|
echo "<p><p>";
|
2018-05-30 00:03:18 +00:00
|
|
|
echo tra("Please make sure BOINC is installed and enabled on your computer.");
|
2018-05-21 22:08:24 +00:00
|
|
|
}
|
|
|
|
}
|
2018-05-29 07:26:26 +00:00
|
|
|
echo "<p><p>";
|
2018-05-21 22:08:24 +00:00
|
|
|
echo sprintf('<center><a href=home.php class="btn btn-success">%s</a></center>
|
|
|
|
',
|
|
|
|
tra('Continue to your home page')
|
|
|
|
);
|
2018-06-06 23:32:09 +00:00
|
|
|
echo "<p><p>";
|
|
|
|
echo sprintf('%s
|
2018-05-21 22:08:24 +00:00
|
|
|
<ul>
|
2018-06-06 23:32:09 +00:00
|
|
|
<li> %s
|
|
|
|
<li> %s
|
2018-06-07 06:53:23 +00:00
|
|
|
<li> %s
|
2018-06-06 23:32:09 +00:00
|
|
|
',
|
|
|
|
tra("Want to help more?"),
|
2018-06-07 06:53:23 +00:00
|
|
|
tra("If BOINC is not installed on this computer, %1download it%2.",
|
2019-03-31 20:10:56 +00:00
|
|
|
"<a href=download_software.php>", "</a>"
|
2018-06-07 06:53:23 +00:00
|
|
|
),
|
2018-06-06 23:32:09 +00:00
|
|
|
tra("Install BOINC on your other computers, tablets, and phones."),
|
|
|
|
tra("Tell your friends about BOINC, and show them how to join %1.", PROJECT)
|
|
|
|
);
|
2018-06-18 22:01:17 +00:00
|
|
|
if (function_exists('project_help_more')) {
|
|
|
|
project_help_more();
|
|
|
|
}
|
|
|
|
echo "</ul>\n";
|
2018-06-06 23:32:09 +00:00
|
|
|
} else {
|
|
|
|
echo "<p>";
|
|
|
|
$pd = "../project/project_description.php";
|
|
|
|
if (file_exists($pd)) {
|
|
|
|
include($pd);
|
|
|
|
} else {
|
|
|
|
echo "No project description yet. Create a file html/project/project_description.php
|
|
|
|
that prints a short description of your project.
|
|
|
|
";
|
|
|
|
}
|
|
|
|
echo "</p>\n";
|
2017-06-20 07:38:11 +00:00
|
|
|
if (NO_COMPUTING) {
|
2020-09-21 10:58:17 +00:00
|
|
|
if (!$no_web_account_creation) {
|
|
|
|
echo "
|
|
|
|
<a href=\"create_account_form.php\">Create an account</a>
|
|
|
|
";
|
|
|
|
}
|
2016-11-29 08:34:26 +00:00
|
|
|
} else {
|
2018-05-29 07:26:26 +00:00
|
|
|
// use auto-attach if possible
|
|
|
|
//
|
2020-09-21 10:58:17 +00:00
|
|
|
if (!$no_web_account_creation) {
|
|
|
|
echo '<center><a href="signup.php" class="btn btn-success"><font size=+2>'.tra('Join %1', PROJECT).'</font></a></center>';
|
|
|
|
}
|
2018-06-06 23:32:09 +00:00
|
|
|
echo "<p><p>".tra("Already joined? %1Log in%2.",
|
|
|
|
"<a href=login_form.php>", "</a>"
|
|
|
|
);
|
2016-11-29 08:34:26 +00:00
|
|
|
}
|
2016-11-11 20:36:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
global $stopped;
|
|
|
|
if (!$stopped) {
|
|
|
|
$profile = get_current_uotd();
|
|
|
|
if ($profile) {
|
2018-06-06 23:32:09 +00:00
|
|
|
panel(tra('User of the Day'),
|
2016-11-12 04:10:12 +00:00
|
|
|
function() use ($profile) {
|
|
|
|
show_uotd($profile);
|
|
|
|
}
|
|
|
|
);
|
2016-11-11 20:36:27 +00:00
|
|
|
}
|
2004-03-20 01:35:37 +00:00
|
|
|
}
|
2016-11-12 04:10:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function right() {
|
2016-11-29 08:34:26 +00:00
|
|
|
panel(tra('News'),
|
2016-11-12 04:10:12 +00:00
|
|
|
function() {
|
|
|
|
include("motd.php");
|
2016-11-29 20:59:38 +00:00
|
|
|
if (!web_stopped()) {
|
|
|
|
show_news(0, 5);
|
|
|
|
}
|
2016-11-12 04:10:12 +00:00
|
|
|
}
|
|
|
|
);
|
2003-12-10 00:54:17 +00:00
|
|
|
}
|
2004-06-11 18:50:15 +00:00
|
|
|
|
2016-11-22 09:20:07 +00:00
|
|
|
page_head(null, null, true);
|
2016-11-11 20:36:27 +00:00
|
|
|
|
|
|
|
grid('top', 'left', 'right');
|
2003-02-12 23:06:49 +00:00
|
|
|
|
2016-11-22 09:20:07 +00:00
|
|
|
page_tail(false, "", true);
|
2003-02-12 23:06:49 +00:00
|
|
|
|
|
|
|
?>
|