- if ($config{discussion}) {
- $template->param(discussionlink => htmllink($page, $page, "Discussion", 1, 1));
+ if ($config{discussion} && $page !~ /.*\/discussion$/ &&
+ (length $config{cgiurl} || exists $links{$page."/".gettext("discussion")})) {
+ $template->param(discussionlink => htmllink($page, $page, gettext("Discussion"), 1, 1));