From 0a69dff7134e858ffe6b95410196a8712522167b Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 25 Sep 2006 22:12:22 +0200 Subject: amendments to previous patch updating rss & cache rss syntax extended to include a refresh parameter period can be d,h,m for days, hours, minutes respectively if not specified will default to 4 hours dokuwiki imposes a minimum of 10 minutes metadata now used "date valid age" (seconds) rather than "date valid end" darcs-hash:20060925201222-9b6ab-c8e6d8e40bb178295bab874fce5147ccff35fbbb.gz --- inc/parser/handler.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'inc/parser/handler.php') 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; } -- cgit v1.2.3