Advertisement:

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

Offline luuuciano

  • SMF Hero
  • ******
  • Posts: 2,979
    • http://cbasites.net/
Re: Share user database for 2 (or more) different forums.
« Reply #420 on: August 29, 2011, 12:50:38 AM »
So... you have not linked theme table? and your user theme setup backs to default when changing between forums?
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

Offline FireDitto

  • Full Member
  • ***
  • Posts: 617
  • Gender: Female
  • Shadow In The Flame
    • @SPWeyr on Twitter
    • Second Pass Weyr RPG
Re: Share user database for 2 (or more) different forums.
« Reply #421 on: August 29, 2011, 04:30:21 AM »
Correct, the Themes table on the db has not been shared.


I have two sites; "OOC" and "MAIN". "MAIN" is not a sub-domain, OOC is.

I set OOC to be "Green Theme", and save it.
The page loads up afterwards, and the theme is visible.

I change tabs, and refresh MAIN, which had also been sporting Green Theme.
It re-loads in default Curve.

Re-assign Green Theme to MAIN, and it loads up.
Change tab, refresh OOC, and it is now default theme.

The site that defaults back to the Base theme, also UNchecks the "Green Theme" as a selectable Theme from the list.


This error wasn't happening before I zipped the Green Theme itself, and attempted to install it on the second site. So there COULD be something there that I screwed up, somehow, or something. But I don't know. It now does this error when I try to get the site to hold ANY personalised theme, not just the Green Theme. Until I uploaded GT on the OOC site, said OOC site was holding a modified Blue Theme.

The only real "error" that is showing up visually when I looked into things, is the profile screen shot, where the refreshed site is defaulting NO theme. It seems all fine and dandy in the admin portion, however. Screenshots #1 & #2.


« Last Edit: August 29, 2011, 06:22:11 AM by FireDitto »
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

Offline FireDitto

  • Full Member
  • ***
  • Posts: 617
  • Gender: Female
  • Shadow In The Flame
    • @SPWeyr on Twitter
    • Second Pass Weyr RPG
Re: Share user database for 2 (or more) different forums.
« Reply #422 on: September 01, 2011, 08:44:27 PM »
*bump* Is anyone able to help me at all??

I, somehow, managed to get it to work... I have NO idea how, though o_o
« Last Edit: September 01, 2011, 11:19:41 PM by FireDitto »
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

Offline Quinn

  • Semi-Newbie
  • *
  • Posts: 50
    • BStreet"s Net
Re: Share user database for 2 (or more) different forums.
« Reply #423 on: September 05, 2011, 12:02:42 PM »
I have a theme set for each forum (3) and don't allow users to select their own. No problems. The main forum has 2 separate forums in sub directories.  To simplify use and allow for a single log in on these I have shared these database tables :

ALTER TABLE smf2_members RENAME TO smf2_members_old;
ALTER TABLE smf2_personal_messages RENAME TO smf2_personal_messages_old;
ALTER TABLE smf2_pm_recipients RENAME TO smf2_pm_recipients_old;

ALTER TABLE smf3_members RENAME TO smf3_members_old;
ALTER TABLE smf3_personal_messages RENAME TO smf3_personal_messages_old;
ALTER TABLE smf3_pm_recipients RENAME TO smf3_pm_recipients_old;

ALTER TABLE smf_members RENAME TO shared_members;
ALTER TABLE smf_personal_messages RENAME TO shared_personal_messages;
ALTER TABLE smf_pm_recipients RENAME TO shared_pm_recipients;

CREATE VIEW smf_members AS SELECT * FROM shared_members;
CREATE VIEW smf_personal_messages AS SELECT * FROM shared_personal_messages;
CREATE VIEW smf_pm_recipients AS SELECT * FROM shared_pm_recipients;

CREATE VIEW smf2_members AS SELECT * FROM shared_members;
CREATE VIEW smf2_personal_messages AS SELECT * FROM shared_personal_messages;
CREATE VIEW smf2_pm_recipients AS SELECT * FROM shared_pm_recipients;

CREATE VIEW smf3_members AS SELECT * FROM shared_members;
CREATE VIEW smf3_personal_messages AS SELECT * FROM shared_personal_messages;
CREATE VIEW smf3_pm_recipients AS SELECT * FROM shared_pm_recipients;

ALTER TABLE smf_log_online RENAME TO shared_log_online;
ALTER TABLE smf2_log_online RENAME TO smf2_log_online_old;
ALTER TABLE smf3_log_online RENAME TO smf3_log_online_old;

CREATE VIEW smf_log_online AS SELECT * FROM shared_log_online;
CREATE VIEW smf2_log_online AS SELECT * FROM shared_log_online;
CREATE VIEW smf3_log_online AS SELECT * FROM shared_log_online;

ALTER TABLE smf_attachments RENAME TO shared_attachments;
ALTER TABLE smf2_attachments RENAME TO smf2_attachments_old;
ALTER TABLE smf3_attachments RENAME TO smf3_attachments_old;

CREATE VIEW smf_attachments AS SELECT * FROM shared_attachments;
CREATE VIEW smf2_attachments AS SELECT * FROM shared_attachments;
CREATE VIEW smf3_attachments AS SELECT * FROM shared_attachments;

ALTER TABLE smf_sessions RENAME TO shared_sessions;
ALTER TABLE smf2_sessions RENAME TO smf2_sessions_old;
ALTER TABLE smf3_sessions RENAME TO smf3_sessions_old;

CREATE VIEW smf_sessions AS SELECT * FROM shared_sessions;
CREATE VIEW smf2_sessions AS SELECT * FROM shared_sessions;
CREATE VIEW smf3_sessions AS SELECT * FROM shared_sessions;

Before doing this I also pointed the settings for attachments & avatars to the main forums directories. I use sub domain independent cookies (PROBABLY NOT NECESSARY IN MY SITUATION) with the same cookie name, database sessions & for all forums. Disabled registration on all but the main forum and can log in/out to all at the same time. I did not share the permissions or member groups so I can control user permissions on the other boards separately.

To keep the script kiddie's reg bots out, I  use the MOD's httpBL with Honey Pot with a few simple questions for registration on the main forum. 6719 Spammers blocked up until today

Everything is working very well.
« Last Edit: September 05, 2011, 12:11:48 PM by Quinn »

Offline FireDitto

  • Full Member
  • ***
  • Posts: 617
  • Gender: Female
  • Shadow In The Flame
    • @SPWeyr on Twitter
    • Second Pass Weyr RPG
Re: Share user database for 2 (or more) different forums.
« Reply #424 on: September 10, 2011, 04:42:53 AM »
@Quinn

I have the following tables shared... but still my forums aren't sharing a session.

The Forum Cookies are different {959, 335, 350}; but I'm kind of afraid to change the cookies in case I kill the site, which I've just opened. =/ They share everything else; database and all that junk. Like I said, everything is working properly -- except the accounts staying logged in across the sites.

Code: [Select]
shared_ads
 shared_ads_settings
 shared_awards
 shared_awards_categories
 shared_awards_members
 shared_cf_fields
 shared_cf_forms
 shared_group_moderators
 shared_membergroups
 shared_members
 shared_messages
 shared_personal_messages
 shared_pm_recipients
 shared_post_drafts
 shared_sessions
 shared_settings
 shared_subaccounts
 shared_subscriptions
 shared_tp_articles
 shared_tp_blocks
 shared_tp_data
 shared_tp_dldata
 shared_tp_events
 shared_tp_modules
 shared_tp_rates
 shared_tp_ratestats
 shared_tp_settings
 shared_tp_shoutbox
 shared_tp_variables


EDIT: The forums are sharing posted topics in related-numbered forums, too >_>... Which I don't understand... What did I share that I shouldn't have to cause that? O_O

EG, Site A and Board ID 1 has the post "Rules"
Site B and Board ID 1 brings up the post "Rules" when a new topic is posted in Site B's ID1 board...


WAIT; that would be "Messages", wouldn't it? How do I *un*share something??
« Last Edit: September 10, 2011, 05:02:12 AM by FireDitto »
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

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 #425 on: September 10, 2011, 05:49:23 AM »
I listed the note on the Caveat & Gotchas of this database mod:
This thread does discuss multiple ways of doing it, but all require significant change or come with significant caveats and gotchas. There's no simple way that actually works cleanly without any side effects :(
Avatar Caveat:
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)
Membergroup Caveat:
Yup, that's the idea but do see the caveats from me above, like about membergroups and so on.
Attachment Caveat:
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.
Cookie Caveat:
I've had no issues with cookies. Just make sure your cookies aren't named the same way. (keep them all different.)
Theme & Board Caveat:
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.
Custom Profile Caveat:
Note also that custom profile fields are also in that table...
Statistic Caveat:
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..
Hope this will help. Happy testing! ;)

Offline FireDitto

  • Full Member
  • ***
  • Posts: 617
  • Gender: Female
  • Shadow In The Flame
    • @SPWeyr on Twitter
    • Second Pass Weyr RPG
Re: Share user database for 2 (or more) different forums.
« Reply #426 on: September 10, 2011, 06:29:30 AM »
Thanks, Ahrasis, that's quite helpful =)

Quote
Attachment Caveat:
Quote from: Arantor on March 28, 2010, 07:47:31 AM
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.

Does this mean I should share the Topic and Message tables? I'm not sharing Avatars or Attachments, so I shouldn't be having the issue related to that... Yet my topics are all duplicating.

And if I make any changes, am I going to keep all the current posts, or are they at risk of being eaten some how?
« Last Edit: September 10, 2011, 06:37:21 AM by FireDitto »
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

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 #427 on: September 10, 2011, 06:41:38 AM »
Fireditto, just follow the link to each quoted facts given about Caveat & Gotchas to see whether it has been answered. The concern is that any pictures, avatars, smileys, attachments, etc. will be duplicated together with the topics and messages.

In this mod, thuswise, it is advisable that we do not allow members to upload any pictures, avatars, smileys, attachments, etc. as this will only complicates thing; but rather only allow members to use external / internal links for them.

I have tested this mod only once upon a time, may be I'll give it another look later on. But as a note, the original purpose of this mod is to mainly share user from one database, thus, I am not very sure if others such as topics and messages can be shared harmoniously.
« Last Edit: September 10, 2011, 06:47:28 AM by ahrasis »

Offline Quinn

  • Semi-Newbie
  • *
  • Posts: 50
    • BStreet"s Net
Re: Share user database for 2 (or more) different forums.
« Reply #428 on: September 10, 2011, 12:11:53 PM »
Cookie Caveat:
I've had no issues with cookies. Just make sure your cookies aren't named the same way. (keep them all different.)
These posts all relate to SMF v.1.1.xx and may not be relevant to SMF 2.0.xx

@FireDitto

I don't know how it would work if you didn't. I use database sessions and the same cookie_name with no issues. If you run into a problem renaming them to be different and clear your browsers cookies cache will fix it.

All forums attachments & avatars point to the same place in settings. Every attachment for a post has a unique identifier name and have yet to see issues with confused posts.

I have no issues with themes since I set one per site and don't allow users to select their own.

You answered your own question.. don't share the smf_message tables or all boards will be confused. Simply remove the shared tables by reversing the table changes. I would bet that all posts created after the view was created will be lost to the other boards and remain on the main board.?

When you reset the original table name your views will be orphaned and a database error will fill the logs until these views are deleted.

« Last Edit: September 10, 2011, 12:49:39 PM by Quinn »

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 #429 on: September 10, 2011, 12:48:35 PM »
If you read, it does relate to SMF 2.0.

Offline Quinn

  • Semi-Newbie
  • *
  • Posts: 50
    • BStreet"s Net
Re: Share user database for 2 (or more) different forums.
« Reply #430 on: September 10, 2011, 12:58:31 PM »
If you read, it does relate to SMF 2.0.

and some refer to 1.1.11 further down the page from that particular post stating they had no issues.

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 #431 on: September 10, 2011, 01:25:02 PM »
Cookie Caveat:
I've had no issues with cookies. Just make sure your cookies aren't named the same way. (keep them all different.)
These posts all relate to SMF v.1.1.xx and may not be relevant to SMF 2.0.xx
Mr Doug was using RC3 at that time.  I was the one asking and testing at that time too. The caveat is that you should use different cookies. He has no problem as he was using that approach.

Read again before you mislead somebody else. I won't be replying or arguing to this anymore.

Offline Quinn

  • Semi-Newbie
  • *
  • Posts: 50
    • BStreet"s Net
Re: Share user database for 2 (or more) different forums.
« Reply #432 on: September 10, 2011, 02:24:39 PM »
Read again before you mislead somebody else. I won't be replying or arguing to this anymore.

A bit testy, aren't you? No one is arguing here.. just a friendly clarification is all that is required.

I am only relating what works for my 3 linked forums...!

As this thread has had both 1.x and 2.x posts for the same discussion it is a bit confusing for anyone trying to discover the "FIX" for this issue.




good bye...
« Last Edit: September 10, 2011, 04:11:27 PM by Quinn »

Offline FireDitto

  • Full Member
  • ***
  • Posts: 617
  • Gender: Female
  • Shadow In The Flame
    • @SPWeyr on Twitter
    • Second Pass Weyr RPG
Re: Share user database for 2 (or more) different forums.
« Reply #433 on: September 12, 2011, 07:41:53 AM »
Okay, so... sorry for sounding dense, but how do I change "Shared messages" to "unshared messages"?



ALTER TABLE shared_messages RENAME TO smf_messages;
ALTER TABLE SMF2_messages_old RENAME TO SMF2_messages;
ALTER TABLE SMF3_messages_old RENAME TO SMF3_messsages;

CREATE VIEW smf_messages AS SELECT * FROM shared_messages;
CREATE VIEW SMF2_messages AS SELECT * FROM SMF2_messages_old;
CREATE VIEW SMF3_messages AS SELECT * FROM SMF3_messages_old;


... Does that look about right?
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

Offline Quinn

  • Semi-Newbie
  • *
  • Posts: 50
    • BStreet"s Net
Re: Share user database for 2 (or more) different forums.
« Reply #434 on: September 12, 2011, 08:52:56 AM »
First, Delete the views you created, then you can rename messages_old to smf_messages

ALTER TABLE shared_messages RENAME TO smf_messages;
ALTER TABLE SMF2_messages_old RENAME TO SMF2_messages;
ALTER TABLE SMF3_messages_old RENAME TO SMF3_messsages;


« Last Edit: September 12, 2011, 09:00:56 AM by Quinn »

Offline luuuciano

  • SMF Hero
  • ******
  • Posts: 2,979
    • http://cbasites.net/
Re: Share user database for 2 (or more) different forums.
« Reply #435 on: September 12, 2011, 09:05:13 AM »
DROP VIEW viewname;
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

Offline FireDitto

  • Full Member
  • ***
  • Posts: 617
  • Gender: Female
  • Shadow In The Flame
    • @SPWeyr on Twitter
    • Second Pass Weyr RPG
Re: Share user database for 2 (or more) different forums.
« Reply #436 on: September 13, 2011, 04:42:52 AM »
I dropped the "shared_messages;" table... Am I meant to drop any others? The original message ones?


Code: [Select]
Error
SQL query:

ALTER TABLE adminSP_messages_old RENAME TO adminSP_messages;


MySQL said:

#1050 - Table 'adminSP_messages' already exists
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

Offline FireDitto

  • Full Member
  • ***
  • Posts: 617
  • Gender: Female
  • Shadow In The Flame
    • @SPWeyr on Twitter
    • Second Pass Weyr RPG
Re: Share user database for 2 (or more) different forums.
« Reply #437 on: September 13, 2011, 04:50:52 AM »
Nvm.
« Last Edit: September 15, 2011, 07:23:16 AM by FireDitto »
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

Offline FireDitto

  • Full Member
  • ***
  • Posts: 617
  • Gender: Female
  • Shadow In The Flame
    • @SPWeyr on Twitter
    • Second Pass Weyr RPG
Re: Share user database for 2 (or more) different forums.
« Reply #438 on: September 15, 2011, 07:45:59 AM »
Okay; I re-did my site. Aside from the mess up with the messages sharing, I think I did okay with the linked databases.

However, I was just looking for second opinion or whatever regarding the sharing of the following;

Code: [Select]
ads
ads_settings
awards
awards_categories
awards_members
group_moderators
log_karma
log_online
membergroups
members
personal_messages
pm_recipients
post_drafts
sessions
settings
subaccounts
subscriptions
tags
tags_log
themes
tp_articles
tp_blocks
tp_data
tp_dldata
tp_dlmanager
tp_events
tp_modules
tp_rates
tp_ratestats
tp_settings
tp_shoutbox
tp_variables

Do any of these strike as trouble-makers when shared? Should something be shared that I haven't included?

Basic forum set up;
Forum A = out of character chatter, information and everything that doesn't fit in the other two boards.
Forum B = Role Playing central.
Forum C = behind the scenes, where admin, moderators, staff, etc can spend time out of prying eyes.
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

Offline nw

  • Semi-Newbie
  • *
  • Posts: 34
Re: Share user database for 2 (or more) different forums.
« Reply #439 on: September 15, 2011, 08:13:33 AM »
Hey guys, I have a quick question. I installed 3 forums and did this:

I have a theme set for each forum (3) and don't allow users to select their own. No problems. The main forum has 2 separate forums in sub directories.  To simplify use and allow for a single log in on these I have shared these database tables :

ALTER TABLE smf2_members RENAME TO smf2_members_old;
ALTER TABLE smf2_personal_messages RENAME TO smf2_personal_messages_old;
ALTER TABLE smf2_pm_recipients RENAME TO smf2_pm_recipients_old;

ALTER TABLE smf3_members RENAME TO smf3_members_old;
ALTER TABLE smf3_personal_messages RENAME TO smf3_personal_messages_old;
ALTER TABLE smf3_pm_recipients RENAME TO smf3_pm_recipients_old;

ALTER TABLE smf_members RENAME TO shared_members;
ALTER TABLE smf_personal_messages RENAME TO shared_personal_messages;
ALTER TABLE smf_pm_recipients RENAME TO shared_pm_recipients;

CREATE VIEW smf_members AS SELECT * FROM shared_members;
CREATE VIEW smf_personal_messages AS SELECT * FROM shared_personal_messages;
CREATE VIEW smf_pm_recipients AS SELECT * FROM shared_pm_recipients;

CREATE VIEW smf2_members AS SELECT * FROM shared_members;
CREATE VIEW smf2_personal_messages AS SELECT * FROM shared_personal_messages;
CREATE VIEW smf2_pm_recipients AS SELECT * FROM shared_pm_recipients;

CREATE VIEW smf3_members AS SELECT * FROM shared_members;
CREATE VIEW smf3_personal_messages AS SELECT * FROM shared_personal_messages;
CREATE VIEW smf3_pm_recipients AS SELECT * FROM shared_pm_recipients;

ALTER TABLE smf_log_online RENAME TO shared_log_online;
ALTER TABLE smf2_log_online RENAME TO smf2_log_online_old;
ALTER TABLE smf3_log_online RENAME TO smf3_log_online_old;

CREATE VIEW smf_log_online AS SELECT * FROM shared_log_online;
CREATE VIEW smf2_log_online AS SELECT * FROM shared_log_online;
CREATE VIEW smf3_log_online AS SELECT * FROM shared_log_online;

ALTER TABLE smf_attachments RENAME TO shared_attachments;
ALTER TABLE smf2_attachments RENAME TO smf2_attachments_old;
ALTER TABLE smf3_attachments RENAME TO smf3_attachments_old;

CREATE VIEW smf_attachments AS SELECT * FROM shared_attachments;
CREATE VIEW smf2_attachments AS SELECT * FROM shared_attachments;
CREATE VIEW smf3_attachments AS SELECT * FROM shared_attachments;

ALTER TABLE smf_sessions RENAME TO shared_sessions;
ALTER TABLE smf2_sessions RENAME TO smf2_sessions_old;
ALTER TABLE smf3_sessions RENAME TO smf3_sessions_old;

CREATE VIEW smf_sessions AS SELECT * FROM shared_sessions;
CREATE VIEW smf2_sessions AS SELECT * FROM shared_sessions;
CREATE VIEW smf3_sessions AS SELECT * FROM shared_sessions;


Although I skipped the "attachments" tables for now.

My question: Is there a way to allow the user to sign in only once and yet be able to access all three board? Looking at what Quinn said, I should be able to accomplish this by altering these tables. I logged into the first forum but when I try to navigate the second and third forums, I need to log in again.

Thanks!