Share user database for 2 (or more) different forums.

Started by Spaceman-Spiff, September 03, 2004, 09:14:44 PM

Previous topic - Next topic

luuuciano

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).

FireDitto

#421
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.


Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

FireDitto

#422
*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
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Quinn

#423
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.

FireDitto

#424
@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.

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??
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Hj Ahmad Rasyid Hj Ismail

Quote from: ahrasis on June 15, 2010, 09:23:04 AM
I listed the note on the Caveat & Gotchas of this database mod:
Quote from: Arantor on March 23, 2010, 06:09:41 PM
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:
Quote from: Arantor on March 05, 2010, 07:15:54 AM
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:
Quote from: Arantor on March 09, 2010, 10:12:29 AM
Yup, that's the idea but do see the caveats from me above, like about membergroups and so on.
Attachment Caveat:
Quote from: Arantor on March 27, 2010, 05:47:31 PM
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:
Quote from: Mr. Doug 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.)
Theme & Board Caveat:
Quote from: Mr. Doug 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.
Custom Profile Caveat:
Quote from: Arantor on March 29, 2010, 08:41:20 AM
Note also that custom profile fields are also in that table...
Statistic Caveat:
Quote from: Mr. Doug 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..
Hope this will help. Happy testing! ;)

FireDitto

#426
Thanks, Ahrasis, that's quite helpful =)

QuoteAttachment 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?
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Hj Ahmad Rasyid Hj Ismail

#427
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.

Quinn

#428
Cookie Caveat:
Quote from: Mr. Doug 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.)
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.


Hj Ahmad Rasyid Hj Ismail


Quinn

Quote from: ahrasis on September 10, 2011, 12:48:35 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.

Hj Ahmad Rasyid Hj Ismail

Quote from: Quinn on September 10, 2011, 12:11:53 PM
Cookie Caveat:
Quote from: Mr. Doug 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.)
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.

Quinn

#432
Quote from: ahrasis on September 10, 2011, 01:25:02 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...

FireDitto

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<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Quinn

#434
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;



luuuciano

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).

FireDitto

I dropped the "shared_messages;" table... Am I meant to drop any others? The original message ones?


Error
SQL query:

ALTER TABLE adminSP_messages_old RENAME TO adminSP_messages;


MySQL said:

#1050 - Table 'adminSP_messages' already exists
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

FireDitto

#437
Nvm.
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

FireDitto

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;

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<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

nw

Hey guys, I have a quick question. I installed 3 forums and did this:

Quote from: Quinn 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;


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!

Advertisement: