Help with forums sharing same database.

Discussion forum for MOD Writers regarding MOD Development.
Locked
Brummiesteven
Registered User
Posts: 4
Joined: Thu Jul 05, 2007 11:46 pm

Help with forums sharing same database.

Post by Brummiesteven » Fri Jul 06, 2007 12:02 am

Hey,

Can someone please help me, this is quite urgent as I want to get these forums up ASAP.

I followed this tutorial here on PHPBB3:
http://www.phpbb.com/kb/article/share-m ... bb-boards/

Even though it was designed for PHPBB2, I had read a few articles saying it worked fine on PHPBB3. Here is the end of my constants file which shows which databases are shared and which ones aren't:

Code: Select all

define('ACL_GROUPS_TABLE',			$table_prefix . 'acl_groups');
define('ACL_OPTIONS_TABLE',			$table_prefix . 'acl_options');
define('ACL_ROLES_DATA_TABLE',		$table_prefix . 'acl_roles_data');
define('ACL_ROLES_TABLE',			$table_prefix . 'acl_roles');
define('ACL_USERS_TABLE',			$table_prefix . 'acl_users');
define('ATTACHMENTS_TABLE',			$table_prefix . 'attachments');
define('BANLIST_TABLE',				'banlist');
define('BBCODES_TABLE',				$table_prefix . 'bbcodes');
define('BOOKMARKS_TABLE',			$table_prefix . 'bookmarks');
define('BOTS_TABLE',				$table_prefix . 'bots');
define('CONFIG_TABLE',				$table_prefix . 'config');
define('CONFIRM_TABLE',				$table_prefix . 'confirm');
define('DISALLOW_TABLE',			'disallow');
define('DRAFTS_TABLE',				$table_prefix . 'drafts');
define('EXTENSIONS_TABLE',			$table_prefix . 'extensions');
define('EXTENSION_GROUPS_TABLE',	$table_prefix . 'extension_groups');
define('FORUMS_TABLE',				$table_prefix . 'forums');
define('FORUMS_ACCESS_TABLE',		$table_prefix . 'forums_access');
define('FORUMS_TRACK_TABLE',		$table_prefix . 'forums_track');
define('FORUMS_WATCH_TABLE',		$table_prefix . 'forums_watch');
define('GROUPS_TABLE',				'groups');
define('ICONS_TABLE',				$table_prefix . 'icons');
define('LANG_TABLE',				$table_prefix . 'lang');
define('LOG_TABLE',					$table_prefix . 'log');
define('MODERATOR_CACHE_TABLE',		$table_prefix . 'moderator_cache');
define('MODULES_TABLE',				$table_prefix . 'modules');
define('POLL_OPTIONS_TABLE',		$table_prefix . 'poll_options');
define('POLL_VOTES_TABLE',			$table_prefix . 'poll_votes');
define('POSTS_TABLE',				$table_prefix . 'posts');
define('PRIVMSGS_TABLE',			'privmsgs');
define('PRIVMSGS_FOLDER_TABLE',		$table_prefix . 'privmsgs_folder');
define('PRIVMSGS_RULES_TABLE',		$table_prefix . 'privmsgs_rules');
define('PRIVMSGS_TO_TABLE',			$table_prefix . 'privmsgs_to');
define('PROFILE_FIELDS_TABLE',		$table_prefix . 'profile_fields');
define('PROFILE_FIELDS_DATA_TABLE',	$table_prefix . 'profile_fields_data');
define('PROFILE_FIELDS_LANG_TABLE',	$table_prefix . 'profile_fields_lang');
define('PROFILE_LANG_TABLE',		$table_prefix . 'profile_lang');
define('RANKS_TABLE',				'ranks');
define('REPORTS_TABLE',				$table_prefix . 'reports');
define('REPORTS_REASONS_TABLE',		$table_prefix . 'reports_reasons');
define('SEARCH_RESULTS_TABLE',		$table_prefix . 'search_results');
define('SEARCH_WORDLIST_TABLE',		$table_prefix . 'search_wordlist');
define('SEARCH_WORDMATCH_TABLE',	$table_prefix . 'search_wordmatch');
define('SESSIONS_TABLE',			'sessions');
define('SESSIONS_KEYS_TABLE',		 'sessions_keys');
define('SITELIST_TABLE',			$table_prefix . 'sitelist');
define('SMILIES_TABLE',				'smilies');
define('STYLES_TABLE',				'styles');
define('STYLES_TEMPLATE_TABLE',		'styles_template');
define('STYLES_TEMPLATE_DATA_TABLE',      'styles_template_data');
define('STYLES_THEME_TABLE',		      'styles_theme');
define('STYLES_IMAGESET_TABLE',		'styles_imageset');
define('STYLES_IMAGESET_DATA_TABLE',       'styles_imageset_data');
define('TOPICS_TABLE',				$table_prefix . 'topics');
define('TOPICS_POSTED_TABLE',		$table_prefix . 'topics_posted');
define('TOPICS_TRACK_TABLE',		$table_prefix . 'topics_track');
define('TOPICS_WATCH_TABLE',		$table_prefix . 'topics_watch');
define('USER_GROUP_TABLE',			'user_group');
define('USERS_TABLE',				'users');
define('WARNINGS_TABLE',			'warnings');
define('WORDS_TABLE',				$table_prefix . 'words');
define('ZEBRA_TABLE',				$table_prefix . 'zebra');
Everything is working fine, users and all. There is just one problem, I currently have 4 boards 2 of them are ready to go:
http://www.gangoozler.com/forums blank phpbb3 installation sharing db's
http://www.footballmoves.co.uk/forums as above.
http://www.gtastation.com/forums configured, skinned and ready to go
http://www.fallenfromstatic.com/forums as above.

The problem comes with permissions. On GTA Station I can see no forums nothing, on fallenfromstatic I can see all the forums. When I go into permissions and change it so that I can see the forums on GTA Station it works but then I can't see anything on fallenfromstatic. It's like a neverending loop, it doesn't seem to be effecting gangoozler or footballmoves.

Any suggestions? Please help.

Brummiesteven
Registered User
Posts: 4
Joined: Thu Jul 05, 2007 11:46 pm

Re: Help with forums sharing same database.

Post by Brummiesteven » Fri Jul 06, 2007 1:49 pm

Bump. Will someone please help? I need to get this done ASAP.

User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Help with forums sharing same database.

Post by A_Jelly_Doughnut » Fri Jul 06, 2007 3:03 pm

The problem lies in the Users table which you are sharing. There is a permissions cache stored in the users table. I'm not really sure the best way to get around this...

My best guess at the moment would be to create 3 additional columns of type text. Name them user_permissions_1, user_permissions_2, and user_permissions_3.

Also create 3 additional columns of type mediumint(8). Name them user_perm_from_1, user_perm_2, and user_perm_from_3.

Then assign each board a number. For each set of php files, go through /includes/auth.php and change all references to user_permissions to user_permissions_2 (for example) and all references to user_perm_from to user_perm_from_2.

I believe all of these changes should be contained to the one file.
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish

Brummiesteven
Registered User
Posts: 4
Joined: Thu Jul 05, 2007 11:46 pm

Re: Help with forums sharing same database.

Post by Brummiesteven » Fri Jul 06, 2007 4:17 pm

I think I'm going to be better off going with PHPBB2 and modding it.

Brummiesteven
Registered User
Posts: 4
Joined: Thu Jul 05, 2007 11:46 pm

Re: Help with forums sharing same database.

Post by Brummiesteven » Fri Jul 06, 2007 6:52 pm

Sorry for the double post. I didn't want to go back to PHPBB2 as I had already done the skins and such. i tried out what you said and it worked a treat.

I cant use the original user_permissions or user_perm_from though. All forums had to be changed to 1, 2, 3 and 4.

I will post a tutorial as soon as I can.

Flame of Darkness
Registered User
Posts: 11
Joined: Sun May 27, 2007 12:56 pm

Re: Help with forums sharing same database.

Post by Flame of Darkness » Fri Oct 05, 2007 9:41 pm

It works great in respect to members can register on multiple forums with one exception. The latest registrated member shows up on the forum (s)he actually registers on - but the index page of the other forum(s) don't show them unless you go into the ACP and resynch the stats (they show up on the members page though). Is there any way to automatically update the stats for all the linked boards when a new member registers at one board?
A rose by any other name would still have thorns...

flyingzaozao
Registered User
Posts: 32
Joined: Fri Sep 07, 2007 7:59 pm

Re: Help with forums sharing same database.

Post by flyingzaozao » Wed Dec 19, 2007 8:45 pm

when I try to register as a new user? It said:

SQL ERROR [ mysql4 ]

Field 'user_permissions_1' doesn't have a default value [1364]

I tried to set a empty string '' to user_permissions_1, the system didn't allow to set a default value. :(. Any thought?

User avatar
jwxie
Registered User
Posts: 392
Joined: Wed Feb 01, 2006 3:45 am
Contact:

Re: Help with forums sharing same database.

Post by jwxie » Thu Jan 31, 2008 12:03 am

Flame of Darkness wrote:It works great in respect to members can register on multiple forums with one exception. The latest registrated member shows up on the forum (s)he actually registers on - but the index page of the other forum(s) don't show them unless you go into the ACP and resynch the stats (they show up on the members page though). Is there any way to automatically update the stats for all the linked boards when a new member registers at one board?
have your user try to login first, and would his / her name show up on the latest registered?

User avatar
TraXy
Registered User
Posts: 43
Joined: Sat Feb 12, 2005 11:46 pm
Location: Nottingham
Contact:

Re: Help with forums sharing same database.

Post by TraXy » Fri Feb 08, 2008 6:22 pm

I followed the KB instructions and the ones listed in this thread. Managed to create an account in forum2 and can log in with it on forum1 and so on, but the rights aren't there. If I use one of the forum1 admin accounts, I can log into forum2, but I can't see the ACP link at the bottom, and if I enter the URL manually, its says the account isn't an admin.

Forum1 says this at the bottom:
Total posts 1 • Total topics 1 • Total members 2 • Our newest member X
(the members it lists is the admin account set up when installing forum1 plus my own personal account)

And forum2:
Total posts 1 • Total topics 1 • Total members 1 • Our newest member Y
(Y being the admin account set up when installing forum2)

Admittedly, my PHP&MySQL skills are fairly non-existent, but I normally manage to mod stuff according to instructions, I just run into trouble when stuff goes wrong, because I don't know what or how to fix it. *sigh*

As the KB instructions are for bb2, I've had to improvise a bit, but... oh well. I've omitted the forum2_ tables as they're the 62 standard installation ones and have not been modified, but here's how the rest is structured:

Code: Select all

acl_groups
acl_roles
acl_roles_data
acl_users
banlist
bbcodes
disallow
forum1_acl_options
forum1_attachments
forum1_bookmarks
forum1_bots
forum1_config
forum1_confirm
forum1_drafts
forum1_extensions
forum1_extension_groups
forum1_forums
forum1_forums_access
forum1_forums_track
forum1_forums_watch
forum1_icons
forum1_log
forum1_moderator_cache
forum1_modules
forum1_poll_options
forum1_poll_votes
forum1_posts
forum1_profile_fields
forum1_profile_fields_data
forum1_profile_fields_lang
forum1_profile_lang
forum1_reports
forum1_reports_reasons
forum1_search_results
forum1_search_wordlist
forum1_search_wordmatch
forum1_sitelist
forum1_topics
forum1_topics_posted
forum1_topics_track
forum1_topics_watch
forum1_zebra
groups
lang
privmsgs
privmsgs_folder
privmsgs_rules
privmsgs_to
ranks
sessions
sessions_keys
smilies
styles
styles_imageset
styles_imageset_data
styles_template
styles_template_data
styles_theme
users
user_group
warnings
words
Any ones that I've removed the prefix from which I shouldn't have, or haven't I removed prefix on enough of them? And what do I do with the cookie settings? I've set them to use the same cookie name but what about the paths? They're in forum1.domainname.com and forum2.domainname.com - should they be different on each board or should both just be .domainname.com ?

Oh, and also, it likes to display this at me: "You currently have the permissions from Anonymous. You are able to browse the board with this user’s permissions, but not access the administration control panel since admin permissions were not transferred. You can revert to your permission set at any time." when I log into the admin panel.

Very grateful for help! :)

mcvetyty
Registered User
Posts: 34
Joined: Sat Feb 16, 2008 10:06 pm

Re: Help with forums sharing same database.

Post by mcvetyty » Tue Feb 19, 2008 4:54 am

Flame of Darkness wrote:It works great in respect to members can register on multiple forums with one exception. The latest registrated member shows up on the forum (s)he actually registers on - but the index page of the other forum(s) don't show them unless you go into the ACP and resynch the stats (they show up on the members page though). Is there any way to automatically update the stats for all the linked boards when a new member registers at one board?

BUMP -- I am having this same problem described above now.. Is there anyway to have it sync automatically?

Thanks!

User avatar
MS FRANKY
Registered User
Posts: 155
Joined: Sun Feb 13, 2005 9:53 pm
Location: Slovakia no SLOVENIA

Re: Help with forums sharing same database.

Post by MS FRANKY » Thu Mar 13, 2008 11:47 pm

A_Jelly_Doughnut wrote:The problem lies in the Users table which you are sharing. There is a permissions cache stored in the users table. I'm not really sure the best way to get around this...

My best guess at the moment would be to create 3 additional columns of type text. Name them user_permissions_1, user_permissions_2, and user_permissions_3.

Also create 3 additional columns of type mediumint(8). Name them user_perm_from_1, user_perm_2, and user_perm_from_3.

Then assign each board a number. For each set of php files, go through /includes/auth.php and change all references to user_permissions to user_permissions_2 (for example) and all references to user_perm_from to user_perm_from_2.

I believe all of these changes should be contained to the one file.
yeah man! Working without bugs.. Just one:

Field 'user_permissions_2' doesn't have a default value [1364]
I think we must add someting to upc_register.php or someting else(add full backtrace report)....

//edit: I found it

Open:Functions_user.php
--------------------------------------
find:

Code: Select all

'user_permissions'	=> '',
---------------------------------------
After add:

Code: Select all

''user_permissions_2'	=> '',
---------------------------------------

Repete on 2nd board

User avatar
MS FRANKY
Registered User
Posts: 155
Joined: Sun Feb 13, 2005 9:53 pm
Location: Slovakia no SLOVENIA

Re: Help with forums sharing same database.

Post by MS FRANKY » Sat Mar 15, 2008 3:44 am

Hmm it don´t help. I change all of php files(on 2-nd forum) witch contain user_permissions and user_perm_from. But issuse is still there. If i do somenting in ACP on 2-nd board all forum permissions on 1-st board to view forum will be lost..

User avatar
NeoID
Registered User
Posts: 406
Joined: Mon Jun 06, 2005 10:12 pm
Location: Norway
Contact:

Re: Help with forums sharing same database.

Post by NeoID » Thu Apr 03, 2008 3:30 pm

Anyone who has got it working? I would like to share my user database too, but it looks like a lot of people have troubles with it...

Another thing is sharing of avatars and attachments, phpbb3 doesn't like it when you use ../ as avatar path.. so how am I supposed to be able to use a common avatar-folder?

Thanks in advance...
Norsk Anime Forum
http://www.AnimeNord.com

User avatar
mehdi2224
Registered User
Posts: 43
Joined: Wed Jan 30, 2008 11:19 am

Re: Help with forums sharing same database.

Post by mehdi2224 » Sat Apr 05, 2008 6:40 pm

i have same problem sayed above too
any body dont know how this sharing can be created . i need enough information about that where i must define the above orders ?
:?: :?:

User avatar
NeoID
Registered User
Posts: 406
Joined: Mon Jun 06, 2005 10:12 pm
Location: Norway
Contact:

Re: Help with forums sharing same database.

Post by NeoID » Sat Apr 05, 2008 7:20 pm

mehdi2224 wrote:i have same problem sayed above too
any body dont know how this sharing can be created . i need enough information about that where i must define the above orders ?
:?: :?:
The best way of doing it (I guess) is to create a symlink (it's basically the same as a shortcut to a folder).
However, you'll have to have shell-access to do it or ask your host to do it for you...
Norsk Anime Forum
http://www.AnimeNord.com

Locked

Return to “[3.0.x] MOD Writers Discussion”