parent
e310313d79
commit
7b62b42de1
|
@ -155,6 +155,7 @@ $conf['broken_iua'] = 0; //Platform with broken ignore_user_abor
|
|||
$conf['xsendfile'] = 0; //Use X-Sendfile (1 = lighttpd, 2 = standard)
|
||||
$conf['renderer_xhtml'] = 'xhtml'; //renderer to use for main page generation
|
||||
$conf['readdircache'] = 0; //time cache in second for the readdir operation, 0 to deactivate.
|
||||
$conf['date_at_format'] = 'Y-m-d-H:i:s';
|
||||
|
||||
/* Network Settings */
|
||||
$conf['dnslookups'] = 1; //disable to disallow IP to hostname lookups
|
||||
|
|
21
doku.php
21
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;
|
||||
|
|
|
@ -395,6 +395,7 @@ function wl($id = '', $urlParameters = '', $absolute = false, $separator = '&
|
|||
global $conf;
|
||||
if(is_array($urlParameters)) {
|
||||
if(isset($urlParameters['rev']) && !$urlParameters['rev']) unset($urlParameters['rev']);
|
||||
if(isset($urlParameters['at']) && $conf['date_at_format']) $urlParameters['at'] = date($conf['date_at_format'],$urlParameters['at']);
|
||||
$urlParameters = buildURLparams($urlParameters, $separator);
|
||||
} else {
|
||||
$urlParameters = str_replace(',', $separator, $urlParameters);
|
||||
|
|
|
@ -366,5 +366,6 @@ $lang['currentns'] = 'Current namespace';
|
|||
$lang['searchresult'] = 'Search Result';
|
||||
$lang['plainhtml'] = 'Plain HTML';
|
||||
$lang['wikimarkup'] = 'Wiki Markup';
|
||||
$lang['page_nonexist_rev'] = "Page has not existed with revision %d, try %d";
|
||||
$lang['page_nonexist_rev'] = 'Page did not exist at %s. It was subsequently created at %s.';
|
||||
$lang['unable_to_parse_date'] = 'Unable to parse at parameter "%s" with format "%s".';
|
||||
//Setup VIM: ex: et ts=2 :
|
||||
|
|
Loading…
Reference in New Issue