4images Issues / Ausgaben > Installation, Update & Configuration

install 2 galleries

<< < (2/4) > >>

Sunny C.:
Nice!
Added to my List:
http://www.4homepages.de/forum/index.php?topic=24888.0

Thanks V@no!

Kurman:
Good job! Works perfectly!

Only one correction - the posts above have a mistyping:

If we use for first gallery database table prefix "4images1", then we must have no prefix in database of second gallery.

##############

A question:
Can we use as well 3 or more galleries with one user table? (just like above, but more than 2)?

V@no:
The point behind prefixes is to have different tables on the same database. A table name without prefix would be automatically different from a table name with a prefix...and besides, using prefixes makes it easier to manage afterwards ;)

Theoretically this method should work for unlimited number of galleries, as long as they all on same database.

Kurman:
Not quite right, V@no.

Look:

We use users table from the first gallery, and we've prefix 4images1 for first gallery, and prefix 4images2 for the second, right?

* in config.php of the first gallery we have $table_prefix = "4images1_";
* in config.php of the second gallery we have $table_prefix = "4images2_";
So, if we call in constants.php in the second gallery for

--- Code: ---define('SESSIONS_TABLE', '4images1_sessions');
define('SESSIONVARS_TABLE', '4images1_sessionvars');
define('USERS_TABLE', '4images1_users');
--- End code ---

We will recieve mysql error, for script (second gallery) will search for

--- Code: ---define('SESSIONS_TABLE', '4images2_4images1_sessions');
define('SESSIONVARS_TABLE', '4images2_4images1_sessionvars');
define('USERS_TABLE', '4images2_4images1_users');
--- End code ---

Because in config of the second gallery we already put  $table_prefix = "4images2_";
and constats.php looks for 4images2_(its own prefix, defined in root config)+4images1_bla-bla.

So, if we do in that way, we must not use table prefix for second gallery. Then it will search correctly for tables and find them

--- Code: ---define('SESSIONS_TABLE', '4images1_sessions');
define('SESSIONVARS_TABLE', '4images1_sessionvars');
define('USERS_TABLE', '4images1_users');
--- End code ---

Because there is no prefix in its own config.php.

Practically it is it. I thought for 3 or more galleries, but there is no way to do it in the similar way :? Because each gallery, when calls for user table of the main gallery, adds its own prefix to path, and we get mysql error 116.. And only prefixless gallery finds right way for other user table.

V@no:
You misunderstand this.
The original line (4images1) is:
define('SESSIONS_TABLE', $table_prefix.'sessions');

then in second 4images (with prefix 4images2) we change it to:
define('SESSIONS_TABLE', '4images1_sessions');
see, no more $table_prefix used, therefor there is no "4images2_4images1_sessions" issue

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version