News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Multiple Boards (again)

Started by drhamad, December 10, 2004, 03:07:59 AM

Previous topic - Next topic

drhamad

Quote from: Jerry on December 26, 2004, 12:13:36 AM
not really unless some one on the server has phpBB installed, it takes out most php files on the server :P So SMF gets problems from phpBB with this worm ;)

Sigh, I just did 6 hours of programming on phpbb and it failed.  Everythings not ready to switch over to SMF yet though :(
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

[Unknown]

The boards table, after doing these things, will have a new column named "ID_FORUM".

The value of this column will determine which forum it is shown on.  For example, if its value is 0, the board will be shown on all forums.  However, if it is 1 it will only be shown on forum #1.  Since no administration interface has been added, you will have to manually edit this column's value using phpMyAdmin.

The "messages" (where the posts are stored) and "topics" (where topics are :P) tables *DO NOT* need the ID_FORUM.  Only "boards" does.  This means you only need to put the posts both into SMF, and it will sort them out for you.

But, yes, the combining part does seem like... a problem.

-[Unknown]

drhamad

#42
Quote from: [Unknown] on December 26, 2004, 01:56:47 AM
The boards table, after doing these things, will have a new column named "ID_FORUM".

The "messages" (where the posts are stored) and "topics" (where topics are :P) tables *DO NOT* need the ID_FORUM.  Only "boards" does.  This means you only need to put the posts both into SMF, and it will sort them out for you.

But, yes, the combining part does seem like... a problem.

-[Unknown]

Well, I can convert each of the boards into their own prefixed tables, then run a recurring command to insert the identifier into each post on that table, no?  Then insert all the posts into the same table? hmm

FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

Goosemoose

#43
Did anyone get this to work? I just want to be able to move the posts between the forums. Right now they are each in their own prefix in the same db. The posts are totalled across all forums right now which is cool. If I just follow your instructions Unknown will they work? It looks like movethread would need to be modified to pull in info from several tables. What do you think?


Goosemoose

Okay I went ahead and tried what [Unknown] talked about. It seems to partially work. The boards show up on the right board depending on the ID_FORUM and 0 shows up on both forums, but I can't move topics between the two, for some reason only the boards on each forum show up. Any ideas on why that would be. They are default installs though I changed one of the boards {db_prefix}boards to be test3_boards. Any ideas?

Goosemoose

Anybody? I'm going nuts here trying to get this to work! Please help. Thanks.

[Unknown]

MoveTopic.php would need to be modified; replace $user_info[query_see_board] with 1, every time you find it.

-[Unknown]

Goosemoose

This works except that the url it lists for the moved thread points to the original forums url. Any ideas on how to change this?

[Unknown]

That would take a good amount of custom code in MoveTopic.php, I'm afraid... you'd probably have to select out the ID_FORUM and map it to the respective URL.

-[Unknown]

Goosemoose

I don't see where you create the post for the new forum though.

[Unknown]

Quote from: goosemoose on February 17, 2005, 01:48:00 AM
I don't see where you create the post for the new forum though.

You don't have to worry about the post insertion code, that's all going to be fine.  The URL is the only problem.

-[Unknown]

Goosemoose

Okay, right now I have three rfc_boards cfc_boards and dfc_boards, I know I need to merge them all into rfc_boards to move things from rfc boards to the other two, but should I leave the existing boards in place so that other functions work properly, or will everything work okay directed to rfc? Meaning post and other stats. Right now most of the other tables are shared and everything counts perfectly.

[Unknown]

Ah, sorry, I misunderstood.  Merging them is going to be a problem indeed, and the ID_FORUM method (which I thought you were using) is the best way I can come up with.

For multiple tables and move to work, you'll need to use UNION:

SELECT blah
FROM table1
   UNION SELECT blah
   FROM table2
   UNION SELECT blah
   FROM table3

-[Unknown]

Goosemoose

I did test out the ID_FORUM and it worked, but I'm was going to try merging the boards just to get move topic to work, and leave everything else from the other method. As long as I leave the original cfc_boards and dfc_boards up it should work, I'm hoping ;0


Goosemoose

Okay, I'm going to sit down and try to do this again. I just want to make sure I understand how [Unknown] is suggesting to do this. Let me know if this is right.

1. Install 2 forums, in different directories, same database, different prefixes.
2. Share members table, and others wanted, and share the boards table
3. Apply the fixes [Unknown] suggested in this thread.

Is this right? I would be combining the suggestions here plus what [Unknown] suggested in the other multiple database thread where he talks about sharing all the tables?

[Unknown]

Actually, my suggestion was more like:

1. Install two forums, in separate directories, with the same database and same prefixes.
2. Share everything, anything, and all things.
3. Then do what I said to make the two forums differ.

-[Unknown]

Goosemoose

Okay, I'll go ahead and try that. Any suggestions on how to merge the posts and boards from all three forums into one db? I'm going to do it on a test db first.

Also, I want the a few of the images to be different in each forum (like the new message notification for each board, and the smiley set). Any ideas on how to do this? I think I could just change the themes to a different prefix then I would be okay.

drhamad

Hey guys, I'm back!
Sorry for my few month dissappearance.

I've begun multiple forum tests, finally.
I have two boards installed:
http://development.fmvperformance.com/multiforumtest/
http://development.fmvperformance.com/secondmultitest/

I've done the mod as you said, Unknown.  In addition, I've defined the boards (went into the database, in table smf_boards I've defined two of the test forums to ID_FORUM=1 and two to ID_FORUM=2.  They show up exactly where they should - awesome.  And I can post to them fine.  Unfortunately the problem comes when you try to read topics - after posting, if I try to go back into the topic, I get:

QuoteYou have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '//-----------------------MULTIPLE FORUMS MOD BY UNKNOWN--------
File: /home/develope/public_html/secondmultitest/Sources/Load.php
Line: 475

The code around there:

Quote// Just build this here, it makes it easier to change/use.
   if ($user_info['is_guest'])
      $user_info['query_see_board'] = 'FIND_IN_SET(-1, b.memberGroups)';
   // Administrators can see all boards.
   elseif ($user_info['is_admin'])
      $user_info['query_see_board'] = '1';
   // Registered user.... just the groups in $user_info['groups'].
   else
      $user_info['query_see_board'] = '(FIND_IN_SET(' . implode(', b.memberGroups) OR FIND_IN_SET(', $user_info['groups']) . ', b.memberGroups))';
   // MULTIPLE FORUMS MOD BY UNKNOWN
   $user_info['query_see_board'] .= ' AND b.ID_FORUM IN (0, ' . $GLOBALS['ID_FORUM'] . ')';
}

// MD5 Encryption used for passwords.
function md5_hmac($data, $key)
{
   $key = str_pad(strlen($key) <= 64 ? $key : pack('H*', md5($key)), 64, chr(0x00));
   return md5(($key ^ str_repeat(chr(0x5c), 64)) . pack('H*', md5(($key ^ str_repeat(chr(0x36), 64)). $data)));
}
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

drhamad

#59
wait a sec, that's the wrong code.

Found the problem... it was just one of my commented out lines giving you credit, was in a bad place and was interferring :)
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

Advertisement: