diff options
author | friendica <info@friendica.com> | 2013-07-03 02:47:36 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-07-03 02:47:36 -0700 |
commit | c16b65b5bd7f5a43647523ef9dd351a9edb17fde (patch) | |
tree | 8f6e31fa7939c2dde80781fc3683813d2dfc0168 /mod/profile.php | |
parent | 8369a8a7559391ea6cb2757b5093bcf47aed0ed1 (diff) | |
download | volse-hubzilla-c16b65b5bd7f5a43647523ef9dd351a9edb17fde.tar.gz volse-hubzilla-c16b65b5bd7f5a43647523ef9dd351a9edb17fde.tar.bz2 volse-hubzilla-c16b65b5bd7f5a43647523ef9dd351a9edb17fde.zip |
multi-profiles work
Diffstat (limited to 'mod/profile.php')
-rw-r--r-- | mod/profile.php | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/mod/profile.php b/mod/profile.php index 2f869a533..c4c0fc35b 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -10,25 +10,35 @@ function profile_init(&$a) { return; } - $profile = 0; + $profile = ''; $channel = $a->get_channel(); - +dbg(1); if((local_user()) && (argc() > 2) && (argv(2) === 'view')) { $which = $channel['channel_address']; $profile = argv(1); + $r = q("select profile_guid from profile where id = %d and uid = %d limit 1", + intval($profile), + intval(local_user()) + ); + if(! $r) + $profile = ''; + $profile = $r[0]['profile_guid']; } $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/feed/' . $which .'" />' . "\r\n" ; - $x = q("select channel_id as profile_uid from channel where channel_address = '%s' limit 1", - dbesc(argv(1)) - ); - if($x) { - $a->profile = $x[0]; + if(! $profile) { + $x = q("select channel_id as profile_uid from channel where channel_address = '%s' limit 1", + dbesc(argv(1)) + ); + if($x) { + $a->profile = $x[0]; + } + } // $channel_display = get_pconfig($a->profile['profile_uid'],'system','channel_format'); // if(! $channel_display) - profile_load($a,$which,$profile); - } + profile_load($a,$which,$profile); +dbg(0); } |