make photo menu work better on remote profile logins
This commit is contained in:
parent
9f804b936a
commit
742bdd3054
10
boot.php
10
boot.php
|
@ -2686,10 +2686,16 @@ function item_photo_menu($item){
|
||||||
$photo_link="";
|
$photo_link="";
|
||||||
$profile_link = ((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
|
$profile_link = ((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
|
||||||
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
|
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
|
||||||
|
|
||||||
|
|
||||||
|
$contact_uid = ((x($item,'contact-uid')) && intval($item['contact-uid']) ? intval($item['contact-uid']) : 0);
|
||||||
|
|
||||||
if(strlen($item['author-link'])) {
|
// $item['contact-uid'] is only set on profile page.
|
||||||
|
// So we are checking for a profile page where the viewer owns the page,
|
||||||
|
// otherwise a logged in user if some other page that displays items.
|
||||||
|
// Then check if we can use a sparkle (redirect) link to the profile by virtue of it being our contact
|
||||||
|
// or a friend's contact that we both have a connection to.
|
||||||
|
|
||||||
|
if(((local_user() && (! $contact_uid)) || ($contact_uid && $contact_uid == local_user())) && strlen($item['author-link'])) {
|
||||||
if(link_compare($item['author-link'],$item['url']) && ($item['network'] === 'dfrn') && (! $item['self'])) {
|
if(link_compare($item['author-link'],$item['url']) && ($item['network'] === 'dfrn') && (! $item['self'])) {
|
||||||
$status_link = $redirect_url."?url=status";
|
$status_link = $redirect_url."?url=status";
|
||||||
$profile_link = $redirect_url."?url=profile";
|
$profile_link = $redirect_url."?url=profile";
|
||||||
|
|
|
@ -402,7 +402,7 @@ function profile_content(&$a, $update = 0) {
|
||||||
// This is my profile page but I'm not the author of this post/comment. If it's somebody that's a fan or mutual friend,
|
// This is my profile page but I'm not the author of this post/comment. If it's somebody that's a fan or mutual friend,
|
||||||
// I can go directly to their profile as an authenticated guest.
|
// I can go directly to their profile as an authenticated guest.
|
||||||
|
|
||||||
if(local_user() && ($item['contact-uid'] == $_SESSION['uid'])
|
if(local_user() && ($item['contact-uid'] == local_user())
|
||||||
&& ($item['network'] === 'dfrn') && (! $item['self'] )) {
|
&& ($item['network'] === 'dfrn') && (! $item['self'] )) {
|
||||||
$profile_url = $redirect_url;
|
$profile_url = $redirect_url;
|
||||||
$sparkle = ' sparkle';
|
$sparkle = ' sparkle';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user