diff options
author | Igor <pashev.igor@gmail.com> | 2010-11-06 19:31:16 +0300 |
---|---|---|
committer | Igor <pashev.igor@gmail.com> | 2010-11-06 19:31:16 +0300 |
commit | fbafb72df08821dc281c5f04225cd6da5452d30f (patch) | |
tree | b71e6725a16ec60ef9e2b5b8831aaf33d7428200 /syntax.php | |
parent | e6cb69aed00a8465525e9609b8085e999962158e (diff) | |
download | dokuwiki-plugin-papers-fbafb72df08821dc281c5f04225cd6da5452d30f.tar.gz |
Added: recent papers
Diffstat (limited to 'syntax.php')
-rw-r--r-- | syntax.php | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -82,7 +82,7 @@ class syntax_plugin_papers extends DokuWiki_Syntax_Plugin } $options = array('byyear' => 0); - foreach(array('raw', 'byyear') as $o) + foreach(array('raw', 'byyear', 'recent') as $o) { if (isset($spec[$o])) { @@ -90,6 +90,12 @@ class syntax_plugin_papers extends DokuWiki_Syntax_Plugin unset($spec[$o]); } } + if (isset($options['recent'])) + { + $options['raw'] = 1; + $options['byyear'] = 1; + } + // end: display options, not BiBTeX fields $bibtex = (!isset($options['byyear']) || $options['byyear']) ? @@ -152,9 +158,15 @@ class syntax_plugin_papers extends DokuWiki_Syntax_Plugin $dub = array(); $byyear = !isset($options['byyear']) || $options['byyear']; $raw = !isset($options['raw']) || !$options['raw']; + $recent = isset($options['recent']) ? $options['recent'] : 9999999; + $count = 0; foreach ($bibtex->SELECTION as &$entry) { + $count++; + if ($count > $recent) + break; + if ($raw) { if ($byyear) |