From: Victor Wagner Date: Tue, 1 Apr 2008 10:17:58 +0000 (+0000) Subject: Fixed problem with substitution of message link X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=8aba8ac06a5627acf0d529584df96bc8bf48a088;p=oss%2Fstilllife.git Fixed problem with substitution of message link --- diff --git a/forum/forum b/forum/forum index d2ae686..e73f98a 100755 --- a/forum/forum +++ b/forum/forum @@ -1095,7 +1095,7 @@ sub reply { show_error($forum,"В шаблоне сообщения отсутствует якорь для ссылок на него"); # подставляем mlink substinfo($newmsg,[_tag=>"a","class"=>"mlink"], - href=>$cgi->path_info."#id"); + href=>$cgi->path_info."#$id"); # подставляем mparent my $parent_id=$cgi->param("id"); if ($parent_id) { @@ -1151,8 +1151,13 @@ sub record_as_recent { $msglist->attr("style",$style); $msglist->look_down(class=>"message")->replace_with($msg); } else { - my $prev = $msglist->look_down("class"=>"message"); - $prev->preinsert($msg); + my @msgs = $msglist->look_down("class"=>"message"); + if (@msgs > $forum->{replies_per_page}) { + for (my $i=$#msgs;$i>=$forum->{replies_per_page};$i--) { + $msgs[$i]->delete; + } + } + $msgs[0]->preinsert($msg); } } savetree($forum->{forumroot}."/recent.html",$tree,$lockfd);