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'] .= "<meta name=\"dfrn-template\" content=\"" . $a->get_baseurl() . "/profile/%s" . "\" />\r\n";
$dfrn_pages = array('request', 'confirm', 'notify', 'poll');
$tab = 'posts';
-
-
+ if(! $update) {
+ $_SESSION['profile_uid'] = $a->profile['uid'];
+ }
if(remote_user()) {
$contact_id = $_SESSION['visitor_id'];
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 {
$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']
));
$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) {
$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'])) {
'$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' : ''),