+ if($tab === 'profile') {
+ $profile_lang = get_config('system','language');
+ if(! $profile_lang)
+ $profile_lang = 'en';
+ if(file_exists("view/$profile_lang/profile_advanced.php"))
+ require_once("view/$profile_lang/profile_advanced.php");
+ else
+ require_once('view/profile_advanced.php');
+
+ call_hooks('profile_advanced',$o);
+
+ return $o;
+ }
+
+ $commpage = (($a->profile['page-flags'] == PAGE_COMMUNITY) ? true : false);
+ $commvisitor = (($commpage && $remote_contact == true) ? true : false);
+
+ $celeb = ((($a->profile['page-flags'] == PAGE_SOAPBOX) || ($a->profile['page-flags'] == PAGE_COMMUNITY)) ? true : false);
+
+ if(can_write_wall($a,$a->profile['profile_uid'])) {
+
+ $geotag = ((($is_owner || $commvisitor) && $a->profile['allow_location']) ? load_view_file('view/jot_geotag.tpl') : '');
+
+ $tpl = load_view_file('view/jot-header.tpl');
+
+ $a->page['htmlhead'] .= replace_macros($tpl, array(
+ '$baseurl' => $a->get_baseurl(),
+ '$geotag' => $geotag,
+ '$nickname' => $a->profile['nickname']
+ ));
+
+ require_once('include/acl_selectors.php');
+
+ $tpl = load_view_file('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(),
+ '$defloc' => (($is_owner) ? $a->user['default-location'] : ''),
+ '$return_path' => $a->cmd,
+ '$visitor' => (($is_owner || $commvisitor) ? 'block' : 'none'),
+ '$lockstate' => $lockstate,
+ '$bang' => '',
+ '$acl' => (($is_owner) ? populate_acl($a->user, $celeb) : ''),
+ '$profile_uid' => $a->profile['profile_uid']
+ ));
+ }
+
+ // This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
+ // because browser prefetching might change it on us. We have to deliver it with the page.
+
+ if($tab === 'posts' && (! $a->pager['start'])) {
+ $o .= '<div id="live-profile"></div>' . "\r\n";
+ $o .= "<script> var profile_uid = " . $a->profile['profile_uid'] . "; </script>\r\n";
+ }
+
+ }
+
+ // Construct permissions