aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/sites.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-01 16:30:51 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-01 16:30:51 +0000
commit1ba0fab3389b57e0167c9df94ed19602cc4103af (patch)
treef430f0a1d6ed9a76bf7f28034fb5b292c06b9a8f /engine/lib/sites.php
parent2cc7809fbc2e3fef24f213e2ef1e40fa54f1d05e (diff)
downloadelgg-1ba0fab3389b57e0167c9df94ed19602cc4103af.tar.gz
elgg-1ba0fab3389b57e0167c9df94ed19602cc4103af.tar.bz2
Major site config changes
git-svn-id: https://code.elgg.org/elgg/trunk@615 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/sites.php')
-rw-r--r--engine/lib/sites.php22
1 files changed, 10 insertions, 12 deletions
diff --git a/engine/lib/sites.php b/engine/lib/sites.php
index a0d5005ee..89ab9bd80 100644
--- a/engine/lib/sites.php
+++ b/engine/lib/sites.php
@@ -462,24 +462,22 @@
* @return true
*/
function sites_init($event, $object_type, $object) {
- /* global $CONFIG;
- $CONFIG->site_id = 1;
-
- trigger_event('init','sites');
-
- if ($site = get_data_row("select * from {$CONFIG->dbprefix}sites where id = 1")) {
- if (!empty($site->name))
- $CONFIG->sitename = $site->name;
- if (!empty($site->domain))
- $CONFIG->wwwroot = $site->domain;
+ global $CONFIG;
+ $site = trigger_plugin_hook("siteid","system");
+ if ($site === null || $site === false) {
+ $CONFIG->site_id = (int) datalist_get('default_site');
+ } else {
+ $CONFIG->site_id = $site;
}
+ $CONFIG->site_guid = $CONFIG->site_id;
+
+ return true;
- return true;*/
}
// Register event handlers
- register_event_handler('init','system','sites_init',0);
+ register_event_handler('init','system','sites_init',2);
?> \ No newline at end of file