version 1.99.2.5, 2004/08/31 18:33:44
|
version 1.99.2.8, 2004/09/15 20:35:16
|
Line 92 sub list_discussion {
|
Line 92 sub list_discussion {
|
# Get discussion display settings for this discussion |
# Get discussion display settings for this discussion |
my $lastkey = $ressymb.'_lastread'; |
my $lastkey = $ressymb.'_lastread'; |
my $showkey = $ressymb.'_showonlyunread'; |
my $showkey = $ressymb.'_showonlyunread'; |
my $visitkey = $ressymb.'_visit'; |
|
my $ondispkey = $ressymb.'_markondisp'; |
my $ondispkey = $ressymb.'_markondisp'; |
my %dischash = &Apache::lonnet::get('nohist_'.$ENV{'request.course.id'}.'_discuss',[$lastkey,$showkey,$visitkey,$ondispkey],$ENV{'user.domain'},$ENV{'user.name'}); |
my %dischash = &Apache::lonnet::get('nohist_'.$ENV{'request.course.id'}.'_discuss',[$lastkey,$showkey,$ondispkey],$ENV{'user.domain'},$ENV{'user.name'}); |
my %discinfo = (); |
my %discinfo = (); |
my $showonlyunread = 0; |
my $showonlyunread = 0; |
my $markondisp = 0; |
my $markondisp = 0; |
my $prevread = 0; |
my $prevread = 0; |
my $previous = 0; |
my $previous = 0; |
my $visit = 0; |
|
my $newpostsflag = 0; |
my $newpostsflag = 0; |
|
|
# Retain identification of "NEW" posts identified in last display, if continuing 'previous' browsing of posts. |
# Retain identification of "NEW" posts identified in last display, if continuing 'previous' browsing of posts. |
Line 115 sub list_discussion {
|
Line 113 sub list_discussion {
|
} |
} |
|
|
# Get discussion display default settings for user |
# Get discussion display default settings for user |
my %userenv = &Apache::lonnet::get('environment',['discdisplay','discmarkread'],$ENV{'user.domain'},$ENV{'user.name'}); |
if ($ENV{'environment.discdisplay'} eq 'unread') { |
my $discdisplay=$userenv{'discdisplay'}; |
|
if ($discdisplay eq 'unread') { |
|
$showonlyunread = 1; |
$showonlyunread = 1; |
} |
} |
my $discmarkread=$userenv{'discmarkread'}; |
if ($ENV{'environment.discmarkread'} eq 'ondisp') { |
if ($discmarkread eq 'ondisp') { |
|
$markondisp = 1; |
$markondisp = 1; |
} |
} |
|
|
# Override user's default if user specified display setting for this discussion |
# Override user's default if user specified display setting for this discussion |
if (defined($dischash{$ondispkey})) { |
if (defined($dischash{$ondispkey})) { |
$markondisp = $dischash{$ondispkey}; |
unless ($dischash{$showkey} eq '') { |
|
$markondisp = $dischash{$ondispkey}; |
|
} |
} |
} |
if ($markondisp) { |
if ($markondisp) { |
$discinfo{$lastkey} = time; |
$discinfo{$lastkey} = time; |
} |
} |
|
|
if (defined($dischash{$showkey})) { |
if (defined($dischash{$showkey})) { |
$showonlyunread = $dischash{$showkey}; |
unless ($dischash{$showkey} eq '') { |
|
$showonlyunread = $dischash{$showkey}; |
|
} |
} |
} |
|
|
if (defined($dischash{$visitkey})) { |
|
$visit = $dischash{$visitkey}; |
|
} |
|
$visit ++; |
|
|
|
my $seeid=&Apache::lonnet::allowed('rin',$crs); |
my $seeid=&Apache::lonnet::allowed('rin',$crs); |
my $viewgrades=(&Apache::lonnet::allowed('vgr',$crs) |
my $viewgrades=(&Apache::lonnet::allowed('vgr',$crs) |
&& ($symb=~/\.(problem|exam|quiz|assess|survey|form)$/)); |
&& ($symb=~/\.(problem|exam|quiz|assess|survey|form)$/)); |
Line 166 sub list_discussion {
|
Line 160 sub list_discussion {
|
} |
} |
|
|
my $now = time; |
my $now = time; |
$discinfo{$visitkey} = $visit; |
if (%discinfo) { |
|
&Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'}); |
&Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'}); |
} |
|
|
if ($contrib{'version'}) { |
if ($contrib{'version'}) { |
my $oldest = $contrib{'1:timestamp'}; |
my $oldest = $contrib{'1:timestamp'}; |
Line 223 sub list_discussion {
|
Line 217 sub list_discussion {
|
if ($hidden) { |
if ($hidden) { |
$message='<font color="#888888">'.$message.'</font>'; |
$message='<font color="#888888">'.$message.'</font>'; |
} |
} |
my $screenname=&Apache::loncommon::screenname( |
# my $screenname=&Apache::loncommon::screenname( |
$contrib{$idx.':sendername'}, |
# $contrib{$idx.':sendername'}, |
$contrib{$idx.':senderdomain'}); |
# $contrib{$idx.':senderdomain'}); |
my $plainname=&Apache::loncommon::nickname( |
# my $plainname=&Apache::loncommon::nickname( |
$contrib{$idx.':sendername'}, |
# $contrib{$idx.':sendername'}, |
$contrib{$idx.':senderdomain'}); |
# $contrib{$idx.':senderdomain'}); |
|
($$screenname,$$plainname)=($$contrib{$idx.':screenname'}, |
|
$$contrib{$idx.':plainname'}); |
my $sender=&mt('Anonymous'); |
my $sender=&mt('Anonymous'); |
if ((!$contrib{$idx.':anonymous'}) || ($seeid)) { |
if ((!$contrib{$idx.':anonymous'}) || ($seeid)) { |
$sender=&Apache::loncommon::aboutmewrapper( |
$sender=&Apache::loncommon::aboutmewrapper( |