untested patch for issue #58 - will require theming if it works
This commit is contained in:
parent
55cb322489
commit
b9a8b73392
18
boot.php
18
boot.php
@ -1623,20 +1623,13 @@ function profile_sidebar($profile, $block = 0) {
|
||||
|
||||
call_hooks('profile_sidebar_enter', $profile);
|
||||
|
||||
// don't show connect link to yourself
|
||||
$connect = (($profile['uid'] != local_user()) ? t('Connect') : False);
|
||||
require_once('include/Contact.php');
|
||||
|
||||
// don't show connect link to authenticated visitors either
|
||||
|
||||
if(remote_user() && count($_SESSION['remote'])) {
|
||||
foreach($_SESSION['remote'] as $visitor) {
|
||||
if($visitor['uid'] == $profile['uid']) {
|
||||
$connect = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$connect_url = rconnect_url($profile['uid'],get_observer_xchan());
|
||||
$connect = (($connect_url) ? t('Connect') : '');
|
||||
|
||||
if($connect_url)
|
||||
$connect_url = $connect_url . '/follow?f=1&url=' . $profile['channel_address'] . '@' . $a->get_hostname();
|
||||
|
||||
// show edit profile to yourself
|
||||
if($is_owner) {
|
||||
@ -1702,6 +1695,7 @@ function profile_sidebar($profile, $block = 0) {
|
||||
$o .= replace_macros($tpl, array(
|
||||
'$profile' => $profile,
|
||||
'$connect' => $connect,
|
||||
'$connect_url' => $connect_url,
|
||||
'$location' => $location,
|
||||
'$gender' => $gender,
|
||||
'$pdesc' => $pdesc,
|
||||
|
@ -1,6 +1,24 @@
|
||||
<?php /** @file */
|
||||
|
||||
|
||||
|
||||
function rconnect_url($channel_id,$xchan) {
|
||||
if(! $xchan)
|
||||
return '';
|
||||
$r = q("select abook_id from abook where abook_channel_id = %d and abook_xchan = '%s' limit 1",
|
||||
intval($channel_id),
|
||||
dbesc($xchan)
|
||||
);
|
||||
if($r)
|
||||
return '';
|
||||
$r = q("select hubloc_url from hubloc where hubloc_hash = '%s' and (hubloc_flags & HUBLOC_FLAGS_PRIMARY) limit 1",
|
||||
dbesc($xchan)
|
||||
);
|
||||
if($r)
|
||||
return $r[0]['hubloc_url'];
|
||||
return '';
|
||||
}
|
||||
|
||||
function abook_connections($channel_id, $sql_conditions = '') {
|
||||
$r = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d
|
||||
and not ( abook_flags & %d ) $sql_conditions",
|
||||
|
@ -45,6 +45,10 @@
|
||||
{{if $homepage}}<dl class="homepage"><dt class="homepage-label">{{$homepage}}</dt><dd class="homepage-url"><a href="{{$profile.homepage}}" >{{$profile.homepage}}</a></dd></dl>{{/if}}
|
||||
|
||||
|
||||
{{if $connect}}
|
||||
<a href="{{$connect_url}}" class="rconnect">$connect</a>
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
<div id="vcard-end"></div>
|
||||
{{$contact_block}}
|
||||
|
Reference in New Issue
Block a user