Exemplo n.º 1
0
// set the current unix timestamp
define('TIMENOW', time());
define('SAPI_NAME', php_sapi_name());
define('SAFEMODE', (@ini_get('safe_mode') == 1 or strtolower(@ini_get('safe_mode')) == 'on') ? true : false);
// try to force display_errors on
@ini_set('display_errors', true);
// define current directory
if (!defined('CWD')) {
    define('CWD', ($getcwd = getcwd()) ? $getcwd : '.');
}
// #############################################################################
// fetch the core classes
require_once CWD . '/includes/class_core.php';
require_once CWD . '/includes/functions.php';
// initialize the data registry
$vbulletin = new vB_Registry();
// parse the configuration ini file
$vbulletin->fetch_config();
if (CWD == '.') {
    // getcwd() failed and so we need to be told the full forum path in config.php
    if (!empty($vbulletin->config['Misc']['forumpath'])) {
        define('DIR', $vbulletin->config['Misc']['forumpath']);
    } else {
        // This can not be phrased as it appears before phrase load and phrases won't load if we move this after ..
        trigger_error('<strong>Configuration</strong>: You must insert a value for <strong>forumpath</strong> in config.php', E_USER_ERROR);
    }
} else {
    define('DIR', CWD);
}
// Load Phrases
$phrases = vB_Upgrade::fetch_language();
Exemplo n.º 2
0
 /**
  * Takes the contents of an array and recursively uses each title/data
  * pair to create a new defined constant.
  */
 function array_define($array)
 {
     foreach ($array as $title => $data) {
         if (is_array($data)) {
             vB_Registry::array_define($data);
         } else {
             define(strtoupper($title), $data);
         }
     }
 }
Exemplo n.º 3
0
define('SAFEMODE', (@ini_get('safe_mode') == 1 OR strtolower(@ini_get('safe_mode')) == 'on') ? true : false);

// define current directory
if (!defined('CWD'))
{
	define('CWD', (($getcwd = getcwd()) ? $getcwd : '.'));
}

// #############################################################################
// fetch the core includes

require_once(CWD . '/includes/class_core.php');
set_error_handler('vb_error_handler');

// initialize the data registry
$vbulletin = new vB_Registry();

// parse the configuration ini file
$vbulletin->fetch_config();

// Add AdSense if present
$vbulletin->adsense_pub_id = '';
$vbulletin->adsense_host_id = '';

if (CWD == '.')
{
	// getcwd() failed and so we need to be told the full forum path in config.php
	if (!empty($vbulletin->config['Misc']['forumpath']))
	{
		define('DIR', $vbulletin->config['Misc']['forumpath']);
	}