From a9dba2720bc0a5ffd9472f3233cf0ea3034019c4 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 29 Apr 2012 01:42:48 -0700 Subject: enhanced profile reporting for single values --- mod/profiles.php | 66 +++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 15 deletions(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index 7a33a03e4..478aab8a5 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -139,21 +139,49 @@ function profiles_post(&$a) { $changes = array(); + $value = ''; if($is_default) { - if($marital != $orig[0]['marital']) $changes[] = '♥ ' . t('Marital Status'); - if($withchanged) $changes[] = '♥ ' . t('Romantic Partner'); - if($work != $orig[0]['work']) $changes[] = t('Work/Employment'); - if($religion != $orig[0]['religion']) $changes[] = t('Religion'); - if($politic != $orig[0]['politic']) $changes[] = t('Political Views'); - if($gender != $orig[0]['gender']) $changes[] = t('Gender'); - if($sexual != $orig[0]['sexual']) $changes[] = t('Sexual Preference'); - if($homepage != $orig[0]['homepage']) $changes[] = t('Homepage'); - if($interest != $orig[0]['interest']) $changes[] = t('Interests'); + if($marital != $orig[0]['marital']) { + $changes[] = '♥ ' . t('Marital Status'); + $value = $marital; + } + if($withchanged) { + $changes[] = '♥ ' . t('Romantic Partner'); + $value = strip_tags($with); + } + if($work != $orig[0]['work']) { + $changes[] = t('Work/Employment'); + } + if($religion != $orig[0]['religion']) { + $changes[] = t('Religion'); + $value = $religion; + } + if($politic != $orig[0]['politic']) { + $changes[] = t('Political Views'); + $value = $politic; + } + if($gender != $orig[0]['gender']) { + $changes[] = t('Gender'); + $value = $gender; + } + if($sexual != $orig[0]['sexual']) { + $changes[] = t('Sexual Preference'); + $value = $sexual; + } + if($homepage != $orig[0]['homepage']) { + $changes[] = t('Homepage'); + $value = $homepage; + } + if($interest != $orig[0]['interest']) { + $changes[] = t('Interests'); + $value = $interest; + } if($address != $orig[0]['address'] || $locality != $orig[0]['locality'] || $region != $orig[0]['region'] - || $country_name != $orig[0]['country_name']) - $changes[] = t('Location'); + || $country_name != $orig[0]['country_name']) { + $changes[] = t('Location'); + } - profile_activity($changes); + profile_activity($changes,$value); } @@ -245,7 +273,7 @@ function profiles_post(&$a) { } -function profile_activity($changed) { +function profile_activity($changed, $value) { $a = get_app(); if(! local_user() || ! is_array($changed) || ! count($changed)) @@ -289,7 +317,7 @@ function profile_activity($changed) { foreach($changed as $ch) { if(strlen($changes)) { if ($z == ($t - 1)) - $changes .= ' and '; + $changes .= t(' and '); else $changes .= ', '; } @@ -299,7 +327,15 @@ function profile_activity($changed) { $prof = '[url=' . $self[0]['url'] . '?tab=profile' . ']' . t('public profile') . '[/url]'; - $arr['body'] = sprintf( t('%1$s has an updated %2$s, changing %3$s.'), $A, $prof, $changes); + if($t == 1 && strlen($value)) { + $message = sprintf( t('%1$s changed %2$s to %3$s'), $A, $changes, $value); + $message .= "\n\n" . sprintf( t(' - Visit %1$s\'s %2$s'), $A, $prof); + } + else + $message = sprintf( t('%1$s has an updated %2$s, changing %3$s.'), $A, $prof, $changes); + + + $arr['body'] = $message; $arr['object'] = '' . ACTIVITY_OBJ_PROFILE . '' . $self[0]['name'] . '' . '' . $self[0]['url'] . '/' . $self[0]['name'] . ''; -- cgit v1.2.3 From 735f518fd8547fab37ca39c7717e8d89e07e3337 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 29 Apr 2012 01:49:54 -0700 Subject: fix location change notification --- mod/profiles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index 478aab8a5..d640ba1ba 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -177,7 +177,7 @@ function profiles_post(&$a) { $value = $interest; } if($address != $orig[0]['address'] || $locality != $orig[0]['locality'] || $region != $orig[0]['region'] - || $country_name != $orig[0]['country_name']) { + || $country_name != $orig[0]['country-name']) { $changes[] = t('Location'); } -- cgit v1.2.3 From def6f0b408680c4e5f209890bbf1ad6bf40b5add Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 29 Apr 2012 02:11:33 -0700 Subject: the heart should really be red. --- mod/profiles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index d640ba1ba..3a52c8fa5 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -142,7 +142,7 @@ function profiles_post(&$a) { $value = ''; if($is_default) { if($marital != $orig[0]['marital']) { - $changes[] = '♥ ' . t('Marital Status'); + $changes[] = '[color=#ff0000]♥[/color] ' . t('Marital Status'); $value = $marital; } if($withchanged) { -- cgit v1.2.3 From 06d6ab481280d786c40b0741ebd0b787addee40d Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 2 May 2012 01:07:23 -0700 Subject: delineate the new profile changes from the rest of the text --- mod/profiles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index 3a52c8fa5..4de9057dc 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -328,7 +328,7 @@ function profile_activity($changed, $value) { $prof = '[url=' . $self[0]['url'] . '?tab=profile' . ']' . t('public profile') . '[/url]'; if($t == 1 && strlen($value)) { - $message = sprintf( t('%1$s changed %2$s to %3$s'), $A, $changes, $value); + $message = sprintf( t('%1$s changed %2$s to "%3$s"'), $A, $changes, $value); $message .= "\n\n" . sprintf( t(' - Visit %1$s\'s %2$s'), $A, $prof); } else -- cgit v1.2.3 From f3e18df55dc259e70e9acdfd6e851b97ec062f46 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 3 May 2012 16:55:03 -0700 Subject: string update --- mod/profiles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index 4de9057dc..558044842 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -329,7 +329,7 @@ function profile_activity($changed, $value) { if($t == 1 && strlen($value)) { $message = sprintf( t('%1$s changed %2$s to "%3$s"'), $A, $changes, $value); - $message .= "\n\n" . sprintf( t(' - Visit %1$s\'s %2$s'), $A, $prof); + $message .= "\n\n" . sprintf( t(" - Visit %1$s\'s %2$s"), $A, $prof); } else $message = sprintf( t('%1$s has an updated %2$s, changing %3$s.'), $A, $prof, $changes); -- cgit v1.2.3 From 2818cb28e98f54fe413885bac34592fbfa7e07f5 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 3 May 2012 17:19:53 -0700 Subject: use html symbols for double quotes --- mod/profiles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index 558044842..c72a233c2 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -328,7 +328,7 @@ function profile_activity($changed, $value) { $prof = '[url=' . $self[0]['url'] . '?tab=profile' . ']' . t('public profile') . '[/url]'; if($t == 1 && strlen($value)) { - $message = sprintf( t('%1$s changed %2$s to "%3$s"'), $A, $changes, $value); + $message = sprintf( t('%1$s changed %2$s to “%3$s”'), $A, $changes, $value); $message .= "\n\n" . sprintf( t(" - Visit %1$s\'s %2$s"), $A, $prof); } else -- cgit v1.2.3