start whipping the item photo menu into shape
This commit is contained in:
parent
f8c33243bf
commit
47235e5b32
10
boot.php
10
boot.php
@ -1770,13 +1770,13 @@ 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 ",
|
$r = q("SELECT abook_id, abook_flags, abook_my_perms, abook_their_perms, xchan_hash, xchan_photo_m, xchan_name, xchan_url from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and not (abook_flags & %d) ",
|
||||||
intval($uid)
|
intval($uid),
|
||||||
|
intval(ABOOK_FLAG_SELF)
|
||||||
);
|
);
|
||||||
if(count($r)) {
|
if($r) {
|
||||||
foreach($r as $rr){
|
foreach($r as $rr){
|
||||||
$url = normalise_link($rr['url']);
|
$ret[$rr['xchan_hash']] = $rr;
|
||||||
$ret[$url] = $rr;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -712,7 +712,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
|
|||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
||||||
function best_link_url($item,&$sparkle,$ssl_state = false) {
|
function best_link_url($item) {
|
||||||
|
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
@ -745,6 +745,7 @@ function best_link_url($item,&$sparkle,$ssl_state = false) {
|
|||||||
if(! function_exists('item_photo_menu')){
|
if(! function_exists('item_photo_menu')){
|
||||||
function item_photo_menu($item){
|
function item_photo_menu($item){
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
$contact = null;
|
||||||
|
|
||||||
$ssl_state = false;
|
$ssl_state = false;
|
||||||
|
|
||||||
@ -752,54 +753,33 @@ function item_photo_menu($item){
|
|||||||
$ssl_state = true;
|
$ssl_state = true;
|
||||||
if(! count($a->contacts))
|
if(! count($a->contacts))
|
||||||
load_contact_links(local_user());
|
load_contact_links(local_user());
|
||||||
|
$channel = $a->get_channel();
|
||||||
|
$channel_hash = (($channel) ? $channel['channel_hash'] : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
$sub_link="";
|
$sub_link="";
|
||||||
$poke_link="";
|
$poke_link="";
|
||||||
$contact_url="";
|
$contact_url="";
|
||||||
$pm_url="";
|
$pm_url="";
|
||||||
$status_link="";
|
|
||||||
$photos_link="";
|
|
||||||
$posts_link="";
|
|
||||||
|
|
||||||
if((local_user()) && local_user() == $item['uid'] && $item['parent'] == $item['id'] && (! $item['self'])) {
|
if((local_user()) && local_user() == $item['uid'] && $item['parent'] == $item['id']
|
||||||
|
&& $channel && ($channel_hash != $item['author_xchan'])) {
|
||||||
$sub_link = 'javascript:dosubthread(' . $item['id'] . '); return false;';
|
$sub_link = 'javascript:dosubthread(' . $item['id'] . '); return false;';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sparkle = false;
|
$profile_link = z_root() . "/chanview/?f=&hash=" . $item['author_xchan'];
|
||||||
$profile_link = best_link_url($item,$sparkle,$ssl_state);
|
$pm_url = $a->get_baseurl($ssl_state) . '/message/new/?f=&hash=' . $item['author_xchan'];
|
||||||
|
|
||||||
if($sparkle) {
|
if($a->contacts && array_key_exists($item['author_xchan'],$a->contacts))
|
||||||
$cid = intval(basename($profile_link));
|
$contact = $a->contacts[$item['author_xchan']];
|
||||||
$status_link = $profile_link . "?url=status";
|
|
||||||
$photos_link = $profile_link . "?url=photos";
|
if($contact) {
|
||||||
$profile_link = $profile_link . "?url=profile";
|
$poke_link = $a->get_baseurl($ssl_state) . '/poke/?f=&c=' . $contact['abook_id'];
|
||||||
$pm_url = $a->get_baseurl($ssl_state) . '/message/new/' . $cid;
|
$contact_url = $a->get_baseurl($ssl_state) . '/connnections/' . $contact['abook_id'];
|
||||||
$zurl = '';
|
$posts_link = $a->get_baseurl($ssl_state) . '/network/?cid=' . $contact['abook_id'];
|
||||||
}
|
|
||||||
else {
|
|
||||||
$profile_link = zid($profile_link);
|
|
||||||
if(local_user() && local_user() == $item['uid'] && link_compare($item['url'],$item['author-link'])) {
|
|
||||||
$cid = $item['contact-id'];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$cid = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(($cid) && (! $item['self'])) {
|
|
||||||
$poke_link = $a->get_baseurl($ssl_state) . '/poke/?f=&c=' . $cid;
|
|
||||||
$contact_url = $a->get_baseurl($ssl_state) . '/contacts/' . $cid;
|
|
||||||
$posts_link = $a->get_baseurl($ssl_state) . '/network/?cid=' . $cid;
|
|
||||||
|
|
||||||
$clean_url = normalise_link($item['author-link']);
|
$clean_url = normalise_link($item['author-link']);
|
||||||
|
|
||||||
if((local_user()) && (local_user() == $item['uid'])) {
|
|
||||||
if(isset($a->contacts) && x($a->contacts,$clean_url)) {
|
|
||||||
if($a->contacts[$clean_url]['network'] === NETWORK_DIASPORA) {
|
|
||||||
$pm_url = $a->get_baseurl($ssl_state) . '/message/new/' . $cid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$menu = Array(
|
$menu = Array(
|
||||||
|
Reference in New Issue
Block a user