From 754fec9a547159c38386d70a6b3e1c4b88193690 Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Sat, 27 Dec 2014 12:46:59 +0100 Subject: Redirect /profiles to default profile when multi_profiles is off. Fixes #768 --- mod/profiles.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'mod') 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)) { -- cgit v1.2.3 From 6a679d26ce1c2947e49c74f3b6a98a7ad770b325 Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Sat, 27 Dec 2014 13:36:05 +0100 Subject: Fix #771, add tooltips to mail and intros count in channel manager, always show counts (even when 0, makes it easier to understand what the icons are) --- mod/manage.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/manage.php b/mod/manage.php index 00c6db7f0..28fa8e658 100644 --- a/mod/manage.php +++ b/mod/manage.php @@ -49,7 +49,7 @@ function manage_content(&$a) { for($x = 0; $x < count($channels); $x ++) { $channels[$x]['link'] = 'manage/' . intval($channels[$x]['channel_id']); if($channels[$x]['channel_id'] == local_user()) - $selected_channel = $channels[$x]; + $selected_channel = &$channels[$x]; // Needs to be a reference! $channels[$x]['default'] = (($channels[$x]['channel_id'] == $account['account_default_channel']) ? "1" : ''); $channels[$x]['default_links'] = '1'; @@ -153,6 +153,8 @@ function manage_content(&$a) { '$msg_make_default' => t('Make Default'), '$links' => $links, '$all_channels' => $channels, + '$mail_format' => t('%d new messages'), + '$intros_format' => t('%d new introductions'), '$channel_usage_message' => $channel_usage_message, )); -- cgit v1.2.3 From 40a327b68fe1bb37bbc2fc6bc1c6d761ee564898 Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Sat, 27 Dec 2014 14:06:09 +0100 Subject: Allow quick access to mail and connections from Channel Manager --- mod/manage.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/manage.php b/mod/manage.php index 28fa8e658..21327a120 100644 --- a/mod/manage.php +++ b/mod/manage.php @@ -28,8 +28,13 @@ function manage_content(&$a) { if($change_channel) { $r = change_channel($change_channel); - if($r && $r['channel_startpage']) - goaway(z_root() . '/' . $r['channel_startpage']); + if((argc() > 2) && !(argv(2) === 'default')) { + goaway(z_root() . '/' . implode('/',array_slice($a->argv,2))); // Go to whatever is after /manage/, but with the new channel + } + else { + if($r && $r['channel_startpage']) + goaway(z_root() . '/' . $r['channel_startpage']); // If nothing extra is specified, go to the default page + } goaway(z_root()); } -- cgit v1.2.3 From 3065650683c221c0a23c1dbcab2e1ec2d73997d4 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 28 Dec 2014 23:21:49 -0800 Subject: filter posts you author from unseen notifications - note there are other ways to do this, but involve some code complexity. This is easier to implement but may have a slight impact on the ping query performance. It's not horrid, just mentioning for the record. --- mod/ping.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'mod') diff --git a/mod/ping.php b/mod/ping.php index ef8afd91c..cdb6aa0b2 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -46,6 +46,7 @@ function ping_init(&$a) { if(local_user()) { $vnotify = get_pconfig(local_user(),'system','vnotify'); $evdays = intval(get_pconfig(local_user(),'system','evdays')); + $ob_hash = get_observer_hash(); } // if unset show all visual notification types @@ -275,10 +276,12 @@ function ping_init(&$a) { $result = array(); $r = q("SELECT * FROM item - WHERE item_restrict = %d and ( item_flags & %d ) > 0 and uid = %d", + WHERE item_restrict = %d and ( item_flags & %d ) > 0 and uid = %d + and author_xchan != '%s' ", intval(ITEM_VISIBLE), intval(ITEM_UNSEEN), - intval(local_user()) + intval(local_user()), + dbesc($ob_hash) ); if($r) { @@ -381,10 +384,12 @@ function ping_init(&$a) { if($vnotify & (VNOTIFY_NETWORK|VNOTIFY_CHANNEL)) { $r = q("SELECT id, item_restrict, item_flags FROM item - WHERE (item_restrict = %d) and ( item_flags & %d ) > 0 and uid = %d", + WHERE (item_restrict = %d) and ( item_flags & %d ) > 0 and uid = %d + and author_xchan != '%s'", intval(ITEM_VISIBLE), intval(ITEM_UNSEEN), - intval(local_user()) + intval(local_user()), + dbesc($ob_hash) ); if($r) { -- cgit v1.2.3 From e69e59d260c311ceae4cbde3239c33d8caea4553 Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Mon, 29 Dec 2014 22:07:40 +0100 Subject: Don't show current channel separately in channel manager, highlight it instead --- mod/manage.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'mod') diff --git a/mod/manage.php b/mod/manage.php index 21327a120..b0de945bf 100644 --- a/mod/manage.php +++ b/mod/manage.php @@ -46,15 +46,12 @@ function manage_content(&$a) { intval(PAGE_REMOVED) ); - $selected_channel = null; $account = get_app()->get_account(); if($r && count($r)) { $channels = $r; for($x = 0; $x < count($channels); $x ++) { $channels[$x]['link'] = 'manage/' . intval($channels[$x]['channel_id']); - if($channels[$x]['channel_id'] == local_user()) - $selected_channel = &$channels[$x]; // Needs to be a reference! $channels[$x]['default'] = (($channels[$x]['channel_id'] == $account['account_default_channel']) ? "1" : ''); $channels[$x]['default_links'] = '1'; @@ -152,8 +149,8 @@ function manage_content(&$a) { $o = replace_macros(get_markup_template('channels.tpl'), array( '$header' => t('Channel Manager'), '$msg_selected' => t('Current Channel'), - '$selected' => $selected_channel, - '$desc' => t('Attach to one of your channels by selecting it.'), + '$selected' => local_user(), + '$desc' => t('Switch to one of your channels by selecting it.'), '$msg_default' => t('Default Channel'), '$msg_make_default' => t('Make Default'), '$links' => $links, -- cgit v1.2.3