From fbafd92f7f7b96b215b98f30de9a1ccbdb3479be Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 25 Sep 2012 17:57:20 -0700 Subject: moving a lot of structure around. 'entity' is now 'channel' --- boot.php | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index fbc2e1f71..afa9c0e1e 100644 --- a/boot.php +++ b/boot.php @@ -368,7 +368,8 @@ if(! class_exists('App')) { class App { public $account = null; - public $identity = null; + private $channel = null; + public $language; public $module_loaded = false; public $query_string; @@ -594,6 +595,15 @@ if(! class_exists('App')) { return $this->path; } + function set_channel($channel) { + $this->channel = $channel; + } + + function get_channel() + return $this->channel; + } + + function set_pager_total($n) { $this->pager['total'] = intval($n); } @@ -1056,7 +1066,7 @@ if(! function_exists('get_max_import_size')) { if(! function_exists('profile_load')) { function profile_load(&$a, $nickname, $profile = 0) { - $user = q("select entity_id from entity where entity_address = '%s' limit 1", + $user = q("select channel_id from channel where channel_address = '%s' limit 1", dbesc($nickname) ); @@ -1069,7 +1079,7 @@ function profile_load(&$a, $nickname, $profile = 0) { if(remote_user() && count($_SESSION['remote'])) { foreach($_SESSION['remote'] as $visitor) { - if($visitor['uid'] == $user[0]['entity_id']) { + if($visitor['uid'] == $user[0]['channel_id']) { $r = q("SELECT `profile_id` FROM `contact` WHERE `id` = %d LIMIT 1", intval($visitor['cid']) ); @@ -1084,17 +1094,17 @@ function profile_load(&$a, $nickname, $profile = 0) { if($profile) { $profile_int = intval($profile); - $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar_date` AS picdate, entity.* FROM `profile` - left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN entity ON `profile`.`uid` = entity.entity_id - WHERE entity.entity_address = '%s' AND `profile`.`id` = %d and `contact`.`self` = 1 LIMIT 1", + $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar_date` AS picdate, channel.* FROM `profile` + left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN channel ON `profile`.`uid` = channel.channel_id + WHERE channel.channel_address = '%s' AND `profile`.`id` = %d and `contact`.`self` = 1 LIMIT 1", dbesc($nickname), intval($profile_int) ); } if(! ($r && count($r))) { - $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar_date` AS picdate, `entity`.* FROM `profile` - left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `entity` ON `profile`.`uid` = entity.entity_id - WHERE entity.entity_address = '%s' AND `profile`.`is_default` = 1 and `contact`.`self` = 1 LIMIT 1", + $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar_date` AS picdate, `channel`.* FROM `profile` + left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `channel` ON `profile`.`uid` = channel.channel_id + WHERE channel.channel_address = '%s' AND `profile`.`is_default` = 1 and `contact`.`self` = 1 LIMIT 1", dbesc($nickname) ); } @@ -1119,7 +1129,7 @@ function profile_load(&$a, $nickname, $profile = 0) { $a->profile = $r[0]; - $a->page['title'] = $a->profile['entity_name'] . " @ " . $a->config['sitename']; + $a->page['title'] = $a->profile['channel_name'] . " @ " . $a->config['sitename']; // FIXME $_SESSION['theme'] = $a->profile['theme']; -- cgit v1.2.3