PWP wiki processor

Configuration

TextRules . SimpleTextRules . Installation . Configuration
UserManual . FAQ . »find more online

 -Mapping config settings to variables
 -Application control
 -General HTML settings
 -Static HTML settings
 -Edit, Save, View pages
 -Calendar
 -File StaticHtml.inc
 -File Snippets.inc

This pages describes the settings in the file wiki/conf/config.inc and other config files within the same directory.

Mapping config settings to variables

For security reasons the config settings are not web editable. But if you feel, some should, you can map a setting to a variable and enable "AllowEditConfig":

  1. Create a variable "DateFormat"
  2. Map the config setting to the variable:
    $this->mProp['DateFormat'] = $this->mVars['DateFormat'];

Be aware that variables can only contain strings. If you want to map a number, use a type cast:

$this->mProp['MinFileAge']     = (int)$this->mVars['MinFileAge'];
$this->mProp['UseGzipHandler'] = (bool)$this->mVars['UseGzipHandler'];

For arrays usa the PHP function "explode()".

Application control

Note: The setting 'IsProductive' has become obsolete from 1.4.0 on. Instead you may decide to use either 'run.php' or 'run.debug.php'. See Development for details.

UseGzipHandler

Compress HTML finally into a zip stream if the client signals support for this kind of communication (Mozilla/Netscape an MS IE will). May speed up internet based applications. May slow down internal applications if bandwidth does not matter.

Values: TRUE or FALSE
Sample: $this->mProp['UseGzipHandler'] = false;

UseCache

If TRUE, PWP will try to fetch the current page from cache. Set it to FALSE if PWP should create the page every time. Working without cache might be faster in cases when files are often created and deleted by several editors.

Values: TRUE or FALSE
Sample: $this->mProp['UseCache'] = false;

AllowEditConfig

DANGER! Allows you to edit variables and InterWiki links in a web form. It means actually to change PHP code in your config file! Set this value to FALSE if you are running an open wiki. It could be easy for an attacker to kill your Wiki. Set to TRUE if your Wiki is protected by .htaccess or a similar mechanism AND you can trust the editors.

Values: TRUE or FALSE
Sample: $this->mProp['AllowEditConfig'] = false;

UseJSLinks

JavaScript links will prevent search engine spiders from deleting your files by following the "erase" links. But people with user agents not supporting JavaScript won't be able to participate. Enable this option if you are running an open Wiki. The search engines will be able to follow the "view" links and to index your pages. Just the "maintenance" links will be composed of JavaScript.

Values: TRUE or FALSE
Sample: $this->mProp['UseJSLinks'] = false;

TextFileTypes

Affects the search in uploaded files. Which files are text files and shall become included in a full text search? Note: All files with a name matching one if the text file extensions are accepted: '.htm' matches 'web.html' and '.txt' matches 'my.txt.zip'.

Values: String, comma separated list of text file extensions
Sample: $this->mProp['TextFileTypes']	 = '.txt,.htm,.xml';

MinFileAge

Minimal age in days before history files and files from trash can be deleted physically. Prevents open Wikis from wipe out attacks. Consider using 3 * 365 for a long time period. PWP calculates internally with seconds, so do not exceed about 29 years. Otherwise an integer overflow might happen.

Values: Integer (-1,0,N)
   0 enable immediate erase (like Windows trash bin)
  -1 will keep all files forever
  30 will delete files which have been in trash for at least 30 days

Sample:$this->mProp['MinFileAge'] = 21;

DateFormat

String pattern for the date format in PWP. For more details see PHP documentation of date(). Default for ISO format: 'Y-m-d H:i:s'

Values: TEXT
  l = weekday
  Y = year 4 digits
  m = month 2 digits
  d = day of month, 2 digits
  H = hours, 2 digits
  i = minutes, 2 digits

Sample: $this->mProp['DateFormat'] = 'l, Y-m-d H:i';

MenuType

NOT effective in 1.4.1

Change the layout of the dynamic Wiki pages; doesn't affect the static pages.

Values: Integer
   1 Top&Bottom (standard)
   2 Left side only

Sample:$this->mProp['MenuType'] = 1;

General HTML settings

These settings affect the (invisible) header of every HTML page. The title will show up in the title bar of the user agent window. The language setting is just an information for the user agent as well as the char set definition. The latter one tells the user agent which fonts are to apply - some languages have pretty 'special' characters. And it is an useful information for search engines, too.

HTML Header Settings

Sample: $this->mProp['HtmlTitle'] = 'PWP Wiki Processor';

Sample: $this->mProp['CommonDescription'] = "The PWP Wiki Processor.";

Sample: $this->mProp['CommonKeywords']	= "PWP, PHP, Wiki, WikiWiki, Community";

Values: Use two char ISO code: en, fr, de, dk, se, es, it, hu.
Sample: $this->mProp['Language'] = "fr";

Values: 'iso-8859-15' is a good choice for Europe, Australia and NorthAmerica.
Sample: $this->mProp['Charset'] = "iso-8859-15";

LogoImg

Which logo should be at the top of the page? You have to provide a complete HTML img tag. Use a relative path (without http://webserver) - otherwise the logo might not be found on your static pages.

Values: A whole HTML image tag - or even more HTML.
Sample: $this->mProp['LogoImg'] = "<img src='../img/wiki.jpg' alt='PWP wiki'>";

StyleSheets

Web path and name of the style sheet(s). The name of this setting has been changed in 1.4.0. The path should be relative. You can include more than one style sheet. The settings of a later included style sheet will override similar settings of previously included style sheets.

Values:
   old style: <link rel='STYLESHEET' type='text/css' href='fileName'>
   new style: <style type="text/css">@import url(../css/standard.css);</style>;

Sample: this->mProp['StyleSheets'] 
        = '<style type="text/css">@import url(../my.css);</style>';

Static HTML settings

EnableStaticExport

Allows or denies the creation of static pages.

Values: TRUE|FALSE: 
Sample: $this->mProp['EnableStaticExport'] = TRUE;

CreateStaticLists

Include a list of all pages and a list of all files in static pages. May help to improve the navigation within the static pages.

Values: TRUE|FALSE: 
Sample: $this->mProp['CreateStaticLists'] = TRUE;

RemoveCommentsStatic

Removes all visible editor comments in static pages. These are lines starting with an '!'.

Values: TRUE|FALSE: 
Sample: $this->mProp['RemoveCommentsStatic'] = TRUE;

ConstructionMessage

The default message for static "under construction" pages. This message will appear on a static page instead of the page contents if a Wiki page contains the "under construction comment" which consists of '!?' and a text is omitted.

Values: Text, HTML is allowed
Sample: $this->mProp['ConstructionMessage'] 
           = 'Sorry, this page is still <strong>under construction</strong>.';

Edit, Save, View pages

CreateTOC

Create a table of contents on top of each page, uses all contained H1 and H2 tags.

Values: TRUE|FALSE
Sample: $this->mProp['CreateTOC'] = TRUE;

ShowInfoLine

If TRUE every page will have a small line at the bottom informing about file size, create date and cache state.

Values: TRUE|FALSE
Sample: $this->mProp['ShowInfoLine'] = true;

EditRows

Number of rows of the text edit box. Default: 21.

Values: Integer
Sample: $this->mProp['EditRows'] = 21;

EditColumns

Number of chars in one line of the text edit box. Default: 85.

Values: Integer
Sample: $this->mProp['EditColumns'] = 85;

AllowedTags

Enumeration of allowed HTML tags inside a Wiki file. If this string is EMPTY '', no HTML is allowed; all chars like & < > will be converted into HTML entities '&...;'

If this string contains ANY tag(s), all undefined tags will be silently removed. You may use < > as single char with spaces around in mathematical meaning. But << and >> may cause the strip_tags() function to remove text or even to truncate your text starting at '<<'!

Values: Enumeration of opening HTML tags or empty string.
Sample: $this->mProp['AllowedTags'] 
           = '<h1><h2><h3><p><pre><div><ul><ol><li><img><a><hr><br><b><i>';
        $this->mProp['AllowedTags'] = '';

UseSnippets

The edit form will show snippet links if set to TRUE. A snippet is a user defined text fragment which can be appended at the edit form. Snippets are defined in the file config/Snippets.inc.

Values: TRUE|FALSE
Sample: $this->mProp['UseSnippets'] = TRUE;

MaxUploadSize

Max. size for uploaded files in KBytes. PHP itself has a default of max. 2048 KB. This setting may be restricted further by providing a smaller setting. It cannot exceed the PHP setting. Default: 1024;

Values: Integer
Sample: $this->mProp['MaxUploadSize'] = 1024;

MaxPostSize

Max. file size for Wiki pages in KB. Note, we are talking about Wiki code size, not HTML. 64 KB are about 12..16 typewriter pages with a lot of text on each. A user would have to scroll about 3 meters down in such a Wiki page.

Values: Integer
Sample: $this->mProp['MaxPostSize'] = 64;

RecentChangesLinks

View RecentChanges of the last N days. This array defines the links to be generated. The first value is the default value. Default: array(1,3,7,15,31,90);

Values: Array containing integers.
Sample: $this->mProp['RecentChangesLinks'] = array(1,3,7,15,30,60,90);

IndexType

This setting affects the list of Wiki pages, uploaded files and the recent changes. PWP supports two list types: A single column index with detailed information and a multi column index with less information.

Values: Integer
        1 = single column index with time information
        n = n column index without time information
        use n = 3 for 800 pixel screen resolution
        use n = 4 for 1024 pixel screen resolution
        0 or smaller: forbidden
Sample: $this->mProp['IndexType'] = 3;

ListLength

Now active in 1.4.1.

How many entries should appear on one list page? See also above: IndexType. Default: 100

Values: Integer
Sample: $this->mProp['ListLength'] = 100;

Calendar

EnableCalendar

Enable or disable calendar creation.

Values: TRUE|FALSE
Sample: $this->mProp['EnableCalendar'] = TRUE;

IsUSCalendar

US calendars (and others?) have a week begin on Sunday. A German week starts on Monday. Affects the small month overview table. The contained week number is calculated by PHP corresponding to some ISO definition. This hopefully works around the globe...

Values: TRUE|FALSE
Sample: $this->mProp['IsUSCalendar'] = TRUE;

Holidays, Events and Entries

Predefine things which should appear in your calendar pages. A semi-colon separated string: "dd.mm;holiday name;dd.mm;...;" is required. The order of the dates doesn't matter; every date may only appear once within a string.

By using this format, these settings can be mapped to variables. And variables are web editable. You can use line breaks in the web edit form, putting each date on a single line.

Note: PWP cannot calculate holidays which are not bound to a date, like the easter days.

Values: STRING: dd.mm;text
Sample:
  $this->mProp['CalendarHolidays'] = "25.12.;X-Mas;26.12.;X-Mas";
  $this->mProp['CalendarEvents'] = "21.06.;Summer;23.09.;Autum";
  $this->mProp['CalendarEntries'] = "10.03.;Annual Business Report";

File StaticHtml.inc

This file contains the HTML header and footer for static HTML pages. Header and footer for dynamic Wiki pages are contained in wiki/resp/out/Html.inc. However this file is not considered to be part of the configuration; it contains a whole bunch of program logic.

StaticHtml.inc consists of thee functions, each returning a string. Just edit the part between:

 return <<<eoh

 eoh;

You can access config settings and variables using:

{$gConfig->mProp['StartPage']}
{$gConfig->mVars['IconYes']}

Having some programming experience, you might use the passed $wikiPage to use different headers. For example, if a page name ends with ".EN" or ".DE", an appropriate header could be returned.

The third function returns an index (default) page which must match the naming requirements of your webserver. It simply forwards to the configured start page. Usually you do not have to change this function.

File Snippets.inc

Here are the snippets defined which appear as JavaScript links below the edit box. The function "_defineSnippets()" is of interest for you. It must return an array with a name => value mapping.

   (Powered by PWP Version 1-4-3)