version 1.96, 2004/11/19 19:31:13
|
version 1.97, 2004/11/19 20:17:52
|
Line 141 sub select_recent {
|
Line 141 sub select_recent {
|
return $return; |
return $return; |
} |
} |
|
|
|
sub get_recent { |
|
my ($area, $n) = @_; |
|
my %recent=&Apache::lonnet::dump(&recent_filename($area)); |
|
|
|
# Create hash with key as time and recent as value |
|
my %time_hash = (); |
|
foreach (keys %recent) { |
|
my $thistime=(split(/\&/,$recent{$_}))[0]; |
|
$time_hash{$thistime} = $_; |
|
} |
|
|
|
# Sort by decreasing time and return key value pairs |
|
my %return_hash = (); |
|
my $idx = 1; |
|
foreach (reverse sort keys %time_hash) { |
|
$return_hash{$time_hash{$_}} = |
|
&Apache::lonnet::unescape((split(/\&/,$recent{$_}))[1]); |
|
if ($n && ($idx++ >= $n)) {last;} |
|
} |
|
|
|
return %return_hash; |
|
} |
|
|
|
|
|
|
=pod |
=pod |
|
|