Dear Thomas,
For changes in the modules:
Guidline for making old modules working in Modera >= 4.00
Starting from version 3.81 Modera is not using register_globals and from version 4.00 uses new i18n system (Translator). Module classes should work without any modifications while admin files will not work and should be modified.
register_globals emulation
While writing new modules programmers should make them compatible with register_globals off.
Old modules might be changed to get request data from superglobals arrays $_GET, $_POST. However in some cases you may just emulate register globals behaviour putting following 2 lines in the beginning of module admin files:
foreach ($_GET as $k => $v) $$k = $v;
foreach ($_POST as $k => $v) $$k = $v;
i18n
In new module admin files you should include “admin_header.php” file that will perform all common work.
To make modules compatible with new versions of Modera you can rewrite your old admin files for using “admin_header.php” or make following changes:
* include following files “class/config.php”, “class/common.php”, “class/Database.php”
* insert after “$ses = new Session();” following code:
// create database instance
// using database connection id from Session instance
$sql = new sql();
$sql->con = $ses->dbc;
$database = new Database($sql);
$GLOBALS['database'] =& $database;
load_site_settings($database);
unset($sql);
language initialization part should be modified:
// init language object
$lan = new Language($language);
$language2 = $lan->interfaceLanguage($language2);
$language = $lan->lan();
if ($language2) { include("../class/admin_" . $language2 . ".php"); }
should be changed with
// init language object
$lan = new AdminLanguage($database, $language);
$language2 = $lan->interfaceLanguage($language2);
$language = $lan->lan();
Other guidlines will be available soon and include instructions of importing old language files.
With best regards,
Simon
|