User Tools

Site Tools


aredn:admin

Admin

Wiki Tools

Upgrating the Wiki Engine

When upgrading the core wiki engine, follow these steps:

  1. Update all plugins before updating the wiki itself
  2. Install the htmlok plugin
  3. Install the SearchIndex plugin. You'll need to “Rebuild Index” after the wiki is updated.
  4. Enable the htmlok plugin in the config manager
  5. Follow the steps below to re-modify the template.

Template Mods

Collapse TOC automatically

  • open
    pico lib/tpl/dokuwiki/script.js
  • find
    if($toc.length) {
      $toc[0].setState(1);
  • replace with
    if($toc.length) {
      $toc[0].setState(-1);

Browser <head>

Changed lib/tpl/dokuwiki/main.php

from:

<title><?php tpl_pagetitle() ?> [<?php echo strip_tags($conf['title'])</title>

to:

<title>West Coast AREDN</title>

Top Bar

  • Removed extra buttons in footer by removing these lines
    lib/tpl/dokuwiki/tpl_footer.php
    <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>
  • and also remove the second to last line: '' <?php tpl_includeFile('footer.html'); ?>''

For Static Site Only

Changes to http://va7fi-linux.local.mesh/wiki (only):

  • Created a footer page on the AREDN site (only) that will be automatically updated by the sync script.
  • Around line 955, added a line commented some lines out to remove [page] Last Modified: [date] by [user] in the footer. Be careful not to add extra lines at the top or none of the pictures will show
    inc/template.php
        // print it
        $out=tpl_includeFile('footer.html');
        if ($INFO['exists']) {
    /*
            $out = '<bdi>' . $fn . '</bdi>';
            $out .= ' · ';
            $out .= $lang['lastmod'];
            $out .= ' ';
            $out .= $date;
            if ($INFO['editor']) {
                $out .= ' ' . $lang['by'] . ' ';
                $out .= '<bdi>' . editorinfo($INFO['editor']) . '</bdi>';
            } else {
                $out .= ' (' . $lang['external_edit'] . ')';
            }
    */

Header Spacing

  • Edited this file:
    lib/tpl/dokuwiki/css/design.less
    #dokuwiki__header {
        padding: 2em 0 0;       // padding (top, left, bottom) of logo 
     
        .headings,
        .tools {
            margin-top: 0em;        // padding at the top of the logo and title
            margin-bottom: 0em;     // padding at the bottom of the logo and title
            width: 49%;             // width of logo
        }
        .tools {
            margin-top: .2em;      // padding between first line and search bar
        }
     
        h1 {
            margin: 0em;             // top-left corner margin of logo and title
            margin-top: 0em;         // padding above logo and title
            margin-bottom: 2em;      // padding below logo and title
            font-size: 1.5em;
            font-weight: normal;
     
            img {			//postion of logo only
                float: left;
                margin-right: .5em;
                margin-top: 0em;
            }

Editing Window Message

Edited the following file to:

inc/lang/en/edit.txt
Edit the page (only if you can **improve** it) and hit ''Save''.
For help, see the [[/wikisyntax/home|Syntax page]].
If you want to test some things, use the
[[/wikisyntax/playground|Playground page]].

Created an AREDN link type with a different icons to show which links require connection to AREDN. The syntax is:

[[aredn>link]]

Created this file:

conf/interwiki.local.conf
aredn     {NAME}

And copied the favicon.ico to a different folder as a different name:

cp ./data/media/favicon.ico ./lib/images/interwiki/aredn.svg

Troubleshooting

Broken Images

If after tweaking the template files the images don't show anymore, it might be that there are extra lines or spaces on some of the php files.

  • Copy this script to the /wiki/ folder and fix its permissions.
  • Call the script from the browser. It'll produce a list of php files that have issues.
  • Manually fix each file.

Update Script

This Bash script runs at least once a day at 2am to synchronize the Mesh site from the Public site:1)

AREDNSync.sh
#!/bin/bash
 
# Navigate to wiki data pages
cd /var/www/html/wiki/data/pages/
 
# Sync the text pages that have changed from server, excluding the about page
# (which are different), and the footer page.
rsync -apP -e ssh --delete --exclude 'about/home.txt' --exclude 'footer.txt' \
  --exclude 'nextcloud/login.txt' \
  patrick@scarcs.ca:~/sites/aredn/data/pages/ /var/www/html/wiki/data/pages/
 
 
# Sync the media files that have changed from server.
rsync -apP -e ssh --delete patrick@scarcs.ca:~/sites/aredn/data/media/ \
   /var/www/html/wiki/data/media/
 
 
# Write custom footer page to note the date of last sync.
echo '<WRAP rightalign><fs x-small>Last synchronized from [[https://wcaredn.ca]] on' \
  $(date) '</fs></WRAP>' > footer.txt
 
# Update ownership and permissions that might have been lost during the sync
chown aredn:www-data -R /var/www/html/wiki/data/
chmod 770 -R /var/www/html/wiki/data/
 
# Refresh the cache to make the changes visible.
touch /home/aredn/html/wiki/conf/local.php

To add cronjob, add:

0 2 * * * . /home/aredn/Scripts/SyncWiki.sh
1)
Must be run as root
aredn/admin.txt · Last modified: by 127.0.0.1