aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-03 16:55:52 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-03 16:55:52 +0000
commit1253db7de2ea703e03866436bed9c50561971de9 (patch)
tree62122d917450f5e592b2b7c76dfb4684282d5ab9 /IkiWiki.pm
parent14d107ee6bf9dfcec3e14f766658d88a818f5a95 (diff)
downloadikiwiki-1253db7de2ea703e03866436bed9c50561971de9.tar
ikiwiki-1253db7de2ea703e03866436bed9c50561971de9.tar.gz
* Added created_before and created_after PageSpec limits.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm26
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);
} #}}}