Hello!
I m currently trying to create a kind of hack for the phpBB forums, and this would let me, using only one install of php files + one sqk db but with 2 differents installs in the sql db with 2 diff tables prefix.
I explain a lil more...
(ftp view)
root/
------>forums
----------->bob's forums
----------->john's forums
I want to have only one time the .php and img files installed in the root/forums folder then have an index.php in each bob's forums and john's forums looking like this :
index.php of bob's forums dir
$phpbb_root_path = '?????';
$bb = 'bob'
And a kind of config.php in the root/forums like this
if ( !$bb )
{
die();
}
else if ( $bb == bob )
{
$table_prefix = 'bobsbb_';
}
else if ( $bb == john )
{
$table_prefix = 'johnsbb_';
}
else
{
die();
}
This was my first idea.
After some work, here is what I done.
ftp view :
www/
---------> forums/
---------------->1/ ( forum 1 )
---------------->2/ ( forum 2 )
And I did put all the files of phpbb in the forums/ dir.
I modified the config.php looking now like this:
<?php
// phpBB 2.x auto-generated config file
// Do not change anything in this file!
$dbms = 'mysql4';
$dbhost = 'localhost';
$dbname = 'phpbb';
$dbuser = 'root';
$dbpasswd = '';
if ( $HTTP_COOKIE_VARS[bbnumberz] == 1 )
{
$table_prefix = 'phpbb1_';
}
else if ( $HTTP_COOKIE_VARS[bbnumberz] == 2 )
{
$table_prefix = 'phpbb2_';
}
else
{
echo "I am sorry but you actually need to choose a forum:<br><a href=\"1/index.php\">forum 1</a><br><a href=\"2/index.php\">forum 2</a><br>You MUST have cookies enabled for use these forums.";
die();
}
define('PHPBB_INSTALLED', true);
?>
And in the each repertory 1/ and 2/ I did put index files like this
<?php
if (empty($HTTP_COOKIE_VARS[bbnumberz]))
{
setcookie (bbnumberz, 1, time()+ 999600, "/", localhost);
}
else
{
setcookie (bbnumberz, 0, time()- 3600, "/", localhost);
setcookie (bbnumberz, 1, time()+ 999600, "/", localhost);
}
header ("location: [url]http://localhost/forums/index.php[/url]");
?>
But this dont works.... I guess its some domain cookie error? help thanks.