diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-08-03 16:55:52 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-08-03 16:55:52 +0000 |
commit | 1253db7de2ea703e03866436bed9c50561971de9 (patch) | |
tree | 62122d917450f5e592b2b7c76dfb4684282d5ab9 /IkiWiki.pm | |
parent | 14d107ee6bf9dfcec3e14f766658d88a818f5a95 (diff) | |
download | ikiwiki-1253db7de2ea703e03866436bed9c50561971de9.tar ikiwiki-1253db7de2ea703e03866436bed9c50561971de9.tar.gz |
* Added created_before and created_after PageSpec limits.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r-- | IkiWiki.pm | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index d9559bde4..a732be999 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -553,7 +553,7 @@ sub pagespec_translate ($) { #{{{ elsif ($word eq "(" || $word eq ")" || $word eq "!") { $code.=" ".$word; } - elsif ($word =~ /^(link|backlink|creation_month|creation_year|creation_day)\((.+)\)$/) { + elsif ($word =~ /^(link|backlink|created_before|created_after|creation_month|creation_year|creation_day)\((.+)\)$/) { $code.=" match_$1(\$page, ".safequote($2).")"; } else { @@ -598,6 +598,30 @@ sub match_backlink ($$) { #{{{ match_link(pop, pop); } #}}} +sub match_created_before ($$) { #{{{ + my $page=shift; + my $testpage=shift; + + if (exists $pagectime{$testpage}) { + return $pagectime{$page} < $pagectime{$testpage}; + } + else { + return 0; + } +} #}}} + +sub match_created_after ($$) { #{{{ + my $page=shift; + my $testpage=shift; + + if (exists $pagectime{$testpage}) { + return $pagectime{$page} > $pagectime{$testpage}; + } + else { + return 0; + } +} #}}} + sub match_creation_day ($$) { #{{{ return ((gmtime($pagectime{shift()}))[3] == shift); } #}}} |