First, an apology. '''A lot of this is way out of date'''.
Any references to NBWiki here relate to a predecessor to qwkzit.
Setting up or modifying the basic structure of a website involves making changes to several files. Most are in the "setup" sub folder of the folder containing index.php (which initiates loading the website). This folder is referred to below as [home]. The index.php file is not itself normally changed.
Text configuration
File [home]/setup/config.php
This defines most of the text used in headings and messages, permitting for example use of a local language. The defaults are in English. Other things such as the locations of various folders can be changed - if you really must. The file mainly comprises keyword=text pairs. Many keywords are self-explanatory but the main ones to consider are described here. Most English users will only need to consider the first few items.
| '''Name''' | '''Example''' | '''Notes''' |
| $SITE_TITLE | "Converting a diesel to battery power" | Main title on Wiki pages |
| $START_PAGE | "Home" | Name of the first page displayed |
| $EXTRA | "" | Text appended to page load calls. Could be "'&r=' . rand(100,999)" to force page reloads rather than use of locally cached copies on slow links. |
| $PAGES_DIR | "./pages/" | Folder location for the marked-up page text. |
| $DOC_DIR | "./docs/" | Folder for locally stored documents etc. that may be referenced for viewing or download. |
| $PIC_DIR | "./pics/" | Folder for locally stored graphic files that may be shown embedded in pages and/or required by page templates |
| $VIEW_TEMPLATE | "./templates/view.html" | Define the template file normally used, |
| $EDIT_TEMPLATE | "./templates/edit.html" | Define the template file used for editing. Normally designed to maximize the size of the editing window. Adds fields used to encrypt passwords etc. |
| $RECENT_COUNT | 15 | Set the number of recently changed pages to list if Recent Changes is selected. |
| EDIT_ROWS | 20 | The maximum number of rows of marked-up text visible (without scrolling) in an edit window. The window can however be resized by dragging when in use. |
| EDIT_COLS | 100% | The initial width of the editing window. |
| $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 this page" | Text on Edit button. Not used if no button defined in template. |
| $RECENT_CHANGES | "Recent changes" | Text on Recent Changes button and page title for recent changes list |
| $NEW_DATE | "New page" | Used in place of a specific date where appropriate |
| $LIST_DATE | "See list" | Used in place of a specific date in list headers |
| $EDIT_REFUSED | "Sorry, you do not seem to have permission to edit this page." | Shown when editing refused. |
| $NEW_TEXT | "Sorry, content is awaited." | Initial content of a new page |
| $NO_BUTTON | "" | Replaces any button when it is not appropriate to display it |
| $SAVE_BUTTON | "Save changes" | Text on button for saving edits |
| $SEARCH_NAMES | "Search page names:" | Prefix to page name search radio button |
| $SEARCH_ALL | " or, search content also:" | Prefix to full search radio button |
| $SEARCH_BUTTON | "Find pages" | Text on search button |
| $SEARCH_RESULTS | "Search results for" | Start of page header for search results |
| $EDITING_PAGE | "Editing " | Start of page header for editing |
| $FORCE_REFRESH | '&r=' . rand(100,999) | For forcing bypass of caches in high latency links. May be set to "" (null string) if latency will not be a problem. |
Below here is old stuff for possible cannibalizing.
The viewing template
Five types of configuration are envisaged:
- Configuring the script, including defining the credentials needed by editors
- Changing the "view" and "edit" templates, including making changes to fit in with your website style
- Editing the initial style sheets
- Altering or extending NBWiki, particularly the markup syntax
1. Configuring the script
A PHP script, index.php, forms the heart of qwkzit. This references a number of other php files, primarily for convenience in development and deployment. They could all be rolled in to index.php but this is not recommended.Note that the previous approach to restricting editing rights - using multiple versions of the script - no longer applies.
The following are set near the top of the script
2. -redundant-
3. Changing the template(s), 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 templates are well worth considering. You can, for example, create a template for general visitors to your site with no hint of editing being a possibility simply by removing '''{EDIT}''' when it occurs.
4. Editing the style sheets.
This requires an understanding of Cascading Style Sheets (CSS) but gives you control over most visual aspects of your NBWiki.5. Altering or extending NBWiki, particularly the markup syntax
Production versions of the script (typically nbwiki.php) may have most comments stripped beyond the configuration section. Ask for a version with comments to help if you wish to try fixing any bugs you find (or to make any other changes). When you have retrieved it, remove the '''.txt''' from the filename if this is present.The complex section at the end of the script handles the conversion 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 nbwiki at nomaz dot co dot uk with a statement saying that your ideas may be used freely. Thanks.
