From d0ae5ce3263ec96250ecc1da0031f420891a370f Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 4 Oct 2015 14:41:39 +0200 Subject: [PATCH 1/3] Show more information when following a new contact --- mod/follow.php | 48 ++++++++++++++++++++------------- mod/notifications.php | 1 - object/Item.php | 2 +- view/templates/auto_request.tpl | 7 +++-- view/templates/dfrn_request.tpl | 5 ++++ 5 files changed, 40 insertions(+), 23 deletions(-) mode change 100755 => 100644 mod/follow.php diff --git a/mod/follow.php b/mod/follow.php old mode 100755 new mode 100644 index dd717aacd..603707809 --- a/mod/follow.php +++ b/mod/follow.php @@ -61,6 +61,9 @@ function follow_content(&$a) { // Makes the connection request for friendica contacts easier $_SESSION["fastlane"] = $ret["url"]; + $r = q("SELECT `location`, `about`, `keywords` FROM `gcontact` WHERE `nurl` = '%s'", + normalise_link($ret["url"])); + $header = $ret["name"]; if ($ret["addr"] != "") @@ -71,25 +74,32 @@ function follow_content(&$a) { $o = replace_macros($tpl,array( '$header' => htmlentities($header), '$photo' => $ret["photo"], - '$desc' => "", - '$pls_answer' => t('Please answer the following:'), - '$does_know_you' => array('knowyou', sprintf(t('Does %s know you?'),$ret["name"]), false, '', array(t('No'),t('Yes'))), - '$add_note' => t('Add a personal note:'), - '$page_desc' => "", - '$friendica' => "", - '$statusnet' => "", - '$diaspora' => "", - '$diasnote' => "", - '$your_address' => t('Your Identity Address:'), - '$invite_desc' => "", - '$emailnet' => "", - '$submit' => t('Submit Request'), - '$cancel' => t('Cancel'), - '$nickname' => "", - '$name' => $ret["name"], - '$url' => $ret["url"], - '$myaddr' => $myaddr, - '$request' => $request + '$desc' => "", + '$pls_answer' => t('Please answer the following:'), + '$does_know_you' => array('knowyou', sprintf(t('Does %s know you?'),$ret["name"]), false, '', array(t('No'),t('Yes'))), + '$add_note' => t('Add a personal note:'), + '$page_desc' => "", + '$friendica' => "", + '$statusnet' => "", + '$diaspora' => "", + '$diasnote' => "", + '$your_address' => t('Your Identity Address:'), + '$invite_desc' => "", + '$emailnet' => "", + '$submit' => t('Submit Request'), + '$cancel' => t('Cancel'), + '$nickname' => "", + '$name' => $ret["name"], + '$url' => $ret["url"], + '$url_label' => t("Profile URL"), + '$myaddr' => $myaddr, + '$request' => $request, + '$location' => bbcode($r[0]["location"]), + '$location_label' => t("Location:"), + '$about' => bbcode($r[0]["about"]), + '$about_label' => t("About:"), + '$keywords' => bbcode($r[0]["keywords"]), + '$keywords_label' => t("Tags:") )); return $o; } diff --git a/mod/notifications.php b/mod/notifications.php index 44f6dd567..1fc31c3eb 100644 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -216,7 +216,6 @@ function notifications_content(&$a) { '$contact_id' => $rr['contact-id'], '$photo' => ((x($rr,'photo')) ? proxy_url($rr['photo']) : "images/person-175.jpg"), '$fullname' => $rr['name'], - '$location_label' => t('Location:'), '$location' => $rr['glocation'], '$location_label' => t('Location:'), '$about' => proxy_parse_html(bbcode($rr['gabout'], false, false)), diff --git a/object/Item.php b/object/Item.php index 8d364e602..c7a025861 100644 --- a/object/Item.php +++ b/object/Item.php @@ -644,7 +644,7 @@ class Item extends BaseObject { if(!$this->is_toplevel() && !(get_config('system','thread_allow') && $a->theme_thread_allow)) { return ''; } - + $comment_box = ''; $conv = $this->get_conversation(); $template = get_markup_template($this->get_comment_box_template()); diff --git a/view/templates/auto_request.tpl b/view/templates/auto_request.tpl index 56653c655..09e616332 100644 --- a/view/templates/auto_request.tpl +++ b/view/templates/auto_request.tpl @@ -1,5 +1,3 @@ - -

{{$header}}

{{if $myaddr == ""}} @@ -30,6 +28,11 @@ {{/if}} +{{if $url}}
{{$url_label}}
{{$url}}
{{/if}} +{{if $location}}
{{$location_label}}
{{$location}}
{{/if}} +{{if $keywords}}
{{$keywords_label}}
{{$keywords}}
{{/if}} +{{if $about}}
{{$about_label}}
{{$about}}
{{/if}} +
{{if $myaddr}} diff --git a/view/templates/dfrn_request.tpl b/view/templates/dfrn_request.tpl index 6c63c5331..d376b3a5d 100644 --- a/view/templates/dfrn_request.tpl +++ b/view/templates/dfrn_request.tpl @@ -27,6 +27,11 @@ {{/if}} +{{if $url}}
{{$url_label}}
{{$url}}
{{/if}} +{{if $location}}
{{$location_label}}
{{$location}}
{{/if}} +{{if $keywords}}
{{$keywords_label}}
{{$keywords}}
{{/if}} +{{if $about}}
{{$about_label}}
{{$about}}
{{/if}} +
{{if $myaddr}} From ba41336099141a25b84291c1bbd8366dc9797d1b Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 4 Oct 2015 14:49:12 +0200 Subject: [PATCH 2/3] Preparation for a not found contact. --- mod/follow.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mod/follow.php b/mod/follow.php index 603707809..b635b3493 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -64,6 +64,9 @@ function follow_content(&$a) { $r = q("SELECT `location`, `about`, `keywords` FROM `gcontact` WHERE `nurl` = '%s'", normalise_link($ret["url"])); + if (!$r) + $r = array(array("location" => "", "about" => "", "keywords" => "")); + $header = $ret["name"]; if ($ret["addr"] != "") From 83ea4f72538bb4cd2e79979307744933010a2082 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 4 Oct 2015 15:55:24 +0200 Subject: [PATCH 3/3] transfer some stuff from "follow" to the "notifications" to reduce the differences in the two dialogues. --- mod/follow.php | 4 ++-- mod/notifications.php | 3 ++- view/templates/intros.tpl | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mod/follow.php b/mod/follow.php index b635b3493..7b1957c93 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -99,9 +99,9 @@ function follow_content(&$a) { '$request' => $request, '$location' => bbcode($r[0]["location"]), '$location_label' => t("Location:"), - '$about' => bbcode($r[0]["about"]), + '$about' => proxy_parse_html(bbcode($r[0]["about"], false, false)), '$about_label' => t("About:"), - '$keywords' => bbcode($r[0]["keywords"]), + '$keywords' => $r[0]["keywords"], '$keywords_label' => t("Tags:") )); return $o; diff --git a/mod/notifications.php b/mod/notifications.php index 1fc31c3eb..831beee76 100644 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -216,7 +216,7 @@ function notifications_content(&$a) { '$contact_id' => $rr['contact-id'], '$photo' => ((x($rr,'photo')) ? proxy_url($rr['photo']) : "images/person-175.jpg"), '$fullname' => $rr['name'], - '$location' => $rr['glocation'], + '$location' => bbcode($rr['glocation'], false, false), '$location_label' => t('Location:'), '$about' => proxy_parse_html(bbcode($rr['gabout'], false, false)), '$about_label' => t('About:'), @@ -227,6 +227,7 @@ function notifications_content(&$a) { '$hidden' => array('hidden', t('Hide this contact from others'), ($rr['hidden'] == 1), ''), '$activity' => array('activity', t('Post a new friend activity'), (intval(get_pconfig(local_user(),'system','post_newfriend')) ? '1' : 0), t('if applicable')), '$url' => zrl($rr['url']), + '$url_label' => t('Profile URL'), '$knowyou' => $knowyou, '$approve' => t('Approve'), '$note' => $rr['note'], diff --git a/view/templates/intros.tpl b/view/templates/intros.tpl index aa10cde48..d50b14cd4 100644 --- a/view/templates/intros.tpl +++ b/view/templates/intros.tpl @@ -5,6 +5,7 @@

{{$str_notifytype}} {{$notify_type}}

{{$fullname}}
{{$fullname|escape:'html'}} +
{{$url_label}}
{{$url}}
{{if $location}}
{{$location_label}}
{{$location}}
{{/if}} {{if $gender}}
{{$gender_label}}
{{$gender}}
{{/if}} {{if $keywords}}
{{$keywords_label}}
{{$keywords}}
{{/if}}