You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 425 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
More than one PHP-Nuke sites

3.7.1. More than one PHP-Nuke sites

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:

3.7.1.1. Different PHP-Nuke sites from the same database

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.

3.7.1.2. Different PHP-Nuke sites with the same user base

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 the same database as descibed in Section 3.7.1.1.

  • 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.

Tip 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.

Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.198 Seconds - 189 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::