'.
'';
}
@@ -755,10 +759,11 @@ ENDDISCUSS
}
sub build_posting_display {
- my ($usernamesort,$subjectsort,$namesort,$notshown,$newitem,$dischash,$shown,$alldiscussion,$imsitems,$imsfiles,$roleinfo,$discussionitems,$replies,$depth,$posters,$maxdepth,$visible,$newpostsflag,$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$ressymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,$rolefilter,$sectionpick,$statusfilter,$toggkey,$outputtarget) = @_;
+ my ($usernamesort,$subjectsort,$namesort,$notshown,$newitem,$dischash,$shown,$alldiscussion,$imsitems,$imsfiles,$roleinfo,$discussionitems,$replies,$depth,$posters,$maxdepth,$visible,$newpostsflag,$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$ressymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,$rolefilter,$sectionpick,$statusfilter,$toggkey,$outputtarget,$anonhash,$anoncnt) = @_;
my @original=();
my @index=();
my $symb=&Apache::lonenc::check_decrypt($ressymb);
+ my $escsymb=&Apache::lonnet::escape($ressymb);
my %contrib=&Apache::lonnet::restore($symb,$env{'request.course.id'},
$env{'course.'.$env{'request.course.id'}.'.domain'},
$env{'course.'.$env{'request.course.id'}.'.num'});
@@ -822,6 +827,13 @@ sub build_posting_display {
my %allattachments = ();
my ($screenname,$plainname);
my $sender = &mt('Anonymous');
+# Anonymous users getting number within a discussion
+# Since idx is in static order, this should give the same sequence every time.
+ my $key=$contrib{$idx.':sendername'}.'@'.$contrib{$idx.':senderdomain'};
+ unless ($$anonhash{$key}) {
+ $anoncnt++;
+ $$anonhash{$key}=&mt('Anonymous').' '.$anoncnt;
+ }
my ($message,$subject,$vgrlink,$ctlink);
&get_post_contents(\%contrib,$idx,$seeid,$outputtarget,\%messages,\%subjects,\%allattachments,\%attachtxt,$imsfiles,\$screenname,\$plainname,$numoldver);
@@ -860,7 +872,7 @@ sub build_posting_display {
$contrib{$idx.':sendername'}.' at '.
$contrib{$idx.':senderdomain'}.')';
if ($contrib{$idx.':anonymous'}) {
- $sender.=' ['.&mt('anonymous').'] '.
+ $sender.=' ['.$$anonhash{$key}.'] '.
$screenname;
}
@@ -896,13 +908,13 @@ sub build_posting_display {
if ($env{'course.'.$env{'request.course.id'}.'.allow_discussion_post_editing'} =~ m/yes/i) {
if (($env{'user.domain'} eq $contrib{$idx.':senderdomain'}) && ($env{'user.name'} eq $contrib{$idx.':sendername'})) {
$sender.=' '.&mt('Edit').'';
unless ($seeid) {
- $sender.=" ';
}
}
@@ -911,7 +923,7 @@ sub build_posting_display {
if ($hidden) {
unless ($studenthidden) {
$sender.=' ';
}
$sender.=' '.&mt('Display all versions').'';
+ $$discussionitems[$idx] .= ' '.&mt('Display all versions').'';
}
$$discussionitems[$idx].=' '.&mt('Earlier version(s) were posted on: ');
if ($contrib{$idx.':history'} =~ m/:/) {
@@ -1166,11 +1180,11 @@ sub get_post_contents {
# $$screenname=&Apache::loncommon::screenname(
# $$contrib{$idx.':sendername'},
# $$contrib{$idx.':senderdomain'});
-# $$plainname=&Apache::loncommon::nickname(
-# $$contrib{$idx.':sendername'},
-# $$contrib{$idx.':senderdomain'});
- ($$screenname,$$plainname)=($$contrib{$idx.':screenname'},
- $$contrib{$idx.':plainname'});
+ $$plainname=&Apache::loncommon::nickname(
+ $$contrib{$idx.':sendername'},
+ $$contrib{$idx.':senderdomain'});
+ $$screenname=$$contrib{$idx.':screenname'};
+
my $sender=&Apache::loncommon::aboutmewrapper(
$$plainname,
$$contrib{$idx.':sendername'},
@@ -2294,7 +2308,8 @@ sub screen_header {
&mt('Contribution to course discussion of resource');
$discussoptions.=' ';
+ ' ('.&mt('name only visible to course faculty').') '.
+ ''.&mt('Change Screenname').'';
}
}
if ($msgoptions) { $msgoptions=' '.&mt('Sending Messages').''.$msgoptions; }
|