The variables in the config.php file allow for quite some flexibility when it comes to installing more than one PHP-Nuke sites that have to be related in one or
the other way:
If you have two (or more) PHP-Nuke sites, located in different Web URLs (or different local directories), that you want to operate from the same database, you have
some handwork to do, but it is not difficult. From the point of view of the database server, what differentiates one PHP-Nuke site from another, is the name of the
table(s) used. In PHP-Nuke, all tables come with a prefix: the users table uses the $user_prefix prefix from the config.php file(Section 3.7), while all other
tables use $prefix.
Thus, you don't need a second database to operate a second PHP-Nuke site. A different database helps keep the installations separate by providing a kind of
"container" to put each installation's tables in, but apart from this, there is nothing special to it. To use only one database for two PHP-Nuke installations,
proceed as follows:
Use separate $prefix and $user_prefix values in each site's config.php, e.g.
$prefix = "nuke1";
$user_prefix = "nuke1";
in config.php for site 1 and
$prefix = "nuke2";
$user_prefix = "nuke2";
in config.php for site 2. All other values should stay identical in the config.php files of both sites.
Edit the nuke.sql file (located under the sql directory of the PHP-Nuke package) for each site. Change every occurence of "nuke_" to "nuke1_" for site 1 and to
"nuke2_" for site 2, then proceed with the installation as described in Section 3.2.4. If you use nukesql.php (Section
3.5) for the installation, see the tip at the end of this section.
There are situations that you might want to share users among your PHP-Nuke sites. For example, if you have a site about cars and another one about car insurance,
your users will probably be interested in both. But requiring them to enter two different logins and passwords is not going to make them happy - that's where $user_prefix comes into play.
The idea behind a separate prefix for the users table in PHP-Nuke is to enable you to keep all other tables separate, but use the same users table across different
PHP-Nuke installations. By using a different $prefix for each site, but the same $user_prefix for both, your users will require only one login and password - and will
be recognized by the second site, while logged in in the first one and vice versa.
To use the same user base in two separate PHP-Nuke sites, proceed as follows:
Use separate $prefix values, but the same $user_prefix for both config.php files, e.g.
$prefix = "nuke1";
$user_prefix = "nuke-common";
in config.php for site 1 and
$prefix = "nuke2";
$user_prefix = "nuke-common";
in config.php for site 2. All other values should stay identical in the config.php files of both sites.
Edit the nuke.sql file (located under the sql directory of the PHP-Nuke package) for each site. Change every occurence of "nuke_" to "nuke1_" for site 1 and to
"nuke2_" for site 2, except the ones for the nuke_users table, which you should change to "nuke-common". The full name of the users table should thus be "nuke-common_users" in both nuke.sql
files. Then proceed with the installation as described in Section 3.2.4.
Using nukesql.php
If you use nukesql.php (Section 3.5) for the installation, you should change the prefixes as above and point your browser to each instance of
nukesql.php (one for each installation, located in the respective PHP-Nuke root directory). It will then create the tables with the right prefixes for you.