From aee4522ad43acf52ea8e9a65d0d3f5d9c2d5d4ee Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 27 Oct 2015 23:10:52 +0100 Subject: [PATCH 1/2] The contact page now shows the connection status. --- mod/dirfind.php | 16 ++++++++++++---- view/global.css | 5 +++++ view/theme/vier/templates/contact_template.tpl | 3 ++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/mod/dirfind.php b/mod/dirfind.php index 492f39d5a..c2b18e3e2 100644 --- a/mod/dirfind.php +++ b/mod/dirfind.php @@ -3,6 +3,7 @@ require_once('include/contact_widgets.php'); require_once('include/socgraph.php'); require_once('include/Contact.php'); require_once('include/contact_selectors.php'); +require_once('mod/contacts.php'); function dirfind_init(&$a) { @@ -77,7 +78,7 @@ function dirfind_content(&$a, $prefix = "") { $j = new stdClass(); $j->total = $count[0]["total"]; $j->items_page = $perpage; - $j->page = $a->pager['page']; + $j->page = $a->pager['page']; foreach ($results AS $result) { if (poco_alternate_ostatus_url($result["url"])) continue; @@ -121,15 +122,21 @@ function dirfind_content(&$a, $prefix = "") { foreach($j->results as $jj) { + $alt_text = ""; + + $itemurl = $jj->url; + // If We already know this contact then don't show the "connect" button if ($jj->cid > 0) { $connlnk = ""; $conntxt = ""; $contact = q("SELECT * FROM `contact` WHERE `id` = %d", intval($jj->cid)); - if ($contact) + if ($contact) { $photo_menu = contact_photo_menu($contact[0]); - else + $details = _contact_detail_for_template($contact[0]); + $alt_text = $details['alt_text']; + } else $photo_menu = array(); } else { $connlnk = $a->get_baseurl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url); @@ -141,8 +148,9 @@ function dirfind_content(&$a, $prefix = "") { $jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo); $entry = array( + 'alt_text' => $alt_text, 'url' => zrl($jj->url), - 'itemurl' => $jj->url, + 'itemurl' => $itemurl, 'name' => htmlentities($jj->name), 'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB), 'img_hover' => $jj->tags, diff --git a/view/global.css b/view/global.css index e1ccd8b92..6b1c0bfc3 100644 --- a/view/global.css +++ b/view/global.css @@ -274,3 +274,8 @@ a { #poke-recip-label, #poke-action-label, #prvmail-message-label { margin: 10px 0 10px; } + +.contact-entry-photo img { + max-width: 96px; + max-height: 96px; +} diff --git a/view/theme/vier/templates/contact_template.tpl b/view/theme/vier/templates/contact_template.tpl index add2eff5c..2993bb92c 100644 --- a/view/theme/vier/templates/contact_template.tpl +++ b/view/theme/vier/templates/contact_template.tpl @@ -5,7 +5,8 @@ - {{$contact.name}} + + {{$contact.name}} {{if $multiselect}} From 5a58f55a3625af994fc0a91c9a609ff014f4fc15 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 28 Oct 2015 00:18:56 +0100 Subject: [PATCH 2/2] Set the maximum avatar size to 80 pixels --- view/global.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/global.css b/view/global.css index 6b1c0bfc3..d5a44f75f 100644 --- a/view/global.css +++ b/view/global.css @@ -276,6 +276,6 @@ a { } .contact-entry-photo img { - max-width: 96px; - max-height: 96px; + max-width: 80px; + max-height: 80px; }