1 (edited by druvans 2005-08-29 20:06)

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

Re: How do I

You want to use the same user table, but have nothing else the same?

Re: How do I

Smartys wrote:

You want to use the same user table, but have nothing else the same?

yes

4 (edited by Smartys 2005-09-01 12:37)

Re: How do I

Well, that's a bit difficult to do tongue
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 tongue
The alternative is to rewrite all calls to '.$db->prefix.'users to a hardcoded prefix in one of the boards

Re: How do I

Smartys wrote:

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

Re: How do I

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 tongue
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

Re: How do I

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

Go Canada! - No matter what, except when Stephen Harper is Prime Minster!
NHL is back, GO TORONTO MAPLE LEAFS! even if they lose...
[Firefox Rules!] - [Amazing Race] - [My Site!]

Re: How do I

Smartys wrote:

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 tongue
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 ... big_smile

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

9 (edited by druvans 2005-10-20 00:24)

Re: How do I

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