2004-02-04 01:21:51 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// This is a sample project file.
|
|
|
|
// Modify it to suit your project.
|
2004-06-11 18:50:15 +00:00
|
|
|
// Put your version in html/project/project.inc
|
2010-02-16 01:06:03 +00:00
|
|
|
// add tra() around visible strings to make them translatable
|
|
|
|
// see inc/translation.inc and http://boinc.berkeley.edu/trac/wiki/TranslateProject for Details
|
2004-02-04 01:21:51 +00:00
|
|
|
|
2006-09-14 00:18:13 +00:00
|
|
|
require_once("../inc/util.inc");
|
|
|
|
|
2006-05-09 18:25:15 +00:00
|
|
|
$master_url = parse_config(get_config(), "<master_url>");
|
2007-12-30 22:02:16 +00:00
|
|
|
define("PROJECT", "REPLACE WITH PROJECT NAME");
|
2006-05-09 18:25:15 +00:00
|
|
|
define("URL_BASE", $master_url);
|
2004-02-24 04:05:13 +00:00
|
|
|
define("IMAGE_PATH", "../user_profile/images/");
|
|
|
|
define("IMAGE_URL", "user_profile/images/");
|
|
|
|
define("PROFILE_PATH", "../user_profile/");
|
|
|
|
define("PROFILE_URL", "user_profile/");
|
|
|
|
define("LANGUAGE_FILE", "languages.txt");
|
|
|
|
define("STYLESHEET", "white.css");
|
2012-03-09 21:40:57 +00:00
|
|
|
//define("STYLESHEET2", "xxx.css");
|
2009-01-25 12:22:11 +00:00
|
|
|
define("FORUM_QA_MERGED_MODE", false); // Set to true to merge Message boards and Q&A section
|
2007-12-30 22:02:16 +00:00
|
|
|
define("COPYRIGHT_HOLDER", "REPLACE WITH COPYRIGHT HOLDER");
|
2006-05-09 18:25:15 +00:00
|
|
|
define("SYS_ADMIN_EMAIL", "admin@$master_url");
|
2007-12-30 22:02:16 +00:00
|
|
|
define("UOTD_ADMIN_EMAIL", "admin@$master_url");
|
|
|
|
// who gets user of the day pool running low e-mails?
|
2011-03-12 15:36:58 +00:00
|
|
|
//define("MEMCACHE_SERVERS", "127.0.0.1:11211");
|
2006-11-04 19:21:05 +00:00
|
|
|
|
|
|
|
// Email addresses separated by pipe ( | ) that will receive user reported
|
|
|
|
// offensive forum posts.
|
|
|
|
define("POST_REPORT_EMAILS", "moderator1@$master_url|moderator2@$master_url");
|
2004-02-04 01:21:51 +00:00
|
|
|
|
2014-04-30 17:36:04 +00:00
|
|
|
// If you use PHPMailer, uncomment the following
|
|
|
|
// and complete the function definition based on your SMTP server
|
|
|
|
// (not all fields may be needed)
|
|
|
|
//
|
|
|
|
if (0) {
|
|
|
|
function make_php_mailer() {
|
|
|
|
$mail = new PHPMailer();
|
|
|
|
$mail->IsSMTP();
|
|
|
|
//$mail->Mailer = 'smtp';
|
|
|
|
$mail->SMTPAuth = true;
|
|
|
|
$mail->SMTPSecure = "tls";
|
|
|
|
$mail->Host = "smtp.gmail.com";
|
|
|
|
$mail->Port = 587;
|
|
|
|
$mail->Username = "john.doe@gmail.com";
|
|
|
|
$mail->Password = "xxx";
|
|
|
|
// Google's application-specific password,
|
|
|
|
// if you are using the 2-Step Verification: 16 characters, no spaces.
|
|
|
|
// OR: Put here the regular Gmail password if you are not using the
|
|
|
|
// 2-Step Verification with your Gmail account.
|
|
|
|
// See https://support.google.com/accounts/answer/185833?hl=en";
|
|
|
|
$mail->SetFrom('admin@boincproject.com', 'John Doe');
|
|
|
|
$mail->AddReplyTo("admin@boincproject.com", "John Doe");
|
|
|
|
$mail->From = "admin@boincproject.com";
|
|
|
|
return $mail;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-12 04:50:10 +00:00
|
|
|
function project_banner($title, $prefix) {
|
2004-02-04 01:21:51 +00:00
|
|
|
// Put your project title and logo here
|
2008-06-12 04:50:10 +00:00
|
|
|
// If you include any links, prepend URL with $prefix
|
2004-02-04 01:21:51 +00:00
|
|
|
|
2011-04-20 14:50:50 +00:00
|
|
|
echo "<div class=\"page_title\">$title</div>";
|
2004-02-04 01:21:51 +00:00
|
|
|
}
|
|
|
|
|
2008-06-12 04:50:10 +00:00
|
|
|
function project_footer($show_return, $show_date, $prefix) {
|
|
|
|
// If you include any links, prepend URL with $prefix
|
2005-01-24 14:45:51 +00:00
|
|
|
echo "<br><hr noshade size=1><center>";
|
|
|
|
if ($show_return) {
|
2010-07-14 19:20:31 +00:00
|
|
|
echo "<a href=".$prefix."index.php>".tra("Main page")."</a> · <a href=".$prefix."home.php>".tra("Your account")."</a> · <a href=".$prefix."forum_index.php>".tra("Message boards")."</a><br>\n";
|
2005-01-24 14:45:51 +00:00
|
|
|
}
|
2012-05-12 15:13:43 +00:00
|
|
|
echo "<br><br>".tra("Copyright")." © ".gmdate("Y ").COPYRIGHT_HOLDER."</center>\n";
|
2005-01-24 14:45:51 +00:00
|
|
|
if ($show_date) {
|
2008-07-18 20:59:59 +00:00
|
|
|
$t = time_str(time());
|
2014-10-02 19:15:54 +00:00
|
|
|
echo "<p class=\"text-muted\">".tra("Generated")." $t</p>\n";
|
2005-01-24 14:45:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-09-15 18:14:37 +00:00
|
|
|
// Authorize access to administrative pages.
|
2009-09-15 04:48:08 +00:00
|
|
|
// You can check for login, IP address, or whatever you want.
|
|
|
|
//
|
2010-02-21 04:45:52 +00:00
|
|
|
function auth_ops_example() {
|
2009-09-15 18:14:37 +00:00
|
|
|
// if running from cmdline, skip checks
|
|
|
|
//
|
|
|
|
if (!$_SERVER['REMOTE_ADDR']) {
|
|
|
|
return;
|
2009-09-15 04:48:08 +00:00
|
|
|
}
|
|
|
|
|
2009-09-15 18:14:37 +00:00
|
|
|
// example: require login as a particular user (id 1 in this case)
|
|
|
|
//
|
2009-09-15 04:48:08 +00:00
|
|
|
if (0) {
|
2009-09-15 18:14:37 +00:00
|
|
|
auth_ops_userid(array(1));
|
|
|
|
return;
|
2009-09-15 04:48:08 +00:00
|
|
|
}
|
|
|
|
|
2009-09-15 18:14:37 +00:00
|
|
|
// example: require that logged-in user have ADMIN or DEV flags
|
|
|
|
// set in their forum_prefs.privilege
|
|
|
|
//
|
|
|
|
if (0) {
|
|
|
|
auth_ops_privilege();
|
|
|
|
return;
|
2009-09-15 04:48:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-02-04 01:21:51 +00:00
|
|
|
function show_profile_heading1() {
|
2010-02-16 01:06:03 +00:00
|
|
|
return tra("Your personal background.");
|
2004-02-04 01:21:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function show_profile_question1() {
|
2010-02-16 01:06:03 +00:00
|
|
|
return tra("Tell us about yourself. You could tell us where you're from, your age, occupation, hobbies, or anything else about yourself.");
|
2004-02-04 01:21:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function show_profile_heading2() {
|
2010-02-16 01:06:03 +00:00
|
|
|
return tra("Your opinions about %1", PROJECT);
|
2004-02-04 01:21:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function show_profile_question2() {
|
2010-02-16 01:06:03 +00:00
|
|
|
return tra("Tell us your thoughts about %1<ol>
|
|
|
|
<li>Why do you run %1?
|
|
|
|
<li>What are your views about the project?
|
|
|
|
<li>Any suggestions?
|
|
|
|
</ol>", PROJECT);
|
2004-04-23 01:42:09 +00:00
|
|
|
}
|
2004-03-09 23:20:52 +00:00
|
|
|
|
2005-03-09 01:02:36 +00:00
|
|
|
function project_workunit($wu){
|
2008-07-18 20:59:59 +00:00
|
|
|
// shown in the workunit page
|
2005-03-09 01:02:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function project_user_summary($user){
|
2008-07-18 20:59:59 +00:00
|
|
|
// shown in the user summary page
|
2005-03-09 01:02:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function project_user_page_private($user){
|
2008-07-18 20:59:59 +00:00
|
|
|
// shown in the private account page
|
2005-03-09 01:02:36 +00:00
|
|
|
}
|
|
|
|
|
2014-08-15 23:20:40 +00:00
|
|
|
if (0) {
|
2014-08-15 21:01:32 +00:00
|
|
|
|
|
|
|
// show project-specific credit on user/team pages
|
|
|
|
//
|
|
|
|
function show_app_credit_user($user, $app_name, $appids) {
|
|
|
|
$t = 0;
|
|
|
|
$a = 0;
|
|
|
|
$n = 0;
|
|
|
|
foreach ($appids as $appid) {
|
|
|
|
$cu = BoincCreditUser::lookup(
|
|
|
|
"userid=$user->id and appid=$appid and credit_type=0"
|
|
|
|
);
|
|
|
|
if ($cu) {
|
|
|
|
$t += $cu->total;
|
|
|
|
$a += $cu->expavg;
|
|
|
|
$n += $cu->njobs;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
row2("$app_name credit",
|
|
|
|
format_credit_large($t)." total, ".
|
|
|
|
format_credit($a)." average".
|
|
|
|
" ($n tasks)"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
function show_app_credit_team($team, $app_name, $appids) {
|
|
|
|
$t = 0;
|
|
|
|
$a = 0;
|
|
|
|
$n = 0;
|
|
|
|
foreach ($appids as $appid) {
|
|
|
|
$ct = BoincCreditTeam::lookup(
|
|
|
|
"teamid=$team->id and appid=$appid and credit_type=0"
|
|
|
|
);
|
|
|
|
if ($ct) {
|
|
|
|
$t += $ct->total;
|
|
|
|
$a += $ct->expavg;
|
|
|
|
$n += $ct->njobs;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
row2("$app_name credit",
|
|
|
|
format_credit_large($t)." total, ".
|
|
|
|
format_credit($a)." average".
|
|
|
|
" ($n tasks)"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2014-08-18 20:48:27 +00:00
|
|
|
// a list of "sub-projects", used in the display of per-app credit and badges.
|
|
|
|
// A subproject is:
|
|
|
|
// - a set of 1 or more apps; an app can belong to at most 1 subproject.
|
|
|
|
// - a name, shown on the web site
|
|
|
|
// - a short name, used in badge names. Don't use "total".
|
|
|
|
//
|
2014-08-15 23:20:40 +00:00
|
|
|
$sub_projects = array(
|
2014-08-18 20:48:27 +00:00
|
|
|
array("name" => "Remote Test", "short_name" => "RT", "appids" => array(16)),
|
|
|
|
array("name" => "Uppercase", "short_name" => "UC", "appids" => array(1, 25)),
|
2014-08-15 23:20:40 +00:00
|
|
|
);
|
|
|
|
|
2005-03-09 01:02:36 +00:00
|
|
|
function project_user_credit($user){
|
2014-08-15 23:20:40 +00:00
|
|
|
global $sub_projects;
|
|
|
|
foreach ($sub_projects as $sp) {
|
|
|
|
show_app_credit_user($user, $sp["name"], $sp["appids"]);
|
|
|
|
}
|
2014-08-15 21:01:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function project_team_credit($team) {
|
2014-08-15 23:20:40 +00:00
|
|
|
global $sub_projects;
|
|
|
|
foreach ($sub_projects as $sp) {
|
|
|
|
show_app_credit_team($team, $sp["name"], $sp["appids"]);
|
|
|
|
}
|
2005-03-09 01:02:36 +00:00
|
|
|
}
|
|
|
|
|
2014-08-15 23:20:40 +00:00
|
|
|
} // if(0)
|
|
|
|
|
2007-11-28 17:40:08 +00:00
|
|
|
function project_forum_post_rules() {
|
2008-07-18 20:59:59 +00:00
|
|
|
// additional forum post rules
|
|
|
|
return "";
|
2007-11-28 17:40:08 +00:00
|
|
|
}
|
|
|
|
|
2004-02-04 01:21:51 +00:00
|
|
|
?>
|