diff options
author | RedMatrix <info@friendica.com> | 2014-12-29 09:28:47 +1100 |
---|---|---|
committer | RedMatrix <info@friendica.com> | 2014-12-29 09:28:47 +1100 |
commit | 8d144396b16048bf30cb43a4668588d39c833e03 (patch) | |
tree | eb26bef1652d774b4ca547704a330550876cffdb /mod | |
parent | fa23439b9cb93869985be14bc150c5a6a702ccce (diff) | |
parent | 754fec9a547159c38386d70a6b3e1c4b88193690 (diff) | |
download | volse-hubzilla-8d144396b16048bf30cb43a4668588d39c833e03.tar.gz volse-hubzilla-8d144396b16048bf30cb43a4668588d39c833e03.tar.bz2 volse-hubzilla-8d144396b16048bf30cb43a4668588d39c833e03.zip |
Merge pull request #769 from pafcu/profiles
Redirect /profiles to default profile when multi_profiles is off. Fixes ...
Diffstat (limited to 'mod')
-rw-r--r-- | mod/profiles.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/mod/profiles.php b/mod/profiles.php index 1d784c506..f2695f332 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -156,9 +156,14 @@ function profiles_init(&$a) { // Run profile_load() here to make sure the theme is set before // we start loading content - if((argc() > 1) && (intval(argv(1)))) { + if(((argc() > 1) && (intval(argv(1)))) || !feature_enabled(local_user(),'multi_profiles')) { + if(feature_enabled(local_user(),'multi_profiles')) + $id = $a->argv[1]; + else + $id = q("select id from profile where uid = %d and is_default = 1",local_user())[0]['id']; + $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1", - intval($a->argv[1]), + intval($id), intval(local_user()) ); if(! count($r)) { @@ -556,9 +561,14 @@ function profiles_content(&$a) { $profile_fields_basic = get_profile_fields_basic(); $profile_fields_advanced = get_profile_fields_advanced(); - if((argc() > 1) && (intval(argv(1)))) { + if(((argc() > 1) && (intval(argv(1)))) || !feature_enabled(local_user(),'multi_profiles')) { + if(feature_enabled(local_user(),'multi_profiles')) + $id = $a->argv[1]; + else + $id = q("select id from profile where uid = %d and is_default = 1",local_user())[0]['id']; + $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1", - intval($a->argv[1]), + intval($id), intval(local_user()) ); if(! count($r)) { |