Improved contact menu
This commit is contained in:
parent
26983bafff
commit
bb0dff2c75
3 changed files with 25 additions and 15 deletions
2
boot.php
2
boot.php
|
@ -1658,7 +1658,7 @@ if(! function_exists('load_contact_links')) {
|
||||||
if(! $uid || x($a->contacts,'empty'))
|
if(! $uid || x($a->contacts,'empty'))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$r = q("SELECT `id`,`network`,`url`,`thumb` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `thumb` != ''",
|
$r = q("SELECT `id`,`network`,`url`,`thumb`, `rel` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `thumb` != ''",
|
||||||
intval($uid)
|
intval($uid)
|
||||||
);
|
);
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
|
|
|
@ -884,6 +884,7 @@ function item_photo_menu($item){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (local_user()) {
|
||||||
$menu = Array(
|
$menu = Array(
|
||||||
t("Follow Thread") => $sub_link,
|
t("Follow Thread") => $sub_link,
|
||||||
t("View Status") => $status_link,
|
t("View Status") => $status_link,
|
||||||
|
@ -897,8 +898,11 @@ function item_photo_menu($item){
|
||||||
if ($a->contacts[$clean_url]['network'] === NETWORK_DFRN)
|
if ($a->contacts[$clean_url]['network'] === NETWORK_DFRN)
|
||||||
$menu[t("Poke")] = $poke_link;
|
$menu[t("Poke")] = $poke_link;
|
||||||
|
|
||||||
if (($cid == 0) AND in_array($item['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA)))
|
if ((($cid == 0) OR ($a->contacts[$clean_url]['rel'] == CONTACT_IS_FOLLOWER)) AND
|
||||||
|
in_array($item['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA)))
|
||||||
$menu[t("Connect/Follow")] = $a->get_baseurl($ssl_state)."/follow?url=".urlencode($item['author-link']);
|
$menu[t("Connect/Follow")] = $a->get_baseurl($ssl_state)."/follow?url=".urlencode($item['author-link']);
|
||||||
|
} else
|
||||||
|
$menu = array(t("View Profile") => $item['author-link']);
|
||||||
|
|
||||||
$args = array('item' => $item, 'menu' => $menu);
|
$args = array('item' => $item, 'menu' => $menu);
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,11 @@ require_once('include/Contact.php');
|
||||||
|
|
||||||
function dirfind_init(&$a) {
|
function dirfind_init(&$a) {
|
||||||
|
|
||||||
|
if(! local_user()) {
|
||||||
|
notice( t('Permission denied.') . EOL );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(! x($a->page,'aside'))
|
if(! x($a->page,'aside'))
|
||||||
$a->page['aside'] = '';
|
$a->page['aside'] = '';
|
||||||
|
|
||||||
|
@ -132,7 +137,8 @@ function dirfind_content(&$a, $prefix = "") {
|
||||||
} else {
|
} else {
|
||||||
$connlnk = $a->get_baseurl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url);
|
$connlnk = $a->get_baseurl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url);
|
||||||
$conntxt = t('Connect');
|
$conntxt = t('Connect');
|
||||||
$photo_menu = array(array(t("Connect/Follow"), $connlnk));
|
$photo_menu = array(array(t("View Profile"), zrl($jj->url)));
|
||||||
|
$photo_menu[] = array(t("Connect/Follow"), $connlnk);
|
||||||
}
|
}
|
||||||
|
|
||||||
$jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo);
|
$jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo);
|
||||||
|
|
Loading…
Reference in a new issue