. // This is a template for your web site's front page. // You are encouraged to customize this file, // 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 // // If you add text, put it in tra() to make it translatable. 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"); require_once("../inc/bootstrap.inc"); $config = get_config(); $no_web_account_creation = parse_bool($config, "no_web_account_creation"); $project_id = parse_config($config, ""); $stopped = web_stopped(); $user = get_logged_in_user(false); // The panel at the top of the page // function panel_contents() { } function top() { global $stopped, $master_url, $user; if ($stopped) { echo '

' .tra("%1 is temporarily shut down for maintenance.", PROJECT) .'

'; } //panel(null, 'panel_contents'); } function left(){ global $user, $no_web_account_creation, $master_url, $project_id; panel( $user?tra("Welcome, %1", $user->name):tra("What is %1?", PROJECT), function() use($user) { global $no_web_account_creation, $master_url, $project_id; if ($user) { $dt = time() - $user->create_time; if ($dt < 86400) { echo tra("Thanks for joining %1", PROJECT); } else if ($user->total_credit == 0) { echo tra("Your computer hasn't completed any tasks yet. If you need help, %1go here%2.", "", "" ); } else { $x = format_credit($user->expavg_credit); echo tra("You've contributed about %1 credits per day to %2 recently.", $x, PROJECT); if ($user->expavg_credit > 1) { echo " "; echo tra("Thanks!"); } else { echo "

"; echo tra("Please make sure BOINC is installed and enabled on your computer."); } } echo "

"; echo sprintf('

%s
', tra('Continue to your home page') ); echo "

"; echo sprintf('%s

\n"; } else { echo "

"; $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 "

\n"; if (NO_COMPUTING) { echo " Create an account "; } else { // use auto-attach if possible // echo '
'.tra('Join %1', PROJECT).'
'; echo "

".tra("Already joined? %1Log in%2.", "", "" ); } } } ); global $stopped; if (!$stopped) { $profile = get_current_uotd(); if ($profile) { panel(tra('User of the Day'), function() use ($profile) { show_uotd($profile); } ); } } } function right() { panel(tra('News'), function() { include("motd.php"); if (!web_stopped()) { show_news(0, 5); } } ); } page_head(null, null, true); grid('top', 'left', 'right'); page_tail(false, "", true); ?>