diff --git a/checkin_notes b/checkin_notes index 02ef1b1253..7623503fc4 100644 --- a/checkin_notes +++ b/checkin_notes @@ -12520,3 +12520,15 @@ David 24 Dec 2007 show_user.php sched/ sched_send.C + +David 24 Dec 2007 + - web: default for user_links() is to not show profile pic. + Show the pic only in the context of friends list. + + html/ + inc/ + forum.inc + util.inc + user.inc + user/ + friend.php diff --git a/db/bolt_schema.sql b/db/bolt_schema.sql index 6f57166ec2..91f273d5da 100644 --- a/db/bolt_schema.sql +++ b/db/bolt_schema.sql @@ -72,14 +72,18 @@ create table bolt_exercise_result ( create table bolt_exercise_set_result ( id integer not null auto_increment, score double not null, + view_id integer not null, + -- the answer page of last exercise in set + name varchar(255) not null, + -- logical name of result set unit primary key(id) ); create table bolt_refresh ( id integer not null auto_increment, - view_id integer not null, + set_result_id integer not null, + -- most recent result for this set due_time integer not null, - name varchar(255) not null, - state text not null, + -- when to trigger review primary key (id) ); diff --git a/doc/addon_data.php b/doc/addon_data.php index 4cc41e21f3..291471f172 100644 --- a/doc/addon_data.php +++ b/doc/addon_data.php @@ -475,6 +475,15 @@ array('http://download.conmunix.net/pub/boinc_lcs/boinc_lcs_3.0_beta.tar.gz', 'Boinc LCS is a free PHP based script, that allows you to monitor the current state (and other information) from each of your connected BOINC clients. It runs on a simple webserver and since version 2.1 it is also platform independent. Boinc LCS is released under the GNU/GPL license. You can modify and redistribute or just using it!', '1193023938' ), +array('b-sig.zip', + 'Forum signature showing jobs in progress', + '', + 'A PHP script that generates a forum signature showing jobs in progress', + '', + 'Apache, PHP, and GD', + 'A PHP script that generates an image, appropriate for use as a forum signature, showing BOINC jobs in progress on the server computer', + 1198534706 +), array('boincphpgui-2.3.tar.gz', 'BoincPHP5-GUI', '2.3', diff --git a/doc/boinc_news.php b/doc/boinc_news.php index 9a54e3ac95..e77ab28f05 100644 --- a/doc/boinc_news.php +++ b/doc/boinc_news.php @@ -2,6 +2,10 @@ $project_news = array( +array("Dec 26, 2007", + "A story in the Chicago Tribune, \"Bit by bit, home computers aid science\", + highlights Cosmology@home." +), array("Dec 18, 2007", "The Lattice Project, based at the University of Maryland diff --git a/doc/links.php b/doc/links.php index 2b3baef4cc..06631c0abb 100644 --- a/doc/links.php +++ b/doc/links.php @@ -87,6 +87,7 @@ echo "
If you'd like to add a web site to this list, please
contact us.
+
+
+BOINC-related videos
+
+
";
page_tail();
?>
diff --git a/html/inc/bolt.inc b/html/inc/bolt.inc
index 4228252ff6..5d160cbfbf 100644
--- a/html/inc/bolt.inc
+++ b/html/inc/bolt.inc
@@ -82,7 +82,6 @@ class BoltSequence extends BoltUnit {
}
function walk(&$iter, $incr, &$frac_done) {
- //echo "call to walk() for $this->name: next: $next\n";
$n = count($this->units);
if (array_key_exists($this->name, $iter->state)) {
$state_rec = $iter->state[$this->name];
@@ -125,6 +124,7 @@ class BoltSequence extends BoltUnit {
if ($i == $n) {
$frac_done = 1;
$state_rec['i'] = 0;
+ $state_rec['child_name'] = null;
$iter->state[$this->name] = $state_rec;
return true;
}
@@ -136,8 +136,8 @@ class BoltSequence extends BoltUnit {
$child = $this->units[$i];
$frac_done = $i/$n;
$state_rec = null;
- $state_rec->i = $i;
- $state_rec->child_name = $child->name;
+ $state_rec['i'] = $i;
+ $state_rec['child_name'] = $child->name;
$iter->state[$this->name] = $state_rec;
if ($child->is_item) {
$iter->item = $child;
@@ -148,6 +148,103 @@ class BoltSequence extends BoltUnit {
}
}
+// state for random unit is:
+// seed The RNG seed used to shuffle
+// i index of current child
+// number_shown number of units shown so far (not necessarily the
+// same as i on 2nd and later pass through this unit)
+// child_name name of current child
+class BoltRandom extends BoltUnit {
+ public $units;
+ function __construct($n, $u, $n) {
+ $this->name = $n;
+ $this->units = $u;
+ $this->is_item = false;
+ $this->number = $n;
+ $this->shuffled = false;
+ }
+
+ function walk(&$iter, $incr, &$frac_done) {
+ $n = count($this->units);
+ if (array_key_exists($this->name, $iter->state)) {
+ $state_rec = $iter->state[$this->name];
+ $child_name = $state_rec['child_name'];
+ $number_shown = $state_rec['number_shown'];
+ if (!$this->shuffled) {
+ srand($state_rec['seed']);
+ shuffle($this->units);
+ $this->shuffled = true;
+ }
+
+ // look up unit by name
+ //
+ $child = null;
+ for ($i=0; $i<$n; $i++) {
+ $c = $this->units[$i];
+ if ($c->name == $child_name) {
+ $child = $c;
+ break;
+ }
+ }
+
+ // if not there, look up by index
+ //
+ if (!$child) {
+ $i = $state_rec['i'];
+ if ($i >= $n) {
+ // and if index is too big, use last unit
+ //
+ $i = $n-1;
+ }
+ $child = $this->units[$i];
+ }
+
+ // at this point, $child is the current unit, and $i is its index
+ //
+ if ($incr) {
+ $my_inc = false;
+ if ($child->is_item) {
+ $my_inc = true;
+ } else {
+ $my_inc = $child->walk($iter, $incr, $frac_done);
+ }
+ if ($my_inc) {
+ $i = ($i+1)%$n;
+ $number_shown++;
+ if ($number_shown >= $this->number) {
+ $frac_done = 1;
+ $state_rec['i'] = $i;
+ $state_rec['number_shown'] = 0;
+ $state_rec['child_name'] = null;
+ $iter->state[$this->name] = $state_rec;
+ return true;
+ }
+ }
+ }
+ } else {
+ $i = 0;
+ $number_shown = 0;
+ $state_rec = null;
+ $seed = ((double)microtime()*1000000);
+ srand($seed);
+ shuffle($this->units);
+ $state_rec['seed'] = $seed;
+ }
+ $child = $this->units[$i];
+ $frac_done = $number_shown/$this->number;
+ $state_rec['i'] = $i;
+ $state_rec['number_shown'] = $number_shown;
+ $state_rec['child_name'] = $child->name;
+ $iter->state[$this->name] = $state_rec;
+ if ($child->is_item) {
+ $iter->item = $child;
+ } else {
+ $child->walk($iter, false, $f);
+ $frac_done += $f*(1/$number);
+ }
+ }
+}
+
class BoltItem extends BoltUnit {
public $filename;
function __construct($name, $title, $filename) {
@@ -200,6 +297,10 @@ function title($n) {
return array('title', $n);
}
+function number($n) {
+ return array('number', $n);
+}
+
function filename($n) {
return array('filename', $n);
}
@@ -212,13 +313,6 @@ function review($s, $u) {
return new BoltReview($s, $u);
}
-function exercise_set() {
- $args = func_get_args();
- foreach ($args as $arg) {
- return $arg;
- }
-}
-
function refresh() {
}
@@ -300,6 +394,53 @@ function sequence() {
return new BoltSequence($name, $units);
}
+function random() {
+ $args = func_get_args();
+ $units = array();
+ $name = "";
+ $number = 1;
+ foreach ($args as $arg) {
+ if (is_array($arg)) {
+ switch ($arg[0]) {
+ case 'name': $name = $arg[1]; break;
+ case 'title': $title = $arg[1]; break;
+ case 'number': $number = $arg[1]; break;
+ default: echo "Unrecognized array arg: ", $arg[0], "\n"; break;
+ }
+ } else if (is_object($arg)) {
+ if (is_subclass_of($arg, "BoltUnit")) {
+ $units[] = $arg;
+ } else {
+ echo "Unrecognized arg";
+ }
+ }
+ }
+ return new BoltRandom($name, $units, $number);
+}
+
+function exercise_set() {
+ $args = func_get_args();
+ $units = array();
+ $name = "";
+ foreach ($args as $arg) {
+ if (is_array($arg)) {
+ switch ($arg[0]) {
+ case 'name': $name = $arg[1]; break;
+ case 'title': $title = $arg[1]; break;
+ case 'number': $number = $arg[1]; break;
+ default: echo "Unrecognized array arg: ", $arg[0], "\n"; break;
+ }
+ } else if (is_object($arg)) {
+ if (is_subclass_of($arg, "BoltUnit")) {
+ $units[] = $arg;
+ } else {
+ echo "Unrecognized arg";
+ }
+ }
+ }
+ return new BoltExerciseSet($name, $units, $number);
+}
+
function enum_course($course) {
$iter = new BoltIter($course);
while (1) {
diff --git a/html/inc/forum.inc b/html/inc/forum.inc
index 66101cc7b1..a831751956 100644
--- a/html/inc/forum.inc
+++ b/html/inc/forum.inc
@@ -490,7 +490,7 @@ function show_post(