Go Back   Pligg CMS Forum > Other > Suggestions

Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 03-30-2007, 09:54 AM
Constant Pligger
 
Join Date: Mar 2006
Posts: 575
Thanks: 14
Thanked 126 Times in 61 Posts
Simplest way would be to take your central database, link it to both pligg sites, then open up config.php for each installation:

Code:
if(!defined('table_categories')){ define('table_categories', table_prefix . "categories" ); }
if(!defined('table_comments')){ define('table_comments', table_prefix . "comments" ); }
if(!defined('table_cron')){ define('table_cron', table_prefix . "cron" ); }
if(!defined('table_friends')){ define('table_friends', table_prefix . "friends" ); }
if(!defined('table_links')){ define('table_links', table_prefix . "links" ); }
if(!defined('table_trackbacks')){ define('table_trackbacks', table_prefix . "trackbacks" ); }
if(!defined('table_users')){ define('table_users', table_prefix . "users" ); }
if(!defined('table_tags')){ define('table_tags', table_prefix . "tags" ); }
if(!defined('table_votes')){ define('table_votes', table_prefix . "votes" ); }
if(!defined('table_pageviews')){ define('table_pageviews', table_prefix . "pageviews" ); }
if(!defined('table_config')){ define('table_config', table_prefix . "config" ); }
if(!defined('table_modules')){ define('table_modules', table_prefix . "modules" ); }
if(!defined('table_messages')){ define('table_messages', table_prefix . "messages" ); }
if(!defined('table_formulas')){ define('table_formulas', table_prefix . "formulas" ); }
if(!defined('table_feeds')){ define('table_feeds', table_prefix . "feeds" ); }
if(!defined('table_feed_import')){ define('table_feed_import', table_prefix . "feed_import" ); }
if(!defined('table_feed_import_fields')){ define('table_feed_import_fields', table_prefix . "feed_import_fields" ); }
if(!defined('table_feed_link')){ define('table_feed_link', table_prefix . "feed_link" ); }
if(!defined('table_saved_links')){ define('table_saved_links', table_prefix . "saved_links" ); }
if(!defined('table_totals')){ define('table_totals', table_prefix . "totals" ); }
Mine might look slightly different to yours, however, all you should need to do is locate the tables you don't want to share between the sites (so story data etc) and rename them. So one installation is renamed to table_prefix . "links1" and the other to table_prefix . "links2". Repeat for other tables you dont want to share, then import those tables into the central database as pligg_links1 and pligg_links2 etc. The other tables, like users, friends and messages will be shared.

When I saw this thread, I thought someone had come up with a "multi" pligg environment (1 file set, 1 database, multiple sets of tables), for use with say pligg hosting. I'm half tempted to make one, but I wouldn't really have a use for it...
__________________


Last edited by Simon; 03-30-2007 at 10:02 AM..
Reply With Quote
  #12 (permalink)  
Old 03-30-2007, 01:21 PM
New Pligger
 
Join Date: Mar 2007
Location: Malaysia
Posts: 14
Thanks: 3
Thanked 0 Times in 0 Posts
Talking thanks simon..

thanks for your quick and generous reply simon!

I've managed to combine both sites together.

thanks again.

Last edited by lcct83; 03-30-2007 at 02:12 PM..
Reply With Quote
  #13 (permalink)  
Old 04-05-2007, 12:50 PM
Casual Pligger
 
Join Date: Mar 2007
Posts: 80
Thanks: 5
Thanked 2 Times in 2 Posts
Quote:
Originally Posted by Simon View Post
Simplest way would be to take your central database, link it to both pligg sites, then open up config.php for each installation:

Code:
if(!defined('table_categories')){ define('table_categories', table_prefix . "categories" ); }
if(!defined('table_comments')){ define('table_comments', table_prefix . "comments" ); }
if(!defined('table_cron')){ define('table_cron', table_prefix . "cron" ); }
if(!defined('table_friends')){ define('table_friends', table_prefix . "friends" ); }
if(!defined('table_links')){ define('table_links', table_prefix . "links" ); }
if(!defined('table_trackbacks')){ define('table_trackbacks', table_prefix . "trackbacks" ); }
if(!defined('table_users')){ define('table_users', table_prefix . "users" ); }
if(!defined('table_tags')){ define('table_tags', table_prefix . "tags" ); }
if(!defined('table_votes')){ define('table_votes', table_prefix . "votes" ); }
if(!defined('table_pageviews')){ define('table_pageviews', table_prefix . "pageviews" ); }
if(!defined('table_config')){ define('table_config', table_prefix . "config" ); }
if(!defined('table_modules')){ define('table_modules', table_prefix . "modules" ); }
if(!defined('table_messages')){ define('table_messages', table_prefix . "messages" ); }
if(!defined('table_formulas')){ define('table_formulas', table_prefix . "formulas" ); }
if(!defined('table_feeds')){ define('table_feeds', table_prefix . "feeds" ); }
if(!defined('table_feed_import')){ define('table_feed_import', table_prefix . "feed_import" ); }
if(!defined('table_feed_import_fields')){ define('table_feed_import_fields', table_prefix . "feed_import_fields" ); }
if(!defined('table_feed_link')){ define('table_feed_link', table_prefix . "feed_link" ); }
if(!defined('table_saved_links')){ define('table_saved_links', table_prefix . "saved_links" ); }
if(!defined('table_totals')){ define('table_totals', table_prefix . "totals" ); }
Mine might look slightly different to yours, however, all you should need to do is locate the tables you don't want to share between the sites (so story data etc) and rename them. So one installation is renamed to table_prefix . "links1" and the other to table_prefix . "links2". Repeat for other tables you dont want to share, then import those tables into the central database as pligg_links1 and pligg_links2 etc. The other tables, like users, friends and messages will be shared.

When I saw this thread, I thought someone had come up with a "multi" pligg environment (1 file set, 1 database, multiple sets of tables), for use with say pligg hosting. I'm half tempted to make one, but I wouldn't really have a use for it...
Simon, why do you use if (!defined ?

Just curious.
Reply With Quote
  #14 (permalink)  
Old 04-05-2007, 12:59 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 575
Thanks: 14
Thanked 126 Times in 61 Posts
To be honest, it was because that is what was in the config.php file, and I just did a quick copy and paste of the relevant code to this thread. So really it is the devs you should ask.
__________________

Reply With Quote
  #15 (permalink)  
Old 04-05-2007, 01:41 PM
Casual Pligger
 
Join Date: Mar 2007
Posts: 80
Thanks: 5
Thanked 2 Times in 2 Posts
Sorry Simon, you are right. I guess I'm running an older version of Pligg. I'm behind the times! :-)


For my sites, I have changed to global the following tables: friends, messages and users.

Is it a good rule that any table with link_id or page_id should not be a global table?

So for example, tags table should not be global.

Depending on how different your sites are from each other, language and modules could be global tables.

What about feed_ tables? It looks like maybe these could be global tables as well.
Reply With Quote
  #16 (permalink)  
Old 04-07-2007, 06:25 PM
Casual Pligger
 
Join Date: Mar 2007
Posts: 80
Thanks: 5
Thanked 2 Times in 2 Posts
Quote:
Originally Posted by Simon View Post
Simplest way would be to take your central database, link it to both pligg sites, then open up config.php for each installation:

Mine might look slightly different to yours, however, all you should need to do is locate the tables you don't want to share between the sites (so story data etc) and rename them. So one installation is renamed to table_prefix . "links1" and the other to table_prefix . "links2". Repeat for other tables you dont want to share, then import those tables into the central database as pligg_links1 and pligg_links2 etc. The other tables, like users, friends and messages will be shared.

When I saw this thread, I thought someone had come up with a "multi" pligg environment (1 file set, 1 database, multiple sets of tables), for use with say pligg hosting. I'm half tempted to make one, but I wouldn't really have a use for it...
Simon, I've been looking at friends, votes and messages... can these tables really be shared in a multi pligg environment if they still have a relationship to table links? I don't think a person can change the prefix only for these tables. Is this correct?

In fact, aren't user table, categories, friens, messages, config and modules (plus some feed tables) the only ones you can really just change the prefix to global_ ?

Last edited by acidride; 04-07-2007 at 06:29 PM..
Reply With Quote
  #17 (permalink)  
Old 04-07-2007, 06:34 PM
Casual Pligger
 
Join Date: Mar 2007
Posts: 80
Thanks: 5
Thanked 2 Times in 2 Posts
Quote:
Originally Posted by acidride View Post
Simon, I've been looking at friends, votes and messages... can these tables really be shared in a multi pligg environment if they still have a relationship to table links? I don't think a person can change the prefix only for these tables. Is this correct?

In fact, aren't user table, categories, friens, messages, config and modules (plus some feed tables) the only ones you can really just change the prefix to global_ ?
Never mind. My mistake, votes cannot be because of its relationship with links table, but messages and friends can be global_ IF users table is also global. If you don't make users table global, then you can't make messages or friends global.
Reply With Quote
  #18 (permalink)  
Old 05-07-2007, 09:49 AM
beatniak's Avatar
Pligg Donor
 
Join Date: Apr 2006
Location: NL - 52.100863;5.108356
Posts: 310
Thanks: 14
Thanked 77 Times in 48 Posts
By the way... since revision 1029 (?) this code:
Code:
if(!defined('table_prefix')){
    define('table_prefix','');
}
if(!defined('table_categories')){ define('table_categories', table_prefix . "categories" ); }
.......
is in the file /pligg/libs/define_tables.php

(for those who are working with pligg from the SVN and are searching for those lines)
__________________
Like my work? Donations are welcome if you would like to support my work!
Finger pliggin' good sites of mine: receptencocktail.nl / numarketing.nl / goboz.com
Reply With Quote
  #19 (permalink)  
Old 05-07-2007, 08:21 PM
New Pligger
 
Join Date: May 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
it's possible to share the user's table between 2 pligg's installation, every one uses its own databse

PS : sorry for my poor english.
Reply With Quote
  #20 (permalink)  
Old 08-22-2007, 07:54 AM
Casual Pligger
 
Join Date: Jan 2007
Posts: 67
Thanks: 11
Thanked 6 Times in 3 Posts
What about the avatars? When I upload the avatar from one installation, the other one gets nothing. I think there should be a way to globalize this too.

Edit: OK, I found that in html1.php line 115:
PHP Code:
$imgsrc my_pligg_base User_Upload_Avatar_Folder "/" $user_name "_" $imgsize ".jpg"
Converting it to:
PHP Code:
$imgsrc my_global_url my_pligg_base User_Upload_Avatar_Folder "/" $user_name "_" $imgsize ".jpg"
Where my_global_url is the main website you keep the avatars.

I'm now working on uploading avatars to the global source from sub websites.

Last edited by formicin; 08-22-2007 at 08:04 AM..
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Search Engine Friendly URLs by vBSEO 3.2.0