Advertisement:

Author Topic: Share user database for 2 (or more) different forums.  (Read 380612 times)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Share user database for 2 (or more) different forums.
« Reply #300 on: March 27, 2010, 05:47:31 PM »
Quote
At the same time, share the avatar / attachment table using this tips.

Incredibly bad idea!

Assuming you have two topic and two message tables, you'll be duplicating attachments unless you modify all the attachment handling code too (have fun with that)

Basically, an attachment is attached to a post by id. If you attach a file to message id 1000, the same attachment is visible in BOTH sides' message 1000.
No good deed goes unpunished
All helpful urges should be circumvented

Offline Hj Ahmad Rasyid Hj Ismail

  • SMF Hero
  • ******
  • Posts: 4,905
  • Gender: Male
  • Busy mode is on.
    • ahmad.rasyid.ismail on Facebook
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • @ahrasis on Twitter
    • ElkArte Malaysia
Re: Share user database for 2 (or more) different forums.
« Reply #301 on: March 27, 2010, 06:20:14 PM »
Incredibly bad idea!

Assuming you have two topic and two message tables, you'll be duplicating attachments unless you modify all the attachment handling code too (have fun with that)

Basically, an attachment is attached to a post by id. If you attach a file to message id 1000, the same attachment is visible in BOTH sides' message 1000.
Wow... ok.
Note that member avatars are shared if they use an external URL or pick from the gallery (since that's stored in the members table, along with their post count) but not if they upload their own (since that's stored in the attachments table)
So we just leave the last part for the time being and do not allow members to upload but they can instead use an external URL or pick from the gallery? Will that be fine Arantor?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Share user database for 2 (or more) different forums.
« Reply #302 on: March 27, 2010, 06:32:27 PM »
Yeah, that works.
No good deed goes unpunished
All helpful urges should be circumvented

Offline Hj Ahmad Rasyid Hj Ismail

  • SMF Hero
  • ******
  • Posts: 4,905
  • Gender: Male
  • Busy mode is on.
    • ahmad.rasyid.ismail on Facebook
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • @ahrasis on Twitter
    • ElkArte Malaysia
Re: Share user database for 2 (or more) different forums.
« Reply #303 on: March 27, 2010, 06:39:58 PM »
Thanks a lot for your patience, tips and supports.
« Last Edit: June 15, 2010, 09:02:03 AM by Abu Fahim Ismail »

Offline Mr. Doug

  • Jr. Member
  • **
  • Posts: 160
  • Gender: Male
    • Putter Talk
Re: Share user database for 2 (or more) different forums.
« Reply #304 on: March 27, 2010, 08:22:14 PM »
Ok...so that was the most painless process on the planet. (after I got everything in the same DB)

RC3, up and running with no issues using the MySQL method. The only thing I'd add is that you need to make sure you "recount forum statistics" after you link them all to the same user DB. I'm showing the correct count across 3 sites now. (Soon to be 4...as soon as I can figure out how to import 25,000 phpBB3 users to my SMF installation.)
--
Doug Hardman
doug (at) puttertalk (dot) com

Offline Hj Ahmad Rasyid Hj Ismail

  • SMF Hero
  • ******
  • Posts: 4,905
  • Gender: Male
  • Busy mode is on.
    • ahmad.rasyid.ismail on Facebook
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • @ahrasis on Twitter
    • ElkArte Malaysia
Re: Share user database for 2 (or more) different forums.
« Reply #305 on: March 28, 2010, 05:49:08 AM »
Ok...so that was the most painless process on the planet. (after I got everything in the same DB)

RC3, up and running with no issues using the MySQL method. The only thing I'd add is that you need to make sure you "recount forum statistics" after you link them all to the same user DB. I'm showing the correct count across 3 sites now. (Soon to be 4...as soon as I can figure out how to import 25,000 phpBB3 users to my SMF installation.)

By the way, do you face any problems with cookie(s)? It seems like I cannot login or logout or do certain admin settings properly. I bothers me when it says "You were unable to login. Please check your cookie settings." I have tried cleaning cookies, clear caches, setting new cookies' name, using repair_settings.php and even re-upgrade to RC3 with no success at all.

Any advices guys?

Offline Mr. Doug

  • Jr. Member
  • **
  • Posts: 160
  • Gender: Male
    • Putter Talk
Re: Share user database for 2 (or more) different forums.
« Reply #306 on: March 28, 2010, 08:26:56 AM »
I've had no issues with cookies. Just make sure your cookies aren't named the same way. (keep them all different.)
--
Doug Hardman
doug (at) puttertalk (dot) com

Offline Hj Ahmad Rasyid Hj Ismail

  • SMF Hero
  • ******
  • Posts: 4,905
  • Gender: Male
  • Busy mode is on.
    • ahmad.rasyid.ismail on Facebook
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • @ahrasis on Twitter
    • ElkArte Malaysia
Re: Share user database for 2 (or more) different forums.
« Reply #307 on: March 28, 2010, 10:54:59 AM »
I guess my mod is creating this problem. Thanks anyway.

Offline forfun

  • Jr. Member
  • **
  • Posts: 226
Re: Share user database for 2 (or more) different forums.
« Reply #308 on: March 29, 2010, 01:17:25 AM »
If the second forum is located in a sub-domain and in a different database, but both databases are located in the same server, will it be able to "share" the same members/PM accounts.
Thanks much in advanced

Offline Mr. Doug

  • Jr. Member
  • **
  • Posts: 160
  • Gender: Male
    • Putter Talk
Re: Share user database for 2 (or more) different forums.
« Reply #309 on: March 29, 2010, 08:38:17 AM »
I found a caveat to a shared member DB. Make sure all the Themes on your boards are numbered the same way. If I make a change the default to one (and reset the members options), all 3 get the change pushed.
--
Doug Hardman
doug (at) puttertalk (dot) com

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Share user database for 2 (or more) different forums.
« Reply #310 on: March 29, 2010, 08:41:20 AM »
Note also that custom profile fields are also in that table...
No good deed goes unpunished
All helpful urges should be circumvented

Offline Mr. Doug

  • Jr. Member
  • **
  • Posts: 160
  • Gender: Male
    • Putter Talk
Re: Share user database for 2 (or more) different forums.
« Reply #311 on: March 30, 2010, 02:02:59 PM »
Here's another thought...if I share the banlogs and ban-triggers, would that translate? I can't imagine it wouldn't, but thought I'd ask before I just went and shared them.
--
Doug Hardman
doug (at) puttertalk (dot) com

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Share user database for 2 (or more) different forums.
« Reply #312 on: March 30, 2010, 02:09:54 PM »
That should be fine.
No good deed goes unpunished
All helpful urges should be circumvented

Offline j4r3k

  • Newbie
  • *
  • Posts: 6
Re: Share user database for 2 (or more) different forums.
« Reply #313 on: March 31, 2010, 06:49:47 AM »
Hello,
I have successfully merged more than 2 forums together (running SMF 1.1.11). Sharing tables:
members
membergroups
personal_messages
pm_recipients
log_online
smileys

My PROBLEM is when new user registers the info about totalusers and latest member does not update.
Someone posted a solution here but it doesn't work.
Only the latestRealName field in _settings tables is updated, but the totalMembers does not update.

Any ideas how to fix it?
« Last Edit: March 31, 2010, 12:27:07 PM by j4r3k »

Offline Mr. Doug

  • Jr. Member
  • **
  • Posts: 160
  • Gender: Male
    • Putter Talk
Re: Share user database for 2 (or more) different forums.
« Reply #314 on: March 31, 2010, 08:36:06 AM »
I ran into the same thing. If you run the "update statistics" maintenance, it fixes it. So now I just run that every few days until I can get around to writing a cron script that does it for me. Everything functions correctly, it just doesn't update the number of users in the bottom of the page..
--
Doug Hardman
doug (at) puttertalk (dot) com

Offline j4r3k

  • Newbie
  • *
  • Posts: 6
Re: Share user database for 2 (or more) different forums.
« Reply #315 on: March 31, 2010, 09:08:27 AM »
There must be a way to solve this.
From my investigation it works this way:
even if you manually update all the _settings tables (fields: latestMember, totalMembers) the info won't show at the bottom of main page, action that updates stats must take place - user registers for example - but then this action does not update _settings tables regardless of the code I included above, so your are 1 user behind already  :(

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Share user database for 2 (or more) different forums.
« Reply #316 on: March 31, 2010, 10:20:39 AM »
Did you also:
* update $modSettings in memory?
* force the cache to be emptied?
No good deed goes unpunished
All helpful urges should be circumvented

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Share user database for 2 (or more) different forums.
« Reply #317 on: March 31, 2010, 11:04:01 AM »
So what are you actually feeding $value as then?
No good deed goes unpunished
All helpful urges should be circumvented

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Share user database for 2 (or more) different forums.
« Reply #318 on: March 31, 2010, 11:26:24 AM »
How are you calling it exactly?
No good deed goes unpunished
All helpful urges should be circumvented

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Share user database for 2 (or more) different forums.
« Reply #319 on: March 31, 2010, 11:44:24 AM »
Code: [Select]
updateSettings(array('totalMembers' => true), true);
This is what I was looking for. Is that the line you're using?

See I don't understand how you've mashed up the code, to be quite blunt.
No good deed goes unpunished
All helpful urges should be circumvented