Author Topic: How do i open a new subdomain with same SQL + same image urls and different th  (Read 11287 times)

0 Members and 1 Guest are viewing this topic.

Offline Ersen

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
Firstly, apologise for my english.

How do i open a new subdomain with same SQL + same image urls and different themes.

I have a photo gallery http://www.example.com i want publish same gallery with different language. http://es.example.com

i want galleries working same SQL, Same images and different themes.

My process was:
1.i created a subdomain.
2.move script documents. (not move images)
3.open a new theme.

My theme is ok but i have image problem. My image cant preview. I change constant.php like this :

// Data paths
define('MEDIA_DIR', 'esl/data/media');
define('THUMB_DIR', 'es/data/thumbnails');
define('MEDIA_TEMP_DIR', 'es/data/tmp_media');
define('THUMB_TEMP_DIR', 'es/data/tmp_thumbnails');
define('DATABASE_DIR', '../data/database');
define('TEMPLATE_DIR', '../templates/espanol');

How can i do this?
« Last Edit: October 22, 2009, 02:19:45 PM by Ersen »

Offline V@nо

  • Addicted member
  • ******
  • Posts: 1.223
    • View Profile
Your first three "must do" before you ask a question:
If I asked you to PM me, I meant PM to my primary account, this account doesn't accept PMs.

Offline Ersen

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
maybe this can help:
www.4homepages.de/forum/index.php?topic=25739.0

Hello Vano, i did this but this error.

An unexpected error occured. Please try again later.
ERROR: Could not load configuration settings!

Second gallery constant is this:

Code: [Select]
// Table names
define('CATEGORIES_TABLE', $table_prefix.'categories');
define('COMMENTS_TABLE', $table_prefix.'comments');
define('GROUP_ACCESS_TABLE', $table_prefix.'groupaccess');
define('GROUP_MATCH_TABLE', $table_prefix.'groupmatch');
define('GROUPS_TABLE', $table_prefix.'groups');
define('IMAGES_TABLE', $table_prefix.'images');
define('IMAGES_TEMP_TABLE', $table_prefix.'images_temp');
define('LIGHTBOXES_TABLE', $table_prefix.'lightboxes');
define('POSTCARDS_TABLE', $table_prefix.'postcards');
define('SESSIONS_TABLE', '4images1_sessions');
define('SESSIONVARS_TABLE', '4images1_sessionvars');
define('SETTINGS_TABLE', $table_prefix.'settings');
define('USERS_TABLE', '4images1_users');
define('WORDLIST_TABLE', $table_prefix.'wordlist');
define('WORDMATCH_TABLE', $table_prefix.'wordmatch');

Second gallery data paths:
Code: [Select]
// Data paths
define('MEDIA_DIR', '../data/media');
define('THUMB_DIR', '../data/thumbnails');
define('MEDIA_TEMP_DIR', '../data/tmp_media');
define('THUMB_TEMP_DIR', '../data/tmp_thumbnails');
define('DATABASE_DIR', '../data/database');
define('TEMPLATE_DIR', '../templates/theme3');

Second gallery Config.php is

Code: [Select]
$db_servertype = "mysql";
$db_host = "localhost";
$db_name = "ersen_deneme";
$db_user = "ersen_eutbola";
$db_password = "ersenim";

$table_prefix = "4images_2";

define("4IMAGES_ACTIVE", 1);
define('SESSION_KEY

How can i do?


When i didnt changed config.php i have this error.

Code: [Select]
An unexpected error occured. Please try again later.

An unexpected error occured. Please try again later.

An unexpected error occured. Please try again later.

An unexpected error occured. Please try again later.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/example/public_html/it/includes/db_mysql.php on line 116

"/it/" name is my subdomain name.
« Last Edit: October 24, 2009, 12:35:33 PM by Ersen »

Offline V@nо

  • Addicted member
  • ******
  • Posts: 1.223
    • View Profile
did both of your galleries work before you did any changes?
Your first three "must do" before you ask a question:
If I asked you to PM me, I meant PM to my primary account, this account doesn't accept PMs.

Offline Ersen

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
did both of your galleries work before you did any changes?

First gallery is ok (http://www.example.com) is work but second gallery (www.it.example.com) didnt work (Error:Currently there are no new images.). Second gallery's theme is ok but cant preview images. Second gallery image path is: http://it.example.com/data/media/... All images in www.example.com/data/media/...

i copy all images in this documents for work second gallery. But i want all galleries show same image path. (www.example.com/data/media/...)

Regards.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
ok, I think that method will not work, because 4images uses relative paths.

Lets try different approach - override settings based on domain.

in global.php find:
$config['allowed_mediatypes_match'] = str_replace(",""|"$config['allowed_mediatypes']);

insert below:
/*
domain based settings
insert begin
*/
$host str_replace("www.""", (!empty($HTTP_SERVER_VARS['HTTP_HOST'])) ? $HTTP_SERVER_VARS['HTTP_HOST'] : getenv("SERVER_NAME"));
switch (
$host)
{
  case 
"it.example.com":
      
$config['language_dir'] = "italian"//language
      
$config['template_dir'] = "blah"//template
    
break;
  case 
"en.example.com":
      
$config['language_dir'] = "english"//language
      
$config['template_dir'] = "default"//template
    
break;
  default:
    break;
}
/*
domain based settings
insert end
*/

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Ersen

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
Hello again i did but second script cannot show images. i send u my site url with private message.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
You must misunderstand me. Forget about second 4images installation, it won't work that way. We are now working with only one, the first/original installation.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Ersen

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
oo sorry.

i did your say in Reply #5 like this stuff.

Code: [Select]
/*
domain based settings
insert begin
*/
$host = str_replace("www.", "", (!empty($HTTP_SERVER_VARS['HTTP_HOST'])) ? $HTTP_SERVER_VARS['HTTP_HOST'] : getenv("SERVER_NAME"));
switch ($host)
{
  case "it.domain.net":
      $config['language_dir'] = "english"; //language -(i did different language by template)-
      $config['template_dir'] = "7dana/italy"; //template
    break;
  case "domain.net":
      $config['language_dir'] = "english"; //language
      $config['template_dir'] = "7dana"; //template
    break;
  default:
    break;
}
/*
domain based settings
insert end
*/

But nothing changed. First gallery is ok but second gallery cant show images yet.


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
mmmm....ok, lets try it again.
1) are both of your domains (domain.net and it.domain.net) are on the same server and are have the same root folder? If so, then YOU DON'T NEED SECOND GALLERY
2) this got me very puzzled, either you do something very, very different and custom, or you do it wrong:
      $config['language_dir'] = "english"//language -(i did different language by template)-
      
$config['template_dir'] = "7dana/italy"//template

in default 4images, you cannot have a template inside another template...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Ersen

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
i have a template inside another template. 7dana/italy. i have 1 sql. Second theme is ok it.domain.net but image cant view by visitors.

i send pm about my process, urls, etc.

mmmm....ok, lets try it again.
1) are both of your domains (domain.net and it.domain.net) are on the same server and are have the same root folder? If so, then YOU DON'T NEED SECOND GALLERY
2) this got me very puzzled, either you do something very, very different and custom, or you do it wrong:
      $config['language_dir'] = "english"//language -(i did different language by template)-
      
$config['template_dir'] = "7dana/italy"//template

in default 4images, you cannot have a template inside another template...