2001-02-24 00:31:58 +00:00
|
|
|
<?php
|
2001-04-20 07:30:45 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* common.php
|
|
|
|
* -------------------
|
|
|
|
* begin : Saturday, Feb 23, 2001
|
|
|
|
* copyright : (C) 2001 The phpBB Group
|
|
|
|
* email : support@phpbb.com
|
|
|
|
*
|
2001-02-24 00:31:58 +00:00
|
|
|
* $Id$
|
2001-04-20 07:30:45 +00:00
|
|
|
*
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
2001-02-24 00:31:58 +00:00
|
|
|
|
|
|
|
|
2001-04-20 07:30:45 +00:00
|
|
|
/***************************************************************************
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
2001-02-24 00:31:58 +00:00
|
|
|
|
2001-04-19 13:30:47 +00:00
|
|
|
//
|
2001-05-03 22:10:23 +00:00
|
|
|
// Define some basic configuration arrays
|
2001-05-27 16:40:25 +00:00
|
|
|
// this also prevents malicious rewriting
|
|
|
|
// of language array values via URI params
|
2001-04-19 13:30:47 +00:00
|
|
|
//
|
2001-05-03 22:10:23 +00:00
|
|
|
$board_config = Array();
|
|
|
|
$userdata = Array();
|
|
|
|
$theme = Array();
|
|
|
|
$images = Array();
|
2001-05-27 16:40:25 +00:00
|
|
|
$lang = Array();
|
2001-04-19 13:30:47 +00:00
|
|
|
|
2001-05-03 22:10:23 +00:00
|
|
|
include('config.'.$phpEx);
|
|
|
|
include('includes/constants.'.$phpEx);
|
2001-04-19 13:30:47 +00:00
|
|
|
|
2001-05-03 22:10:23 +00:00
|
|
|
$url_images = "images";
|
2001-07-06 00:03:51 +00:00
|
|
|
$images['quote'] = "$url_images/icon_quote.gif";
|
|
|
|
$images['edit'] = "$url_images/icon_edit.gif";
|
2001-07-05 19:38:39 +00:00
|
|
|
$images['search_icon'] = "$url_images/search_icon.gif";
|
2001-07-06 00:03:51 +00:00
|
|
|
$images['profile'] = "$url_images/icon_profile.gif";
|
|
|
|
$images['privmsg'] = "$url_images/icon_pm.gif";
|
2001-05-03 22:10:23 +00:00
|
|
|
$images['email'] = "$url_images/email.gif";
|
|
|
|
$images['delpost'] = "$url_images/edit.gif";
|
2001-07-06 00:42:44 +00:00
|
|
|
$images['ip'] = "$url_images/icon_ip.gif";
|
|
|
|
$images['www'] = "$url_images/icon_www.gif";
|
2001-05-03 22:10:23 +00:00
|
|
|
$images['icq'] = "$url_images/icq_add.gif";
|
|
|
|
$images['aim'] = "$url_images/aim.gif";
|
|
|
|
$images['yim'] = "$url_images/yim.gif";
|
|
|
|
$images['msnm'] = "$url_images/msnm.gif";
|
|
|
|
$images['posticon'] = "$url_images/posticon.gif";
|
|
|
|
$images['folder'] = "$url_images/folder.gif";
|
2001-06-05 13:34:23 +00:00
|
|
|
$images['new_folder'] = "$url_images/red_folder.gif";
|
2001-05-03 22:10:23 +00:00
|
|
|
$images['latest_reply'] = "$url_images/latest_reply.gif";
|
2001-04-24 22:32:57 +00:00
|
|
|
|
2001-03-09 23:33:06 +00:00
|
|
|
include('includes/template.inc');
|
2001-02-24 00:31:58 +00:00
|
|
|
|
2001-04-19 13:30:47 +00:00
|
|
|
include('includes/error.'.$phpEx);
|
2001-07-03 00:32:27 +00:00
|
|
|
include('includes/message.'.$phpEx);
|
2001-04-19 13:30:47 +00:00
|
|
|
include('includes/sessions.'.$phpEx);
|
|
|
|
include('includes/auth.'.$phpEx);
|
|
|
|
include('includes/functions.'.$phpEx);
|
2001-03-09 23:33:06 +00:00
|
|
|
include('includes/db.'.$phpEx);
|
2001-02-24 00:31:58 +00:00
|
|
|
|
2001-07-03 22:50:56 +00:00
|
|
|
|
2001-05-27 16:40:25 +00:00
|
|
|
// Obtain and encode users IP
|
|
|
|
//$get_user_ip = ;
|
|
|
|
$user_ip = encode_ip(($HTTP_X_FORWARDED_FOR) ? $HTTP_X_FORWARDED_FOR : $REMOTE_ADDR);
|
|
|
|
|
2001-05-03 22:10:23 +00:00
|
|
|
//
|
2001-02-24 00:31:58 +00:00
|
|
|
// Setup forum wide options.
|
2001-02-24 10:01:48 +00:00
|
|
|
// This is also the first DB query/connect
|
2001-05-03 22:10:23 +00:00
|
|
|
//
|
2001-03-21 23:25:03 +00:00
|
|
|
$sql = "SELECT *
|
2001-07-03 00:32:27 +00:00
|
|
|
FROM " . CONFIG_TABLE;
|
2001-02-24 00:31:58 +00:00
|
|
|
if(!$result = $db->sql_query($sql))
|
|
|
|
{
|
2001-05-03 22:10:23 +00:00
|
|
|
//
|
|
|
|
// Define some basic configuration
|
|
|
|
// vars, necessary since we haven't
|
|
|
|
// been able to get them from the DB
|
|
|
|
//
|
|
|
|
$board_config['default_template'] = "Default";
|
|
|
|
$board_config['default_timezone'] = 0;
|
|
|
|
$board_config['default_dateformat'] = "d M Y H:i";
|
|
|
|
$board_config['default_theme'] = 1;
|
|
|
|
$board_config['default_lang'] = "english";
|
2001-06-30 21:04:37 +00:00
|
|
|
$board_config['gzip_compress'] = 0;
|
2001-05-03 22:10:23 +00:00
|
|
|
|
2001-07-03 22:50:56 +00:00
|
|
|
message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
|
2001-02-24 00:31:58 +00:00
|
|
|
}
|
2001-04-20 07:30:45 +00:00
|
|
|
else
|
2001-02-24 00:31:58 +00:00
|
|
|
{
|
2001-07-03 00:32:27 +00:00
|
|
|
/*
|
|
|
|
while($row = $db->sql_fetchrow($result))
|
|
|
|
{
|
|
|
|
$board_config[$row['config_var_name']] = stripslashes($row['config_var_value']);
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
2001-03-21 23:25:03 +00:00
|
|
|
$config = $db->sql_fetchrow($result);
|
2001-06-30 21:04:37 +00:00
|
|
|
|
2001-07-03 00:32:27 +00:00
|
|
|
$board_config['board_disable'] = $config['board_disable'];
|
2001-05-03 22:10:23 +00:00
|
|
|
$board_config['sitename'] = stripslashes($config['sitename']);
|
|
|
|
$board_config['allow_html'] = $config['allow_html'];
|
|
|
|
$board_config['allow_bbcode'] = $config['allow_bbcode'];
|
2001-05-27 16:40:25 +00:00
|
|
|
$board_config['allow_smilies'] = $config['allow_smilies'];
|
2001-05-03 22:10:23 +00:00
|
|
|
$board_config['allow_sig'] = $config['allow_sig'];
|
|
|
|
$board_config['allow_namechange'] = $config['allow_namechange'];
|
2001-06-12 23:46:24 +00:00
|
|
|
$board_config['allow_avatar_local'] = $config['allow_avatar_local'];
|
2001-07-03 00:32:27 +00:00
|
|
|
$board_config['allow_avatar_remote'] = $config['allow_avatar_local'];
|
2001-05-27 16:40:25 +00:00
|
|
|
$board_config['allow_avatar_upload'] = $config['allow_avatar_upload'];
|
2001-05-03 22:10:23 +00:00
|
|
|
$board_config['require_activation'] = $config['require_activation'];
|
|
|
|
$board_config['override_user_themes'] = $config['override_themes'];
|
|
|
|
$board_config['posts_per_page'] = $config['posts_per_page'];
|
|
|
|
$board_config['topics_per_page'] = $config['topics_per_page'];
|
|
|
|
$board_config['default_theme'] = $config['default_theme'];
|
|
|
|
$board_config['default_dateformat'] = stripslashes($config['default_dateformat']);
|
|
|
|
$board_config['default_template'] = stripslashes($config['sys_template']);
|
|
|
|
$board_config['default_timezone'] = $config['system_timezone'];
|
|
|
|
$board_config['default_lang'] = stripslashes($config['default_lang']);
|
|
|
|
$board_config['board_email'] = stripslashes(str_replace("<br />", "\n", $config['email_sig']));
|
|
|
|
$board_config['board_email_from'] = stripslashes($config['email_from']);
|
2001-05-27 03:11:27 +00:00
|
|
|
$board_config['flood_interval'] = $config['flood_interval'];
|
2001-05-27 16:40:25 +00:00
|
|
|
$board_config['avatar_filesize'] = $config['avatar_filesize'];
|
2001-06-12 23:46:24 +00:00
|
|
|
$board_config['avatar_max_width'] = $config['avatar_max_width'];
|
|
|
|
$board_config['avatar_max_height'] = $config['avatar_max_height'];
|
2001-05-27 16:40:25 +00:00
|
|
|
$board_config['avatar_path'] = $config['avatar_path'];
|
2001-06-19 17:38:00 +00:00
|
|
|
$board_config['prune_enable'] = $config['prune_enable'];
|
2001-06-30 21:04:37 +00:00
|
|
|
$board_config['gzip_compress'] = $config['gzip_compress'];
|
2001-07-04 19:36:32 +00:00
|
|
|
$board_config['smtp_delivery'] = $config['smtp_delivery'];
|
|
|
|
$board_config['smtp_host'] = $config['smtp_host'];
|
2001-07-03 00:32:27 +00:00
|
|
|
|
2001-02-24 00:31:58 +00:00
|
|
|
}
|
2001-06-30 21:04:37 +00:00
|
|
|
|
2001-07-03 00:32:27 +00:00
|
|
|
include('language/lang_' . $board_config['default_lang'] . '.'.$phpEx);
|
|
|
|
|
|
|
|
if($board_config['board_disable'])
|
|
|
|
{
|
|
|
|
message_die(GENERAL_MESSAGE, $lang['Board_disable'], $lang['Information']);
|
|
|
|
}
|
2001-06-30 21:04:37 +00:00
|
|
|
|
2001-07-03 00:32:27 +00:00
|
|
|
?>
|