Advertisement:

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

Offline Quinn

  • Semi-Newbie
  • *
  • Posts: 50
    • BStreet"s Net
Re: Share user database for 2 (or more) different forums.
« Reply #440 on: September 17, 2011, 01:15:07 PM »
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!

Offline nw

  • Semi-Newbie
  • *
  • Posts: 31
Re: Share user database for 2 (or more) different forums.
« Reply #441 on: September 17, 2011, 05:39:35 PM »
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?

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 #442 on: September 17, 2011, 06:16:51 PM »
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

Offline nw

  • Semi-Newbie
  • *
  • Posts: 31
Re: Share user database for 2 (or more) different forums.
« Reply #443 on: September 17, 2011, 06:39:26 PM »
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.

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 #444 on: September 18, 2011, 04:22:33 AM »
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.
« Last Edit: September 18, 2011, 04:56:11 AM by FireDitto »
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

Offline nw

  • Semi-Newbie
  • *
  • Posts: 31
Re: Share user database for 2 (or more) different forums.
« Reply #445 on: September 18, 2011, 05:44:31 AM »
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.

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 #446 on: September 18, 2011, 06:22:16 AM »
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.
« Last Edit: September 18, 2011, 06:39:19 AM by FireDitto »
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.6 with SP 2.3.5

Offline nw

  • Semi-Newbie
  • *
  • Posts: 31
Re: Share user database for 2 (or more) different forums.
« Reply #447 on: September 18, 2011, 06:04:00 PM »
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?
« Last Edit: September 18, 2011, 07:02:40 PM by nw »

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 #448 on: September 18, 2011, 07:56:29 PM »
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

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 #449 on: September 19, 2011, 05:07:28 AM »
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

Offline TaGBaN

  • Semi-Newbie
  • *
  • Posts: 96
Re: Share user database for 2 (or more) different forums.
« Reply #450 on: September 19, 2011, 03:42:19 PM »
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!

Offline nw

  • Semi-Newbie
  • *
  • Posts: 31
Re: Share user database for 2 (or more) different forums.
« Reply #451 on: September 19, 2011, 07:51:05 PM »
@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
Code: [Select]
'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:

Code: [Select]
'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:

Code: [Select]
'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:

Code: [Select]
$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:

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


@ TaGBaN

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

Offline TaGBaN

  • Semi-Newbie
  • *
  • Posts: 96
Re: Share user database for 2 (or more) different forums.
« Reply #452 on: September 19, 2011, 09:48:48 PM »
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?

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 #453 on: September 20, 2011, 07:30:34 PM »
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

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 #454 on: January 06, 2012, 07:11:05 AM »
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

Offline Wh0CaREs

  • Semi-Newbie
  • *
  • Posts: 22
Re: Share user database for 2 (or more) different forums.
« Reply #455 on: March 29, 2012, 05:28:31 PM »
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?

Offline Eudemon

  • Sr. Member
  • ****
  • Posts: 807
  • An Anime Fan
    • KumaKuni
Re: Share user database for 2 (or more) different forums.
« Reply #456 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

Offline luuuciano

  • SMF Hero
  • ******
  • Posts: 2,978
    • http://cbasites.net/
Re: Share user database for 2 (or more) different forums.
« Reply #457 on: March 29, 2012, 09:58:23 PM »
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).

Offline Wh0CaREs

  • Semi-Newbie
  • *
  • Posts: 22
Re: Share user database for 2 (or more) different forums.
« Reply #458 on: March 31, 2012, 06:36:49 AM »
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

Offline DenDen60

  • Sr. Member
  • ****
  • Posts: 761
  • Gender: Male
    • CitizensAndSocieties on Facebook
    • ca.linkedin.com/in/citizensandsocieties/ on LinkedIn
    • @@Denis_Pageau on Twitter
    • Dialogum
Multi forum anyone here remember - SMFXXL Multi Forum System
« Reply #459 on: May 11, 2012, 10:43:23 AM »
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