From fbafb72df08821dc281c5f04225cd6da5452d30f Mon Sep 17 00:00:00 2001 From: Igor Date: Sat, 6 Nov 2010 19:31:16 +0300 Subject: Added: recent papers --- syntax.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'syntax.php') diff --git a/syntax.php b/syntax.php index f98507f..11e36e3 100644 --- a/syntax.php +++ b/syntax.php @@ -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) -- cgit v1.2.3