$a->page['title'] = $a->profile['name'] . " @ " . $a->config['sitename'];
-// if (!$profiledata)
-// $_SESSION['theme'] = $a->profile['theme'];
+ if (!$profiledata && !get_pconfig(local_user(),'system','always_my_theme'))
+ $_SESSION['theme'] = $a->profile['theme'];
$_SESSION['mobile-theme'] = $a->profile['mobile-theme'];
if($profile) {
$profile_int = intval($profile);
- $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `contact`.`addr`, `user`.* FROM `profile`
- INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
- WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d AND `contact`.`self` = 1 LIMIT 1",
+ $r = q("SELECT `contact`.`id` AS `contact_id`, `profile`.`uid` AS `profile_uid`, `profile`.*,
+ `contact`.`avatar-date` AS picdate, `contact`.`addr`, `user`.*
+ FROM `profile`
+ INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` AND `contact`.`self`
+ INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
+ WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d LIMIT 1",
dbesc($nickname),
intval($profile_int)
);
}
if((!$r) && (!count($r))) {
- $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `contact`.`addr`, `user`.* FROM `profile`
- INNER JOIN `contact` ON `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
- WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 AND `contact`.`self` = 1 LIMIT 1",
+ $r = q("SELECT `contact`.`id` AS `contact_id`, `profile`.`uid` AS `profile_uid`, `profile`.*,
+ `contact`.`avatar-date` AS picdate, `contact`.`addr`, `user`.*
+ FROM `profile`
+ INNER JOIN `contact` ON `contact`.`uid` = `profile`.`uid` AND `contact`.`self`
+ INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
+ WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` LIMIT 1",
dbesc($nickname)
);
}
);
}
- // check if profile is a forum
- if((intval($profile['page-flags']) == PAGE_COMMUNITY)
- || (intval($profile['page-flags']) == PAGE_PRVGROUP)
- || (isset($profile['forum']) && intval($profile['forum']))
- || (isset($profile['prv']) && intval($profile['prv']))
- || (isset($profile['community']) && intval($profile['community'])))
- $account_type = t('Forum');
- else
- $account_type = "";
+ // Fetch the account type
+ $account_type = account_type($profile);
if((x($profile,'address') == 1)
|| (x($profile,'location') == 1)
$about = ((x($profile,'about') == 1) ? t('About:') : False);
+ $xmpp = ((x($profile,'xmpp') == 1) ? t('XMPP:') : False);
+
if(($profile['hidewall'] || $block) && (! local_user()) && (! remote_user())) {
$location = $pdesc = $gender = $marital = $homepage = $about = False;
}
? trim(substr($profile['name'],0,strpos($profile['name'],' '))) : $profile['name']);
$lastname = (($firstname === $profile['name']) ? '' : trim(substr($profile['name'],strlen($firstname))));
- $diaspora = array(
- 'guid' => $profile['guid'],
- 'podloc' => $a->get_baseurl(),
- 'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ),
- 'nickname' => $profile['nickname'],
- 'fullname' => $profile['name'],
- 'firstname' => $firstname,
- 'lastname' => $lastname,
- 'photo300' => $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg',
- 'photo100' => $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg',
- 'photo50' => $a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg',
- );
+ if ($profile['guid'] != "")
+ $diaspora = array(
+ 'guid' => $profile['guid'],
+ 'podloc' => $a->get_baseurl(),
+ 'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ),
+ 'nickname' => $profile['nickname'],
+ 'fullname' => $profile['name'],
+ 'firstname' => $firstname,
+ 'lastname' => $lastname,
+ 'photo300' => $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg',
+ 'photo100' => $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg',
+ 'photo50' => $a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg',
+ );
+ else
+ $diaspora = false;
if (!$block){
$contact_block = contact_block();
$tpl = get_markup_template('profile_vcard.tpl');
$o .= replace_macros($tpl, array(
'$profile' => $p,
+ '$xmpp' => $xmpp,
'$connect' => $connect,
'$remoteconnect' => $remoteconnect,
'$subscribe_feed' => $subscribe_feed,
return replace_macros($tpl, array(
'$title' => t('Profile'),
+ '$basic' => t('Basic'),
+ '$advanced' => t('Advanced'),
'$profile' => $profile
));
}
),
);
- if ($is_owner){
- if ($a->theme_events_in_profile)
+ // the calendar link for the full featured events calendar
+ if ($is_owner && $a->theme_events_in_profile) {
$tabs[] = array(
'label' => t('Events'),
'url' => $a->get_baseurl() . '/events',
'id' => 'events-tab',
'accesskey' => 'e',
);
+ // if the user is not the owner of the calendar we only show a calendar
+ // with the public events of the calendar owner
+ } elseif (! $is_owner) {
+ $tabs[] = array(
+ 'label' => t('Events'),
+ 'url' => $a->get_baseurl() . '/cal/' . $nickname,
+ 'sel' =>((!isset($tab)&&$a->argv[0]=='cal')?'active':''),
+ 'title' => t('Events and Calendar'),
+ 'id' => 'events-tab',
+ 'accesskey' => 'e',
+ );
+ }
+
+ if ($is_owner){
$tabs[] = array(
'label' => t('Personal Notes'),
'url' => $a->get_baseurl() . '/notes',
}
}
- proc_run('php','include/gprobe.php',bin2hex($tmp_str));
+ proc_run(PRIORITY_LOW, 'include/gprobe.php',bin2hex($tmp_str));
$arr = array('zrl' => $tmp_str, 'url' => $a->cmd);
call_hooks('zrl_init',$arr);
}