Advertisement:

Author Topic: Multiple Boards (again)  (Read 58891 times)

Offline drhamad

  • Sophist Member
  • *****
  • Posts: 1,358
  • Gender: Male
    • FMVperformance Automotive Communities
Re: Multiple Boards (again)
« Reply #40 on: December 26, 2004, 01:25:35 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

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Multiple Boards (again)
« Reply #41 on: December 26, 2004, 01:56:47 AM »
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]

Offline drhamad

  • Sophist Member
  • *****
  • Posts: 1,358
  • Gender: Male
    • FMVperformance Automotive Communities
Re: Multiple Boards (again)
« Reply #42 on: December 26, 2004, 02:32:04 PM »
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

« Last Edit: December 26, 2004, 02:35:14 PM by drhamad »
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

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Multiple Boards (again)
« Reply #43 on: February 09, 2005, 01:13:05 AM »
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?

« Last Edit: February 09, 2005, 02:11:11 AM by goosemoose »

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Multiple Boards (again)
« Reply #44 on: February 09, 2005, 03:03:46 AM »
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?

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Multiple Boards (again)
« Reply #45 on: February 12, 2005, 01:40:25 AM »
Anybody? I'm going nuts here trying to get this to work! Please help. Thanks.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Multiple Boards (again)
« Reply #46 on: February 14, 2005, 09:15:21 AM »
MoveTopic.php would need to be modified; replace $user_info[query_see_board] with 1, every time you find it.

-[Unknown]

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Multiple Boards (again)
« Reply #47 on: February 15, 2005, 03:00:39 AM »
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?

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Multiple Boards (again)
« Reply #48 on: February 15, 2005, 04:23:24 AM »
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]

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Multiple Boards (again)
« Reply #49 on: February 17, 2005, 01:48:00 AM »
I don't see where you create the post for the new forum though.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Multiple Boards (again)
« Reply #50 on: February 18, 2005, 01:50:08 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]

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Multiple Boards (again)
« Reply #51 on: February 18, 2005, 02:21:10 AM »
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.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Multiple Boards (again)
« Reply #52 on: February 18, 2005, 02:49:28 AM »
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]

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Multiple Boards (again)
« Reply #53 on: February 18, 2005, 02:52:07 AM »
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

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Multiple Boards (again)
« Reply #54 on: February 18, 2005, 03:11:57 AM »
Doh! That won't work :(

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Multiple Boards (again)
« Reply #55 on: March 15, 2005, 02:50:49 AM »
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?

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Multiple Boards (again)
« Reply #56 on: March 15, 2005, 04:19:33 AM »
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]

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: Multiple Boards (again)
« Reply #57 on: March 15, 2005, 08:59:27 PM »
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.

Offline drhamad

  • Sophist Member
  • *****
  • Posts: 1,358
  • Gender: Male
    • FMVperformance Automotive Communities
Re: Multiple Boards (again)
« Reply #58 on: March 24, 2005, 04:06:17 PM »
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:

Quote
You 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

Offline drhamad

  • Sophist Member
  • *****
  • Posts: 1,358
  • Gender: Male
    • FMVperformance Automotive Communities
Re: Multiple Boards (again)
« Reply #59 on: March 24, 2005, 04:16:20 PM »
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 :)
« Last Edit: March 24, 2005, 04:20:36 PM by drhamad »
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