NBWiki information and source files

Configuring NBWiki

Configuring NBWiki


Three types of configuration are envisaged:
  1. Configuring the script, including creating separate scrips for different editors
  2. Changing the template, including making changes to fit in with your website style
  3. Altering or extending NBWiki, particularly the markup syntax
These are described below.

1. Configuring the script

As you will see below, you may use multiple scripts for one Wiki in order to control editing rights. Change $EDIT_IF parameter, and possibly others.

The following are set near the top of the script

NameExampleNotes
$WIKI_TITLE"NBWiki information and source files"Main title on Wiki page (unless template is altered)
$PAGES_DIR"./pages/"Set as a relative link ending in /
$DOC_DIR"./docs/"For locally stored Word documents etc. that may be referenced from the Wiki for viewing or download. Set as a relative link ending in /
$PIC_DIR"./pics/"For locally stored graphic files that may be shown embedded in the Wiki. Set as a relative link ending in /
$TEMPLATE_FILE"./templates/__.html"Define the template file, including the path. May be shared between Wikis.
$EDIT_IFarray('This page is managed by the Baptist Church','This page is managed by Churches Together')The ability to edit Wiki documents can be controlled by making different versions of the script available to different groups of people. The example settings could be made in a version of the script only available to the secretary of the Baptist Church who could change any Baptist Church or Churches Together page. If he or she created a new page, it would be seeded with the first entry.
 
The administrator or "Super editor" uses a version with a null string, can edit any page (unless read-only), and can therefore create starter pages for other editors.

Set a value such as 'ViEw OnLy' to prevent editing altogether. Generally, public access would be from such a script, normally called index.php.
$START_PAGE"NBWiki home page"Home filenames normally have the form Home.txt (the script adds .txt to all page files) but a variation may be desirable if the Wiki forms part of a larger website.
$RECENT_COUNT15Set the number of recently changed pages to list if Recent Changes is selected
$TIME_FORMAT"%d-%m-%G %R"Set date and time displays to country standard. The example suits the UK
$TABLE_FORMAT'<table border="4" bordercolorlight="#80f0f0" bordercolordark="#80f080" cellpadding="6">'Table format for ruled tables - complete html <table ...> string
$HOME_BUTTON"NBWiki Home"Text on Wiki home button
$EDIT_BUTTON"Edit page"Text on Edit button
$DONE_BUTTON"Save changes"Text on button for saving edits
$PROTECTED_BUTTON"Editing not permitted"Alternative text for "Edit" button
$SEARCH_BUTTON"Search"Text on search button
$SEARCH_RESULTS"Search results for"Header for search results
$NEW_PAGE"New page"Text to show a page is new
$RECENT_CHANGES"Recent changes"Header for recent changes list
$FORCE_REFRESH'&r=' . rand(1,999)For forcing bypass of caches in high latency links. May be set to "" (null string) if latency will not be a problem.

2. Changing the template, including making changes to fit in with your website style

This requires an understanding of HTML and (preferably) it's interaction with PHP. These you must gain elsewhere.

Changes to the template are well worth considering. You could, for example, create a template form general visitors to your site with no hint of editing being a possibility.

The scripts do not have to be named by the default name of index.php and several versions with different names could be included in one directory. This may be useful in some circumstances, such as where you have no worry that sub-editors might interfere with each others pages.

3. Altering or extending NBWiki, particularly the markup syntax

Production versions of the script (typically index.php for general use, admin/index.php for super-editors and others for restricted editors) may have most comments stripped beyond the configuration section. You can download a version with comments included called dev.php.txt to help if you wish to try fixing any bugs you find (or make any other changes). When you have retrieved it, remove the .txt from the filename.

The complex section at the end of the script handles the convertion from marked up "plain text" to HTML for normal display. Changing it without breaking it may prove challenging, but you are welcome to try. Be aware that the order of these statements is often important.

The syntax for "code" - double opening brackets, content, double closing brackets - needs some work. Current thinking is that it may be best processed near the start of the conversion section and work by inserting a null character after every included character. But I don't yet know how to do this efficiently.

If you come up with changes you think generally useful, please send details to nbwikiatnomazdotcodotuk with a statement saying that your ideas may be used freely. Thanks.

 

NBWiki is based on roWiki