| Code: |
|
$user_data = $prefix . '_user_data';
$pntable['user_data'] = $user_data; $pntable['user_data_column'] = array ('uda_id' => $user_data . '.pn_uda_id', 'uda_propid' => $user_data . '.pn_uda_propid', 'uda_uid' => $user_data . '.pn_uda_uid', 'uda_value' => $user_data . '.pn_uda_value'); $user_perms = $prefix . '_user_perms'; $pntable['user_perms'] = $user_perms; $pntable['user_perms_column'] = array ('pid' => $user_perms . '.pn_pid', 'uid' => $user_perms . '.pn_uid', 'sequence' => $user_perms . '.pn_sequence', 'realm' => $user_perms . '.pn_realm', 'component' => $user_perms . '.pn_component', 'instance' => $user_perms . '.pn_instance', 'level' => $user_perms . '.pn_level', 'bond' => $user_perms . '.pn_bond'); |
| whazoo wrote: |
| wouldnt a user_table =
option in the config.php be great? |
| Code: |
|
$pnconfig['prefix'] = array(
'default' => 'md_gm.', '_faqanswer' => 'md.', '_group_membership' => 'md.', '_group_perms' => 'md.', '_groups' => 'md.', '_message' => 'md.', '_priv_msgs' => 'md.', '_priv_msgs_outbox' => 'md.', '_stats_date' => 'md.', '_stats_hour' => 'md.', '_stats_month' => 'md.', '_stats_week' => 'md.', '_user_data' => 'md.', '_user_perms' => 'md.', '_user_property' => 'md.', '_users' => 'md.', '_users_delrequest' => 'md.', '_admin_lite_group' => 'md.', '_admin_lite_group_members' => 'md.', '_users_modrequest' => 'md.', ); $pnconfig['encoded'] = '1'; |
| Code: |
| Session initialization failed |
| Code: |
| **Note - This is an example. If you are actually sharing the users tables, then you need to edit all of the associated users tables. It also might be wise to change the _group_membership prefix so users are assigned to the proper group throughout your multisites. |
| Code: |
|
$users = $md . '_users';
$pntable['users'] = md_users; |
| Code: |
| Fatal error: Call to a member function on a non-object in /hsphere/local/home/alesundp/gamer.alesundportalen.net/includes/pnUser.php on line 71 |
| Code: |
|
70 list($uid, $realpass) = $result->fields;
71 $result->Close(); 72 // Confirm that passwords match 73 if (!comparePasswords($pass, $realpass, $uname, substr($realpass, 0, 2))) { 74 return false; |
| Code: |
|
$pnconfig['dbtype'] = 'mysql';
$pnconfig['dbtabletype'] = 'myisam'; $pnconfig['dbhost'] = 'localhost'; $pnconfig['dbuname'] = 'yournick'; $pnconfig['dbpass'] = 'yourpassword'; $pnconfig['dbname'] = 'yourdatabase'; $pnconfig['system'] = '0'; $pnconfig['prefix'] = 'nuke'; $pnconfig['encoded'] = '0'; |
| Code: |
|
$pnconfig['dbtype'] = 'mysql';
$pnconfig['dbtabletype'] = 'myisam'; $pnconfig['dbhost'] = 'localhost'; $pnconfig['dbuname'] = 'yournick'; $pnconfig['dbpass'] = 'yourpassword'; $pnconfig['dbname'] = 'yourdatabase'; $pnconfig['system'] = '0'; $pnconfig['prefix'] = 'nuke'; $pnconfig['encoded'] = '1'; |
| Code: |
|
We have
1 guest and 1 member online You are anonymous user. You can log in or register here. |
| Code: |
|
// Cookie path
ini_set('session.cookie_path', $path); // Cookie domain // only needed for multi-server multisites - adapt as needed $domain = preg_replace('/^[^.]+/','',$host); ini_set('session.cookie_domain', $domain); |
| Code: |
|
$pnconfig['dbtype'] = 'mysql';
$pnconfig['dbhost'] = 'localhost'; $pnconfig['dbuname'] = 'cm9vdA=='; $pnconfig['dbpass'] = 'cGFzc3dvcmQ='; $pnconfig['dbname'] = 'md107'; $pnconfig['system'] = '0'; $pnconfig['prefix'] = 'md'; $pnconfig['encoded'] = '1'; |
| Code: |
|
$pnconfig['dbtype'] = 'mysql';
$pnconfig['dbhost'] = 'localhost'; $pnconfig['dbuname'] = 'root'; $pnconfig['dbpass'] = 'password'; $pnconfig['dbname'] = 'md107'; $pnconfig['system'] = '0'; $pnconfig['prefix'] = 'md'; $pnconfig['encoded'] = '0'; |
| Code: |
|
This is a tutorial on how to make several MDPro sites can use the same user database without using the Multisites module included with MDPro. As some might want to have independent sites sharing the same database here is how you do it.
Tutorial to create MultiSites: Introduction: This is tested with MDPro version 1.0.75. It works with subdomains and domains sharing the same database. Some changes must be done if it`s on different databases, but that`s another story. The test setup was performed on one domain and 4 subdomains. Examples: http://www.yourdomain.com (main domain) http://subdomain.yourdomain.com (subdomain) http://www.yourotherdomain.com (other domain) In this system you will use one database (databases for each portal will be in such database) and as many MDPro installations as you would like(tested with 1 domain and 4 subdomain). 1.Installation: We begin installing MDPro normally on the server and creating a database with it's tables, for this first intallation we use the default prefix, meaning, "md" (it's an important detail, because each extra portal we install will has to have a new prefix). 2.Once we've got our main portal installed and working we access the server's control panel to create as many subdomains as needed. 3.Inside each of those folders we install a different MD-Pro.Use same database settings as main but install the portals with its own table prefix. Example(you can name the other prefixes as you please, this is just examples): Table prefix: md (main) Table prefix: md2 (subdomain) Table prefix: md3 (subdomain) Table prefix: md4 (other domain) 4.Setting up the config/md-config.php file in all of the subdomains and other domains is crucial to make this work. The main domain md-config.php file has to be set up like this: $pnconfig['dbtype'] = 'mysql'; $pnconfig['dbtabletype'] = 'myisam'; $pnconfig['dbhost'] = 'localhost'; $pnconfig['dbuname'] = 'yournick'; $pnconfig['dbpass'] = 'yourpassword'; $pnconfig['dbname'] = 'yourdatabase'; $pnconfig['system'] = '0'; $pnconfig['prefix'] = 'md'; $pnconfig['encoded'] = '0'; The other md-config.php files from the subdomains and other domains will be like this: $pnconfig['dbtype'] = 'mysql'; $pnconfig['dbtabletype'] = 'myisam'; $pnconfig['dbhost'] = 'localhost'; $pnconfig['dbuname'] = 'yournick'; $pnconfig['dbpass'] = 'yourpassword'; $pnconfig['dbname'] = 'your database'; $pnconfig['system'] = '0'; $pnconfig['prefix'] = 'md2'; $pnconfig['encoded'] = '0'; $pnconfig['dbtype'] = 'mysql'; $pnconfig['dbtabletype'] = 'myisam'; $pnconfig['dbhost'] = 'localhost'; $pnconfig['dbuname'] = 'yournick'; $pnconfig['dbpass'] = 'yourpassword'; $pnconfig['dbname'] = 'your database'; $pnconfig['system'] = '0'; $pnconfig['prefix'] = 'md3'; $pnconfig['encoded'] = '0'; and so on until you complete each one of the files inside each MDPro installations you may have. As you can see, we will have only changed the prefix (md2, md3, ..., md2 and md3 are just my examples, name them as you please). Remember that each portal has to have a different prefix. Now, we have the Multisite portals installed and the subdomains working, but as of now they are totally independant. 6.Setting up the pntables.php file In order to have a Multisite operational and working we have to share some tables (you could really share as many tables as you want), like: Users and PM's (Private Messages), because we want that once our users have logged in or registered to one of the portals, they become registered or logged on to all the portals, so they can access their private messages from anywhere in the Multisite. So then, lets see how we have to modify the tables and what tables are recomendable to modify: The pntables.php file (which is in the root folder) from the main portal doesn't need to be modified, but the ones inside the portal folders do. Find the next string in each file: $users = $prefix . '_users'; $pntable['users'] = $users; and change it to: $users = md . '_users'; $pntable['users'] = $users; As you can see, we have substituted prefix for md so the other portals share the same tables as the main portal (which in our example has the prefix md). The same has to be done to each table you want to share, in my case i have shared the next tables: $group_membership $group_perms $groups $user_data $user_perms $user_property $priv_msgs $users $sessions_infos logically in some portals you could be interested in sharing less tables or some other types of tables, but we leave that to your own choice, the one which suits your needs better. We almost have our multisite portal ready, but we still need to do a small but important tweak, because since MDPro works with cookies, we have to configure them in order to get our Multisite working. 7.Setting up the pnSession.php file The pnSession.php file is located inside the includes folder. This file has to be modified in all installations, main and secondary, like this. 1.- Find this(Line 34): $path = pnGetBaseURI(); if (empty($path)) { $path = '/'; } and change it to this: $path = '/'; 2.- You will find this 2 lines like commented out like this(Line 81): // $domain = preg_replace('/^[^.]+/','',$host); // ini_set('session.cookie_domain', $domain); remove the // in order to make them operational. They should look now like this: $domain = preg_replace('/^[^.]+/','',$host); ini_set('session.cookie_domain', $domain); TIP: In order to make it definetively operational, most of all if the main portal was already active and it had its own cookies, session info, etc. you will have to empty the prefix_sessions_infos tables and eliminate the cookies. From now on you have a new Multisite ready and completely operational. Enjoy. ---------------------------------------------------------------------------------------------------------------------- Installing MDForum 2.0.1 shared with the multisites we just installed. If you don`t want to install MDForum, ignore these steps. Installing MDForum while sharing the database with multisites (this is not for the multisite module) 1.First we need to upload the complete module to all our sites to /modules. This will haveto be done to both main domain and all subdomains an other domains. 2.Then go to your main domains Administration >Settings >Modules. Press "Regenerate" and your list of modules will appear. Find MDForum module currently "Uninitialized". Press initialize, then activate when the page reloads. The MDForum is now activ and you can find it here(change to your actual domain): http://yourdomain.com/modules.php?op=modload&name=MDForum&file=index 3.Now we need to change and delete some files to integrate this module for the other sites. As the MDForum has been installed and the proper tables inserted to our database, we do not want another set of tables. First the delete(this will be done to all subdomains and other domains. NOT the main domain!): In all subdomains/other domains, delete the entire MDForum install folder and all its files. /modules/MDForum/install/. Also delete pninit.php found in /modules/MDForum/. 4.Then the file change((this will be done to all subdomains and other domains. NOT the main domain!): Find the file common.php in /modules/MDForum/ and do the following change: Find on line 191 // Begin MDForum Multi-Site Support $table_prefix = pnConfigGetVar('prefix') . '_phpbb_'; // End MDForum Multi-Site Support Change to: // Begin MDForum Multi-Site Support $table_prefix = md. '_phpbb_'; // End MDForum Multi-Site Support As you can see we now have changed what prefix the MDForum should query from. As the tables have been installed on our main prefix, we set that as the prefix for the forum. Do this to all subdomains and other domains. After these changes we can enter the Administration >Settings >Modules to initialize and aktivate MDForum for all our subdomains and other domains. Now we should have a multisite sharing user database and a shared forum. Tip. You might want to empty the _phpbb_session_info table in your database before using. Enjoy. |
| Code: |
|
ini_set('session.cookie_domain','workwanted.ca'); |
| Code: |
|
<?php // ---------------------------------------------------------------------- // eNvolution Content Management System // Copyright (C) 2002 by the eNvolution Development Team. // http://www.envolution.com/ // ---------------------------------------------------------------------- // Based on: // Postnuke Content Management System - www.postnuke.com // PHP-NUKE Web Portal System - http://phpnuke.org/ // Thatware - http://thatware.org/ // ---------------------------------------------------------------------- // LICENSE // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License (GPL) // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // To read the license please visit http://www.gnu.org/copyleft/gpl.html // //************************************************************************ //* Envolution: Web Portal System * //* =========================== * //* * //* MySQL_Tools * //* * //* Copyright (c) 2002 by: * //* * //* Michaelius (michaelius@nukeland.de) * //* http://www.nukeland.de * //* in memory of my friend Michaelius * //* hacked by TiMax timax@envolution.com - * modules_get_language(); modules_get_manual(); function mysql_tools_admin_main() { if (!(pnSecAuthAction(0, 'MySQL_Tools::', '::', ACCESS_ADMIN))) { include 'header.php'; OpenTable(); echo _BADAUTHKEY; CloseTable(); include 'footer.php'; } else { include 'header.php'; OpenTable(); GraphicAdmin(); echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr align=\"center\"><form action=\"admin.php?module=NS-MySQL_Tools&type=admin&op=updatedb\" |