From 2a7a5b2d0182193c96a12097dd3cf47f517e3553 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 6 Dec 2012 19:44:13 -0800 Subject: move 'Connect' button to local chanview page, remove from remote profile pages - still requires some theming love --- boot.php | 6 ------ include/Contact.php | 17 +++++++++++++++-- view/tpl/profile_vcard.tpl | 10 ---------- view/tpl/xchan_vcard.tpl | 11 +++++++++++ 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/boot.php b/boot.php index 36fa535b1..6fac2d914 100644 --- a/boot.php +++ b/boot.php @@ -1334,12 +1334,6 @@ if(! function_exists('profile_sidebar')) { } } - if(get_my_url() && $profile['unkmail']) - $wallmessage = t('Message'); - else - $wallmessage = false; - - // show edit profile to yourself if($is_owner) { diff --git a/include/Contact.php b/include/Contact.php index ff798ed74..e52b5c9cf 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -2,9 +2,22 @@ function vcard_from_xchan($xchan) { + + $connect = false; + if(local_user()) { + $r = q("select * from abook where abook_xchan = '%s' and abook_channel = %d limit 1", + dbesc($xchan['xchan_hash']), + intval(local_user()) + ); + if(! $r) + $connect = t('Connect'); + } + return replace_macros(get_markup_template('xchan_vcard.tpl'),array( - '$name' => $xchan['xchan_name'], - '$photo' => $xchan['xchan_photo_l'] + '$name' => $xchan['xchan_name'], + '$photo' => $xchan['xchan_photo_l'], + '$url' => $xchan['xchan_addr'], + '$connect' => $connect )); } diff --git a/view/tpl/profile_vcard.tpl b/view/tpl/profile_vcard.tpl index 216f9665a..7ae62330c 100644 --- a/view/tpl/profile_vcard.tpl +++ b/view/tpl/profile_vcard.tpl @@ -47,16 +47,6 @@ {{ if $homepage }}
$homepage
$profile.homepage
{{ endif }} - $contact_block diff --git a/view/tpl/xchan_vcard.tpl b/view/tpl/xchan_vcard.tpl index 6bc56ce74..4e3f69b0c 100644 --- a/view/tpl/xchan_vcard.tpl +++ b/view/tpl/xchan_vcard.tpl @@ -2,3 +2,14 @@
$name
name
+ + + + + -- cgit v1.2.3