About
- This program is a framework, similar in functionality with
phpBB, which uses ajax technology (tables from phpBB can be exported)
- The forum has another functionality, same as "private messages" from phpBB called
Notebook
- CSS compatibility with phpBB.
1. Forum Installation
Note: First install
MUMSAI application and than the forum.
Installation steps:
- In MUMSAI, add web address forum (using "New url" option)
- Edit file framework/includes/custom_configs.php.
Here, configure the database parameters,
and very important set TCS (TCS was send by email at
the first step);
* Mandatory options are database parameters,web page address,
MUMSAI and
BASE_SERVER web address.
- Run forum_logic/install.php
Note:
It’s recommended after this step, to delete or to move the file in
another directory (not accessible from browser).
- Grant write access to apache user for framework/Session and framework/static
directories (here is generated the lo-fi forum
version).
- Move forum_logic/crontab_sessions.php script in crontab, 1 day
setting is recommended. This script delete all session expire files.
- Move forum_logic/crontab_generate_static.php script in crontab,
1 day setting is recommended. This script generates files for lo-fi
forum version.
phpBB database export
If you have phpBB installed and you do not want to loose the
data from database, use
export_phpBB.php script to export these data.
First, databases parameters for these two forums must be set (these parameters
are at the beginning of the file).
Notebook
Notebook is a facility as "private messages" from
phpBB. It has labels.
- Has the same look as main forum, replay to an item from INBOX,
is the same.
- You can send messages to other users.
- You can send messages to forum.
- New messages are put in INBOX label; all sending,
received messages will be in ALL ITEMS label. INBOX massages can be
archived (will be sent to ALL ITEMS).
- New labels can be created and item can be group by labels.
Css
CSS style and images are from phpBB. Directory structure is
the same. A template sample is in templates directory. To change template, copy
directory in templates, css.css file in root and change constant TEMPLATE value
from
custom_configs.php file.
2. Directory Structure
- -App --> applications (php servers), use ajax .
- -blocks --> interface config files. Here can change
static left menu, links from footer, and messages from header (top_ files).
- -history --> history browser framework
- -includes -> config files
- -js --> javascript files.
- -language -> files with messages translated in
different languages. To add a new language, add a new file in this
director, add in custom_configs.php file a new values pair to $languages
array.
- -modules --> scripts used in forum, notebook, to change
zone and language.
- -pages --> forum main pages
- -pages_iframe -> iframe pages
- -SERVER --> logout server.
- -Session --> session files
- static --> static forum version
3. Adding new modules, interaction between PHP and AJAX
In App directory, there is
Test directory which
explain how new ajax application can be added.
Note:
Adding a new module in "App" directory, imply setting the web address
for server.php file, in custom_configs.php file (add a new location
$php_servers array)
Writing is done normally; there is an exception for forms
and links:
3.1 Forms
Change <form
action="" method="">, with
BuildSubmit("id_form",
array("page"=>"form_page")) function
This function will generate the necessary html code.
For "Submit" buttons use:
BuildSubmit("id_form","value",array("fieldname"=>"validation_type",".."))
function.
Array contains html fields list needed for validations. Validations types there
are in
js/validate_functions.js file.
Example: array("field"=>"isMoney") - field must
be float.
If you do not want these validations, you can use your validation:
BuildSubmit("id_form","value",array(),"","","validate()")
- where validate() is an ordinary js function.
Note: When submit buttons implement save, delete actions and when BACK
button from browser is click, you do not want to come back to form, use
NO_HISTORY constant:
-BuildSubmit("id_form","value",array(),"",NO_HISTORY)
Inside forum, there is html code.
3.2 Links
Links must have:
<a href=""
onClick="doAction("modul_name","page=included_page");return
false;">..</a>
or you can use
BuildLink("name","link","style")
function, where link has the form "page=hello".
4. Sessions
This forum has its own sessions. Sessions are created in
Session directory and have two files:
- a file with unique name (generated random), contains
session data
- a file (has the same name as the username), created in
subdirectory Session/Link, which contains the random file name.
This is used in logout action, when the files must be deleted.
4.1. Use
Pages from
pages directory from each module are
included in
server.php file
Sessions are read in $session variable (a
Sessions instance).
For easy manipulation, there is the function
getArray()
$SESSION=$session->getArray().
Each page from
pages directory, must declare globally this variable.
From now on,
$SESSION variable can be used as
$_SESSION php
array too;
To insert a value to session, use
$session->setSession("key","value");
function.
When in session are inserted more values, for optimization, first insert values
to session and then call setSession() function (with no parameters).
Example:
$session->info->data["key1"]="value1";
$session->info->data["key2"]="value2";
...
$session->setSession();
4.2. Sessions expiration
Default, a session expires after a week. After that time,
browser will delete from cookie the filename automatically, but on the server
side these files are deleted by a script added in crontab (see I.5 section)
Each session file, has a header, which contains the username and the time when
expires.
Script reads this section and decides if the file must be deleted or not.