Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dokuwiki:server [2022/10/09 19:38] – [Customization] Bernard Condraudokuwiki:server [2024/06/11 09:37] (current) – [Customization] Bernard Condrau
Line 37: Line 37:
   * Add "_blank" to "Target window for external links" and "Target window for media links" under //Links// in DokuWiki's //Configuration Settings//.   * Add "_blank" to "Target window for external links" and "Target window for media links" under //Links// in DokuWiki's //Configuration Settings//.
 ==== Customization ==== ==== Customization ====
-There are a few core hacks required to make my template work properly, both for a regular wiki as well as for a help server. <span orange>**Note: you need to verify below modifications after every DokuWiki upgrade.**</span> +There are a few core hacks required to make my template work properly, both for a regular wiki as well as for a help server. Additionally, there is a bug fix required to display table of contents if you utilize the plugin:condition and plugin:toctweak.\\ <span orange>**Note: you need to verify below modifications after every DokuWiki upgrade.**</span> 
-  - Install my {{ :dokuwiki:tpl_bethico.zip |Bethico Template}} into ''/lib/tpl/''. Current version is 2022-10-09 suitable for DokuWiki "Igor".+=== Concept === 
 +  * The dispatcher calls files ''doku.php'' and ''help.php'' in the template directory instead of ''main.php'' (function ''bethico_dispatch''
 +  * Language detection and fallback added to ''doku.php'' in the root directory which then dispatches ''doku.php'' in the template directory 
 +  * Language detection and fallback added to ''help.php'' (copy of ''doku.php'') in the root directory which then dispatches ''help.php'' in the template directory 
 + 
 +=== Core hacks === 
 +  - Install my {{ :dokuwiki:tpl_bethico.zip |Bethico Template}} into ''/lib/tpl/''. Current version is v55.1 / 2024-06-09 suitable for DokuWiki "Kaos".
   - Add the following lines in ''doku.php'' in DokuWiki's root after line ''$ID = getID();'' at the beginning...<file>require_once(template('dispatcher.php'));   - Add the following lines in ''doku.php'' in DokuWiki's root after line ''$ID = getID();'' at the beginning...<file>require_once(template('dispatcher.php'));
-$langcode = bethico_language();</file>+$langcode = bethico_language(); 
 +bethico_init_toc();</file>
   - ...and replace at the end line ''act_dispatch();'' with<file>init_lang($langcode);   - ...and replace at the end line ''act_dispatch();'' with<file>init_lang($langcode);
 bethico_dispatch(basename(__FILE__));</file> bethico_dispatch(basename(__FILE__));</file>
-  - Copy ''doku.php'' to ''help.php'' in the DokuWiki root folder +  - Add a line to file ''/lib/scripts/page.js'' in function ''makeToggle'' to allow the template to set the table of contents to //open// or //closed//<file>$handle[0].setState = function(state){ 
-  - Modify ''/inc/template.php'' and add before line ''Event::createAndTrigger('TPL_TOC_RENDER', $toc, null, false);'' in function ''tpl_toc''. This is a non-destructive change which fixes an issue in the table of contents if plugin ''condition'' is installed in the wiki<file>if (@include_once(template('dispatcher.php'))) bethico_update_toc($toc$TOC);</file> +            var hidden; 
-  - Copies of the modified files for "Igor" are in folder ''/lib/tpl/bethico/core/'', copy them with<file>cp -R /lib/tpl/bethico/core/* /</file>+        --> if(!state && JSINFO.toc) state = JSINFO.toc.initial_state; 
 +            if(!state) state = 1;</file> 
 + 
 +=== Fix toc handling in core === 
 +  - Modify ''/inc/template.php'' in function ''tpl_toc'' add before line ''Event::createAndTrigger('TPL_TOC_RENDER', $toc, null, false);'':<file>if (@include_once(template('dispatcher.php'))) bethico_update_toc($toc, $TOC);</file>This is a non-destructive change which fixes an issue in the table of contents if plugin:condition is installed
 + 
 +=== Fix toc handling in plugin:toctweak === 
 +  - Make elements of items array unique at the end of function ''_toc'' in file ''lib/plugins/toctweak/helper.php''<file>$items = array_unique($itemsSORT_REGULAR);</file> 
 + 
 +=== Install === 
 +  - Copies of the modified files for "Kaos" are in folder ''/lib/tpl/bethico/core/v551/'', copy them with<file>cp -R /lib/tpl/bethico/core/v551/* /</file>then check file permissions
   - After a DokuWiki upgrade check and change if necessary   - After a DokuWiki upgrade check and change if necessary
     - Check ''/inc/actions.php'' and change ''/lib/tpl/bethico/dispatcher.php''     - Check ''/inc/actions.php'' and change ''/lib/tpl/bethico/dispatcher.php''
Line 51: Line 68:
     - Check ''/doku.php'' and change then copy to ''/help.php''     - Check ''/doku.php'' and change then copy to ''/help.php''
   - Optional: replace favicon and logo in '/lib/tpl/bethico/images/'.   - Optional: replace favicon and logo in '/lib/tpl/bethico/images/'.
 +  - Add the following line in ''/lib/scripts/page.js'' (v55.1-line 170) right before ''if(!state) state = 1;''<code>if(!state && JSINFO.toc) state = JSINFO.toc.initial_state;</code>
 +
  
  
Line 71: Line 90:
 | {minor} | Joomla minor version number || | {minor} | Joomla minor version number ||
 | {maintenance} | Joomla maintenance version number || | {maintenance} | Joomla maintenance version number ||
 +
 +===== Backup with zip =====
 +  * use the following command to backup an entire wiki with zip<code>$ sudo zip -r my_wiki my_wiki -x my_wiki/data/cache/**\* my_wiki my_wiki -x my_wiki/data/log/error/**\* my_wiki my_wiki -x my_wiki/data/log/deprecated/**\*</code>
  
 ===== Upgrade to Version 2020-07-29 "Hogfather" ===== ===== Upgrade to Version 2020-07-29 "Hogfather" =====
Line 89: Line 111:
   * [[https://www.dokuwiki.org/tips:safely_include_php_code|Safely include PHP code]]   * [[https://www.dokuwiki.org/tips:safely_include_php_code|Safely include PHP code]]
   * [[https://www.splitbrain.org/personal|Andreas Gohr]]   * [[https://www.splitbrain.org/personal|Andreas Gohr]]
 +  * [[https://www.plothost.com/kb/update-dokuwiki-command-line/|How to update DokuWiki from the command line]]
 ===== PHP 8.1 issues ===== ===== PHP 8.1 issues =====
 ==== Plugin condition ==== ==== Plugin condition ====
Line 96: Line 118:
 ==== Plugin html5video ==== ==== Plugin html5video ====
   * Put brackets enclosing the expressions on line 190 and 191 of ''plugins/html5video/syntax/video.php'' if you run your webserver with PHP 8.   * Put brackets enclosing the expressions on line 190 and 191 of ''plugins/html5video/syntax/video.php'' if you run your webserver with PHP 8.
 +
 +===== davcal =====
 +==== Check when a date entry was made ====
 +  - Copy ''/data/meta/davcal.sqlite3'' to D:\
 +  - Open ''sqlite3.exe'' command line tool from D:\PortableCustom\sqlite3, then enter the following commands to see entries made after 2023-01-01:<code>.open /davcal.sqlite3
 +SELECT calendardata FROM calendarobjects WHERE datetime(lastoccurence, 'unixepoch') > '2023-01-01 00:00:00';
 +.quit</code>