Home Features Demos Download Installation User Manual Developer Manual Relation function Credits

Anmelden

site/configuration.php

When you install the wiki, you have to configurate this with this file. Edit this file of a copy of inc/configuration.php with a text editor and upload it to the site folder.

The following settings are all already in the file. You need just to edit it, not to type it.

Name your wiki


$swMainName = "SofaWiki";
$swBaseHref = "http://www.sofawiki.com/index.php";
$swBaseHrefFolder = "http://www.sofawiki.com/";

Create a cookie prefix

You need this if you have multiple wikis on your domain.
Used cookies are $lang and $skin.
You may want to define also cookies by your own.
The user authentification however is handled as a session.

Cookie Expiration deines how long a user can be logged in via the cookie.

$swCookiePrefix = 'sofawiki';
$swUserCookieExpiration = 4 * 60 * 60;

Create a master user

All users are defined as user pages. The master user stays, even if the user page is deleted.

$poweruser = new swUser;
$poweruser->username = "admin";
$poweruser->ppass = "1234";
$poweruser->content = "[[_view::*]] [[_create::*]]
[[_upload::*]]
[[_modify::*]]
[[_protect::*]]
[[_rename::*]]
[[_delete::*]]
[[_special::special]]";

Define default rights for user that creates themselves

$swAllUserRights .= " [[_view::Main]] [[_view::Category]] ";
$swNewUserRights .= " ";
$swNewUserEnable = true;

Define encryption salt

Passwords on user pages are saved as a hash. The encryption salt makes sure that the hash cannot be reused on another server. Note that changing the salt live invaldates all previous hashes.

$swEncryptionSalt = "0000";

Configure skins and add your own skin

Add your own skins in the site/skin folder

$swSkins["default"] = "inc/skins/default.php";
$swDefaultSkin = "zeitung";

Enable languages

$swLanguages[] = "de";
$swLanguages[] = "en";
$swLanguages[] = "fr";
$swDefaultLang = "en";

Define namespaces that are allowed for transclusion

$swTranscludeNamespaces[] = "Image";

Note: if you add user namespace, everybody can inspect user pages adding the user name in the transclusion on a main page.

Define search options

By default, only the main namespace is searched.

$swSearchNamespaces[] = "Images";

On all searches, filtering will be aborted after n msec. Index will be created over multiple searches
$swMaxOverallSearchTime = 2000;

Search first in titles. if title search gives results, returns only these
$swQuickSearchinTitle = true;

if $swQuickSearchinTitle is set and an exact match is found, the page is returned instead of a search result
$swQuickSearchRedirect = false;

Limit the number of searching words for long search to avoid long searches
$swSearchWordLimit = 4;

Define email for notifications

All actions have a logline in the log file. You can specify actions where an email is also sent to you.

$swNotifyMail = "a@b.c";
$swNotifyActions[] = "newusersubmit";
$swNotifyActions[] = "lostpasswordsubmit";

Define your hooks

Hooks allow to personalize the code within the dataflow

Return a custom page when a user has not the right to view a page
function swInternalNoAccessHook($name) {}

Reorder and format Category pages and search results

function swInternalCategoryHook($name,$wn) {}
function swInternalSearchHook($name,$wn) {}

Make your own cronjob housekeeping. (Return true to prevent the default cron jobs)
function swInternalCronHook() {}

Handle pseudo namespaces linke interlanguage links
function swInternalLinkHook($val,$label) {}

Handle external data in queries
function swVirtualLinkHook($url, $fields) {}

Define custom function

Custom functions add functionality in the parser. For example can add functions, that use some external information, like a weather service. Put these functions into the site/funcions folder and include them here. You can inspect inc/functions to see how functions are written.

include_once "$swRoot/site/functions/myfunction.php";

Use simpe URL scheme

Allows you to write www.mysite.com/this-wunderful-page instead of www.mysite.com/index.php?name=this-wunderful-page

$swSimpleURL = true;

To make it work, you need also to add a .htaccess file

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?name=$1 [L,QSA]

Use PHP image scaler

Set this to true if you are on a server. Set it to false if you are on localhost (image scaler does not work)

$swImageScaler = true;

Set Timezone

Important for properly dated revisions

swSetTimeZone("Europe/Zurich");

Define download filetypes

$swMediaFileTypeDownload = ".xls.docx.doc.";

Protect your website

Number of unsuccessful logins that block the IP for the day.

$swDenyCount = 5

Probability in % that an access to the login page without password triggers an unsuccessful logins (useful values 0-10).

$swStrongDeny = 0

File structure Site folder