common.php.txt

Jak postawić ShoutBox? Proszę o dokładne instrukcje.

Plikom należy skasować rozszerzenie txt bo nie mogę przesłaś na forum elektrody plików z rozszerzeniem php


& lt; ?php
/***************************************************************************
* common.php
* -------------------
* begin : Saturday, Feb 23, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
* modification : (C) 2003 Przemo http://www.przemo.org
* date modification : ver. 1.8 2004/05/30 21:50
*
* $Id: common.php,v 1.8.9 2004/05/30 21:50
***************************************************************************/

/***************************************************************************
* 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.
***************************************************************************/

if ( !defined('IN_PHPBB') )
{
die('Hacking attempt');
}

// This will NOT report uninitialized variables
error_reporting (E_ERROR | E_WARNING | E_PARSE);
// Disable magic_quotes_runtime
set_magic_quotes_runtime(0);

// addslashes to vars if magic_quotes_gpc is off
// this is a security precaution to prevent someone
// trying to break out of a SQL statement.
if ( !get_magic_quotes_gpc() )
{
if ( is_array($HTTP_GET_VARS) )
{
while( list($k, $v) = each($HTTP_GET_VARS) )
{
if ( is_array($HTTP_GET_VARS[$k]) )
{
while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) )
{
$HTTP_GET_VARS[$k][$k2] = addslashes($v2);
}
@reset($HTTP_GET_VARS[$k]);
}
else
{
$HTTP_GET_VARS[$k] = addslashes($v);
}
}
@reset($HTTP_GET_VARS);
}

if ( is_array($HTTP_POST_VARS) )
{
while( list($k, $v) = each($HTTP_POST_VARS) )
{
if ( is_array($HTTP_POST_VARS[$k]) )
{
while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) )
{
$HTTP_POST_VARS[$k][$k2] = addslashes($v2);
}
@reset($HTTP_POST_VARS[$k]);
}
else
{
$HTTP_POST_VARS[$k] = addslashes($v);
}
}
@reset($HTTP_POST_VARS);
}

if ( is_array($HTTP_COOKIE_VARS) )
{
while( list($k, $v) = each($HTTP_COOKIE_VARS) )
{
if ( is_array($HTTP_COOKIE_VARS[$k]) )
{
while( list($k2, $v2) = each($HTTP_COOKIE_VARS[$k]) )
{
$HTTP_COOKIE_VARS[$k][$k2] = addslashes($v2);
}
@reset($HTTP_COOKIE_VARS[$k]);
}
else
{
$HTTP_COOKIE_VARS[$k] = addslashes($v);
}
}
@reset($HTTP_COOKIE_VARS);
}
}

// Define some basic configuration arrays this also prevents
// malicious rewriting of language and otherarray values via
// URI params
$board_config = array();
$shoutbox_config = array();
$portal_config = array();
$userdata = array();
$theme = array();
$images = array();
$lang = array();
$gen_simple_header = FALSE;

include($phpbb_root_path . 'config.'.$phpEx);

if ( !defined( " PHPBB_INSTALLED " ) )
{
header( " Location: install.$phpEx " );
exit;
}

include($phpbb_root_path . 'includes/constants.'.$phpEx);
include($phpbb_root_path . 'includes/template.'.$phpEx);
include($phpbb_root_path . 'includes/sessions.'.$phpEx);
include($phpbb_root_path . 'includes/auth.'.$phpEx);
include($phpbb_root_path . 'includes/functions.'.$phpEx);
include($phpbb_root_path . 'includes/db.'.$phpEx);

// Mozilla navigation bar
// Default items that should be valid on all pages.
// Defined here and not in page_header.php so they can be redefined in the code
$nav_links['top'] = array (
'url' = & gt; append_sid($phpbb_root_dir. " index. " .$phpEx),
'title' = & gt; sprintf($lang['Forum_Index'], $board_config['sitename'])
);
$nav_links['search'] = array (
'url' = & gt; append_sid($phpbb_root_dir. " search. " .$phpEx),
'title' = & gt; $lang['Search']
);
$nav_links['help'] = array (
'url' = & gt; append_sid($phpbb_root_dir. " faq. " .$phpEx),
'title' = & gt; $lang['FAQ']
);
$nav_links['author'] = array (
'url' = & gt; append_sid($phpbb_root_dir. " memberlist. " .$phpEx),
'title' = & gt; $lang['Memberlist']
);

// Obtain and encode users IP
if (getenv(HTTP_CLIENT_IP))
{
$ip = getenv(HTTP_CLIENT_IP);
}
else
{
$ip = getenv(REMOTE_ADDR);
}

$client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( (!empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : $REMOTE_ADDR );
$user_ip = encode_ip($client_ip);

// Setup forum wide options, if this fails
// then we output a CRITICAL_ERROR since
// basic forum information is not available
$sql = " SELECT *
FROM " . CONFIG_TABLE;
if ( !($result = $db- & gt; sql_query($sql)) )
{
message_die(CRITICAL_ERROR, " Could not query config information " , " " , __LINE__, __FILE__, $sql);
}
while ( $row = $db- & gt; sql_fetchrow($result) )
{
$board_config[$row['config_name']] = $row['config_value'];
}

$board_config['topics_per_page'] = ($board_config['topics_per_page'] & lt; 1) ? '25' : $board_config['topics_per_page'];
$board_config['posts_per_page'] = ($board_config['posts_per_page'] & lt; 1) ? '25' : $board_config['posts_per_page'];
$board_config['hot_threshold'] = ($board_config['hot_threshold'] & lt; 1) ? '25' : $board_config['hot_threshold'];
$board_config['session_lenght'] = ($board_config['session_lenght'] & lt; 5) ? '3600' : $board_config['session_lenght'];

$sql = " SELECT config_value
FROM " . SHOUTBOX_CONFIG_TABLE . "
WHERE config_name = 'shoutbox_on' " ;
if ( !($result = $db- & gt; sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not query shoutbox config information', '', __LINE__, __FILE__, $sql);
}
$row = $db- & gt; sql_fetchrow($result);

if ( $row['config_value'] == 1)
{
$sql = " SELECT *
FROM " . SHOUTBOX_CONFIG_TABLE;
if ( !($result = $db- & gt; sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not query shoutbox config information', '', __LINE__, __FILE__, $sql);
}

while ( $row = $db- & gt; sql_fetchrow($result) )
{
$shoutbox_config[$row['config_name']] = $row['config_value'];
}
}

$sql = " SELECT config_value
FROM " . PORTAL_CONFIG_TABLE . "
WHERE config_name = 'portal_on' " ;
if ( !($result = $db- & gt; sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not query portal config information', '', __LINE__, __FILE__, $sql);
}
$row = $db- & gt; sql_fetchrow($result);

if ( $row['config_value'] == 1)
{
$sql = " SELECT *
FROM " . PORTAL_CONFIG_TABLE;
if ( !($result = $db- & gt; sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not query portal config information', '', __LINE__, __FILE__, $sql);
}

while ( $row = $db- & gt; sql_fetchrow($result) )
{
$portal_config[$row['config_name']] = $row['config_value'];
}
}

if ( $template )
{
$board_config['default_style'] = $template;
setcookie('default_style',$template , (time() + 21600), $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
}
else if (isset($HTTP_COOKIE_VARS['default_style']) )
{
$board_config['default_style'] = $HTTP_COOKIE_VARS['default_style'];
}

$sql = " SELECT config_value
FROM " . ATTACH_CONFIG_TABLE . "
WHERE config_name = 'disable_mod' " ;
if ( !($result = $db- & gt; sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not query attachments config information', '', __LINE__, __FILE__, $sql);
}
$row = $db- & gt; sql_fetchrow($result);

if (!$row['config_value'] || defined('IN_ADMIN'))
{
define('ATTACHMENTS_ON', true);
include($phpbb_root_path . 'attach_mod/attachment_mod.'.$phpEx);
}

// Show 'Board is disabled' message if needed.
if ( trim($board_config['board_disable']) & & !defined('IN_ADMIN') & & !defined('IN_LOGIN') )
{
$reason = $board_config['board_disable'];
$reason = str_replace( " \n " , " & lt; br / & gt; " , $reason);

message_die(GENERAL_MESSAGE, $reason, 'Information');
}

? & gt;


Download file - link to post