= 5.1.0RC1
'hash_hmac', //(hash) - enabled by default as of PHP 5.1.2
) as $func)
{
if (!function_exists($func))
{
include_once(PHPWG_ROOT_PATH . 'include/php_compat/'.$func.'.php');
}
}
include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
@include(PHPWG_ROOT_PATH. 'include/config_local.inc.php');
include(PHPWG_ROOT_PATH . 'include/constants.php');
include(PHPWG_ROOT_PATH . 'include/functions.inc.php');
include(PHPWG_ROOT_PATH . 'include/template.php');
// Database connection
mysql_connect( $cfgHote, $cfgUser, $cfgPassword )
or die ( "Could not connect to database server" );
mysql_select_db( $cfgBase )
or die ( "Could not connect to database" );
//
// Setup gallery wide options, if this fails then we output a CRITICAL_ERROR
// since basic gallery information is not available
//
load_conf_from_db();
load_plugins();
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'));
}
trigger_action('loading_lang');
@include_once(get_language_filepath('local.lang.php'));
// 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'];
}
// template instance
if
(
defined('IN_ADMIN') and IN_ADMIN and
isset($user['admin_template']) and
isset($user['admin_theme'])
)
{
// Admin template
$template = new Template(PHPWG_ROOT_PATH.'template/'.$user['admin_template'], $user['admin_theme'] );
}
else
{
// Classic template
$template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template'], $user['theme'] );
}
if ($conf['gallery_locked'])
{
$header_msgs[] = $lang['gallery_locked_message'];
if ( script_basename() != 'identification' and !is_admin() )
{
echo $lang['gallery_locked_message']
.'.';
exit();
}
}
if ($conf['check_upgrade_feed']
and defined('PHPWG_IN_UPGRADE')
and PHPWG_IN_UPGRADE)
{
// retrieve already applied upgrades
$query = '
SELECT id
FROM '.UPGRADE_TABLE.'
;';
$applied = array_from_query($query, 'id');
// retrieve existing upgrades
$existing = get_available_upgrade_ids();
// which upgrades need to be applied?
if (count(array_diff($existing, $applied)) > 0)
{
$header_msgs[] = 'Some database upgrades are missing, '
.'upgrade now';
}
}
if (is_adviser())
{
$header_msgs[] = $lang['adviser_mode_enabled'];
}
if (count($header_msgs) > 0)
{
$template->assign_block_vars('header_msgs',array());
foreach ($header_msgs as $header_msg)
{
$template->assign_block_vars('header_msgs.header_msg',
array('HEADER_MSG'=>$header_msg));
}
}
if (!empty($conf['filter_pages']) and get_filter_page_value('used'))
{
include(PHPWG_ROOT_PATH.'include/functions_filter.inc.php');
include(PHPWG_ROOT_PATH.'include/filter.inc.php');
}
else
{
// global variable for filter
$filter = array();
$filter['enabled'] = false;
}
if (isset($conf['header_notes']))
{
$header_notes = array_merge($header_notes, $conf['header_notes']);
}
// default event handlers
add_event_handler('render_comment_content', 'htmlspecialchars');
add_event_handler('render_comment_content', 'parse_comment_content');
add_event_handler('render_comment_author', 'strip_tags');
trigger_action('init');
?>