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

Login

api.php

This file has all the includes.
It includes all code from the inc and the site folder and the site/configuration.php file.
It initializes all global variables.
It checks the cookies, if it is called from index.php (if (defined('SOFAWIKIINDEX')).
It initializes the database.

Other PHP code can include api.php to get full access to the database.
It can either access a wiki by the functions swMessage($msg,$lang) or swSystemMessage($msg,$lang,$styled=false) or create a new wiki, lookup it or insert changes.

$w = new swWiki;
$w->name = 'myname';
$w->lookup();
$s = $w->content;
...
$w->content = $s;
$w->insert();

Note that you work with wikitext. If you want to have HTML, you should parse it.
You can also use the swFilter function to search in the wiki.

Functions

swMessage($msg,$lang)

Returns a page based by name and language. The page is loosly parsed (template, links and style)

swSystemMessage($msg,$lang,$styled=false)

Returns a page based by name and language. The page is loosly parsed (template, links and style)

File structure