• Welcome to Simple Machines Community Forum. Please login or sign up.
December 02, 2021, 08:36:17 AM

News:

Want to get involved in developing SMF, then why not lend a hand on our github!


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

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

Previous topic - Next topic

Quinn

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

Some would say that all cookies named the same won't work but... it works for me. Good Luck!

nw

Brilliant. Thanks, Quinn! It works perfect after I changed the cookies names. I'm wondering if there is any implications in having the same cookie name for all the forums?

FireDitto

How do you change the cookie name without slaughtering the site? I've never had any success with that.
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

nw

I changed the cookie name for the 2nd and 3rd forum to the main forum in the Settings.php file. That was all I did FireDitto. It is working fine now, I've logged out and logged in multiple times to try it. I will report if there is a problem with this.

FireDitto

September 18, 2011, 04:22:33 AM #444 Last Edit: September 18, 2011, 04:56:11 AM by FireDitto
Hrm. I changed the cookie name of the second forum to that of the first, and allowed for subdomain independents. They are sharing the sessions on the database.

However, I've cleared the cache and done refreshes, but they aren't linking for me... well, not in a good way, anyway. Instead of going "Oh, you're logged in on A, I'll log you in on B" it goes "OMG! INTRUDER! *logs out on all forums*"

Say I logged in on ForumA. I'm totally fine to stay logged in there -- until I go refresh the page on ForumB, which results in ForumA being logged out, and ForumB remaining logged out and/or logging out and asking to be logged in.

o_o where did I mess up?


EDIT: I also tried without the subdomain independents. Now, I'm allowed to be logged in on both... but I have to manually log in to both; it isn't picking up that I'm logged into one and echoing it.
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

nw

Mine seems to work fine with the Subaccounts mod too. I've left the "Enable local storage of cookies" and "Use subdomain independent cookies" unticked in all forums, while "Use database driven sessions" and "Allow browsers to go back to cached pages" are both ticked.

FireDitto

September 18, 2011, 06:22:16 AM #446 Last Edit: September 18, 2011, 06:39:19 AM by FireDitto
Hrm. My settings are the same there, too. Same ones off, same ones on. I wonder what's going on?

Did you share the Subaccounts on the database? I don't know if that would effect it, but I figured I'd ask anyway.

... it probably  has something to do with the fact that, somehow, I missed sharing the database members >_>

Damnit. Or not. Shared members, now, but still not sharing sessions.
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

nw

Yep, I shared the subaccounts db table. Also the session table.

Edit: If it's still not working. Maybe try it on new forums. I wonder if it might be one of the mods?

FireDitto

I got it!

I had the OpenID enabled, but not shared. I disabled it, and now it works.

Thanks for your assistance =D
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

FireDitto

How were you able to allow registration on one, but not the other two?

I am unable to duplicate this.

=/
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

TaGBaN

I just went thru and did this, also included spiders, ban_items, sesisons, etc.

First: Cookies are definately not working for me, neither are sessions cross domains.
- Both DOMAINS are on the same webserver, so sharing DB was easy.
Second: I was trying to follow [Unknown]'s initial instructions for sharing "Last Member Registered", and "Register Count", but was unable to. I am using SMF 2.0.1.

My domains: http://www.bnet.cc // http://www.earena.net/

Any help is welcome!

nw

@FD:

Ideally, we should edit the register() function and redirect it to the first board, but I'm too lazy to do that so I just hardcode the link.

In the Source/Subs.php file, change the 'register' => array(
'title' => $txt['register'],
'href' => $scripturl . '?action=register',
'show' => $user_info['is_guest'],
'sub_buttons' => array(
),
'is_last' => !$context['right_to_left'],
),


to false like this:

'register' => array(
'title' => $txt['register'],
'href' => $scripturl . '?action=register',
'show' => false,
'sub_buttons' => array(
),
'is_last' => !$context['right_to_left'],
),


If you want to completely disable the registration button on the child boards. Or you can also redirect them to the main board using this code:

'register' => array(
'title' => $txt['register'],
'href' => 'your main site registration link here',
'show' => $user_info['is_guest'],
'sub_buttons' => array(
),
'is_last' => !$context['right_to_left'],
),



You will also need to edit your theme. This is the edit in the default theme:

Themes/default/language/index.english.php

Look for:

$txt['login_or_register'] = 'Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>.';

And remove the registration link:

$txt['login_or_register'] = 'Please <a href="' . $scripturl . '?action=login">login</a>';



@ TaGBaN

Haven't tried the instruction for the register count Yet. Sorry!

TaGBaN

Its ok, I did EVERYTHING with database redirects, so thatthere isn't any confusion. I used the SQL "VIEW" command and linked them together that way. So that if SMF updates, it shouldn't mess up anything. Definately works smoothly, just really worried about the 'Cookies' and Database sessions not working right now. Anyone have ideas about those?

FireDitto

Tagban... If you also linked "messages" you're going to run into the issue I had: the topics with the same number will be duplicated across all linked forums. 
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

FireDitto

I changed hosts... But in re-setting everything, it appears that my forums are not going to read the 'shared' settings required in the database...

How can I fix this??
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

Wh0CaREs

I have question well when i go to online members i see

User    Time    Action
Online SworDFisH    04:27:18 PM    Viewing Who's Online.
Online Gallardo     04:19:38 PM    Viewing the topic Welcome to SMF!.

And when i want to lick one Welcome to SMF it redirect me to 2 forum because i watch secund forum, but this theme was on first forum... How i can fix that it link to right forum and right post?

Eudemon

that's one of the conflict issue with sharing log_online
for example
when an user view one topic, its action will be recorded and stored to database with the board, topic id, but not domain
so even he is actually viewing one topic in 2nd forum, when the 1st forum fetches info from that table, that row will be loaded as if he is on the 1st forum doing the action in that specific topic/board id

there are two solutions to this problem i can think of (if you have other idea please share it)
1, do not share log_online, each site will display its own traffic, obviously less than when share the log which combines two sites' traffics
2, modify that part of smf function, for example, add domain name to the query when storing to db, and also modify the function when fetch from db, simply read and add domain to the action link, to make it fancy, if you want to make it display whole link only when it's not the same domain, just add a condition check before hand

of course, it's easier to say than do it, but this theory(logic) should probably work

luuuciano

I do not remember how pmx-subforums mod handle it... (in fact, I have disabled the who section of our forum)
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).

Wh0CaREs

Quote from: Eudemon on March 29, 2012, 08:38:42 PM
that's one of the conflict issue with sharing log_online
for example
when an user view one topic, its action will be recorded and stored to database with the board, topic id, but not domain
so even he is actually viewing one topic in 2nd forum, when the 1st forum fetches info from that table, that row will be loaded as if he is on the 1st forum doing the action in that specific topic/board id

there are two solutions to this problem i can think of (if you have other idea please share it)
1, do not share log_online, each site will display its own traffic, obviously less than when share the log which combines two sites' traffics
2, modify that part of smf function, for example, add domain name to the query when storing to db, and also modify the function when fetch from db, simply read and add domain to the action link, to make it fancy, if you want to make it display whole link only when it's not the same domain, just add a condition check before hand

of course, it's easier to say than do it, but this theory(logic) should probably work
Then i wont share log :D

DenDen60

I need to develop a forum that includes a  lot of sub forums. Anyone  remembers smfxxl? Someone used to specialize in this a few years back?

Thanks

Denis

Advertisement: