Проблем с интеграция на PHPBB3 и сайт

shashma88

Registered
Интегрирах си сайта с пхпбб3. Изкарва ми тази грешка -
Код:
 The config. file could not be found.

Click here to install phpBB

А пхпбб ми е инсталирано :shock: Ето конфиг файла на сайта:
Код:
<?php 
ob_start();
define('IN_PHPBB', true); /* задавам че форума е пуснат */

include('./forum/common.php'); /* това може да се нарече главният файл на phpbb3 , без него нищо не може да стане */
$phpbb_root_path = './forum/'; /* задаваме нов път до форума , защото все пак се намираме в едно ниво над форума */

$user->session_begin(); /*Създаваме сесия на потрителя*/
$auth->acl($user->data); /* ауторизираме потерителя */
$user = $user->data; /* Това съм го направил аз , с цел да не изписвам доста по-дълги променливи. */
$uid = $user['user_id']; /* Ако потребителя работи с mysql извън форума , както при мене , потрртеля добавя филми , коментари за тях , и серий */
$ureg = $user['is_registered']; /* 1 = true , NULL = false */ /* дали е регистриран или не е */

$user = "root";
$pass = "8888"; 
$db = "888";
$host = "localhost";
$connection = mysql_connect("$host", "$user", "$pass") or die("Сайтът не може да се свърже към базата данни1");
$db = mysql_select_db("$db",$connection)or die("Сайтът не може да се свърже към базата данни2"); 
$chars="set character set cp1251";
mysql_query($chars);
?>

Ето и common.php
Код:
<?php
/**
*
* @package phpBB3
* @version $Id: common.php 8760 2008-08-15 19:46:51Z aptx $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
* Minimum Requirement: PHP 4.3.3
*/

/**
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

$starttime = explode(' ', microtime());
$starttime = $starttime[1] + $starttime[0];

// Report all errors, except notices
error_reporting(E_ALL ^ E_NOTICE);

/*
* Remove variables created by register_globals from the global scope
* Thanks to Matt Kavanagh
*/
function deregister_globals()
{
	$not_unset = array(
		'GLOBALS'	=> true,
		'_GET'		=> true,
		'_POST'		=> true,
		'_COOKIE'	=> true,
		'_REQUEST'	=> true,
		'_SERVER'	=> true,
		'_SESSION'	=> true,
		'_ENV'		=> true,
		'_FILES'	=> true,
		'phpEx'		=> true,
		'phpbb_root_path'	=> true
	);

	// Not only will array_merge and array_keys give a warning if
	// a parameter is not an array, array_merge will actually fail.
	// So we check if _SESSION has been initialised.
	if (!isset($_SESSION) || !is_array($_SESSION))
	{
		$_SESSION = array();
	}

	// Merge all into one extremely huge array; unset this later
	$input = array_merge(
		array_keys($_GET),
		array_keys($_POST),
		array_keys($_COOKIE),
		array_keys($_SERVER),
		array_keys($_SESSION),
		array_keys($_ENV),
		array_keys($_FILES)
	);

	foreach ($input as $varname)
	{
		if (isset($not_unset[$varname]))
		{
			// Hacking attempt. No point in continuing unless it's a COOKIE
			if ($varname !== 'GLOBALS' || isset($_GET['GLOBALS']) || isset($_POST['GLOBALS']) || isset($_SERVER['GLOBALS']) || isset($_SESSION['GLOBALS']) || isset($_ENV['GLOBALS']) || isset($_FILES['GLOBALS']))
			{
				exit;
			}
			else
			{
				$cookie = &$_COOKIE;
				while (isset($cookie['GLOBALS']))
				{
					foreach ($cookie['GLOBALS'] as $registered_var => $value)
					{
						if (!isset($not_unset[$registered_var]))
						{
							unset($GLOBALS[$registered_var]);
						}
					}
					$cookie = &$cookie['GLOBALS'];
				}
			}
		}

		unset($GLOBALS[$varname]);
	}

	unset($input);
}

// If we are on PHP >= 6.0.0 we do not need some code
if (version_compare(PHP_VERSION, '6.0.0-dev', '>='))
{
	/**
	* @ignore
	*/
	define('STRIP', false);
}
else
{
	@set_magic_quotes_runtime(0);

	// Be paranoid with passed vars
	if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on' || !function_exists('ini_get'))
	{
		deregister_globals();
	}

	define('STRIP', (get_magic_quotes_gpc()) ? true : false);
}

if (defined('IN_CRON'))
{
	$phpbb_root_path = dirname(__FILE__) . DIRECTORY_SEPARATOR;
}

if (!file_exists($phpbb_root_path . 'config.' . $phpEx))
{
	die("<p>The config.$phpEx file could not be found.</p><p><a href=\"{$phpbb_root_path}install/index.$phpEx\">Click here to install phpBB</a></p>");
}

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

if (!defined('PHPBB_INSTALLED'))
{
	// Redirect the user to the installer
	// We have to generate a full HTTP/1.1 header here since we can't guarantee to have any of the information
	// available as used by the redirect function
	$server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
	$server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT');
	$secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0;

	$script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
	if (!$script_name)
	{
		$script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
	}

	// Replace any number of consecutive backslashes and/or slashes with a single slash
	// (could happen on some proxy setups and/or Windows servers)
	$script_path = trim(dirname($script_name)) . '/install/index.' . $phpEx;
	$script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);

	$url = (($secure) ? 'https://' : 'http://') . $server_name;

	if ($server_port && (($secure && $server_port <> 443) || (!$secure && $server_port <> 80)))
	{
		// HTTP HOST can carry a port number...
		if (strpos($server_name, ':') === false)
		{
			$url .= ':' . $server_port;
		}
	}

	$url .= $script_path;
	header('Location: ' . $url);
	exit;
}

if (defined('DEBUG_EXTRA'))
{
	$base_memory_usage = 0;
	if (function_exists('memory_get_usage'))
	{
		$base_memory_usage = memory_get_usage();
	}
}

// Load Extensions
if (!empty($load_extensions))
{
	$load_extensions = explode(',', $load_extensions);

	foreach ($load_extensions as $extension)
	{
		@dl(trim($extension));
	}
}

// Include files
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
require($phpbb_root_path . 'includes/cache.' . $phpEx);
require($phpbb_root_path . 'includes/template.' . $phpEx);
require($phpbb_root_path . 'includes/session.' . $phpEx);
require($phpbb_root_path . 'includes/auth.' . $phpEx);

require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/functions_content.' . $phpEx);

require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);

// Set PHP error handler to ours
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');

// Instantiate some basic classes
$user		= new user();
$auth		= new auth();
$template	= new template();
$cache		= new cache();
$db			= new $sql_db();

// Connect to DB
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, defined('PHPBB_DB_NEW_LINK') ? PHPBB_DB_NEW_LINK : false);

// We do not need this any longer, unset for safety purposes
unset($dbpasswd);

// Grab global variables, re-cache if necessary
$config = $cache->obtain_config();

// Add own hook handler
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));

foreach ($cache->obtain_hooks() as $hook)
{
	@include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
}

?>
 
трябва да инсталираш форума .. :) там ти пише click here to install или там каквото пишеше ..
 
justspy каза:
трябва да инсталираш форума .. :) там ти пише click here to install или там каквото пишеше ..
phpbb ми е инсталирано, както виждаш не вади .php след configa. а пхпбб-то работи чудесно.. :(
 
justspy каза:
погледни този урок :

http://web-tourist.net/login/login/view.php?st=2168

Е да добре, това казва как да вадя записите от таблиците на пхпбб?! Как ми помага..
 
Извинявай подведох се по заглавие и не прочетох за какво става дума ето :

http://web-tourist.net/login/login/view.php?st=2665
 
justspy каза:
Извинявай подведох се по заглавие и не прочетох за какво става дума ето :

http://web-tourist.net/login/login/view.php?st=2665

Точно по този урок, го интегрирах :?
 
Виж да не бъркаш пътищата към файловете , и по-скоро провери си пак
$phpbb_root_path = './forum/'; /* задаваме нов път до форума , защото все пак се намираме в едно ниво над форума */
 
Оправих го, сега ми се появи друга грешка:
Код:
Fatal error: Cannot redeclare deregister_globals() (previously declared in C:\AppServ\www\pisani\cs\DNP\forum\common.php:32) in C:\AppServ\www\pisani\cs\DNP\forum\common.php on line 29
 
Няма такава... ето индекса:
Код:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Depiction Template by Knightmare @ Clantemplates.com</title>
<script type="text/javascript" > 
 
</script>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>

<div id="wrap">
	<div id="header">
		<div id="innerheader">
			
			<ul>
				<li><a href="index.php">Home</a></li>
				<li><a href="/forum/">Forums</a></li>
				<li><a href="movies.php">Movies</a></li>
				<li><a href="maps.php">Maps</a></li>
				<li><a href="history.php">History</a></li>
				<li><a href="sponsors.php">Roster</a></li>
				<li><a href="join.php">Join Us</a></li>
				<li><a href="servers.php">Servers</a></li>
			</ul>
		</div>
		
	</div>
	
	<div id="content">
		<div class="side_column">
		
			<h1>Match<small>Results</small></h1>
			
			<?php
include ('config.php');
$zaqvka = mysql_query("SELECT * FROM rezultati");
while($row = mysql_fetch_array($zaqvka)){ 
echo "<center><ul><li>eTL-GaminG vs $row[team] - <b>$row[a]:$row[b]</b></li></ul></center></center>";
}
?> 
			
			<h1>Chat<small>Box</small></h1>
		
			<form action="#" method="post">
				<p>
				Chat box kod tuk:
				<input type="text" class="text" name="search" value="Search" /><br />
				<input type="image" src="images/search_button.gif" class="button" />
				</p>
			</form>
			<h1>Last<small>Topics</small></h1>
			
			kod za posledni temi
			
			
		</div>
		
		<div id="middle" >
			<div id="division_select">
<?php 
    include"config.php";
    $mysql = mysql_query("SELECT * FROM clips ORDER BY id DESC LIMIT 0,4");
echo "<table><tr>";
while($r = mysql_fetch_array($mysql))
{
$vid=$r['id'];
$title=$r['ime'];
$pic=$r['pic'];
if($pic != null)
{
echo "<td><a href='view.php?id=$vid' title='$title'><img src='$pic' border='0' alt='$title' width='120' height='90'></a><br />
<font color='red'><a href='view.php?id=$vid'>$title</a></center></td>";
}
else
{ 
echo "<td><center><a href='view.php?id=$vid' title='$title'><img src='no.jpg' border='0' alt='$title'></a><br />
<b><font color='red'><a href='view.php?id=$vid'>$title</a></font></b></td>";}} 
echo "</table>";
?>
			</div>
			
			<h1>Welcome to OurSite</h1>
			
			<div class="content">
				
				<h2>Depiction Template by Knightmare at ClanTemplates.com </h2>
				<p>
					Firstly	thank	you for downloading this wonderful template we hope you enjoy using it. Please ensure the link in the footer remains in place else you will not be allowed to use this template for free. Thats the only requirement we ask for and well for a design its a bargin. We want to keep it that way so please leave it there!</p>
				<p>If you would like to edit the clan name or text in the header we have included a header_image_blank.gif file. You can edit it in your favourite graphics editing program such as  Photoshop/GIMP/Paint Shop Pro. In order to edit the text you will need a WYSIWYG editor such as Adobe/Marcomedia Dreamweaver or Microsoft FrontPage. Most of the tags have been labelled. In order to add more items to the menu simply press the enter buttons whilst you have one of the other menu items selected. You can use the Format menu in Dreamweaver to change text to side headings etc. For the white text you will need to wrap the text in <small>TEXT</small> tags. </p>
				<p>Make sure you upload all the images to a folder called<strong> 'images'</strong> its a common thing many people for get. Also just a small note to warn you that the login and search boxes are placed there merely for visual effects they do <strong>not</strong> actually work.</p>
				<p>Thank you for using our template if you require addition help don't hesitate to visit our forums at http://forums.clantemplates.com/forumdisplay.php?f=9 there you can recieve help from our dedicated support staff. </p>
				<p>Good Luck! </p>
			</div>
			<div class="content">
				<h2>Unde Omnis Iste Natus</h2>
				<p>
					In id justo. Proin nec justo eu nunc pellentesque ultricies. Aliquam orci. Morbi diam est, sagittis id, faucibus ut, elementum ut, velit. Morbi vel neque. Nullam vehicula diam id diam. Nulla facilisi. Quisque vel risus. Mauris sodales orci eget ante. Morbi fermentum luctus dui. Sed odio tortor, fermentum id, blandit id, interdum quis, nisl.
				</p>
				<p>
					Etiam tempus nulla vel urna fermentum pellentesque. Sed adipiscing, justo ut aliquet blandit, elit nulla elementum arcu, sed ullamcorper ipsum mauris sit amet metus. Etiam odio metus, consequat sit amet, faucibus non, luctus ut, velit. Vestibulum at erat et odio pulvinar porttitor. Nam condimentum. In bibendum, mi non bibendum feugiat, neque ligula sollicitudin arcu, dictum dictum mi nunc eget pede.
				</p>
			</div>
			<div class="content">
				<h2>Heading 2 </h2>
				<p>
				Paragraph text</p>
				<p>
					Etiam tempus nulla vel urna fermentum pellentesque. Sed adipiscing, justo ut aliquet blandit, elit nulla elementum arcu, sed ullamcorper ipsum mauris sit amet metus. Etiam odio metus, consequat sit amet, faucibus non, luctus ut, velit. Vestibulum at erat et odio pulvinar porttitor. Nam condimentum. In bibendum, mi non bibendum feugiat, neque ligula sollicitudin arcu, dictum dictum mi nunc eget pede.
				</p>
			</div>
			
		</div>
		<div class="side_column" id="right">
				<?php
				include"config.php";
if(!$_SESSION['username'])
{
echo '			<h1>Member<small>Area</small></h1>
			<form action="login.php" method="post">
				<p>
				<input type="text" class="text" name="name" value="Username" /><br />
				<input type="password" class="text" name="pass" value="Password" /><br />
				<label for="remember"><input type="checkbox"  class="check" id="remember" name="remember" value="1" /> Remember Me</label>
				<input type="submit" img src="images/login_button.gif" name="log" class="button" /></p></form>
	<center>
	<b> <a href="register.php"><font align="center" color="red">REGISTER</font></a> 
	<hr />
	 <a href="fpwsd.php">Forgot Password?</a> </b>
	</center>
	<hr />
	
';
}
else
{
$sesuser = $_SESSION['username'];
$sql = mysql_query("SELECT * FROM users WHERE username='$sesuser'");
while($row = mysql_fetch_array($sql))
{

$ra = $row['rank'];
$av = $row['avatar'];
if($ra == "member") $rank = 'Rang: <br><img src="images/member.png">';
if($ra == "admin") $rank = 'Rang:  <br><img src="images/admin.png">';
if($ra == "admin") $rk = '<img src="images/icons/award_star_gold.png" width="16"><font size="2"><a href="jairus">Admin Panel</a></font><br/>';
if($av == null) $avatar = '<br><a href="uploadav.php"><img src="images/icons/layer_treansparent.png"> Add Avatar</a>';
if($av) $avatar = '<a href="uploadav.php"><img src="'.$av.'" width="100"></a>';
}
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="menubg"></td>
  </tr>
  <tr>
    <td class="border1">
<center>
<b>
'.$rank.'
<br />
'.$avatar.'
</center> 
<br />
</b>

<img src="images/29.png" width="16"><font size="2"> <a href="index.php">Index</a></font><br/>
'.$rk.'
<img src="images/msg.gif" width="16"><font size="2"> <a href="pm.php">Private Messages</a></font><font color="#84aa03" size="2">('.$num.')</font><br/>
<img src="images/editprofile.gif" width="16"><font size="2"> <a href="profile.php">Profile</a></font><br/>
<img src="images/all.png" width="16"><font size="2"> <a href="movies.php">All Movies</a></font><br/>
<img src="images/all-members.png" width="16"><font size="2"> <a href="members.php">Members</a></font><br/>
<img src="images/exit.gif" width="16"><font size="2"> <a href="logout.php">Logout</a></font><br/>
</b>	
</td>
  </tr>
</table>';
}

?>
			<h1>Current<small>Roster</small></h1>
			<div id="roster">
				<a href="#"><img src="images/shit2.jpg" alt="shiT" onmouseover="ctRoster('shiT');" onmouseout="ctRosterClean();" /></img></a>
				<a href="#"><img src="images/roster_image.gif" alt="TerrorKalle" onmouseover="ctRoster('TerrorKalle_1');" onmouseout="ctRosterClean();" /></a>
				<a href="#"><img src="images/roster_image.gif" alt="TerrorKalle" onmouseover="ctRoster('TerrorKalle_2');" onmouseout="ctRosterClean();" /></a>
				
				<a href="#"><img src="images/roster_image.gif" alt="TerrorKalle" onmouseover="ctRoster('TerrorKalle_3');" onmouseout="ctRosterClean();" /></a>
				<a href="#"><img src="images/roster_image.gif" alt="TerrorKalle" onmouseover="ctRoster('TerrorKalle_4');" onmouseout="ctRosterClean();" /></a>
				<a href="#"><img src="images/roster_image.gif" alt="TerrorKalle" onmouseover="ctRoster('TerrorKalle_5');" onmouseout="ctRosterClean();" /></a>
				<div id="roster_data"></div>
				<img src="images/view_button.gif" alt="button" />
			</div>
			<h1>Heading<small>1</small></h1>
			<ul>
				<li>Unordered List </li>
				<li>List item </li>
			</ul>
		</div>
		
	</div>
	
	<div id="footer">
		<p>Copright 2006 © ClanTemplates.com - Designed by Knightmare - Coded by Opserty</p>
	</div>
</div>

</body>
</html>
 
А във кой файл ти дава грешката ?
Идеята е ,че декларираш два пъти една и съща функция :idea:
 
Ами не знам, то си пише че преди е била декларирана на 32 ре от коммон... :cry: Не инклудвам файлове с тази функция други...
 
Махни от индекс-а си повтарящите
include("config.php");
тъй като в него файл пък инклудваш common.php и се повтаря тази грешка :idea:
 

Back
Горе