From 5c2eed9a193e9341fbfee63d4a973898acdc5ee5 Mon Sep 17 00:00:00 2001 From: lisps Date: Thu, 21 Nov 2013 15:50:52 +0100 Subject: add parameter at($DATE_AT) and mind revisions --- doku.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'doku.php') diff --git a/doku.php b/doku.php index f44e09aa8..2059f9761 100644 --- a/doku.php +++ b/doku.php @@ -34,6 +34,7 @@ $QUERY = trim($INPUT->str('id')); $ID = getID(); $REV = $INPUT->int('rev'); +$DATE_AT= $INPUT->int('at'); $IDX = $INPUT->str('idx'); $DATE = $INPUT->int('date'); $RANGE = $INPUT->str('range'); @@ -47,7 +48,19 @@ $PRE = cleanText(substr($INPUT->post->str('prefix'), 0, -1)); $SUF = cleanText($INPUT->post->str('suffix')); $SUM = $INPUT->post->str('summary'); -//make info about the selected page available +if($DATE_AT) { + $rev_t = getProperRevision($ID,$DATE_AT); + if($rev_t === '') { + $REV = ''; + } else if ($rev_t === false) { + msg('Seite gab es zu diesem Zeitpunkt noch nicht'); + $REV = $DATE_AT; + } else { + $REV = $rev_t; + } +} + +//make infos about the selected page available $INFO = pageinfo(); //export minimal info to JS, plugins can add more -- cgit v1.2.3 From 4bde2196a1e3572cead3f4d4e4b6a5a752bd62b3 Mon Sep 17 00:00:00 2001 From: lisps Date: Fri, 22 Nov 2013 09:04:44 +0100 Subject: remove property rev from xhtml.php changed variable name $create_time to $modified_time --- doku.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doku.php') diff --git a/doku.php b/doku.php index 2059f9761..17ec824a9 100644 --- a/doku.php +++ b/doku.php @@ -34,7 +34,7 @@ $QUERY = trim($INPUT->str('id')); $ID = getID(); $REV = $INPUT->int('rev'); -$DATE_AT= $INPUT->int('at'); +$DATE_AT = $INPUT->int('at'); $IDX = $INPUT->str('idx'); $DATE = $INPUT->int('date'); $RANGE = $INPUT->str('range'); -- cgit v1.2.3 From 78b874e68a5f2a45f71a91efb168761c283e3a91 Mon Sep 17 00:00:00 2001 From: lisps Date: Fri, 22 Nov 2013 10:51:16 +0100 Subject: fix function name media_isexternal() remove empty rev from ml() rename getProperRevision() to getLastRevisionAt() make getLastRevisionAt() a method of ChangeLog --- doku.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doku.php') diff --git a/doku.php b/doku.php index 17ec824a9..e90f8bea2 100644 --- a/doku.php +++ b/doku.php @@ -49,7 +49,8 @@ $SUF = cleanText($INPUT->post->str('suffix')); $SUM = $INPUT->post->str('summary'); if($DATE_AT) { - $rev_t = getProperRevision($ID,$DATE_AT); + $pagelog = new PageChangeLog($ID); + $rev_t = $pagelog->getLastRevisionAt($DATE_AT); if($rev_t === '') { $REV = ''; } else if ($rev_t === false) { -- cgit v1.2.3 From 4c3263af6652b0a479e2c742914eb67a7929b9b9 Mon Sep 17 00:00:00 2001 From: lisps Date: Fri, 22 Nov 2013 13:45:20 +0100 Subject: localize msg --- doku.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doku.php') diff --git a/doku.php b/doku.php index e90f8bea2..be6ab81f8 100644 --- a/doku.php +++ b/doku.php @@ -54,7 +54,8 @@ if($DATE_AT) { if($rev_t === '') { $REV = ''; } else if ($rev_t === false) { - msg('Seite gab es zu diesem Zeitpunkt noch nicht'); + $rev_n = $pagelog->getRelativeRevision($DATE_AT,+1); + msg(sprintf($lang['page_nonexist_rev'], $DATE_AT,$rev_n)); $REV = $DATE_AT; } else { $REV = $rev_t; -- cgit v1.2.3 From 7b62b42de1887c3627c727f0483aea41556742d4 Mon Sep 17 00:00:00 2001 From: lisps Date: Wed, 19 Mar 2014 10:32:55 +0100 Subject: add config date_at_format change translation message --- doku.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'doku.php') diff --git a/doku.php b/doku.php index d984d90e8..733730913 100644 --- a/doku.php +++ b/doku.php @@ -34,7 +34,7 @@ $QUERY = trim($INPUT->str('id')); $ID = getID(); $REV = $INPUT->int('rev'); -$DATE_AT = $INPUT->int('at'); +$DATE_AT = $INPUT->str('at'); $IDX = $INPUT->str('idx'); $DATE = $INPUT->int('date'); $RANGE = $INPUT->str('range'); @@ -48,6 +48,19 @@ $PRE = cleanText(substr($INPUT->post->str('prefix'), 0, -1)); $SUF = cleanText($INPUT->post->str('suffix')); $SUM = $INPUT->post->str('summary'); + +//parse DATE_AT +if($DATE_AT && $conf['date_at_format']) { + $date_o = DateTime::createFromFormat($conf['date_at_format'],$DATE_AT); + if(!$date_o) { + msg(sprintf($lang['unable_to_parse_date'], $DATE_AT,$conf['date_at_format'])); + $DATE_AT = null; + } else { + $DATE_AT = $date_o->getTimestamp(); + } +} + +//check for existing $REV related to $DATE_AT if($DATE_AT) { $pagelog = new PageChangeLog($ID); $rev_t = $pagelog->getLastRevisionAt($DATE_AT); @@ -55,7 +68,11 @@ if($DATE_AT) { $REV = ''; } else if ($rev_t === false) { $rev_n = $pagelog->getRelativeRevision($DATE_AT,+1); - msg(sprintf($lang['page_nonexist_rev'], $DATE_AT,$rev_n)); + if($conf['date_at_format']) { + msg(sprintf($lang['page_nonexist_rev'], date($conf['date_at_format'],$DATE_AT),date($conf['date_at_format'],$rev_n))); + } else { + msg(sprintf($lang['page_nonexist_rev'], $DATE_AT,$rev_n)); + } $REV = $DATE_AT; } else { $REV = $rev_t; -- cgit v1.2.3 From 80d9f3ddb3a602960d23f1849c1ad6287c4f9d92 Mon Sep 17 00:00:00 2001 From: lisps Date: Mon, 29 Sep 2014 10:13:57 +0200 Subject: parse AT parameter: first strtotime then timestamp remove config option --- doku.php | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'doku.php') diff --git a/doku.php b/doku.php index 6673d2d66..f4309d122 100644 --- a/doku.php +++ b/doku.php @@ -50,13 +50,16 @@ $SUM = $INPUT->post->str('summary'); //parse DATE_AT -if($DATE_AT && $conf['date_at_format']) { - $date_o = DateTime::createFromFormat($conf['date_at_format'],$DATE_AT); - if(!$date_o) { - msg(sprintf($lang['unable_to_parse_date'], $DATE_AT,$conf['date_at_format'])); - $DATE_AT = null; - } else { - $DATE_AT = $date_o->getTimestamp(); +if($DATE_AT) { + $date_parse = strtotime($DATE_AT); + if($date_parse) { + $DATE_AT = $date_parse; + } else { // check for UNIX Timestamp + $date_parse = @date('Ymd',$DATE_AT); + if(!$date_parse || $date_parse === '19700101') { + msg(sprintf($lang['unable_to_parse_date'], $DATE_AT)); + $DATE_AT = null; + } } } @@ -64,16 +67,16 @@ if($DATE_AT && $conf['date_at_format']) { if($DATE_AT) { $pagelog = new PageChangeLog($ID); $rev_t = $pagelog->getLastRevisionAt($DATE_AT); - if($rev_t === '') { - $REV = ''; - } else if ($rev_t === false) { + if($rev_t === '') { //current revision + $REV = null; + $DATE_AT = null; + } else if ($rev_t === false) { //page did not exist $rev_n = $pagelog->getRelativeRevision($DATE_AT,+1); - if($conf['date_at_format']) { - msg(sprintf($lang['page_nonexist_rev'], date($conf['date_at_format'],$DATE_AT),date($conf['date_at_format'],$rev_n))); - } else { - msg(sprintf($lang['page_nonexist_rev'], $DATE_AT,$rev_n)); - } - $REV = $DATE_AT; + msg(sprintf($lang['page_nonexist_rev'], + strftime($conf['dformat'],$DATE_AT), + wl($ID, array('rev' => $rev_n)), + strftime($conf['dformat'],$rev_n))); + $REV = $DATE_AT; //will result in a page not exists message } else { $REV = $rev_t; } -- cgit v1.2.3 From 57271d078b9c433bec79d75cb44dadcafeae07df Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 29 Sep 2014 20:15:27 +0200 Subject: release preparations --- doku.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doku.php') diff --git a/doku.php b/doku.php index f4309d122..261ceaec2 100644 --- a/doku.php +++ b/doku.php @@ -9,7 +9,7 @@ */ // update message version -$updateVersion = 45; +$updateVersion = 46; // xdebug_start_profiling(); -- cgit v1.2.3 From 7172294d0cc39ec10ad431dfdd0dd20e15a4ba35 Mon Sep 17 00:00:00 2001 From: Guy Brand Date: Wed, 8 Oct 2014 09:56:30 +0200 Subject: Release preparation --- doku.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doku.php') diff --git a/doku.php b/doku.php index 261ceaec2..71eee564e 100644 --- a/doku.php +++ b/doku.php @@ -9,7 +9,7 @@ */ // update message version -$updateVersion = 46; +$updateVersion = 46.1; // xdebug_start_profiling(); -- cgit v1.2.3 From a638d6de09edffc29a4fd522b0a62584a29c51ef Mon Sep 17 00:00:00 2001 From: Guy Brand Date: Thu, 4 Dec 2014 15:26:02 +0100 Subject: Increase updateVersion for master to sync with stable hotfix --- doku.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doku.php') diff --git a/doku.php b/doku.php index 71eee564e..1477f806c 100644 --- a/doku.php +++ b/doku.php @@ -9,7 +9,7 @@ */ // update message version -$updateVersion = 46.1; +$updateVersion = 46.2; // xdebug_start_profiling(); -- cgit v1.2.3 From f76dd4f5e20fba6666b01fa85e451bc7404cb86a Mon Sep 17 00:00:00 2001 From: Guy Brand Date: Sat, 6 Dec 2014 23:48:32 +0100 Subject: Increasing master branch updateVersion number --- doku.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doku.php') diff --git a/doku.php b/doku.php index 1477f806c..7cb92cffa 100644 --- a/doku.php +++ b/doku.php @@ -9,7 +9,7 @@ */ // update message version -$updateVersion = 46.2; +$updateVersion = 47; // xdebug_start_profiling(); -- cgit v1.2.3 From 90394abd2d0fc66a994a3f81c76e265d0707b351 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 17 Dec 2014 13:14:02 +0100 Subject: fix global environment during test requests --- doku.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doku.php') diff --git a/doku.php b/doku.php index 7cb92cffa..f5aa6cfa4 100644 --- a/doku.php +++ b/doku.php @@ -15,6 +15,11 @@ $updateVersion = 47; if(!defined('DOKU_INC')) define('DOKU_INC', dirname(__FILE__).'/'); +// define all DokuWiki globals here (needed within test requests but also helps to keep track) +global $ACT, $INPUT, $QUERY, $ID, $REV, $DATE_AT, $IDX, + $DATE, $RANGE, $HIGH, $TEXT, $PRE, $SUF, $SUM, $INFO, $JSINFO; + + if(isset($_SERVER['HTTP_X_DOKUWIKI_DO'])) { $ACT = trim(strtolower($_SERVER['HTTP_X_DOKUWIKI_DO'])); } elseif(!empty($_REQUEST['idx'])) { -- cgit v1.2.3