Forums / Cotonti / General / Cotonti Connect?

to use cotonti outside of xtemplate

GHengeveld
#29876 2011-06-21 00:37

Sure, try this:

<?php
define('COT_CODE', TRUE);
require_once './datas/config.php';
require_once $cfg['system_dir'] . '/functions.php';
require_once $cfg['system_dir'] . '/common.php';
?>
<html>
<?=$usr['name']?>
</html>

Common.php is where the magic happens. It handles user authentication so you stay logged in.

Actually, this is the way modules work. They have their own file in the root and use this code to load the framework. However in order for it to show up as a module it needs it's own folder in /modules and a setup file.