]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/inline.pm
unfuzzy
[git.ikiwiki.info.git] / IkiWiki / Plugin / inline.pm
index eb21959f90120ff2b463eedd8ae3da1416858f8c..13ff0aa19c92ea5b97134240b97c985b732b30fa 100644 (file)
@@ -5,7 +5,6 @@ package IkiWiki::Plugin::inline;
 use warnings;
 use strict;
 use IkiWiki 1.00;
 use warnings;
 use strict;
 use IkiWiki 1.00;
-use IkiWiki::Render; # for displaytime
 use URI;
 
 sub import { #{{{
 use URI;
 
 sub import { #{{{
@@ -157,7 +156,9 @@ sub preprocess_inline (@) { #{{{
                        if ($actions) {
                                my $file = $pagesources{$page};
                                my $type = pagetype($file);
                        if ($actions) {
                                my $file = $pagesources{$page};
                                my $type = pagetype($file);
-                               if ($config{discussion}) {
+                               if ($config{discussion} &&
+                                   $page !~ /.*\/discussion$/ &&
+                                   (length $config{cgiurl} || exists $links{$page."/".gettext("discussion")})) {
                                        $template->param(have_actions => 1);
                                        $template->param(discussionlink => htmllink($page, $params{page}, "Discussion", 1, 1));
                                }
                                        $template->param(have_actions => 1);
                                        $template->param(discussionlink => htmllink($page, $params{page}, "Discussion", 1, 1));
                                }
@@ -236,7 +237,7 @@ sub date_822 ($) { #{{{
 
        eval q{use POSIX};
        error($@) if $@;
 
        eval q{use POSIX};
        error($@) if $@;
-       my $lc_time= POSIX::setlocale(&POSIX::LC_TIME);
+       my $lc_time=POSIX::setlocale(&POSIX::LC_TIME);
        POSIX::setlocale(&POSIX::LC_TIME, "C");
        my $ret=POSIX::strftime("%a, %d %b %Y %H:%M:%S %z", localtime($time));
        POSIX::setlocale(&POSIX::LC_TIME, $lc_time);
        POSIX::setlocale(&POSIX::LC_TIME, "C");
        my $ret=POSIX::strftime("%a, %d %b %Y %H:%M:%S %z", localtime($time));
        POSIX::setlocale(&POSIX::LC_TIME, $lc_time);
@@ -248,7 +249,7 @@ sub date_3339 ($) { #{{{
 
        eval q{use POSIX};
        error($@) if $@;
 
        eval q{use POSIX};
        error($@) if $@;
-       my $lc_time= POSIX::setlocale(&POSIX::LC_TIME);
+       my $lc_time=POSIX::setlocale(&POSIX::LC_TIME);
        POSIX::setlocale(&POSIX::LC_TIME, "C");
        my $ret=POSIX::strftime("%Y-%m-%dT%H:%M:%SZ", localtime($time));
        POSIX::setlocale(&POSIX::LC_TIME, $lc_time);
        POSIX::setlocale(&POSIX::LC_TIME, "C");
        my $ret=POSIX::strftime("%Y-%m-%dT%H:%M:%SZ", localtime($time));
        POSIX::setlocale(&POSIX::LC_TIME, $lc_time);