php.ini
)conf/local.protected.php
with <?php date_default_timezone_set("Europe/London");
sudo chown www-data:www-data local.protected.php
too, just to be sureBST
and pages modified in winter time show the time in GMT
php-mbstring
package on the VPSsudo apt-get install php-mbstring
sudo service apache2 restart
— John Pumford-Green 26/04/23 10:04
removed dw2pdf
plugin, it is largely unused and adds pointless bloat.
php.ini
sudo vi /etc/php/XX/apache2/php.ini
upload_max_filesize = 2M
to upload_max_filesize = 20M
post_max_size = 2M
to post_max_size = 20M
sudo service apache2 restart
From https://forum.dokuwiki.org/d/3318-allow-upload-of-any-filetype/5
Edit /var/www/html/www/dokuwiki/inc/media.php
and comment out :
// because a temp file was created already //if (!preg_match('/\.(' . $regex . ')$/i', $fn)) { // return [$lang['uploadwrong'], -1]; //}
I find the underlining and “explanation” of some abbreviations/acronyms by dokuwiki, when rendering a page, to be annoying.
The process is described HERE
To disable this I simply copied the default conf/acronyms.conf
to a local version conf/acronyms.local.conf
and then edited the local
version to remove all the explanations.
# Acronyms. ACL AFAICS AFAIK AFAIR API ASAP ASCII BTW CMS CSS DNS EOF EOL EOM EOT FAQ FTP FOSS FLOSS FUD FYI GB GHz GPL GUI HTML IANAL IE IIRC IMHO IMO IOW IRC IRL KISS LAN LGPL LOL MathML MB MHz MSIE OMG OS OSS OTOH PITA RFC ROTFL RTFM spec TIA TL;DR TOC URI URL W3C WTF? WYSIWYG YMMV
This supresses the annoyance.
— John Pumford-Green 30/04/23 13:49
make a clickable hide/reveal section with
++++ visible text | hidden text blah blah ++++
e.g.
edit /var/www/html/dokuwiki/lib/plugins/cloud/style.less
increase size factor
/* Size factor. */ @sF: 1.2;
force re-fresh of browser to show new font size.
Ctrl+C
/var/www/html/dokuwiki/lib/plugins/keyboard/all.css
kbd.__keyboard { color: #0000ff; background-color: #defede; text-align: center; border-left: 1px solid #cfcfcf; border-top: 1px solid #cfcfcf; border-right: 3px solid #666666; border-bottom: 3px solid #666666; -moz-border-radius: 4px 4px 4px 4px; padding-left: 3px; padding-top: 0px; padding-right: 3px; padding-bottom: 0px; margin-left: 2px; margin-right: 2px; vertical-align: top; font-family: sans-serif; white-space: nowrap; font-size: 1.2em; }
pre,code,samp,kbd
sectionpre, code, samp, kbd { font-family: Consolas, "Andale Mono WT", "Andale Mono", "Bitstream Vera Sans Mono", "Nimbus Mono L", Monaco, "Courier New", monospace; /* same font stack should be used for ".dokuwiki table.diff td" in _diff.css */ font-size: 1em; direction: ltr; text-align: left; background-color: @ini_background_site; color: @ini_text; box-shadow: inset 0 0 .3em @ini_border; border-radius: 5px; }
/var/www/html/dokuwiki/lib/tpl/dokuwiki/css/basic.less
with a hex code for a better colour.code
code { color: #c72522; font-size: 1.1em; padding: 0.1em 0.3em; border-radius: 0; }
/var/www/html/dokuwiki/lib/tpl/dokuwiki/tpl_footer.php
<?php /** * Template footer, included in the main and detail files */ // must be run from within DokuWiki if (!defined('DOKU_INC')) die(); ?> <!-- ********** FOOTER ********** --> <div id="dokuwiki__footer"><div class="pad"> <!-- <?php tpl_license(''); // license text ?> --> <!-- <div class="buttons"> <?php tpl_license('button', true, false, false); // license button, no wrapper $target = ($conf['target']['extern']) ? 'target="'.$conf['target']['extern'].'"' : ''; ?> <a href="https://www.dokuwiki.org/donate" title="Donate" <?php echo $target?>><img src="<?php echo tpl_basedir(); ?>images/button-donate.gif" width="80" height="15" alt="Donate" /></a> <a href="https://php.net" title="Powered by PHP" <?php echo $target?>><img src="<?php echo tpl_basedir(); ?>images/button-php.gif" width="80" height="15" alt="Powered by PHP" /></a> <a href="//validator.w3.org/check/referer" title="Valid HTML5" <?php echo $target?>><img src="<?php echo tpl_basedir(); ?>images/button-html5.png" width="80" height="15" alt="Valid HTML5" /></a> <a href="//jigsaw.w3.org/css-validator/check/referer?profile=css3" title="Valid CSS" <?php echo $target?>><img src="<?php echo tpl_basedir(); ?>images/button-css.png" width="80" height="15" alt="Valid CSS" /></a> <a href="https://dokuwiki.org/" title="Driven by DokuWiki" <?php echo $target?>><img src="<?php echo tpl_basedir(); ?>images/button-dw.png" width="80" height="15" alt="Driven by DokuWiki" /></a> </div> --> </div></div><!-- /footer --> <?php tpl_includeFile('footer.html');
To force specific bootstrap/bootswatch
themes dependant on the namespace
ThemeByNamespace
option <dokuwiki>/conf
called bootstrap3.themes.conf
chown www-data:www-data bootstrap3.themes.conf
# Namespace Bootswatch Theme start bootswatch/darkly public bootswatch/darkly public:calculator bootswatch/slate public:journal bootswatch/journal private bootswatch/flatly playground bootswatch/united private:wire2waves bootswatch/paper blog bootswatch/yeti
showThemeSwitcher
and to select a default theme to be used outside of any listed in the conf fileI like the Vector and Monobook templates, very similar feel to Wikipedia
After upgrading Dokuwiki to Igor it became impossible to log out due to a warning
I initially ignored it but then downgraded back to Hogfather as there seemed to be no fix - other than to use a different template.
I recently upgraded to the latest Dokuwiki (Jack Jackrum), and upgraded all plugins and templates where possible. However the problem with logout with Vector and Monobook re-appeared.
I found there was a fix described on the forum:
https://forum.dokuwiki.org/d/20248-security-token-did-not-match-possible-csrf-attack-cannot-log-out
and the cure is to edit the appropriate line in main.php
for each template, as the author seems not to be maintaining these templates any more, at least not the official ones accessed via Dokuwiki's Template/Extension installer. The github repository shows that the fix has been applied to Vector
, and a pull request submitted to fix Monobook
, the fixes haven't appeared in the official versions.
The does work, though…
For Vector edit /var/www/html/dokuwiki/lib/tpl/vector/main.php
to add , 'sectok' ⇒ getSecurityToken()
in the array
statement after “do” ⇒ “logout”
echo " <li id=\"pt-logout\"><a href=\"".wl(cleanID(getId()), array("do" => "logout", 'sectok' => getSecurityToken()))."\" rel=\"nofollow\">".hsc($lang["btn_logout"])."</a></li>\n"; //language comes from DokuWiki core
and the same for Monobook
echo " <li id=\"pt-logout\"><a href=\"".wl(cleanID(getId()), array("do" => "logout", 'sectok' => getSecurityToken()))."\" rel=\"nofollow\">".hsc($lang["btn_logout"])."</a></li>\n"; //language comes from DokuWiki core
I found the style applied to monospace
text was a little underwhelming.
I found the place to change it:
/var/www/html/dokuwiki/lib/tpl/{vector|monobook}/user/screen.css
add the the following and adjust as needed:
div#content .dokuwiki code { font-size: 100%; padding-left: 5px; padding-right: 5px; background-color: #eee; color: #00f; direction: ltr; text-align: left; }
Remove the default footer buttons by editing {vector|monobook}/user/buttons.php
and adding
$_monobook_btns = array();
//delete all (defaults) $_vector_btns = array();
this suppresses the inclusion of footer buttons from vector/conf/buttons.php
Edit {vector|monobook}/user/buttons.php
monobook
for vector
as appropriate
<?php //check if we are running within the DokuWiki environment if (!defined("DOKU_INC")){ die(); } //delete all (defaults) $_vector_btns = array(); //note: The buttons will be rendered in the order they were defined. Means: // first button will be rendered first, last button will be rendered at // last. //DokuWiki button $_vector_btns["dw"]["img"] = DOKU_TPL."static/img/button-dw.png"; $_vector_btns["dw"]["href"] = "https://www.dokuwiki.org/"; $_vector_btns["dw"]["width"] = 80; $_vector_btns["dw"]["height"] = 15; $_vector_btns["dw"]["title"] = "DokuWiki"; $_vector_btns["dw"]["nofollow"] = !(cleanID(getID()) === "start"); //"vector for DokuWiki" button $_vector_btns["vecfdw"]["img"] = DOKU_TPL."static/img/button-vector.png"; $_vector_btns["vecfdw"]["href"] = "https://www.dokuwiki.org/template:vector"; $_vector_btns["vecfdw"]["width"] = 80; $_vector_btns["vecfdw"]["height"] = 15; $_vector_btns["vecfdw"]["title"] = $lang["vector_mdtemplatefordw"]; $_vector_btns["vecfdw"]["nofollow"] = !(cleanID(getID()) === "start");
The layout on a phone isn't too good, and can't be zoomed/scaled.
I found this thread:
https://forum.dokuwiki.org/d/12469-vector-template-doesn-t-display-correctly-on-mobile-devices/6
and applied the comment-out of the line :
//echo "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />";
in main.php
and mediamanager.php
the page now scales/zooms okay to make it useable on a phone.
Using the loadskin
plugin
it's possible to switch to the default dokuwiki
template when on a mobile device and the vector
template when on a computer.
loadskin
plugin seems to lead to problems switching between monobook
and vector
- the navigation sidebar seems to disappear on one or the other. Not sure where the problem is.
Various Coloured notes:
<note> This is my note ! Remember it!! </note> <note important> Warning ! You're about to lose your mind ;-) </note> <note tip> The clues are in the images. </note> <note warning> Beware of the cat when you open the door !! </note> ++++Note in a Folded section| <note warning> Ça fonctionne seulement avec le //div// pas le //span//. </note> ++++
The dw2pdf
plugin provides a button on many templates to trigger export to PDF
but not on monobook
. It's possible to add a tab to the top of the page, beside the edit
etc. tabs, to do the the pdf export
function.
monobook/user/tabs.php
//PDF plugin: export tab if (file_exists(DOKU_PLUGIN."dw2pdf/action.php") && !plugin_isdisabled("dw2pdf")){ $_monobook_tabs["tab-export-pdf"]["text"] = "pdf export"; $_monobook_tabs["tab-export-pdf"]["href"] = wl(getID(), array("do" => "export_pdf"), false, "&"); }
The icon shown on interwiki links almost always appears as a small “lock” rather than the correct icon
commenting out the .link-https
section in /vector/static/3rd/vector/main-ltr.css
stops this :
div#content a.external, div#content a[href ^="gopher://"] { background: url(static/3rd/vector/external-link-ltr-icon.png) center right no-repeat; padding: 0 13px 0 0; } /* div#content a[href ^="https://"], .link-https { background: url(static/3rd/vector/lock-icon.png) center right no-repeat; padding: 0 13px 0 0; } */ div#content a[href ^="mailto:"], .link-mailto { background: url(static/3rd/vector/mail-icon.png) center right no-repeat; padding: 0 13px 0 0; }
Page Updated: 08/04/24 15:25 BST