/***** end language block ****/ /***** 6. load common libraries *****/ require TR_INCLUDE_PATH . 'lib/output.inc.php'; /* output functions */ /***** end load common libraries ****/ /***** 7. initialize theme and template management *****/ require TR_INCLUDE_PATH . 'classes/Savant2/Savant2.php'; // set default template paths: $savant = new Savant2(); if (isset($_SESSION['prefs']['PREF_THEME']) && file_exists(TR_INCLUDE_PATH . '../themes/' . $_SESSION['prefs']['PREF_THEME']) && $_SESSION['user_id'] > 0) { if (!is_dir(TR_INCLUDE_PATH . '../themes/' . $_SESSION['prefs']['PREF_THEME'])) { $_SESSION['prefs']['PREF_THEME'] = 'default'; } else { //check if enabled $themesDAO = new ThemesDAO(); $row = $themesDAO->getByID($_SESSION['prefs']['PREF_THEME']); if ($row['status'] == 0) { // get default $_SESSION['prefs']['PREF_THEME'] = get_default_theme(); } } } else { $_SESSION['prefs']['PREF_THEME'] = get_default_theme(); } $savant->addPath('template', TR_INCLUDE_PATH . '../themes/' . $_SESSION['prefs']['PREF_THEME'] . '/'); require TR_INCLUDE_PATH . '../themes/' . $_SESSION['prefs']['PREF_THEME'] . '/theme.cfg.php'; require TR_INCLUDE_PATH . 'classes/Message/Message.class.php'; $msg = new Message($savant); /***** end of initialize theme and template management *****/ /***** 8. initialize user instance *****/ // used as global var