X-Git-Url: http://www.wagner.pp.ru/gitweb/?a=blobdiff_plain;f=forum%2Fforum;h=e73f98af81a9aef22cafb80c16275fd66918ca7f;hb=8aba8ac06a5627acf0d529584df96bc8bf48a088;hp=d2ae68623d1e6def113126e65dd7a280feba3108;hpb=363edb3c84c27c360426cabd42e2e8b553cde8ea;p=oss%2Fstilllife.git 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);