コード例 #1
0
 function loadPHPBB3($path)
 {
     global $phpbb_root_path, $phpEx;
     global $db, $user, $auth, $template, $cache, $config, $phpbb_hook, $sql_db;
     if (!defined('IN_PHPBB')) {
         define('IN_PHPBB', true);
     }
     if (!defined('STRIP')) {
         define('STRIP', get_magic_quotes_gpc() ? true : false);
     }
     if (!defined('JPATH_FORUM')) {
         define('JPATH_FORUM', $path);
     }
     // Create the JConfig object
     require_once JPATH_FORUM . DS . 'configuration.php';
     $config = new JConfigForum();
     $phpbb_root_path = JPATH_ROOT . DS . $config->phpbb_path . DS;
     $phpEx = substr(strrchr(__FILE__, '.'), 1);
     //Load configuration
     require $phpbb_root_path . 'config.php';
     // Include files
     require_once $phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.php';
     require_once $phpbb_root_path . 'includes/cache.php';
     require_once $phpbb_root_path . 'includes/template.php';
     require_once $phpbb_root_path . 'includes/session.php';
     require_once $phpbb_root_path . 'includes/auth.php';
     require_once $phpbb_root_path . 'includes/functions.php';
     require_once $phpbb_root_path . 'includes/constants.php';
     require_once $phpbb_root_path . 'includes/db/' . $dbms . '.php';
     require_once JPATH_FORUM . DS . 'includes' . DS . 'utf8.php';
     // Instantiate some basic classes
     $user = new user();
     $auth = new auth();
     $template = new template();
     $cache = new cache();
     $db = new $sql_db();
     // Connect to DB
     $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true);
     // We do not need this any longer, unset for safety purposes
     unset($dbpasswd);
     // Grab global variables, re-cache if necessary
     $config = $cache->obtain_config();
     // Add own hook handler
     require_once $phpbb_root_path . 'includes/hooks/index.' . $phpEx;
     $phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
     foreach ($cache->obtain_hooks() as $hook) {
         @(include $phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
     }
 }
コード例 #2
0
ファイル: gym_style.php プロジェクト: jverkoey/Three20-Scope
        if (empty($acm_type) || empty($dbms)) {
            exit;
        }
        require $phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx;
        require $phpbb_root_path . 'includes/cache.' . $phpEx;
        require $phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx;
        require $phpbb_root_path . 'includes/constants.' . $phpEx;
        require_once $phpbb_root_path . 'gym_sitemaps/includes/gym_common.' . $phpEx;
        $db = new $sql_db();
        $cache = new cache();
        // Connect to DB
        if (!@$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false)) {
            exit;
        }
        unset($dbhost, $dbuser, $dbpasswd, $dbname, $dbport);
        $config = $cache->obtain_config();
        $gym_config = array();
        obtain_gym_config($action, $gym_config);
        // Do we load phpbb css ?
        $load_phpbb_css = isset($gym_config[$action . '_load_phpbb_css']) ? $gym_config[$action . '_load_phpbb_css'] : $load_phpbb_css;
        // Check if requested style does exists
        if ($theme_id > 0) {
            $sql = 'SELECT s.style_id, c.theme_path, c.theme_name, t.template_path
				FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c
				WHERE s.style_id = ' . $theme_id . '
					AND t.template_id = s.template_id
					AND c.theme_id = s.theme_id';
            $result = $db->sql_query($sql, 300);
            $theme = $db->sql_fetchrow($result);
            $db->sql_freeresult($result);
        }