$a->page['template'] = 'profile';
$a->page['title'] = $a->profile['name'];
+ $_SESSION['theme'] = $a->profile['theme'];
return;
}}
$profile = $a->argv[1];
}
profile_load($a,$which,$profile);
- $a->page['htmlhead'] .= "<meta name=\"dfrn-template\" content=\"" . $a->get_baseurl() . "/profile/%s" . "\" />\r\n";
+ $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/dfrn_poll/' . $which .'" />' . "\r\n" ;
+
+ $a->page['htmlhead'] .= '<meta name="dfrn-template" content="' . $a->get_baseurl() . "/profile/%s" . '" />' . "\r\n" ;
+ $a->page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . (($a->profile['net-publish']) ? 'true' : 'false') . '" />' . "\r\n" ;
+
$dfrn_pages = array('request', 'confirm', 'notify', 'poll');
foreach($dfrn_pages as $dfrn)
if(remote_user()) {
$contact_id = $_SESSION['visitor_id'];
$groups = init_groups_visitor($contact_id);
+ $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
+ intval($contact_id),
+ intval($a->profile['uid'])
+ );
+ if(count($r))
+ $contact = $r[0];
}
- if(local_user()) {
- $contact_id = $_SESSION['cid'];
+ else {
+ if(local_user()) {
+ $contact_id = $_SESSION['cid'];
+ $contact = $a->contact;
+ }
}
if($update) {
$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']
));
require_once('view/acl_selectors.php');
$tpl = file_get_contents("view/jot.tpl");
-
+ if(is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))
+ $lockstate = 'lock';
+ else
+ $lockstate = 'unlock';
$o .= replace_macros($tpl,array(
'$baseurl' => $a->get_baseurl(),
'$return_path' => $a->cmd,
'$visitor' => (($_SESSION['uid'] == $a->profile['profile_uid']) ? 'block' : 'none'),
- '$lockstate' => 'unlock',
- '$acl' => (($_SESSION['uid'] == $a->profile['profile_uid']) ? populate_acl() : ''),
+ '$lockstate' => $lockstate,
+ '$acl' => (($_SESSION['uid'] == $a->profile['profile_uid']) ? populate_acl($a->user) : ''),
'$profile_uid' => $a->profile['profile_uid']
));
}
$r = q("SELECT COUNT(*) AS `total`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
- AND NOT `item`.`type` IN ( 'remote', 'net-comment') AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `type` != 'remote')
$sql_extra ",
intval($a->profile['uid'])
if(count($r))
$a->set_pager_total($r[0]['total']);
-
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`,
`contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
- AND NOT `item`.`type` IN ( 'remote', 'net-comment') AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `type` != 'remote')
$sql_extra
ORDER BY `parent` DESC, `id` ASC LIMIT %d ,%d ",
intval($a->profile['uid']),
'$id' => $item['item_id'],
'$parent' => $item['parent'],
'$profile_uid' => $a->profile['uid'],
+ '$mylink' => $contact['url'],
+ '$mytitle' => t('Me'),
+ '$myphoto' => $contact['thumb'],
'$ww' => ''
));
}
// This is my profile 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.
- if(local_user() && ($item['contact-uid'] == $_SESSION['uid']) && (strlen($item['dfrn-id'])) && (! $item['self'] ))
+ if(local_user() && ($item['contact-uid'] == $_SESSION['uid'])
+ && ($item['rel'] == DIRECTION_IN || $item['rel'] == DIRECTION_BOTH) && (! $item['self'] ))
$profile_url = $redirect_url;
// FIXME tryng to solve the mishmash of profile photos.
'$title' => $item['title'],
'$body' => bbcode($item['body']),
'$ago' => relative_date($item['created']),
+ '$location' => (($item['location']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : ''),
'$indent' => (($item['parent'] != $item['item_id']) ? ' comment' : ''),
'$drop' => $drop,
'$comment' => $comment
));
+
}
}