0)
{
$warnings[] = 'Some database upgrades are missing, '
.'upgrade now';
}
}
//
// Setup gallery wide options, if this fails then we output a CRITICAL_ERROR
// since basic gallery information is not available
//
load_conf_from_db();
include(PHPWG_ROOT_PATH.'include/user.inc.php');
// language files
include_once(get_language_filepath('common.lang.php'));
if (defined('IN_ADMIN') and IN_ADMIN)
{
include_once(get_language_filepath('admin.lang.php'));
}
if ($conf['gallery_locked'])
{
$warnings[] = $lang['gallery_locked_message']
. '.';
if ( basename($_SERVER["PHP_SELF"]) != 'identification.php'
and !is_admin() )
{
exit();
}
}
// only now we can set the localized username of the guest user (and not in
// include/user.inc.php)
if ($user['is_the_guest'])
{
$user['username'] = $lang['guest'];
}
// include template/theme configuration
if (defined('IN_ADMIN') and IN_ADMIN)
{
list($user['template'], $user['theme']) = explode('/', $conf['admin_layout']);
// TODO : replace $conf['admin_layout'] by $user['admin_layout']
}
else
{
list($user['template'], $user['theme']) = explode('/', $user['template']);
}
// TODO : replace initial $user['template'] by $user['layout']
include(
PHPWG_ROOT_PATH
.'template/'.$user['template']
.'/theme/'.$user['theme']
.'/themeconf.inc.php'
);
if (is_adviser())
{
$warnings[] = $lang['adviser_mode_enabled'];
}
// template instance
$template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template']);
if (count($warnings) > 0)
{
$template->assign_block_vars('warnings',array());
foreach ($warnings as $warning)
{
$template->assign_block_vars('warnings.warning', array('WARNING'=>$warning));
}
}
?>