Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Mod Requests => Topic started by: drhamad on December 10, 2004, 03:07:59 AM

Title: Multiple Boards (again)
Post by: drhamad on December 10, 2004, 03:07:59 AM
I'm posting this again only because the last thread I could find about it had its last post in January.

We run our forums on phpBB2 currently and am always on the lookout for better software.  The one thing that has stopped us from changing software is that no matter who I go to - IPB, vB, etc - they won't support what we want to do, even after the software is paid for.

Specifically, this is (as the title says) to run multiple boards.  On the same userdb, of course (and it is on the same server).  On a basic level this is a rather simple mod (at least, in phpBB) to get running, but that doesn't exactly make it run WELL.  For instance, on phpBB it causes all kinds of avatar headaches.

It would also be nice if post counts could be kept seperately, but also combined.  What I mean by this is that the standard pc you see every time the user posts is for that forum only, but in the profile you see both that forum and all forums combined.  This is of lesser important than just a well functioning, easy to use multi-forum installation.

And the 3rd thing would be that it would be nice if cross-forum global announcements could be made.  This is a constant pain in the butt.

If these 3 things were taken care of, however unlikely, I would consider it worth almost any price for the software.

To see how we currently run:
http://www.mazda3forums.com
http://www.volvoS40club.com

We normally run 3 more boards but sadly we just lost 2.5 months of data, spanning 50,000 posts and 1,000 new members (and our backups died as well, all the way back to 9-17).  Those 3 other boards have not yet been resurrected.

Anyway, hope that gives you an idea of what I'm looking for.  So far I like what I see with this software, though I haven't yet had much experience with it - but it's a major hassle to change software with all the (necessary because of phpbb's few basic features) mods we run, and we don't want to change unless we can get most of what we want, standard.

Regards,

Daniel R Hamad
FMVperformance.com
Title: Re: Multiple Boards (again)
Post by: Trekkie101 on December 10, 2004, 03:43:42 AM
Freaky requests, but good idea's. im sure someone will try and help you accomplish this, if they cant, you could always try the paid help board they may pick you up there, but id try for free first and see what you get, plus Welcome To SMF.  :)
Title: Re: Multiple Boards (again)
Post by: [Unknown] on December 10, 2004, 03:50:59 AM
Actually, Compuart and several other people have worked on having forums with "multiple outlets".  There are easy and hard ways of doing this, including:
  - using separate tables for each forum (causes avatar problems, yes.)
  - using a column to specify which "outlet" to use (very easy, Compuart did this one.)

Post counts separately would be a little more difficult, but not that hard.  You would only need to have a posts1 and posts2, and increment posts still every time.  This would only mean changing Post.php and Load.php slightly.

Cross forum?  I'll assume from the terminology you're using that you mean what I would call "cross board" - meaning a sticky posted in one board that appears in more than one (e.g. in the whole category, or in the whole forum.)  I actually wrote a mod for YaBB SE to do this, and it was only somewhat annoying :P.  The idea would be the same for SMF, and while I don't have time to port it... I would give anyone permission to should they want to.

Depending on how much you've altered your database, the mods you've installed may not actually mean a significant barrier to conversion.  I would suggest installing a copy of SMF, and testing a conversion - this won't hurt or affect the phpBB installation, but will let you play with SMF and see if you like it - and also tell you if the conversion will work or not.  If it won't, we'll help you fix it or fix it for you ;).

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on December 10, 2004, 02:24:23 PM
Actually, Compuart and several other people have worked on having forums with "multiple outlets".  There are easy and hard ways of doing this, including:
  - using separate tables for each forum (causes avatar problems, yes.)
  - using a column to specify which "outlet" to use (very easy, Compuart did this one.)

The way we do it right now, each board is installed to a different table prefix in the same database, but some table's are stripped entirely of the prefix.  For example, "groups" "users" "banlist" etc have no prefix, so they become cross-board accessible.  The problem with avatars occurs because each board still has a seperate avatar directory, but avatars are controlled globally (since the profile is a global thing).  There needs to be a way to have a single avatar directory for all the sites for it to work properly.

I'm not sure what your 2nd idea  means...

Quote
Post counts separately would be a little more difficult, but not that hard.  You would only need to have a posts1 and posts2, and increment posts still every time.  This would only mean changing Post.php and Load.php slightly.

It is not a particuarly difficult modification, you're right.  It required editing something like 6-7 files in phpBB (a couple of php files and some template files).  The way we're doing it right now, each board records its posts individually, then when it's time to display post counts, depending on what we wanted in the specific place, it either uses just that boards pc, or it adds all the pc's together  (For example, when you post people see only the board pc.  In the profile there's both the board pc and the total pc listed).

Quote
Cross forum?  I'll assume from the terminology you're using that you mean what I would call "cross board" - meaning a sticky posted in one board that appears in more than one (e.g. in the whole category, or in the whole forum.)  I actually wrote a mod for YaBB SE to do this, and it was only somewhat annoying :P.  The idea would be the same for SMF, and while I don't have time to port it... I would give anyone permission to should they want to.

Yes, you're right, I meant cross board.  I hate to have to go through all 5 boards and post the same post 5 times when I need to get everybodies attention ;)
Title: Re: Multiple Boards (again)
Post by: [Unknown] on December 10, 2004, 08:02:36 PM
The second method I mentioned works like this:

One set of tables.  One database.  One install of SMF.  Works even if you uninstall the modification.  The only trick is, everything knows which forum is belongs to - #1 or #2.  And when I say everything, I really only mean a scarce few things that need to know...

When you want cross board posts (sometimes called anything from "announcements" to "super stickies" to "cross stickies" too), do you want them to be for every board in a category, for all your boards in your forum, or for those boards of your own specific choosing?

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on December 11, 2004, 01:11:03 PM
Well, as far as cross board posts go - I would just like to be able to make a global announcement, and have people be able to reply to it.  So I guess what I really want (now that I consider it more) is the ability for specific sections to be cross-board.  For example, an "Announcements" section that spans all boards.  (or also now that I think about it, the Lounge being shared by all boards would be nice... that's beyond what I was originally talking about though.

Normally all these things I've been talking about could be solved by just doing one install of the board and having a few levels of forums, but that would require everything to be on the same domain (due to cookies, among other things... can't log into a subforum), which I don't want.
Title: Re: Multiple Boards (again)
Post by: [Unknown] on December 11, 2004, 11:06:31 PM
Hmm... what you're looking for seems more to me like having a news board and putting links to it in the news (like we do here) than having cross board posts....

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on December 13, 2004, 02:54:51 PM
Well, that would be one way to do it.  The problem is that the links would not show when there is a new post, or what that post topic is (at least, a standard link wouldn't).

Now that I keep thinking about this (its been a while since we've tried to make anything like this work so everythings just resurfacing) I really wish I could do things like the Lounge idea too - having the lounge work across all boards.  Somehow I don't think that's possible though.  At least, not without a lot of work.

With the single installation idea, could you still have a different config for each theoretical board?  Different cookies, different template, etc?

The seperate table idea (which is what we use now, I suppose) works fine, but the avatar problem needs to be solved - besides that I'm perfectly happy with it (well, except for the lack of cross-board ability, but that's just wishful thinking at this point).
Title: Re: Multiple Boards (again)
Post by: ryanbsoftware on December 13, 2004, 03:37:22 PM
What if...Instead of having multipule install, have a diffrent board instead for each installation you wwould have and have sub-forums. ;)
Title: Re: Multiple Boards (again)
Post by: [Unknown] on December 13, 2004, 09:47:12 PM
Now that I keep thinking about this (its been a while since we've tried to make anything like this work so everythings just resurfacing) I really wish I could do things like the Lounge idea too - having the lounge work across all boards.  Somehow I don't think that's possible though.  At least, not without a lot of work.

With the single installation idea, could you still have a different config for each theoretical board?  Different cookies, different template, etc?

Very possible.  This is exactly what Compuart's CMS (it was a full blown CMS) did.

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on December 17, 2004, 12:28:04 AM
What if...Instead of having multipule install, have a diffrent board instead for each installation you wwould have and have sub-forums. ;)

THe problem is that we use about 5 different domains.  These include different graphics/etc.  If this could be done where people could login to the subforum directly, I'd be happy to do it - but that seems to be not possible.



Anyway guys, I'd like to say that we are now in full test mode with SMF.  We've been running a basic test install for about a week now and we installed a full db of ours today.  One problem we're having (and yes, I know this is not the right place to post this, although I'm not sure what the right place is... and I figured I might as well keep it all in one thread anyway) is that the users seem to not be being pulled over.  I'm nto sure why this is, but instead of 5k members we have 0 after conversion ;).  Obviously a problem.
Title: Re: Multiple Boards (again)
Post by: drhamad on December 17, 2004, 12:28:32 AM
Now that I keep thinking about this (its been a while since we've tried to make anything like this work so everythings just resurfacing) I really wish I could do things like the Lounge idea too - having the lounge work across all boards.  Somehow I don't think that's possible though.  At least, not without a lot of work.

With the single installation idea, could you still have a different config for each theoretical board?  Different cookies, different template, etc?

Very possible.  This is exactly what Compuart's CMS (it was a full blown CMS) did.

-[Unknown]

I'm sorry, I don't know what CMS stands for?
Title: Re: Multiple Boards (again)
Post by: Peter Duggan on December 17, 2004, 12:30:47 AM
I'm sorry, I don't know what CMS stands for?

Content Management System.
Title: Re: Multiple Boards (again)
Post by: drhamad on December 17, 2004, 02:16:38 AM
Anyway, if we have a successful conversion and teh criteria we need are met, we'll definitely be willing to pay for SMF's fee.
Title: Re: Multiple Boards (again)
Post by: [Unknown] on December 17, 2004, 02:25:55 AM
SMF is free (http://www.simplemachines.org/community/index.php?topic=16971.msg140624#msg140624).

Anyhow, the problem with members may be caused simply by statistics.  Have you tried logging in with the username and password you had before?  If it works, go to Admin -> Forum Maintenance -> Recount all forum totals and statistics.

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on December 17, 2004, 02:30:38 AM
SMF is free (http://www.simplemachines.org/community/index.php?topic=16971.msg140624#msg140624).

Anyhow, the problem with members may be caused simply by statistics.  Have you tried logging in with the username and password you had before?  If it works, go to Admin -> Forum Maintenance -> Recount all forum totals and statistics.

-[Unknown]

I meant the support fee :)  Heck I'd pay any fee, if the software looks as good as it seems.

But anyway, back to reality.

I have tried logging in with both the SMF username I created prior to the conversion, and both usernames I had on the phpbb2 forum.  It literally recognizes ZERO usernames.
(this is at http://fmvperformance.com/smftest/ )
Title: Re: Multiple Boards (again)
Post by: drhamad on December 17, 2004, 02:50:00 AM
I'm afraid this might be due to the rather large amount of mods that have been done to our forum, mostly relating to running multiple forums on the same database.  I'm just not sure what to do about it.

More specifically, inside of the phpbb user's table, we have a seperate row for each forum's post count...  user_posts_m3f, user_posts_ffc, user_posts_mm6, etc.  I think this is what's causing the error, but I'm not sure how to correct it.
Title: Re: Multiple Boards (again)
Post by: Grudge on December 17, 2004, 04:24:24 AM
IS there a plain user_posts? If not that could be why it's failing. Why not add a new column to the table called posts and do a query like:
Code: [Select]
UPDATE users SET posts = posts_m3f + posts_ffc ....

To sum the posts correctly. Otherwise could you post the table structure of your users table?
Title: Re: Multiple Boards (again)
Post by: drhamad on December 17, 2004, 02:27:33 PM
OK I just created a user_posts table and set it equal to user_posts_m3f, since that's what I'm converting right now (I'm going to have to use some interesting tricks to get the converter to accept the other forums ;) )

It seems to have worked!  I can now login.

There was one issue - it was still saying 0 members despite HAVING all the members, and then I also realized tha tmost of my child boards had not been carried over.  I went through my forum and moved all of the child boards to the root level and reconverted, and somehow it seems to have solved both problems.

So, so far, it looks like phase 1 of the test conversion was successful.  I say phase 1 because I now have to figure out how to trick the converter into accepting the other boards (and for that matter, I need to figure out exactly what to do to get SMF to work with multiple boards - obviously on different tables, since that's the only way I know to do it, though it is not a very elegant solution).
Title: Re: Multiple Boards (again)
Post by: drhamad on December 17, 2004, 02:28:25 PM
IS there a plain user_posts? If not that could be why it's failing. Why not add a new column to the table called posts and do a query like:
Code: [Select]
UPDATE users SET posts = posts_m3f + posts_ffc ....

To sum the posts correctly. Otherwise could you post the table structure of your users table?

I could combine all the post counts, but I kinda like having them seperate - it allows us to track where users spend most of their time, etc.
Title: Re: Multiple Boards (again)
Post by: [Unknown] on December 17, 2004, 02:48:08 PM
I really suggest you send an email or pm to Compuart (http://www.simplemachines.org/community/index.php?action=profile;u=27), referencing this topic, because he may be able to give you the code he was working on.  It used just the one set of tables, and added an ID_FORUM column to boards, if I remember right.

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on December 17, 2004, 03:49:16 PM
I really suggest you send an email or pm to Compuart (http://www.simplemachines.org/community/index.php?action=profile;u=27), referencing this topic, because he may be able to give you the code he was working on.  It used just the one set of tables, and added an ID_FORUM column to boards, if I remember right.

-[Unknown]

Interesting.  I will PM him now.
Title: Re: Multiple Boards (again)
Post by: drhamad on December 17, 2004, 04:43:12 PM
Not to get off topic, but I'm going to get off topic ;)

Does this board have an announcement function?  That is, post a message and set it as announcement and it appears at the very top above the forums?

(Ex on Mazda3Forums.com: "ATTENTION: People who CANNOT Log In  " thread is shown right on top, right on the root level of the forum (and is actually posted in the bottom most section of the forum).

I see an announcement function when you're posting a new topic, but it doesn't seem to do that... I'm not sure what it does do.
Title: Re: Multiple Boards (again)
Post by: Peter Duggan on December 17, 2004, 11:32:01 PM
I see an announcement function when you're posting a new topic, but it doesn't seem to do that... I'm not sure what it does do.

It sends a notification email to members who have agreed to receive emails.

NB You can also set up announcement boards where that always happens.
Title: Re: Multiple Boards (again)
Post by: [Unknown] on December 17, 2004, 11:38:52 PM
No, not in the sense you're talking of.  Like I said, the news is very often used for just this - in fact, there's a news fader too.

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on December 18, 2004, 01:56:40 AM
No, not in the sense you're talking of.  Like I said, the news is very often used for just this - in fact, there's a news fader too.

-[Unknown]

Yeah the news is a good thing.  The problem is that people can't reply to that.
Title: Re: Multiple Boards (again)
Post by: [Unknown] on December 18, 2004, 03:38:36 AM
Yeah the news is a good thing.  The problem is that people can't reply to that.

Well, as I said above (again) if you put a link like this:


This is some news.... (http://www.simplemachines.org/community/Themes/simple_xmas/images/english/reply.gif) (http://www.simplemachines.org/community/index.php?action=post;topic=21252.15)


At the end or whatever, said restriction is quickly limited, no?  But, I'm just saying that this is a common way the same functionality is achieved without such a modification; adding "announcements" isn't that difficult, depending on how you want them implemented.

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on December 19, 2004, 02:55:26 AM
is that "reply" button able to be put in the news menu?
Title: Re: Multiple Boards (again)
Post by: [Unknown] on December 19, 2004, 02:58:31 AM
is that "reply" button able to be put in the news menu?

Of course.  You can use bbc ([ url=http://domain/path/to/smf/index.php?action=post;topic=### ][ img ]http://domain/path/to/reply.gif[ /img ][ /url ]) as I did above, or even just plain html ;).

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on December 19, 2004, 03:37:45 AM
is that "reply" button able to be put in the news menu?

Of course.  You can use bbc ([ url=http://domain/path/to/smf/index.php?action=post;topic=### ][ img ]http://domain/path/to/reply.gif[ /img ][ /url ]) as I did above, or even just plain html ;).

-[Unknown]

Hmm... doesn't seem to work for me.  If you check out the "news box" on http://smftest.fmvperformance.com you can see my attempts to use both bb code and html (though both look weird... they don't include code that I've used and they do include code I didn't use).

Forgive me if we're getting too off topic here... I'd be happy to repost in a different section if preferred.
Title: Re: Multiple Boards (again)
Post by: [Unknown] on December 19, 2004, 03:47:10 AM
Please don't set "break long words" to anything less than 50.  Personally I recommend it off (0).

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on December 19, 2004, 01:30:31 PM
Ya know, I just realized you meant add the reply button below the news, right?  Not in it.  (hits self on head)

Edit:
OK ignore this post, I'm an idiot.
Title: Re: Multiple Boards (again)
Post by: drhamad on December 20, 2004, 08:36:02 PM
I haven't heard back from compuart yet, but on the tables-method front... any idea what the equivalent of constants.php in phpbb2 is for SMF?
(the table names)

Quote
// Table names
define('AUTH_ACCESS_TABLE', $table_prefix.'auth_access');
define('BANLIST_TABLE', 'banlist');
define('CATEGORIES_TABLE', $table_prefix.'categories');
define('CONFIG_TABLE', $table_prefix.'config');
define('DISALLOW_TABLE', 'disallow');
define('FORUMS_TABLE', $table_prefix.'forums');
define('GROUPS_TABLE', 'groups');
define('POSTS_TABLE', $table_prefix.'posts');
define('POSTS_TEXT_TABLE', $table_prefix.'posts_text');
define('PRIVMSGS_TABLE', 'privmsgs');
define('PRIVMSGS_TEXT_TABLE', 'privmsgs_text');
define('PRIVMSGS_IGNORE_TABLE', $table_prefix.'privmsgs_ignore');
define('PRUNE_TABLE', $table_prefix.'forum_prune');
define('RANKS_TABLE', 'ranks');
etc
etc
etc

On another of my random subjects also though, I can't for the life of me figure out how to replace rank banners?  (the star graphics)
Title: Re: Multiple Boards (again)
Post by: Peter Duggan on December 20, 2004, 08:43:13 PM
On another of my random subjects also though, I can't for the life of me figure out how to replace rank banners?  (the star graphics)

Edit Membergroups -> (Group Name) -> Modify.
Title: Re: Multiple Boards (again)
Post by: drhamad on December 20, 2004, 09:00:53 PM
On another of my random subjects also though, I can't for the life of me figure out how to replace rank banners?  (the star graphics)

Edit Membergroups -> (Group Name) -> Modify.

OK you're right ;)  I'd been screwing up the URL.
Title: Re: Multiple Boards (again)
Post by: [Unknown] on December 22, 2004, 05:21:08 AM
SMF doesn't use constants for every table name, but there is a mod to do so.

http://www.simplemachines.org/community/index.php?topic=19045.0

It's meant to share the tables between two forums, but that's essentially what you're planning to do.  However, the way I would do it is essentially this: (requires admin ui work...)

ALTER TABLE smf_boards
ADD ID_FORUM tinyint(4) unsigned NOT NULL default 0;

And then add in the Settings.php for each forum:

$ID_FORUM = 1;

(change the 1 to 2, 3, 4, etc. for each forum..)

Next, edit Load.php... find this:
Code: [Select]
// 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))';

Add after it:
Code: [Select]
$user_info['query_see_board'] .= ' AND b.ID_FORUM IN (0, ' . $GLOBALS['ID_FORUM'] . ')';
Bam.  Done.  All you do now is set the ID_FORUM's for the boards in question - but, without modifications to ManageBoards.php you'd have to do this with phpMyAdmin... where 0 would be "all" and "1" would be forum #1 only.

The next complication is posts.  So:

ALTER TABLE smf_members
ADD posts1 smallint(5) unsigned NOT NULL default 0,
ADD posts2 smallint(5) unsigned NOT NULL default 0;

And so on for each forum.  Now, in Post.php:
Code: [Select]
updateMemberData($ID_MEMBER, array('posts' => 'posts + 1'));
Replace:
Code: [Select]
updateMemberData($ID_MEMBER, array('posts' => 'posts + 1', 'posts' . $GLOBALS['ID_FORUM'] => 'posts' . $GLOBALS['ID_FORUM'] . ' + 1'));
Now, you have to be able to access said post count... so, in Load.php, find this:
Code: [Select]
IFNULL(lo.logTime, 0) AS isOnline, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH, a.filename, mem.signature,
Replace it (twice) with:
Code: [Select]
IFNULL(lo.logTime, 0) AS isOnline, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH, a.filename, mem.signature, mem.posts1, mem.posts2,
Again, add more if you want more forums.  Now, find this:
Code: [Select]
'location' => &$profile['location'],
Add after:
Code: [Select]
'posts1' => &$profile['posts1'],
Rinse and repeat, once again.... then you have to edit Display.template.php, using $message['member']['posts1'], etc.

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on December 22, 2004, 01:25:04 PM
You have been a great help sir.  I will look into this.  Our SMF tests are coming along quite well so far.
Title: Re: Multiple Boards (again)
Post by: drhamad on December 24, 2004, 01:23:48 AM
Alright now a couple questions about that method come to mind (I just input all the changes into the files... haven't put them online yet though)

Quote
Bam.  Done.  All you do now is set the ID_FORUM's for the boards in question - but, without modifications to ManageBoards.php you'd have to do this with phpMyAdmin... where 0 would be "all" and "1" would be forum #1 only.
I'm confused as to what you're saying here.  What would need to be done in phpmyadmin (which is fine, I know how to use it relatively well, I just don't understand what needs to be done).

And the second question is... how do I move the existing posts to the correct board?  I'd need some sort of sql command to add id_forum=1 to each of one forums table of posts, id_forum=2 for another, right?  In addition, I'd need to combine the individual post tables (since right now each forum stores in a seperately prefixed table) into one.
Title: Re: Multiple Boards (again)
Post by: drhamad on December 26, 2004, 12:06:23 AM
Merry Christmas to all, esp those who have helped me out so far.

For christmas I got slammed by the PHP virus (I was still running phpBB 2.0.5 on my server) and have been programming in php for 5 hours straight.

SMF, I assume, does not have this problem? :)
Title: Re: Multiple Boards (again)
Post by: 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 ;)
Title: Re: Multiple Boards (again)
Post by: drhamad 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 :(
Title: Re: Multiple Boards (again)
Post by: [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 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]
Title: Re: Multiple Boards (again)
Post by: drhamad 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

Title: Re: Multiple Boards (again)
Post by: Goosemoose 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?

Title: Re: Multiple Boards (again)
Post by: Goosemoose 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?
Title: Re: Multiple Boards (again)
Post by: Goosemoose on February 12, 2005, 01:40:25 AM
Anybody? I'm going nuts here trying to get this to work! Please help. Thanks.
Title: Re: Multiple Boards (again)
Post by: [Unknown] 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]
Title: Re: Multiple Boards (again)
Post by: Goosemoose 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?
Title: Re: Multiple Boards (again)
Post by: [Unknown] 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]
Title: Re: Multiple Boards (again)
Post by: Goosemoose on February 17, 2005, 01:48:00 AM
I don't see where you create the post for the new forum though.
Title: Re: Multiple Boards (again)
Post by: [Unknown] 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]
Title: Re: Multiple Boards (again)
Post by: Goosemoose 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.
Title: Re: Multiple Boards (again)
Post by: [Unknown] 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]
Title: Re: Multiple Boards (again)
Post by: Goosemoose 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
Title: Re: Multiple Boards (again)
Post by: Goosemoose on February 18, 2005, 03:11:57 AM
Doh! That won't work :(
Title: Re: Multiple Boards (again)
Post by: Goosemoose 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?
Title: Re: Multiple Boards (again)
Post by: [Unknown] 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]
Title: Re: Multiple Boards (again)
Post by: Goosemoose 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.
Title: Re: Multiple Boards (again)
Post by: drhamad 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)));
}
Title: Re: Multiple Boards (again)
Post by: drhamad 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 :)
Title: Re: Multiple Boards (again)
Post by: [Unknown] on March 25, 2005, 04:42:47 AM
As someone else pointed out, the only major problem is that you cannot move topics between one forum and the other.  This can be resolved by modifying MoveTopic.php a bit to ignore the ID_FORUM restriction.

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on March 25, 2005, 10:29:56 AM
As someone else pointed out, the only major problem is that you cannot move topics between one forum and the other.  This can be resolved by modifying MoveTopic.php a bit to ignore the ID_FORUM restriction.

-[Unknown]

Yeah... but then, can't do that with our current multi-forum setup either.

I still need to test it out on multiple domains, also, since right now it's just different folders on the same domain.

The big problem is, of course, how to move our current boards to this.

This is what I'm thinking so far:
-Flatten the heirarchy on all boards (phpBB->SMF converter can't handle subforums (child boards)) which is a pain but doable.
-Convert the 4 boards to SMF seperately
-Combine them into the same db w/different prefixes
-Delete the excess tables that need to end up the same (ex: there will be board1_members, board2_members, etc, but they're really all teh same, so delete board2_members)

The hard part is combining the categories, boards, posts.
The cat's and boards can be made to use different id's (mostly they already do, to avoid some phpbb conflicts, but some of the newer ones aren't).  Make sure posts stay associated with the right boards/etc, of course.  Then, post id's will need to be changed.  Luckily, 3 of our 4 boards are quite small, but still, at a couple thousand posts each, definitely needs to be a recurring mysql function that changes them ;)  So I'm thinking, leave the big board's posts alone (240,000 of them).  Then, go to the small boards, and change their post id's to +240,000 for the first, then +242xxx (whatever the next # is) for the 2nd, and so on.
Then, move all the posts into one table.

And of course, all the boards/cats would need to be moved into one table as well.

Does that sound like it would work?  I'm no mysql expert, but it sounds reasonable to me?
Title: Re: Multiple Boards (again)
Post by: drhamad on March 25, 2005, 11:33:35 AM
ALTER TABLE smf_members
ADD posts1 smallint(5) unsigned NOT NULL default 0,
ADD posts2 smallint(5) unsigned NOT NULL default 0;

Now, you have to be able to access said post count... so, in Load.php, find this:
Code: [Select]
IFNULL(lo.logTime, 0) AS isOnline, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH, a.filename, mem.signature,
Replace it (twice) with:
Code: [Select]
IFNULL(lo.logTime, 0) AS isOnline, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH, a.filename, mem.signature, mem.posts1, mem.posts2,
Again, add more if you want more forums.  Now, find this:
Code: [Select]
'location' => &$profile['location'],
Add after:
Code: [Select]
'posts1' => &$profile['posts1'],
Rinse and repeat, once again.... then you have to edit Display.template.php, using $message['member']['posts1'], etc.

-[Unknown]


What exactly is this section doing.  Is it keeping the post counts for each forum seperately?
Title: Re: Multiple Boards (again)
Post by: [Unknown] on March 27, 2005, 02:08:50 AM
This is what I'm thinking so far:
-Flatten the heirarchy on all boards (phpBB->SMF converter can't handle subforums (child boards)) which is a pain but doable.

I may be able to change this.  How are they stored in the phpBB database, even?

Quote
-Convert the 4 boards to SMF seperately

Eeek.

Quote
The hard part is combining the categories, boards, posts.
The cat's and boards can be made to use different id's (mostly they already do, to avoid some phpbb conflicts, but some of the newer ones aren't).  Make sure posts stay associated with the right boards/etc, of course.  Then, post id's will need to be changed.  Luckily, 3 of our 4 boards are quite small, but still, at a couple thousand posts each, definitely needs to be a recurring mysql function that changes them ;)  So I'm thinking, leave the big board's posts alone (240,000 of them).  Then, go to the small boards, and change their post id's to +240,000 for the first, then +242xxx (whatever the next # is) for the 2nd, and so on.
Then, move all the posts into one table.

Theoretically, that should work.  There are a bunch of ID columns though - you'll need to do ID_TOPIC, ID_BOARD, ID_LAST_MSG, and ID_FIRST_MSG on topics; ID_MSG, and ID_BOARD, ID_TOPIC on messages; ID_LAST_MSG, ID_CAT, and ID_BOARD on boards; and ID_CAT on categories.  That's a lot of columns.

What exactly is this section doing.  Is it keeping the post counts for each forum seperately?

Yes, exactly.

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on March 27, 2005, 02:56:35 PM
This is what I'm thinking so far:
-Flatten the heirarchy on all boards (phpBB->SMF converter can't handle subforums (child boards)) which is a pain but doable.

I may be able to change this.  How are they stored in the phpBB database, even?

Well, officially phpBB does not support child boards.  Which is why I assume the SMF converter doesn't.  Unofficially, I don't think any major phpBB board runs without this:
http://www.phpbb.com/phpBB/viewtopic.php?t=265040&highlight=categories+heirarchy


Quote
Quote
-Convert the 4 boards to SMF seperately

Eeek.

Quote
The hard part is combining the categories, boards, posts.
The cat's and boards can be made to use different id's (mostly they already do, to avoid some phpbb conflicts, but some of the newer ones aren't).  Make sure posts stay associated with the right boards/etc, of course.  Then, post id's will need to be changed.  Luckily, 3 of our 4 boards are quite small, but still, at a couple thousand posts each, definitely needs to be a recurring mysql function that changes them ;)  So I'm thinking, leave the big board's posts alone (240,000 of them).  Then, go to the small boards, and change their post id's to +240,000 for the first, then +242xxx (whatever the next # is) for the 2nd, and so on.
Then, move all the posts into one table.

Theoretically, that should work.  There are a bunch of ID columns though - you'll need to do ID_TOPIC, ID_BOARD, ID_LAST_MSG, and ID_FIRST_MSG on topics; ID_MSG, and ID_BOARD, ID_TOPIC on messages; ID_LAST_MSG, ID_CAT, and ID_BOARD on boards; and ID_CAT on categories.  That's a lot of columns.

Actually in talking to my admins I've reversed this - do all the manual work on this on the phpbb side, before conversion.  That way only converting once.  Still, a ton of manual work, and a bunch of columns.  We've done it before for Forum and Category ID's, but never for posts.  A recurring function should make it relatively "easy", just gotta make sure we do everything correctly.

Quote
What exactly is this section doing.  Is it keeping the post counts for each forum seperately?

Yes, exactly.

-[Unknown]

If a board with an ID_FORUM of 0 (shown across all boards) is posted in, it adds post count to the site's your on, I'd assume?  Or to all?

By the way, this is being tested at:
http://www.mazdaowners.com/testforum/
http://development.fmvperformance.com/multiforumtest/
http://developing.fmvperformance.com/
Title: Re: Multiple Boards (again)
Post by: [Unknown] on March 27, 2005, 05:50:56 PM
If a board with an ID_FORUM of 0 (shown across all boards) is posted in, it adds post count to the site's your on, I'd assume?  Or to all?

Ah, sorry, missed that.  Thanks.

Code: [Select]
updateMemberData($ID_MEMBER, array('posts' => 'posts + 1'));
Replace:
Code: [Select]
if ($GLOBALS['ID_FORUM'] != 0)
   updateMemberData($ID_MEMBER, array('posts' => 'posts + 1', 'posts' . $GLOBALS['ID_FORUM'] => 'posts' . $GLOBALS['ID_FORUM'] . ' + 1'));
else
   updateMemberData($ID_MEMBER, array('posts' => 'posts + 1', 'posts1' => 'posts1 + 1', 'posts2' => 'posts2 + 1'));

And similar...

I'll look into the category thing.  I took a brief look, and I couldn't see exactly how child boards were stored differently.

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on March 28, 2005, 01:00:31 PM
OK so looking over this code more, every time you post:
posts=posts+1
AND
posts1=posts1+1

Correct?

So next, I need to write code to make posts1 visible.  No big deal, I'm just confirming with you that as of right now, nothing actually SHOWS posts1?
Title: Re: Multiple Boards (again)
Post by: drhamad on March 28, 2005, 01:05:55 PM
Oooh just came across one problem:

At the moment, the board is showing me as online as both a member and a guest, even though in the 2 boards I'm browsing, I'm logged in on both.
Title: Re: Multiple Boards (again)
Post by: [Unknown] on March 28, 2005, 05:16:24 PM
OK so looking over this code more, every time you post:
posts=posts+1
AND
posts1=posts1+1

Correct?

So next, I need to write code to make posts1 visible.  No big deal, I'm just confirming with you that as of right now, nothing actually SHOWS posts1?

Yes, but it's available after those changes as $message['member']['posts1'] and similar.  You could do $message['member']['posts' . ID_FORUM]...

Oooh just came across one problem:

At the moment, the board is showing me as online as both a member and a guest, even though in the 2 boards I'm browsing, I'm logged in on both.

Interesting.  That shouldn't happen; I bet they have different session codes.  Hmm... that could get strange.  I wonder if it's theoretically possible to share the session...

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on March 28, 2005, 07:48:59 PM
As database driven sessions, wouldn't it be theoretically possible?

Under phpBB it does not let you log in once / be logged in everywhere, however it will not double count you.  The only problem with the phpBB method is that when you switch between forums, it totally loses what you've read / not read.

Oh btw, I'm currently using the default cookie name on all forums - not sure if that matters.

On further testing, it seems like once I log in, the 2nd (guest) copy dissappears... that didn't happen last time.  Not sure what the difference is.


Edit:
It did the 2 user thing again.  Seems like it keeps the Guest on for a little bit at the beginning, then it dissappears.
Title: Re: Multiple Boards (again)
Post by: Goosemoose on March 30, 2005, 04:09:43 PM
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.

Any ideas on this? I want to switch to [Unknown]'s method of integrating forums. This is becoming too much of a headache the current way when I have to have 3 seperate upgrades, 3 seperate mod installs and everything else.
Title: Re: Multiple Boards (again)
Post by: drhamad on March 31, 2005, 11:27:05 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.

Any ideas on this? I want to switch to [Unknown]'s method of integrating forums. This is becoming too much of a headache the current way when I have to have 3 seperate upgrades, 3 seperate mod installs and everything else.


Well, this method will not really save you from 3 upgrades/etc.  You're still going to be running 3 seperate copies of the software.  The only thing that would carry over between the forums is database changes.  Generally, updates don't make db changes though.  In addition, it means you have to be careful what mods you install, because mods won't know you have 3 forums - you have to make them aware of it, if it's something that affects the board structure, or if it's something that you want each board to act on independantly - you'd have to mod the mod. 

In other words, this would not simplify your process - it would make it more complex.  What this does do is allow you to use the same userdb, banlist, templates, and a few other things among all 3 boards.  It also allows you to setup forums in which posts can be viewed across all 3 boards.

Late edit:  I should mention it also lets you run the boards off different domains, which is the primary reason I do it instead of just having one huge board.
Title: Re: Multiple Boards (again)
Post by: drhamad on April 01, 2005, 12:02:05 PM
This is getting to be a ridiculous amount of work :(  Not your fault at all, [unknown]... it's the conversion process that is screwing everything up.

I found a script that merges phpbb db's, so I run that, then I run the phpbb to smf conversion.  Somewhere along the line things are getting screwed up though - posts aren't where they should be /etc.  I haven't figured out if that is happening before or after the conversion though
Title: Re: Multiple Boards (again)
Post by: drhamad on April 12, 2005, 11:36:26 AM
Well, SMF better be worth it, because I think I've finally succeeded ;)

I've managed to get all my db's merged, I think (test copies obviously) and I'm about to try the SMF conversion.
Title: Re: Multiple Boards (again)
Post by: drhamad on April 12, 2005, 04:28:48 PM
Holy crap... I think it's working.
http://development.fmvperformance.com/smf/
http://development.fmvperformance.com/smf2/
http://www.mazdaowners.com/smf3/

Test copy of the real db, 3 of the four boards that needed to be merged (The last is a bit more complex and didn't feel like dealing with it just now)... everything seems to be working... some messy stuff, mainly from 2 sources - forums that were just links, which SMF doesn't recognize (turns them into regular forums), and some sub-categories that the converter doesn't recognize.  Not big deals.
Title: Re: Multiple Boards (again)
Post by: drhamad on April 12, 2005, 05:45:18 PM
So, one problem I've noticed that needs to be rectified is that by default the search function wants to search all boards.  I'm sure there's a way to make it default to searching only id_forum 0 and (whatever board it's accessed from).
Title: Re: Multiple Boards (again)
Post by: drhamad on April 15, 2005, 05:07:10 PM
One other problem, this one major:
When I try to move sections and categories, they aren't going where they're told.
Title: Re: Multiple Boards (again)
Post by: drhamad on May 04, 2005, 10:39:04 AM
Just wanted to know those couple problems have been solved.  Gettin closer! :)
Title: Re: Multiple Boards (again)
Post by: drhamad on July 01, 2005, 06:19:08 PM
If I wanted to make it so ID_FORUM = 5 is accessible from 2 of the 4 boards, could I do:

Code: [Select]
$user_info['query_see_board'] .= ' AND b.ID_FORUM IN (0, 5, ' . $GLOBALS['ID_FORUM'] . ')';

And use that code on the 2 boards that should see 5?  Any better way to do it?

Anything else I'd have to do?
Title: Re: Multiple Boards (again)
Post by: [Unknown] on July 04, 2005, 04:49:44 AM
You could do that, yes.  Another way would be to replace the ID_FORUM column with a comma separated list of columns, and use:

$user_info['query_see_board'] .= ' AND (FIND_IN_SET(' . $GLOBALS['ID_FORUM'] . ', b.showInForums) OR FIND_IN_SET(0, b.showInForums))';

But, it'd probably be simpler to stick with what you already have.

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on July 04, 2005, 10:11:54 PM
You could do that, yes.  Another way would be to replace the ID_FORUM column with a comma separated list of columns, and use:

$user_info['query_see_board'] .= ' AND (FIND_IN_SET(' . $GLOBALS['ID_FORUM'] . ', b.showInForums) OR FIND_IN_SET(0, b.showInForums))';

But, it'd probably be simpler to stick with what you already have.

-[Unknown]


Hmm that's not a bad idea.  Could just do "1, 5" then in the database, right?
Title: Re: Multiple Boards (again)
Post by: [Unknown] on July 04, 2005, 10:18:38 PM
Exactly.  Then again, you'd have to change all the modifications you've made so far... but really, I guess they're not that many.

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on July 04, 2005, 10:36:15 PM
Exactly.  Then again, you'd have to change all the modifications you've made so far... but really, I guess they're not that many.

-[Unknown]

I haven't done any "5" modifications yet :)
Title: Re: Multiple Boards (again)
Post by: drhamad on July 05, 2005, 01:00:42 PM
Hmm, did I actually say that wrong?

is it in Settings.php, or in the db, that you'd do 1,5
Title: Re: Multiple Boards (again)
Post by: [Unknown] on July 05, 2005, 05:30:31 PM
In the database, on the boards table.  There'd be a column like that.

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on July 05, 2005, 09:22:59 PM
Alright, just went into one of my forums, did:

Find:
Code: [Select]
$user_info['query_see_board'] .= ' AND b.ID_FORUM IN (0, ' . $GLOBALS['ID_FORUM'] . ')';
Replace with:
Code: [Select]
$user_info['query_see_board'] .= ' AND (FIND_IN_SET(' . $GLOBALS['ID_FORUM'] . ', b.showInForums) OR FIND_IN_SET(0, b.showInForums))';
Resulted in:
Quote
Unknown column 'b.showInForums' in 'where clause'
File: /home/mspeed/public_html/Sources/BoardIndex.php
Line: 83


Note:
This is without doing any comma stuff - no database changes were made at all.
Title: Re: Multiple Boards (again)
Post by: [Unknown] on July 05, 2005, 11:14:24 PM
Well, I meant you'd have to create a "showInForums" column on the boards table, e.g.:

ALTER TABLE boards
ADD COLUMN showInForums tinytext NOT NULL default '0';

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on July 05, 2005, 11:24:56 PM
Ahhhhhh.  Sorry, sometimes I need some hand holding ;)  For some reason I was thinking that was an already existing variable.

For some reason I was thinking I'd be able to do it in ID_FORUM

So now there'd be an ID_FORUM column, and a showInForums column.  Post count would still be based off of ID_FORUM of the board.

Now, this may be a stupid question, but wouldn't having the 2 variables conflict?  What happens if ID_FORUM is 1 and showInForums is 2? Or (more likely) 0?
Title: Re: Multiple Boards (again)
Post by: [Unknown] on July 06, 2005, 02:16:52 AM
Well, that's what I meant by:

Exactly.  Then again, you'd have to change all the modifications you've made so far... but really, I guess they're not that many.

The way I would do it, myself, would be to remove the ID_FORUM column and use this new column instead...

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on July 06, 2005, 11:12:38 AM
Ahhhhh
I was thinking you meant any ID_FORUM=5 stuff I'd already done.

So if I'm reading this correctly then, doing what you just said would ignore the ID_FORUM value in the database entirely (in other words, just delete the column), and use Settings.php ID_FORUM=X to determine what the ID of the forum whole is, and if it matches up with one of the values in showInForum.  Post Count with then be based off of... what?  The Settings.php ID_FORUM?


Well, that's what I meant by:

Exactly.  Then again, you'd have to change all the modifications you've made so far... but really, I guess they're not that many.

The way I would do it, myself, would be to remove the ID_FORUM column and use this new column instead...

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on July 11, 2005, 02:49:40 PM
Alright, so I'm going with something slightly different... having a problem though.

I ended up adding a new variable, ID_MULTI_FORUM, also tinyint.
I then added $ID_MULTI_FORUM = 1 to settings.php (where ID_FORUM is also 1).

Now, what I want to happen is for, if EITHER ID_FORUM or ID_MULTI_FORUM = 1  in smf_boards, that board shows.

I tried a couple different methods of adding ID_MULTI_FORUM to:
Code: [Select]
$user_info['query_see_board'] .= ' AND b.ID_FORUM IN (0, ' . $GLOBALS['ID_FORUM'] . ')'; (in Load.php)
Had the same problem every time though - a line 83 boardindex.php cat_id error.  Any ideas as to how I should properly add id_multi_forum to Load.php?
Title: Re: Multiple Boards (again)
Post by: drhamad on July 11, 2005, 02:52:51 PM
I correct myself... now with one way of doing it, I get no boards (but no errors) and with the other, I'm getting way too many / no organization ;)
Title: Re: Multiple Boards (again)
Post by: [Unknown] on July 11, 2005, 05:55:30 PM
Right.  So ID_FORUM would be the "active" forum, and the first ID_FORUM in the showInForums list would be the "primary" one I guess.

It's complicated too.

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on July 18, 2005, 08:16:54 PM
Having a bit of a problem with a couple of boards I just made:
http://www.mazdaspeeders.com/index.php?board=923.0

I can't move the topics that are in that board, to the child boards.  It doesn't give me the option of moving to those boards - though it lists nearly everything else on that site.
Title: Re: Multiple Boards (again)
Post by: [Unknown] on July 19, 2005, 07:54:07 PM
How exactly did you modify the move code?

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on July 21, 2005, 08:02:51 PM
Alright, I figured it out.  It was there.  What the issue was that when you're moving something from a parent board to a child board (or, in general, when you're moving something) it does not show as an option the board you're currently in.  What this meant is that the child boards blended with the child boards of the board above it, so I didn't notice.

For example,

actual structure:
-board1
--board1.1
--board1.2
--board1.3
-board2
--board2.1
--board2.2

What it looked like:
-board1
--board1.1
--board1.2
--board1.3
--board2.1
--board2.2


And of course, with real board names it blended even more, since it was just things like "technical discussion".
Title: Re: Multiple Boards (again)
Post by: drhamad on August 12, 2005, 11:17:24 AM
Using your array method of choosing which forums a board is displayed on, you still need to have the id_forum column obviously.  But would there be a way from which it can determine what post count column to add to by looking at what is in Settings.php, rather than assigned to the board?  In other words, if people post from site A, I want the pc recorded on the site A pc.  This of course always happens if a board is only assigned to that one id_forum, but if it has multiple, you still have to assign only one site to get pc from - I want a post from site A to always be recorded for site A's pc.

Understand what I'm getting at?

Any way to do it?
Title: Re: Multiple Boards (again)
Post by: [Unknown] on August 26, 2005, 01:03:44 AM
Using your array method of choosing which forums a board is displayed on, you still need to have the id_forum column obviously.  But would there be a way from which it can determine what post count column to add to by looking at what is in Settings.php, rather than assigned to the board?

I think I understand.  The way I was thinking was just to use the first id in the list - for example, if you have "1,2,3" then "1" would be the primary one, which gets the post count.  If it were "2,1,3" then it would be "2".... no?

-[Unknown]
Title: Re: Multiple Boards (again)
Post by: drhamad on November 15, 2005, 04:02:10 PM
So, after using this for some time, this is one MAJOR... disadvantage (I hesitate to use the word "problem," because it is not a dehabilitating issue on the forum)... to using it - Google seems to see all the sites, despite the differing domains, as one.  All the sites are showing up as mazda3forums.com, which is killing my ability to get people to the others (especially FordFusionClub.com, which has been around a while, but is barely even recognized by Google).  I don't know what to do about it :(
Title: Re: Multiple Boards (again)
Post by: Elmacik on November 23, 2005, 03:34:42 AM
Any updates on this?
We can share the tables but counting totals is not done automatically... What should we do?
Title: Re: Multiple Boards (again)
Post by: drhamad on November 23, 2005, 03:39:13 PM
Any updates on this?
We can share the tables but counting totals is not done automatically... What should we do?

Counting totals is not done automatically?  What do you mean?
You will not get a seperate forum total post count for each forum with this mod (although I suppose it could be programmed in).  But you can get seperate user post counts for each forum, and a user total post count.

What is it that you can't get working?
Title: Re: Multiple Boards (again)
Post by: Elmacik on November 23, 2005, 03:43:20 PM
The thing that doesnt work is:
When someone registers on one forum, the other forum doesnt count him and doesnt show him as the lastest member.
The member amount is not the same in both forums althouh members table is shared.
[unknown] has given a hack to do this but its very old and new codes are changed much..
Title: Re: Multiple Boards (again)
Post by: drhamad on November 23, 2005, 09:43:03 PM
The thing that doesnt work is:
When someone registers on one forum, the other forum doesnt count him and doesnt show him as the lastest member.
The member amount is not the same in both forums althouh members table is shared.
[unknown] has given a hack to do this but its very old and new codes are changed much..

Are you sure you're talking about this mod?  There aren't any shared or not shared tables in this mod - everything is shared.
Title: Re: Multiple Boards (again)
Post by: drhamad on August 19, 2006, 02:52:57 PM
A problem to updating this to SMF 1.1 RC3 (from SMF 1.0.5):

This function seems to have moved:
Quote
   OPEN Post.php
   
FIND
updateMemberData($ID_MEMBER, array('posts' => 'posts + 1'));

REPLACE WITH
updateMemberData($ID_MEMBER, array('posts' => 'posts + 1', 'posts' . $GLOBALS['ID_FORUM'] => 'posts' . $GLOBALS['ID_FORUM'] . ' + 1'));
Title: Re: Multiple Boards (again)
Post by: mytreo on October 24, 2007, 05:42:36 AM
Hi drhamad, I am too wanting to use this similar mod for our forums too...

I see your forums are now using SMF 1.1.x so did you fix the problem above?

I believe the function has now changed and is in Subs-Post.php at around line 1660:

Code: [Select]
        // Increase the post counter for the user that created the post.
        if (!empty($posterOptions['update_post_count']) && !empty($posterOptions['id']))
        {
                // Are you the one that happened to create this post?
                if ($ID_MEMBER == $posterOptions['id'])
                        $user_info['posts']++;
                updateMemberData($posterOptions['id'], array('posts' => '+'));
        }

I am thinking that changing the above to something like this would do the trick...

Code: [Select]
        // Increase the post counter for the user that created the post.
        if (!empty($posterOptions['update_post_count']) && !empty($posterOptions['id']))
        {
                // Are you the one that happened to create this post?
                if ($ID_MEMBER == $posterOptions['id']) {
                        $user_info['posts']++;
                        $user_info['posts' . $GLOBALS['ID_FORUM'] . '']++; // <-- Not too sure about this bit
                }
                updateMemberData($posterOptions['id'], array('posts' => '+', 'posts' . $GLOBALS['ID_FORUM'] => '+'));
        }

Can you offer any advice?

Thanks
Chris
Title: Re: Multiple Boards (again)
Post by: azn_romeo_4u on May 18, 2009, 11:28:02 PM
I am looking for the same solution.  I'm going to try use though, the one posted above and see what happens.  Anyone got development going on this?
Title: Re: Multiple Boards (again)
Post by: drhamad on May 28, 2009, 10:08:26 PM
Well, it has been a couple years.  We still use a solution in some way similar to this, but we've done a lot of development on it.  Unfortunately, I don't have an easily packagable and useable solution.  Our solution at this point is MUCH more advanced than what you see in this thread, but at the same time, utterly not acceptable as an SMF package due to its... hacked together... nature.

I would recommend seeing if vbgamers (smfhacks.com) publicly released mutliforum package does what you need.  I haven't tried it and can't actually recommend whether or not you should USE it.