fix [1152434 ] Last Reply column is blank in a forum
This commit is contained in:
parent
470670894e
commit
625d0545bf
2 changed files with 23 additions and 2 deletions
|
|
@ -126,9 +126,17 @@ sub getIcon {
|
||||||
return $session{config}{extrasURL}.'/assets/thread.gif';
|
return $session{config}{extrasURL}.'/assets/thread.gif';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub getName {
|
sub getLastPost {
|
||||||
return "Thread";
|
my $self = shift;
|
||||||
|
my $lastPostId = $self->get("lastPostId");
|
||||||
|
my $lastPost = 0;
|
||||||
|
if ($lastPostId) {
|
||||||
|
$lastPost = WebGUI::Asset->new($lastPostId);
|
||||||
|
}
|
||||||
|
return $lastPost if ($lastPost);
|
||||||
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -163,6 +171,11 @@ sub getLockUrl {
|
||||||
$self->getUrl("func=lock");
|
$self->getUrl("func=lock");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
sub getName {
|
||||||
|
return "Thread";
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 getNextThread ( )
|
=head2 getNextThread ( )
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@ sub appendPostListTemplateVars {
|
||||||
for (my $i=0;$i<=$post->get("rating");$i++) {
|
for (my $i=0;$i<=$post->get("rating");$i++) {
|
||||||
push(@rating_loop,{'rating_loop.count'=>$i});
|
push(@rating_loop,{'rating_loop.count'=>$i});
|
||||||
}
|
}
|
||||||
|
my $lastPost = $post->WebGUI::Asset::Post::Thread::getLastPost();
|
||||||
push(@{$var->{post_loop}}, {
|
push(@{$var->{post_loop}}, {
|
||||||
%{$post->get},
|
%{$post->get},
|
||||||
"id"=>$post->getId,
|
"id"=>$post->getId,
|
||||||
|
|
@ -77,6 +78,13 @@ sub appendPostListTemplateVars {
|
||||||
"timeUpdated.human"=>epochToHuman($post->get("dateUpdated"),"%Z"),
|
"timeUpdated.human"=>epochToHuman($post->get("dateUpdated"),"%Z"),
|
||||||
"userProfile.url"=>$post->getPosterProfileUrl,
|
"userProfile.url"=>$post->getPosterProfileUrl,
|
||||||
"user.isVisitor"=>$post->get("ownerUserId") eq "1",
|
"user.isVisitor"=>$post->get("ownerUserId") eq "1",
|
||||||
|
"lastReply.url"=>$lastPost->getUrl(),
|
||||||
|
"lastReply.title"=>$lastPost->get("title"),
|
||||||
|
"lastReply.user.isVisitor"=>$lastPost->get("ownerUserId") eq "1",
|
||||||
|
"lastReply.username"=>$lastPost->get("username"),
|
||||||
|
"lastReply.userProfile.url"=>$lastPost->WebGUI::Asset::Post::getPosterProfileUrl(),
|
||||||
|
"lastReply.dateSubmitted.human"=>epochToHuman($lastPost->get("dateSubmitted"),"%z"),
|
||||||
|
"lastReply.timeSubmitted.human"=>epochToHuman($lastPost->get("dateSubmitted"),"%Z"),
|
||||||
"edit.url"=>$post->getEditUrl,
|
"edit.url"=>$post->getEditUrl,
|
||||||
'controls'=>$controls,
|
'controls'=>$controls,
|
||||||
'inDateRange'=>$inDateRange,
|
'inDateRange'=>$inDateRange,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue