*** empty log message ***

svn path=/trunk/boinc/; revision=3367
This commit is contained in:
David Anderson 2004-05-11 22:49:23 +00:00
parent a0a84bf166
commit 2deee53456
31 changed files with 180 additions and 186 deletions

View File

@ -12139,6 +12139,16 @@ Rom May 6 2004
index.php
pass_percentage_by_platform.php
David May 9 2004
html/
inc/
gallery.inc
uotd.inc (new)
user/
index.php
team.php
team_lookup.php
David May 10 2004
- extend the set of signals that are treated as "external",
i.e. if an app exits with one of these, put it in limbo
@ -12166,3 +12176,9 @@ David May 11 2004
zip/
*
David May 11 2004
- remove "user" argument from page_head()
html/
*

View File

@ -30,7 +30,7 @@ if ($_POST['submit']) {
}
page_head('Forum', $logged_in_user);
page_head('Forum');
if (!empty($_GET['id'])) {
$post = getPost($_GET['id']);

View File

@ -4,7 +4,7 @@ require_once('../inc/forum.inc');
require_once('../inc/util.inc');
require_once('../inc/time.inc');
page_head('Message boards', NULL, NULL);
page_head('Message boards');
show_forum_title(NULL, NULL, false);

View File

@ -30,9 +30,9 @@ $logged_in_user = get_logged_in_user(true);
// TODO: Write a function to do this.
if ($category->is_helpdesk) {
page_head('Help Desk', $logged_in_user);
page_head('Help Desk');
} else {
page_head('Forum', $logged_in_user);
page_head('Forum');
}
show_forum_title($forum, NULL, $category->is_helpdesk);
@ -66,39 +66,32 @@ if ($category->is_helpdesk) {
}
start_forum_table(array($cell), 2);
echo "<tr><td class=fieldname><b>Title</b>";
$x = "Title".
"<br><a href=../html.php><font size=-2>May contain HTML tags</font></a>";
if ($category->is_helpdesk) {
echo "<p>
$x .="<br>
Describe your question in a few words.
A brief, clear summary will help others with the same
question (or an answer) find it.
<p></p>
";
}
echo "
</td>
<td><input type=text name=title size=62></td>
</tr>
<tr>
<td class=fieldname style=\"vertical-align:top\"><b>Message</b>
";
$y = "<input type=text name=title size=62>";
row2($x, $y);
$x = "Message".
"<br><a href=../html.php><font size=-2>May contain HTML tags</font></a>";
if ($category->is_helpdesk) {
echo "<p>
If you are having software problems,
$x .= " If you are having software problems,
mention the version number of the software,
your computer type and operating system.
</td>
";
}
echo "
<td><textarea name=content rows=12 cols=54></textarea></td>
</tr>
";
$y = "<textarea name=content rows=12 cols=54></textarea>";
row2($x, $y);
row2("", "<input name=add_signature value=add_it checked=true type=checkbox>Add my signature to this post");
row2("", "<input type=submit value=\"OK\">");

View File

@ -56,17 +56,17 @@ function show_result_page($success, $post, $choice) {
if ($success) {
if ($choice) {
page_head('Input Recorded', $logged_in_user);
page_head('Input Recorded');
echo "<span class=\"title\">Helpdesk Input Recorded</span>";
echo "<p>Your input has been successfully recorded. Thank you for your help.</p>";
} else {
page_head('Vote Registered', $logged_in_user);
page_head('Vote Registered');
echo "<span class=\"title\">Vote Registered</span>";
echo "<p>Your rating has been successfully recorded. Thank you for your input.</p>";
}
echo "<a href=\"thread.php?id=", $post->thread, "#", $post->id, "\">Return to thread</a>";
} else {
page_head('Vote Submission Problem', $logged_in_user);
page_head('Vote Submission Problem');
echo "<span class=\"title\">Vote submission failed</span>";
if ($post) {
echo "<p>There was a problem recording your vote in our database. Please try again later.</p>";

View File

@ -44,9 +44,9 @@ $helpdesk = $category->is_helpdesk;
// TODO: Write a function for this.
if ($helpdesk) {
page_head('Questions and problems', $logged_in_user);
page_head('Questions and problems');
} else {
page_head('Message boards', $logged_in_user);
page_head('Message boards');
}
show_forum_title($forum, $thread, $helpdesk);

View File

@ -34,9 +34,9 @@ if (!$sort_style) {
}
if ($category->is_helpdesk) {
page_head(PROJECT.': Questions and problems', $logged_in_user);
page_head(PROJECT.': Questions and problems');
} else {
page_head(PROJECT.': Message boards', $logged_in_user);
page_head(PROJECT.': Message boards');
}
// TODO: Constant for default sort style and filter values.

View File

@ -3,6 +3,7 @@
require_once("../project/project.inc");
require_once("../inc/profile.inc");
require_once("../inc/util.inc");
require_once("../inc/uotd.inc");
$alphabet = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9');
@ -57,7 +58,7 @@ function build_picture_pages($width, $height) {
$file = PROFILE_PATH . "user_gallery_" . $page . ".html";
$descriptor = fopen($file, "w");
page_head("User Picture Gallery: Page $page of $numPages", null, $descriptor, false);
page_head("User Picture Gallery: Page $page of $numPages", $descriptor);
fwrite($descriptor,
"<h2>User Profile Pictures</h2>Last updated "
@ -229,7 +230,7 @@ function build_profile_pages($members, $pageHead, $pageTitle, $rowsPerPage, $col
$descriptor = fopen($filename, "w");
$head = $pageHead . ": Page $page of $numPages";
page_head($pageHead, null, $descriptor, false);
page_head($pageHead, $descriptor);
fwrite($descriptor, "<h2>$pageTitle</h2>\n");
fwrite($descriptor, "Last updated " . pretty_time_str(time()) . "<p>\n");
@ -252,7 +253,7 @@ function build_country_summary_page($countryMembers) {
$filename = PROFILE_PATH . "profile_country.html";
$descriptor = fopen($filename, "w");
page_head("User Profiles by Country", null, $descriptor, false);
page_head("User Profiles by Country", $descriptor);
fwrite($descriptor, "<h2>User Profiles by Country</h2>Last updated " . pretty_time_str(time()) . "<p>");
fwrite($descriptor, "<table border=0>\n");
@ -296,87 +297,4 @@ function build_alpha_summary_page($characters) {
fclose($descriptor);
}
function uotd_thumbnail($profile, $user) {
return "<a href=view_profile?userid=$user->id><img align=left src=" . IMAGE_URL . $user->id . "_sm.jpg></a>";
}
function generate_uotd_page($profile, $user) {
$filename = PROFILE_PATH."uotd.html";
$descriptor = fopen($filename, "w");
if ($profile->has_picture) {
fwrite($descriptor, uotd_thumbnail($profile, $user));
}
$x = user_links($user);
fwrite($descriptor, "The " . PROJECT . " User of the Day is $x");
fclose($descriptor);
}
// return the last UOTD profile, or null
//
function get_current_uotd() {
$result = mysql_query("SELECT * FROM profile ORDER BY uotd_time DESC LIMIT 1");
if (mysql_num_rows($result) > 0) {
$p = mysql_fetch_object($result);
} else {
$p = null;
}
return mysql_free_result($result);
return $p;
}
// see if it's time to pick a new UOTD.
// Either way, generate the UOTD page
//
function build_uotd_page() {
$current_utod = get_current_uotd();
if ($current_utod) {
$assigned = getdate($current_uotd->uotd_time);
$now = getdate(time());
if ($assigned['mday'] == $now['mday']) {
$user = lookup_user_id($current_uotd->userid);
generate_uotd_page($current_uotd, $user);
exit();
}
}
// TODO: Verify that adding RAND() didn't screw this up.
$result = mysql_query("SELECT * FROM profile WHERE verification = 1 AND uotd_time IS NULL ORDER BY RAND()");
// If the number of approved profiles dips below a threshold,
// email the sys admin every time we pick a new one.
//
if ($result && mysql_num_rows($result) < UOTD_THRESHOLD) {
mail(SYS_ADMIN_EMAIL,
PROJECT . ": User of the Day pool is running low!",
"The pool of approved candidates for User of the Day has
reached your assigned threshold: there are now only " . mysql_num_rows($result) . " approved users.\n\n
To approve more candidates for User of the Day,
direct your web browser to the " . PROJECT . " administration page and click \"Unrated profile\""
);
}
if ($result && mysql_num_rows($result) == 0) {
// If all verified profiles have been selected as UOTD, reshow the one that was shown least recently.
$result = mysql_query("SELECT * FROM profile WHERE verification = 1 ORDER BY uotd_time ASC LIMIT 1");
}
if (!$result || mysql_num_rows($result) == 0) {
// No valid users of the day - do something.
exit();
}
$profile = mysql_fetch_object($result);
$user = lookup_user_id($profile->userid);
generate_uotd_page($profile, $user);
$sql = "UPDATE profile SET uotd_time = " . time() . " WHERE userid=$user->id";
mysql_query($sql);
mail($user->email_addr,
"You're the " . PROJECT . " user of the day!",
"Congratulations!\n\nYou've been chosen as the "
. PROJECT . " user of the day!
Your profile will be featured on the " . PROJECT . " website for the next 24 hours."
);
}
?>

85
html/inc/uotd.inc Normal file
View File

@ -0,0 +1,85 @@
<?
function uotd_thumbnail($profile, $user) {
return "<a href=view_profile?userid=$user->id><img align=left src=" . IMAGE_URL . $user->id . "_sm.jpg></a>";
}
function generate_uotd_page($profile, $user) {
$filename = PROFILE_PATH."uotd.html";
$descriptor = fopen($filename, "w");
if ($profile->has_picture) {
fwrite($descriptor, uotd_thumbnail($profile, $user));
}
$x = user_links($user);
fwrite($descriptor, "The " . PROJECT . " User of the Day is $x");
fclose($descriptor);
}
// return the last UOTD profile, or null
//
function get_current_uotd() {
$result = mysql_query("SELECT * FROM profile ORDER BY uotd_time DESC LIMIT 1");
$p = null;
if (mysql_num_rows($result) > 0) {
$p = mysql_fetch_object($result);
}
mysql_free_result($result);
return $p;
}
// see if it's time to pick a new UOTD.
// Either way, generate the UOTD page
//
function build_uotd_page() {
$current_uotd = get_current_uotd();
if ($current_uotd) {
$assigned = getdate($current_uotd->uotd_time);
$now = getdate(time());
if ($assigned['mday'] == $now['mday']) {
$user = lookup_user_id($current_uotd->userid);
generate_uotd_page($current_uotd, $user);
exit();
}
}
// TODO: Verify that adding RAND() didn't screw this up.
$result = mysql_query("SELECT * FROM profile WHERE verification = 1 AND uotd_time IS NULL ORDER BY RAND()");
// If the number of approved profiles dips below a threshold,
// email the sys admin every time we pick a new one.
//
if ($result && mysql_num_rows($result) < UOTD_THRESHOLD) {
mail(SYS_ADMIN_EMAIL,
PROJECT . ": User of the Day pool is running low!",
"The pool of approved candidates for User of the Day has".
"reached your assigned threshold: there are now only " . mysql_num_rows($result) . " approved users.\n\n".
"To approve more candidates for User of the Day,".
"go to the " . PROJECT . " administration page and click \"Unrated profile\""
);
}
if ($result && mysql_num_rows($result) == 0) {
// If all verified profiles have been selected as UOTD, reshow the one that was shown least recently.
$result = mysql_query("SELECT * FROM profile WHERE verification = 1 ORDER BY uotd_time ASC LIMIT 1");
}
if (!$result || mysql_num_rows($result) == 0) {
// No valid users of the day - do something.
exit();
}
$profile = mysql_fetch_object($result);
$user = lookup_user_id($profile->userid);
generate_uotd_page($profile, $user);
$sql = "UPDATE profile SET uotd_time = " . time() . " WHERE userid=$user->id";
mysql_query($sql);
mail($user->email_addr,
"You're the " . PROJECT . " user of the day!",
"Congratulations!\n\nYou've been chosen as the "
. PROJECT . " user of the day!
Your profile will be featured on the " . PROJECT . " website for the next 24 hours."
);
}
?>

View File

@ -122,7 +122,7 @@ function write_fd($fd, $str) {
}
}
function page_head($title, $user=null, $fd=null) {
function page_head($title, $fd=null) {
$styleSheet = URL_BASE . STYLESHEET;
write_fd($fd,
@ -132,7 +132,7 @@ function page_head($title, $user=null, $fd=null) {
<body bgcolor=ffffff>
"
);
project_banner($user, $fd);
project_banner($fd);
}
function page_tail($is_main=false, $fd=null) {

View File

@ -6,7 +6,7 @@
$user = get_logged_in_user();
page_head("Account setup", $user);
page_head("Account setup");
echo "
<h3>Account setup</h3>
".PROJECT." uses the BOINC software system.

View File

@ -13,7 +13,7 @@ if ($user == NULL) {
exit();
}
page_head("Account setup", $user);
page_head("Account setup");
echo "
<h3>Account setup</h3>
Thank you for letting ".PROJECT." use part of your computer power.

View File

@ -7,7 +7,7 @@ require_once("../inc/download.inc");
db_init();
$user = get_logged_in_user();
page_head("Download BOINC software", $user);
page_head("Download BOINC software");
echo "
Your account setup is complete.

View File

@ -7,7 +7,7 @@ include_once("../inc/prefs.inc");
db_init();
$user = get_logged_in_user();
page_head("Account setup: resource share", $user);
page_head("Account setup: resource share");
echo "
<h3>Account setup</h3>
";

View File

@ -7,7 +7,7 @@ include_once("../inc/prefs.inc");
db_init();
$user = get_logged_in_user();
page_head("Account setup: done", $user);
page_head("Account setup: done");
echo "
<h3>Account setup: done</h3>

View File

@ -22,7 +22,7 @@ include_once("../inc/util.inc");
fputs($f, $x);
fclose($f);
page_head("Problem report recorded", $user);
page_head("Problem report recorded");
echo "
Your problem report has been recorded.
We apologize for any inconvience you may have experienced.

View File

@ -22,7 +22,7 @@ function print_platform_select() {
$user = get_logged_in_user();
page_head("Problem Report Form", $user);
page_head("Problem Report Form");
echo "
<h3>Problem Report Form</h3>

View File

@ -19,7 +19,7 @@ if (parse_config("<disable_account_creation/>")) {
}
$userid = $_GET['userid'];
echo "
<h1>Create an Account with ".PROJECT." </h1>
<h1>Create an account with ".PROJECT." </h1>
<p><b>Read the <a href=info.php>Rules and Policies</a>
before creating an account.</b></p>
@ -34,47 +34,31 @@ if ($userid) {
<input type=hidden name=userid value=$userid>
";
}
echo "
<table class=content border=0 cellpadding=5 cellspacing=0>
<tr>
<th colspan=2>Create Account</th>
</tr>
<tr>
<td class=item>
Name
<br><span class=description>Identifies you on our web site. Use your real name or a nickname.</span>
</td>
<td class=col1><input name=new_name size=30></td>
</tr>
<tr>
<td class=item>
Email Address
<br><span class=description>Must be a valid address of the form 'name@domain'.</span>
</td>
<td class=col1><input name=new_email_addr size=50></td>
</tr>
<tr>
<td class=item>
Country
<br><span class=description>Select the country you want to represent, if any.</span>
</td>
<td class=col1>
<select name=country>
";
start_table();
row1("Create account");
row2(
"Name<br><span class=description>Identifies you on our web site. Use your real name or a nickname.</span>",
"<input name=new_name size=30>"
);
row2(
"Email Address<br><span class=description>Must be a valid address of the form 'name@domain'.</span>",
"<input name=new_email_addr size=50>"
);
row2_init(
"Country <br><span class=description>Select the country you want to represent, if any.</span>",
"<select name=country>"
);
print_country_select();
echo "</select></td></tr>\n";
row2(
"Postal or ZIP Code <br><span class=description>Optional.</span>",
"<input name=postal_code size=20>"
);
row2("",
"<input type=submit value='Create Account'>"
);
end_table();
echo "
</select>
</td>
</tr>
<tr>
<td class=item>
Postal or ZIP Code
<br><span class=description>Optional.</span>
</td>
<td class=col1><input name=postal_code size=20></td>
</tr>
</table>
<p style=text-align:center><input type=submit value='Create Account'></p>
</form>
";

View File

@ -7,15 +7,15 @@ require_once("../inc/countries.inc");
db_init();
$user = get_logged_in_user();
page_head("Edit user information", $user);
page_head("Edit user information");
echo "<form method=post action=edit_user_info_action.php>";
start_table();
row1("Edit account info");
row2("Name",
row2("Name<br><font size=-2>real name or nickname</font>",
"<input name=user_name size=30 value='$user->name'>"
);
row2("URL",
row2("URL<br><font size=-2>of your web page; optional</font>",
"http://<input name=url size=50 value='$user->url'>"
);
row2_init("Country",
@ -23,12 +23,16 @@ row2_init("Country",
);
print_country_select($user->country);
echo "</select></td></tr>\n";
row2("Postal (ZIP) code",
row2("Postal (ZIP) code<br><font size=-2>Optional</font>",
"<input name=postal_code size=20 value='$user->postal_code'>"
);
$x = "<textarea name=signature rows=4 cols=50>$user->signature</textarea>";
row2("Signature for message boards", $x);
row2("Signature for message boards".
"<br><a href=html.php><font size=-2>May contain HTML tags</font></a>".
"<br><font size=-2>Optional</font>",
$x
);
row2("", "<input type=submit value='Update info'>");
end_table();
echo "</form>\n";

View File

@ -7,7 +7,7 @@
db_init();
$user = get_logged_in_user();
page_head("User page", $user);
page_head("User page");
show_user_page_private($user);
page_tail();
?>

View File

@ -7,7 +7,7 @@ require_once("../inc/host.inc");
db_init();
$user = get_logged_in_user();
page_head("Merge host", $user);
page_head("Merge host");
$hostid = $_GET["hostid"];
$result = mysql_query("select * from host where id=$hostid");

View File

@ -5,10 +5,6 @@
// don't want to use DB here, because master page won't be visible
// if DB is down
//
//db_init();
//$user = get_logged_in_user(false);
//page_head("Home page", $user);
page_head(PROJECT);
@ -37,7 +33,7 @@ if (project_is_stopped()) {
<h3>Returning participants</h3>
<ul>
<li><a href=".URL_BASE."login_form.php>Log in</a>
<li><a href=".URL_BASE."login_form.php>Log in or out</a>
<li><a href=".URL_BASE."home.php>User page</a> - view stats, modify preferences
<li><a href=".URL_BASE."team.php>Teams</a> - create or join a team
<li><a href=".URL_BASE."download.php>Download BOINC</a>
@ -47,8 +43,6 @@ if (project_is_stopped()) {
<li><a href=".URL_BASE."profile_menu.php>User profiles</a>
<li><a href=".URL_BASE."forum/>Message boards</a>
<li><a href=".URL_BASE."forum/help_desk.php>Questions and problems</a>
<li> User-supplied FAQ by
<a href=http://users.iafrica.com/c/ch/chrissu/boinc-README.html>Chris Sutton</a>
";

View File

@ -10,7 +10,7 @@
$user = get_user_from_auth($authenticator);
}
page_head("Log in", $user);
page_head("Log in");
print_login_form_aux($next_url, $user);
page_tail();

View File

@ -6,7 +6,7 @@
db_init();
$user = get_logged_in_user();
page_head("Pending credit", $user);
page_head("Pending credit");
$res = mysql_query("select * from result where userid=$user->id and validate_state=0");
$sum = 0;
start_table();

View File

@ -13,7 +13,7 @@ $venue = $_GET["venue"];
$title = "Edit ".subset_name($subset)." preferences";
if ($venue) $title = "$title for $venue";
page_head($title, $user);
page_head($title);
echo "<h3>$title</h3>\n";

View File

@ -18,7 +18,7 @@
$private = true;
}
page_head("Computer summary", $user);
page_head("Computer summary");
show_host($host, $private, $ipprivate);
page_tail();
?>

View File

@ -22,7 +22,7 @@ echo "<p>".PROJECT." participants may form <b>teams</b>.
<li> disband a team if it has no members.
</ul>
<p>
<form method=post action=team_lookup.php>
<form method=get action=team_lookup.php>
Search for a team whose name contains:
<input name=team_name>
<input type=submit name=search value=Search>

View File

@ -7,7 +7,7 @@
db_init();
init_session();
$team_name = $_POST["team_name"];
$team_name = $_GET["team_name"];
$words = preg_split("/[\s,]+/", $team_name);
$length = count($words);
$name_lc = strtolower($team_name);

View File

@ -18,7 +18,7 @@
}
require_founder_login($user, $team);
page_head("Removing users from $team->name", $user);
page_head("Removing users from $team->name");
$nmembers = 0;
for ($i=0; $i<$_POST["ninactive_users"]; $i++) {
if ($_POST["remove_$i"] != 0) {

View File

@ -19,7 +19,7 @@
$n = 10;
db_init();
page_head("Top computers", null, null, false);
page_head("Top computers");
if ($sort_by == "total_credit") {
$sort_clause = "total_credit desc, total_credit desc";
} else {

View File

@ -17,7 +17,7 @@
db_init();
$numusers = 100;
page_head("Top $numusers users", null, null, false);
page_head("Top $numusers users");
$result = mysql_query("select * from user order by $sort_order limit $numusers");
row1("Users", 6);
user_table_start();