diff options
Diffstat (limited to 'inc/parser')
-rw-r--r-- | inc/parser/handler.php | 7 | ||||
-rw-r--r-- | inc/parser/metadata.php | 8 |
2 files changed, 9 insertions, 6 deletions
diff --git a/inc/parser/handler.php b/inc/parser/handler.php index 28e8c4e4b..a8a29783c 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -522,6 +522,13 @@ class Doku_Handler { $p['date'] = (preg_match('/\b(date)/',$params)); $p['details'] = (preg_match('/\b(desc|detail)/',$params)); + if (preg_match('/\b(\d+)([dhm])\b/',$params,$match)) { + $period = array('d' => 86400, 'h' => 3600, 'm' => 60); + $p['refresh'] = max(600,$match[1]*$period[$match[2]]); // n * period in seconds, minimum 10 minutes + } else { + $p['refresh'] = 14400; // default to 4 hours + } + $this->_addCall('rss',array($link,$p),$pos); return TRUE; } diff --git a/inc/parser/metadata.php b/inc/parser/metadata.php index 9704c0475..1c987dbc3 100644 --- a/inc/parser/metadata.php +++ b/inc/parser/metadata.php @@ -38,6 +38,7 @@ class Doku_Renderer_metadata extends Doku_Renderer { $this->meta['description']['tableofcontents'] = array(); $this->meta['relation']['haspart'] = array(); $this->meta['relation']['references'] = array(); + $this->meta['date']['valid'] = array(); $this->headers = array(); } @@ -326,13 +327,8 @@ class Doku_Renderer_metadata extends Doku_Renderer { } function rss($url,$params) { - global $conf; - $this->meta['relation']['haspart'][$url] = true; - $this->meta['date']['valid']['end'] = - empty($this->meta['date']['valid']['end']) ? - time() + $conf['rss_update'] : - min($this->meta['date']['valid']['end'], time() + $conf['rss_update']); + $this->meta['date']['valid']['age'] = $params['refresh']; } function table_open($maxcols = NULL, $numrows = NULL){} |