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
|
|
|
|
|
|
|
include('config.'.$phpEx);
|
2001-03-09 23:33:06 +00:00
|
|
|
include('includes/constants.'.$phpEx);
|
2001-02-24 00:31:58 +00:00
|
|
|
|
2001-04-19 13:30:47 +00:00
|
|
|
//
|
|
|
|
// Default variable values - most if not all
|
2001-04-20 07:30:45 +00:00
|
|
|
// of these have equivalents in a DB table but
|
2001-04-19 13:30:47 +00:00
|
|
|
// for situations where the DB cannot be read or where
|
|
|
|
// data is missing this data is used instead
|
|
|
|
//
|
|
|
|
//$date_format = "m-d-Y H:i:s"; // American datesformat
|
2001-04-20 07:30:45 +00:00
|
|
|
$date_format = "D, M d Y h:i:s a"; // European datesformat
|
2001-04-19 13:30:47 +00:00
|
|
|
|
|
|
|
$url_images = "images";
|
|
|
|
$image_quote = "$url_images/quote.gif";
|
|
|
|
|
|
|
|
$image_edit = "$url_images/edit.gif";
|
|
|
|
$image_profile = "$url_images/profile.gif";
|
|
|
|
$image_email = "$url_images/email.gif";
|
|
|
|
$image_pmsg = "$url_images/pm.gif";
|
|
|
|
$image_delpost = "$url_images/edit.gif";
|
|
|
|
|
|
|
|
$image_ip = "$url_images/ip_logged.gif";
|
|
|
|
|
|
|
|
$image_www = "$url_images/www_icon.gif";
|
|
|
|
$image_icq = "$url_images/icq_add.gif";
|
|
|
|
$image_aim = "$url_images/aim.gif";
|
|
|
|
$image_yim = "$url_images/yim.gif";
|
|
|
|
$image_msnm = "$url_images/msnm.gif";
|
2001-04-24 22:32:57 +00:00
|
|
|
$theme = array();
|
|
|
|
|
2001-02-24 00:31:58 +00:00
|
|
|
// Find Users real IP (if possible)
|
2001-03-09 23:38:13 +00:00
|
|
|
$user_ip = ($HTTP_X_FORWARDED_FOR) ? $HTTP_X_FORWARDED_FOR : $REMOTE_ADDR;
|
2001-02-24 00:31:58 +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);
|
|
|
|
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-03-09 23:33:06 +00:00
|
|
|
// Initalize to keep safe
|
2001-02-24 00:31:58 +00:00
|
|
|
$userdata = Array();
|
|
|
|
|
|
|
|
// Setup forum wide options.
|
2001-02-24 10:01:48 +00:00
|
|
|
// This is also the first DB query/connect
|
2001-03-21 23:25:03 +00:00
|
|
|
$sql = "SELECT *
|
|
|
|
FROM ".CONFIG_TABLE."
|
|
|
|
WHERE selected = 1";
|
2001-02-24 00:31:58 +00:00
|
|
|
if(!$result = $db->sql_query($sql))
|
|
|
|
{
|
2001-04-20 07:30:45 +00:00
|
|
|
// Our template class hasn't been instantiated so we do it here.
|
|
|
|
$template = new Template("templates/Default");
|
2001-04-15 17:32:12 +00:00
|
|
|
error_die(SQL_QUERY, "Could not query config information.", __LINE__, __FILE__);
|
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-03-21 23:25:03 +00:00
|
|
|
$config = $db->sql_fetchrow($result);
|
|
|
|
$sitename = stripslashes($config["sitename"]);
|
|
|
|
$allow_html = $config["allow_html"];
|
|
|
|
$allow_bbcode = $config["allow_bbcode"];
|
|
|
|
$allow_sig = $config["allow_sig"];
|
|
|
|
$allow_namechange = $config["allow_namechange"];
|
|
|
|
$posts_per_page = $config["posts_per_page"];
|
|
|
|
$hot_threshold = $config["hot_threshold"];
|
|
|
|
$topics_per_page = $config["topics_per_page"];
|
|
|
|
$override_user_themes = $config["override_themes"];
|
|
|
|
$email_sig = stripslashes($config["email_sig"]);
|
|
|
|
$email_from = $config["email_from"];
|
|
|
|
$default_lang = $config["default_lang"];
|
2001-04-29 20:16:08 +00:00
|
|
|
$default_theme = $config['default_theme'];
|
2001-05-02 22:33:29 +00:00
|
|
|
$default_dateformat = $config['default_dateformat'];
|
2001-03-21 23:25:03 +00:00
|
|
|
$require_activation = $config["require_activation"];
|
|
|
|
$sys_timezone = $config["system_timezone"];
|
2001-04-20 07:30:45 +00:00
|
|
|
$sys_template = $config['sys_template'];
|
|
|
|
$sys_lang = $default_lang;
|
2001-02-24 00:31:58 +00:00
|
|
|
}
|
2001-03-09 23:33:06 +00:00
|
|
|
|
2001-03-02 05:46:32 +00:00
|
|
|
include('language/lang_'.$default_lang.'.'.$phpEx);
|
2001-03-09 23:33:06 +00:00
|
|
|
|
2001-02-24 00:31:58 +00:00
|
|
|
?>
|