puzzelcube
Hello forum members,
I have the following problem:
Under each page on the wiki are intended the following information:
[1] Who has the side when created
[2] Who the page when changed
This information is indeed available, just the [2] exists under each side.
Only the [1] disappears in the history, when a change is made.
However, the history should not must be called always separately.
How can I show the information [1] me permanently under each side together with the recent change [2]?
Note:
The information [1] are not should editable on the page itself.
The information is shown automatically from wiki!!!
I tried the PHP code in the template (..\inc\Template.php, row 1004...1016) in the first own approach
to expand through PHP code snippets...Unfortunately that did not work.
Because I have absolutely no idea what I was doing there --> I have no PHP skills!
Does anyone have a solution for this problem?
Many thanks.
puzzelcube
DokuWiki: 2015-08-10a "Detritus"
Template: dokuwiki, default
Web Server: Apache 2.4 (Xampp)
PHP Ver.: 5.6.14
puzzelcube
Solution from the German discussion.
Many thanks to the member: moz
In this case, that's a little more complicated because a function call must be replaced.
For the template Dokuwiki that would go as follows:
- the template folder dokuwiki in lib/tpl/ copy under a different name
- in this folder create a new PHP file (eg. my_functions.php)
- in the file "main.php" (about line 10) to insert the line:
require_once(dirname(__FILE__).'/my_functions.php');
- and (about line 72), replace the function call:
tpl_pageinfo() --> my_pageinfo()
This is the content of: my_functions.php
<?php
/**
* Modifizierte Kopie der Funktion: tpl_pageinfo()
* Original unter inc/template.php
*/
function my_pageinfo($ret = false) {
global $conf;
global $lang;
global $INFO;
global $ID;
// return if we are not allowed to view the page
if(!auth_quickaclcheck($ID)) {
return false;
}
// prepare date and path
$fn = $INFO['filepath'];
if(!$conf['fullpath']) {
if($INFO['rev']) {
$fn = str_replace(fullpath($conf['olddir']).'/', '', $fn);
} else {
$fn = str_replace(fullpath($conf['datadir']).'/', '', $fn);
}
}
$fn = utf8_decodeFN($fn);
$date = dformat($INFO['lastmod']);
// print it
if($INFO['exists']) {
$out .= '<bdi>'.$fn.'</bdi>';
$out .= ' · ';
// -----------------------------start mod. by Moz
$out .= $lang['created'].' ';
$out .= '<bdi>'.dformat($INFO['meta']['date']['created']).'</bdi> ';
$out .= $lang['by'].' <bdi>'.$INFO['meta']['user'].'</bdi> ';
$out .= ' · ';
// ---------------------------- end mod. by Moz
$out .= $lang['lastmod'];
$out .= ' ';
$out .= $date;
if($INFO['editor']) {
$out .= ' '.$lang['by'].' ';
$out .= '<bdi>'.editorinfo($INFO['editor']).'</bdi>';
} else {
$out .= ' ('.$lang['external_edit'].')';
}
if($INFO['locked']) {
$out .= ' · ';
$out .= $lang['lockedby'];
$out .= ' ';
$out .= '<bdi>'.editorinfo($INFO['locked']).'</bdi>';
}
if($ret) {
return $out;
} else {
echo $out;
return true;
}
}
return false;
}
Then just select the template and it should work.
puzzelcube