X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofile.php;h=c8cfc4edddd969aa98668582e059286495675c1a;hb=72b20a6eb104744a2bc64e72d35fe4ec1cc36660;hp=b0ff85a447a4e25336ed24be89334d96cc45f737;hpb=9f81c3345b40d635a34f0448dd625b17f20508c3;p=friendica.git diff --git a/mod/profile.php b/mod/profile.php index b0ff85a447..c8cfc4eddd 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -57,7 +57,12 @@ function profile_init(&$a) { unset($_SESSION['authenticated']); } - profile_load($a,$which); + $profile = 0; + if((local_user()) && ($a->argc > 2) && ($a->argv[2] == 'view')) { + $which = $a->user['nickname']; + $profile = $a->argv[1]; + } + profile_load($a,$which,$profile); $a->page['htmlhead'] .= "get_baseurl() . "/profile/%s" . "\" />\r\n"; $dfrn_pages = array('request', 'confirm', 'notify', 'poll'); @@ -77,8 +82,9 @@ function profile_content(&$a, $update = false) { $tab = 'posts'; - - + if(! $update) { + $_SESSION['profile_uid'] = $a->profile['uid']; + } if(remote_user()) { $contact_id = $_SESSION['visitor_id']; @@ -90,22 +96,7 @@ function profile_content(&$a, $update = false) { if($update) { // Ensure we've got a profile owner if updating. - if(remote_user()) { - $r = q("SELECT `uid` FROM `contact` WHERE `id` = %d LIMIT 1", - intval($_SESSION['visitor_id']) - ); - if(count($r)) - $a->profile['uid'] = $r[0]['uid']; - else - killme(); - } - elseif(local_user()) { - $a->profile['uid'] = $_SESSION['uid']; - } - else { - killme(); - return; // NOTREACHED - } + $a->profile['profile_uid'] = $_SESSION['profile_uid']; } else { @@ -115,7 +106,8 @@ function profile_content(&$a, $update = false) { $tpl = file_get_contents('view/profile_tabs.tpl'); $o .= replace_macros($tpl,array( - '$url' => $a->get_baseurl() . '/' . $a->cmd + '$url' => $a->get_baseurl() . '/' . $a->cmd, + '$phototab' => $a->get_baseurl() . '/photos/' . $a->profile['nickname'] )); @@ -219,6 +211,10 @@ function profile_content(&$a, $update = false) { $tpl = file_get_contents('view/wall_item.tpl'); + if($update) + $return_url = $_SESSION['return_url']; + else + $return_url = $_SESSION['return_url'] = $a->cmd; if(count($r)) { foreach($r as $item) { @@ -227,10 +223,6 @@ function profile_content(&$a, $update = false) { $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; - if($update) - $return_url = $_SESSION['return_url']; - else - $return_url = $_SESSION['return_url'] = $a->cmd; if(can_write_wall($a,$a->profile['uid'])) { @@ -282,6 +274,7 @@ function profile_content(&$a, $update = false) { '$profile_url' => $profile_link, '$name' => $profile_name, '$thumb' => $profile_avatar, + '$title' => $item['title'], '$body' => bbcode($item['body']), '$ago' => relative_date($item['created']), '$indent' => (($item['parent'] != $item['item_id']) ? ' comment' : ''),