Topic: How do I
How do I do this ?
I want to add 1 more forum to my site, I want use same the database[atleast the authentication], But I want the title and themes to be different.
The topics should be mutaly exclusive
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 discussion → How do I
How do I do this ?
I want to add 1 more forum to my site, I want use same the database[atleast the authentication], But I want the title and themes to be different.
The topics should be mutaly exclusive
You want to use the same user table, but have nothing else the same?
You want to use the same user table, but have nothing else the same?
yes
Well, that's a bit difficult to do
I would insert the same data in both databases on registration. And when you log in, log them into both. And in profile.php, all profile updates would have to be rewritten to update both
The alternative is to rewrite all calls to '.$db->prefix.'users to a hardcoded prefix in one of the boards
The alternative is to rewrite all calls to '.$db->prefix.'users to a hardcoded prefix in one of the boards
Would an alternative be that during installation, the install script asked for 2 prefixes, one for the user tables and one for the forum tables. Then, all references in the code to the user prefix can be changed to reflect the new user prefix, therefore supporting the requirement for multiple forums with a single shared user table in a single database. I have not scanned the punbb code to determine the feasibility of this, so I may be 'off target'.
Cheers, Ian
Except that's not the kind of thing 99% of people would want or need at any point, so it wouldn't get implemented like that
But what you're suggesting is basically what I suggested, except you're having another variable be the prefix rather then hardcoding it into the files, which is fine as well
set three different group, one group see all, other see one part, and the other see another part, the only problem is that i am aware of is that u can have differnt defaul skin for each skin, [i am not sure] but if they do, ur in luck
Except that's not the kind of thing 99% of people would want or need at any point, so it wouldn't get implemented like that
But what you're suggesting is basically what I suggested, except you're having another variable be the prefix rather then hardcoding it into the files, which is fine as well
Many thanks for the reply ...
I have done some more digging (and this thread http://punbb.org/forums/viewtopic.php?id=8755 - thanks to Connorhd) and the following seems to work.
To test it, I installed 2 forums, one in the /master directory with master_ as the prefix, the other in the /slave directory with the slave_ prefix. Both were installed in the same MySql database.
On line 76 of /includes/dblayer/mysql.php file of the /slave forum, I added the 2 following lines to point the slave user and group sql queries to the master user and group tables.
$sql = ereg_replace($this->prefix ."users", "master_users", $sql);
$sql = ereg_replace($this->prefix ."groups", "master_groups", $sql);
There are the obvious cookie problems to overcome, but keeping the cookie_name, domain and seed the same across the master and slave forums seemed to do the trick.
The avatar directory would also need to be shared, perhaps a directory outside of both forums.
I will need to check through all the other tables to determine what else needs to be shared, but this seems a pretty good start.
Cheers, Ian
Ok, guys I accomplished it with a little brute force programming
I added a new parameter to config.php $db_user_prefix="xyz";
And did a search and replace like this
'.$user_db_prefix.'users
'.$db->prefix.'users
manualy edited viewtopic.php
and it works ! [Atleast as of I know, it works]
thanks for all the comments
After reading the post backwards, I realized that, what I did is exactly what Smartys suggested. thanks
PunBB Forums → PunBB 1.2 discussion → How do I
Powered by PunBB, supported by Informer Technologies, Inc.