diff options
author | Friendika <info@friendika.com> | 2010-12-11 04:16:58 -0800 |
---|---|---|
committer | Friendika <info@friendika.com> | 2010-12-11 04:16:58 -0800 |
commit | 6b5a83b9b8c3c4fe0e58c92994c3a53e8f3cb175 (patch) | |
tree | 03870eac7d723ddb02b6e2c43cbd60acb9cb124d /mod/profile.php | |
parent | 18823fe54694579ff4d61c2670b55ccd4e060957 (diff) | |
download | volse-hubzilla-6b5a83b9b8c3c4fe0e58c92994c3a53e8f3cb175.tar.gz volse-hubzilla-6b5a83b9b8c3c4fe0e58c92994c3a53e8f3cb175.tar.bz2 volse-hubzilla-6b5a83b9b8c3c4fe0e58c92994c3a53e8f3cb175.zip |
profile load optimisation
Diffstat (limited to 'mod/profile.php')
-rw-r--r-- | mod/profile.php | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/mod/profile.php b/mod/profile.php index a431f4bdd..b40617d03 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -1,53 +1,5 @@ <?php -if(! function_exists('profile_load')) { -function profile_load(&$a, $username, $profile = 0) { - if(remote_user()) { - $r = q("SELECT `profile-id` FROM `contact` WHERE `id` = %d LIMIT 1", - intval($_SESSION['visitor_id'])); - if(count($r)) - $profile = $r[0]['profile-id']; - } - - $r = null; - - if($profile) { - $profile_int = intval($profile); - $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile` - LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid` - WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d LIMIT 1", - dbesc($username), - intval($profile_int) - ); - } - if(! count($r)) { - $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile` - LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid` - WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 LIMIT 1", - dbesc($username) - ); - } - - if(($r === false) || (! count($r))) { - notice( t('No profile') . EOL ); - $a->error = 404; - return; - } - - $a->profile = $r[0]; - - $a->page['template'] = 'profile'; - - $a->page['title'] = $a->profile['name']; - $_SESSION['theme'] = $a->profile['theme']; - - if(! (x($a->page,'aside'))) - $a->page['aside'] = ''; - $a->page['aside'] .= contact_block(); - - return; -}} - function profile_init(&$a) { if($a->argc > 1) |