This was for the topic here: http://www.simplemachines.org/community/index.php?topic=16190.0
Hi,
I am having this same problem:
Quote from: Nic on October 26, 2004, 11:41:05 AM
Firstly, thanks SO much for this post - it was exactly what I needed. I now have two forums for two sub-domains on the same site using one member table, which is just what I wanted. however, I did notice one thing (no biggy, but wondered if I could fix it). If someone registers on one forum, the member count automatically adds another one on, but on the other forum it doesn't and I have to tell it to recount the totals. it's not a big hassle at the moment, since both forums are just new and not many people are registering, but if the forums get bigger it could be annoying having to recount totals each time a new member joins. Is there any way around this?
and the fix for it was:
Quote from: [Unknown] on October 31, 2004, 05:41:46 AM
Find, Sources/Subs.php:
updateSettings(array(
'latestMember' => $latestmember,
'latestRealName' => $latestRealName,
'memberCount' => $memberCount,
'unapprovedMembers' => $unapprovedCount
));
Replace:
db_query("
REPLACE INTO prefix1_settings
VALUES ('latestMember', '$latestmember'),
('latestRealName', '$latestRealName'),
('memberCount', '$memberCount'),
('unapprovedMembers', '$unapprovedCount')", __FILE__, __LINE__);
db_query("
REPLACE INTO prefix2_settings
VALUES ('latestMember', '$latestmember'),
('latestRealName', '$latestRealName'),
('memberCount', '$memberCount'),
('unapprovedMembers', '$unapprovedCount')", __FILE__, __LINE__);
-[Unknown]
But I cannot find those codes for SMF 1.1.6. Can someone help me with it? Thanks.
You can use "Find in Files" feature in notepad++.
Put some of that code in the search box and point it to a fresh extracted SMF Package.
It will go through all SMF Files and return a list of files with that code in them, that's what I use when I need to find a line of code from SMF 1 in SMF 2 :)
-[n3rve]
[n3rve],
You do not understand. The code that I posted from the quote made by Unknown was from like the 1.0 branch. If someone can find what is supposed to be the same code but for 1.1, that would be great.
Thanks,
Brian
*BUMP*
Edit the updateStats() function in Subs.php in the same way. Only the 'member' case but.
Thanks [SiNaN], now known as Blue Dream. :)
I will try it, and let you know how it goes.
Any updates?
Sorry, haven't tested it yet. I will be testing it tonight.
Blue Dream/[SiNaN],
I am confused by the coding inside this file... Could you please provide the simple Find & Replace instructions if possible. For SMF 1.1.7.
Thanks,
Brian
Bump
:) Bump
Find:
updateSettings($changes);
Replace:
foreach ($changes as $key => $change)
{
db_query("
REPLACE INTO prefix1_settings
VALUES ('" . $key . "', '" . $change . "')", __FILE__, __LINE__);
db_query("
REPLACE INTO prefix2_settings
VALUES ('" . $key . "', '" . $change . "')", __FILE__, __LINE__);
}
Ok, thank you. :) That does I guess what it is supposed to do. It updates BOTH forums when it is recounted on one of them.
Could you code something where if a new member registers on one site, the member count goes up on both forums?
Thanks. :)
Brian
BUMP
Quote from: brianjw on December 07, 2008, 10:24:49 PM
Ok, thank you. :) That does I guess what it is supposed to do. It updates BOTH forums when it is recounted on one of them.
Could you code something where if a new member registers on one site, the member count goes up on both forums?
Register function uses the same updateStats() function. So it should already be like that.
foreach ($changes as $key => $change)
{
db_query("
REPLACE INTO prefix1_settings
VALUES ('" . $key . "', '" . $change . "')", __FILE__, __LINE__);
db_query("
REPLACE INTO prefix2_settings
VALUES ('" . $key . "', '" . $change . "')", __FILE__, __LINE__);
}
How do you code this if you have more than 2 forums sharing the user database?
MarkJ, this is just a guess but I would think you just add more of this code after the other depending on how many forums you are sharing.
db_query("
REPLACE INTO prefix3_settings
VALUES ('" . $key . "', '" . $change . "')", __FILE__, __LINE__);
db_query("
REPLACE INTO prefix4_settings
VALUES ('" . $key . "', '" . $change . "')", __FILE__, __LINE__);
Just change the prefixes to match to your forums and add them in the code. It's worth a try anyway. ;)
Yeah, that's it.
brianjw:
Could you get the issue solved or do you still require assistance?
Seems to work fine!
I should have been able to work that out myself!
Cheers.
Blue Dream,
Thank you for asking. I still require assistance.
I have made that one code change you made here (http://www.simplemachines.org/community/index.php?topic=271586.msg1829413#msg1829413) but it still doesn't automatically update both sites stats. The two forums are sharing just the members so the members should be updating automatically on both forums when someone registers on either site. Currently, it just makes it so that when you run the Maintenance, it updates both forums instead of the one you're on right then. Do you think you can modify something a bit to be able to automatically update members on both forums? Thank you.
Brian
In which forum files did you make the change? Does it the same for registrations from both forums?
I think. I combined the sites together using this tutorial: http://www.simplemachines.org/community/index.php?topic=16190.0
which tells me to modify ALL the Sources files so I did.
Anyone found the solution to this yet?
Do you update all forums with the code or just your sub forums, aka not the main forum.
Also are you suppose to use it with this mod?
http://www.simplemachines.org/community/index.php?topic=16190.msg690178#msg690178
Is this issue solved or do you still require assistance?
-[n3rve]
I personally no longer require assistance because I am no longer working on this, however it looks like someone else requires assistance:
Quote from: azn_romeo_4u on May 18, 2009, 06:31:32 PM
Anyone found the solution to this yet?
Do you update all forums with the code or just your sub forums, aka not the main forum.
Also are you suppose to use it with this mod?
http://www.simplemachines.org/community/index.php?topic=16190.msg690178#msg690178
Solution:
http://www.simplemachines.org/community/index.php?topic=16190.msg2564370#msg2564370
p.s. maybe you should change the topic title.