| Name: | dokunotes |
|---|---|
| Created: | 10-Jul-2007 |
| Modified: | 60 weeks ago |
Various notes on things to do in DokuWiki. I'm using the Wiki as a personal CMS, not an collaborative tool.
Out of the box, anyone can do anything to the wiki. Lock it down by either going to the admin page and select the ACL option. You should see a gray box Permissions for Namespace *. Under that, uncheck everything, so only "Read" is checked, and click update.
It should produce something like this for conf/acl.auth.php
# acl.auth.php # <?php exit()?> # Don't modify the lines above # # Access Control Lists # # Auto-generated by install script # Date: Tue, 10 Jul 2007 08:36:47 -0700 * @ALL 1
At this stage, only the superuser (aka you) can make edits and add pages. Everyone else can just read pages.
If the wiki is only being used by trusted users then most of spam prevention measures aren't needed.
You user the admin page to turn off everything, or can edit your conf/local.php to contain
$conf['usewordblock'] = 0; $conf['relnofollow'] = 0; $conf['indexdelay'] = 0; $conf['iexssprotect'] = 0;
Make your own template. Then edit 'footer.html' near the end, but before the final div
<?php
// only put tracking on "normal" page views -- not editing, etc
if ($ACT == "show") {
?>
<!-- GOOGLE ANALYTICS -->
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-XXXXXXX-Y"; // replace with your code
urchinTracker();
</script>
<?php } ?>
For some reason, out of the box DokuWiki replaces common acronyms with annoying html. Get rid of this by doing
$ cd dokuwiki/conf $ mv acronyms.conf acronyms.conf.dist $ touch acronyms.conf
The botton tool bar is very useful if you are an admin/editor of the wiki. For readers, it's less useful. They can't register, login or edit the page. The other features such as "back to top", and "index" are OK, but aren't so useful as to justify their own toolbar. So, we'll make it so if you are logged in, you get the toolbar, and if not, you don't.
If you are using something similar to the default template, find this bit of code near the end of main.php
<div class="bar" id="bar__bottom">
<div class="bar-left" id="bar__bottomleft">
<?php tpl_button('edit')?>
<?php tpl_button('history')?>
</div>
<div class="bar-right" id="bar__bottomright">
<?php tpl_button('subscription')?>
<?php tpl_button('admin')?>
<?php tpl_button('profile')?>
<?php tpl_button('login')?>
<?php tpl_button('index')?>
<?php tpl_button('top')?>
</div>
<div class="clearer"></div>
</div>
And add
<?php if ($_SERVER['REMOTE_USER'] != "") { ?>
and this below
<?php } ?>
You can use this trick to selectively add or remove features depending if the view is a 'writer' or 'reader' (i.e. logged in or not)
Oh yeah, so how do you login? The url is just …/doku.php?do=login so you can bookmark that or make a link for it, e.g. LOGIN
Go into your template directory, edit design.css and look for a.urlextern and empty the style so it looks like this:
/* external link */
div.dokuwiki a.urlextern {
}
The default style has prefomatting text boxes with a different color that are as wide as the page. This looks funny, especially in wide windows. To fix this, go into your template directory, edit design.css and look for pre.code and edit the entry as follows:
/* code blocks by code tag */
div.dokuwiki pre.code {
background-color: __background_other__;
max-width: 600px;
border: 1px dashed black;
padding: 3px;
}
Discussion