Advertisement:

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

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Multiple Boards (again)
« Reply #20 on: December 17, 2004, 02:48:08 PM »
I really suggest you send an email or pm to Compuart, 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]

Offline drhamad

  • Sophist Member
  • *****
  • Posts: 1,358
  • Gender: Male
    • FMVperformance Automotive Communities
Re: Multiple Boards (again)
« Reply #21 on: December 17, 2004, 03:49:16 PM »
I really suggest you send an email or pm to Compuart, 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.
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 #22 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.
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 Peter Duggan

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,664
  • Gender: Male
    • Peat Stack or Pete's Tack?
Re: Multiple Boards (again)
« Reply #23 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.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Multiple Boards (again)
« Reply #24 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]

Offline drhamad

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


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]

Offline drhamad

  • Sophist Member
  • *****
  • Posts: 1,358
  • Gender: Male
    • FMVperformance Automotive Communities
Re: Multiple Boards (again)
« Reply #27 on: December 19, 2004, 02:55:26 AM »
is that "reply" button able to be put in the news menu?
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 #28 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]

Offline drhamad

  • Sophist Member
  • *****
  • Posts: 1,358
  • Gender: Male
    • FMVperformance Automotive Communities
Re: Multiple Boards (again)
« Reply #29 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.
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 #30 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]

Offline drhamad

  • Sophist Member
  • *****
  • Posts: 1,358
  • Gender: Male
    • FMVperformance Automotive Communities
Re: Multiple Boards (again)
« Reply #31 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.
« Last Edit: December 19, 2004, 02:56:47 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 drhamad

  • Sophist Member
  • *****
  • Posts: 1,358
  • Gender: Male
    • FMVperformance Automotive Communities
Re: Multiple Boards (again)
« Reply #32 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)
« Last Edit: December 20, 2004, 08:38:32 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 Peter Duggan

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,664
  • Gender: Male
    • Peat Stack or Pete's Tack?
Re: Multiple Boards (again)
« Reply #33 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.

Offline drhamad

  • Sophist Member
  • *****
  • Posts: 1,358
  • Gender: Male
    • FMVperformance Automotive Communities
Re: Multiple Boards (again)
« Reply #34 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.
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 #35 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]

Offline drhamad

  • Sophist Member
  • *****
  • Posts: 1,358
  • Gender: Male
    • FMVperformance Automotive Communities
Re: Multiple Boards (again)
« Reply #36 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.
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 #37 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.
« Last Edit: December 24, 2004, 01:25:39 AM 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 drhamad

  • Sophist Member
  • *****
  • Posts: 1,358
  • Gender: Male
    • FMVperformance Automotive Communities
Re: Multiple Boards (again)
« Reply #38 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? :)
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 Jerry

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,903
  • Gender: Male
  • What? I can't hear you over my awesomeness!!
    • PlanetSMF
Re: Multiple Boards (again)
« Reply #39 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 ;)
- Jerry
Find me on:
Facebook
Twitter
PlanetSMF

"If all you look for is the negative in things, you will never see the positive."