multi forum mode

Started by DenDen60, March 09, 2022, 03:45:37 PM

Previous topic - Next topic

DenDen60

If someones need a challenge, I would really like to have a mod that let me have multiple forums.

The best would be to have multiple instances of SMF, but using the same member database. 

vbgamer45

Could be done as long as on same server in same database just having different prefixes.
You would just do a replacement on smf_members table prefix_ with the main members table of forum that you are using. Would like modifying the smf database files.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

DenDen60

Quote from: vbgamer45 on March 09, 2022, 04:07:53 PMCould be done as long as on same server in same database just having different prefixes.
You would just do a replacement on smf_members table prefix_ with the main members table of forum that you are using. Would like modifying the smf database files.

So I would install a new instance of smf,  but use the same database as the 1st instance to install it, but with a different  prefixes. For example, if the 1st instances prefix is "SMF1", I use "SMF2" for the second installation.  Once installed, I would go change the  SMF2 _members table prefix to  SMF1 _members.

It this is it, than I should be able to do it myself. :-D 


Kindred

This exists for 2.0.x in the mod section
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Diego Andrés


SMF Tricks - Free & Premium Responsive Themes for SMF.

DenDen60


vbgamer45

That merges two forums together into one forum.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

DenDen60

Ok. This is not what I want to accomplish. I want two distincts forum with their own themes but sharing the same members' list. 

vbgamer45

#8
Quick dirty untested

Sources/Subs-Db-mysql.php
find
function smf_db_query($identifier, $db_string, $db_values = array(), $connection = null)
{
global $db_cache, $db_count, $db_connection, $db_show_debug;
global $db_unbuffered, $db_callback, $modSettings;

// Comments that are allowed in a query are preg_removed.
static $allowed_comments_from = array(
'~\s+~s',
'~/\*!40001 SQL_NO_CACHE \*/~',
'~/\*!40000 USE INDEX \([A-Za-z\_]+?\) \*/~',
'~/\*!40100 ON DUPLICATE KEY UPDATE id_msg = \d+ \*/~',
);
static $allowed_comments_to = array(
' ',
'',
'',
'',
);

// Decide which connection to use.
$connection = $connection === null ? $db_connection : $connection;
add after
global $db_prefix;
$db_string = str_replace("{db_prefix}members","yourmaindbprefix_members",$db_string);

Replace yourmaindbprefix_members with the members table prefix of your main table.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Kindred

The multi forum mod does exactly that....

Multiple forums on separate subdomains, choice for boards to be shared between subgroups or separate. User list is shared but can have access based on permission groups.
I THINK it can do different themes

Found it
https://custom.simplemachines.org/index.php?mod=2137
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

DenDen60


DenDen60

Oups. Something went wrong with my previous post. ;-) 

So here is what I wanted to post.

I will try both approach.

Question. 

How different is 2.1 versus 2.0?

I am under the impression that most mods in 2.0 will not work on 2.1. Is this a false impression?

Kindred

Quote from: DenDen60 on March 10, 2022, 07:45:24 AMI am under the impression that most mods in 2.0 will not work on 2.1. Is this a false impression?

Yes....  The more in-depth the mod, the less chance that it will work without further modification.
Mods which are "hooks only" are likely to work with little problem - mods with file edits are possibly going to encounter errors, depending on how old the mod is (php version dependent code, especially)
 
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

DenDen60


Quote from: vbgamer45 on March 09, 2022, 08:59:48 PMadd after
Code Select Expand
global $db_prefix;
$db_string = str_replace("{$db_prefix}members","yourmaindbprefix_members",$db_string);

Replace yourmaindbprefix_members with the members table prefix of your main table.
Hence if 

  • My 1st members table name is:  smfla_members , and
  • my 2nd community is :  smfez_members

I change my 2nd community  table name to smfla_members

Thus a member of community 1 will be able to access the community 2 and vice versa? 


vbgamer45

Should be able to if you make the change on 2nd community is :  smfez_members
The 2nd community's member table will be ignored. So if they were a member on smfez_members but not on smfla_members then they would need to reregister.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

DenDen60

Quote from: vbgamer45 on April 30, 2022, 08:46:24 AMShould be able to if you make the change on 2nd community is :  smfez_members
The 2nd community's member table will be ignored. So if they were a member on smfez_members but not on smfla_members then they would need to reregister.
OK, just to be clear. I have my main forum already in place. I am creating a new one. Hence there are no members in this second community.

By making the changes, all existing members of the community 1 will have access to community 2.

Any new members, whether they register through community 1 or community 2, will have access to both community.

Do I understand this properly?


vbgamer45

Yes that's how it should work.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

DenDen60

OK I inserted this code:


global $db_prefix;
$db_string = str_replace("{$db_prefix}members","smfla_members",$db_string);

It did not work.

I then try this, just in case, but it didn't work either. 


global $db_prefix;
$db_string = str_replace("{$db_prefix}members","smfla",$db_string);


My question is the following, shouldn't I give the complete path to the database?

Let us say that the first data base is 

user1_smf300_smfla_members


and the second one is


user1_smf301_smfEP_members,
should I point to  user1_smf300_smfla_members for it to work?

Arantor

Don't let them upload avatars.
Holder of controversial views, all of which my own.


vbgamer45

#19
If its a separate database then you have to add the database in front of it such as below. The period seperates the db name and the table
$db_string = str_replace("{db_prefix}members","databasename.smfla_members",$db_string);

Also you must check that your db user has permission to access both databases
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: