group/community/celebrity pages
This commit is contained in:
parent
be981a4f8a
commit
511c761fec
4
boot.php
4
boot.php
|
@ -567,7 +567,7 @@ function xml_status($st, $message = '') {
|
||||||
if(! function_exists('local_user')) {
|
if(! function_exists('local_user')) {
|
||||||
function local_user() {
|
function local_user() {
|
||||||
if((x($_SESSION,'authenticated')) && (x($_SESSION,'uid')))
|
if((x($_SESSION,'authenticated')) && (x($_SESSION,'uid')))
|
||||||
return $_SESSION['uid'];
|
return intval($_SESSION['uid']);
|
||||||
return false;
|
return false;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
@ -576,7 +576,7 @@ function local_user() {
|
||||||
if(! function_exists('remote_user')) {
|
if(! function_exists('remote_user')) {
|
||||||
function remote_user() {
|
function remote_user() {
|
||||||
if((x($_SESSION,'authenticated')) && (x($_SESSION,'visitor_id')))
|
if((x($_SESSION,'authenticated')) && (x($_SESSION,'visitor_id')))
|
||||||
return $_SESSION['visitor_id'];
|
return intval($_SESSION['visitor_id']);
|
||||||
return false;
|
return false;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
|
@ -172,7 +172,7 @@ function contacts_content(&$a) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($r[0]['rel'] != REL_FAN) {
|
if(($r[0]['network'] === 'dfrn') && ($r[0]['rel'])) {
|
||||||
$url = "redir/{$r[0]['id']}";
|
$url = "redir/{$r[0]['id']}";
|
||||||
$sparkle = ' class="sparkle" ';
|
$sparkle = ' class="sparkle" ';
|
||||||
}
|
}
|
||||||
|
@ -272,7 +272,7 @@ function contacts_content(&$a) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($rr['rel'] != REL_FAN) {
|
if(($rr['network'] === 'dfrn') && ($rr['rel'])) {
|
||||||
$url = "redir/{$rr['id']}";
|
$url = "redir/{$rr['id']}";
|
||||||
$sparkle = ' class="sparkle" ';
|
$sparkle = ' class="sparkle" ';
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ function dfrn_poll_init(&$a) {
|
||||||
$sql_extra = '';
|
$sql_extra = '';
|
||||||
switch($direction) {
|
switch($direction) {
|
||||||
case (-1):
|
case (-1):
|
||||||
$sql_extra = sprintf(" AND `dfrn-id` = '%s' ", dbesc($dfrn_id));
|
$sql_extra = sprintf(" AND ( `dfrn-id` = '%s' OR `issued-id` = '%s' ) ", dbesc($dfrn_id),dbesc($dfrn_id));
|
||||||
$my_id = $dfrn_id;
|
$my_id = $dfrn_id;
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -56,7 +56,10 @@ function dfrn_poll_init(&$a) {
|
||||||
|
|
||||||
$r = q("SELECT `contact`.*, `user`.`nickname`
|
$r = q("SELECT `contact`.*, `user`.`nickname`
|
||||||
FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
|
FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
|
||||||
WHERE `contact`.`blocked` = 0 AND `contact`.`pending` = 0 $sql_extra LIMIT 1");
|
WHERE `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
||||||
|
AND `user`.`nickname` = '%s' $sql_extra LIMIT 1",
|
||||||
|
dbesc($a->argv[1])
|
||||||
|
);
|
||||||
|
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ function display_content(&$a) {
|
||||||
|
|
||||||
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
|
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
|
||||||
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
|
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
|
||||||
`contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
|
`contact`.`network`, `contact`.`thumb`, `contact`.`self`,
|
||||||
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
|
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
|
||||||
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||||
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
|
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
|
||||||
|
@ -116,7 +116,7 @@ function display_content(&$a) {
|
||||||
$sparkle = '';
|
$sparkle = '';
|
||||||
if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) {
|
if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) {
|
||||||
$url = $item['url'];
|
$url = $item['url'];
|
||||||
if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) {
|
if(($item['network'] === 'dfrn') && (! $item['self'])) {
|
||||||
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
||||||
$sparkle = ' class="sparkle"';
|
$sparkle = ' class="sparkle"';
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ function display_content(&$a) {
|
||||||
}
|
}
|
||||||
if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) {
|
if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) {
|
||||||
$url = $item['url'];
|
$url = $item['url'];
|
||||||
if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) {
|
if(($item['network'] === 'dfrn') && (! $item['self'])) {
|
||||||
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
||||||
$sparkle = ' class="sparkle"';
|
$sparkle = ' class="sparkle"';
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ function display_content(&$a) {
|
||||||
|
|
||||||
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
|
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
|
||||||
|
|
||||||
if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'] )) {
|
if(($item['network'] === 'dfrn') && (! $item['self'] )) {
|
||||||
$profile_url = $redirect_url;
|
$profile_url = $redirect_url;
|
||||||
$sparkle = ' sparkle';
|
$sparkle = ' sparkle';
|
||||||
}
|
}
|
||||||
|
@ -209,7 +209,7 @@ function display_content(&$a) {
|
||||||
$template = $wallwall;
|
$template = $wallwall;
|
||||||
$commentww = 'ww';
|
$commentww = 'ww';
|
||||||
// If it is our contact, use a friendly redirect link
|
// If it is our contact, use a friendly redirect link
|
||||||
if(($item['owner-link'] == $item['url']) && ($item['rel'] == REL_VIP || $item['rel'] == REL_BUD)) {
|
if(($item['owner-link'] == $item['url']) && ($item['network'] === 'dfrn')) {
|
||||||
$owner_url = $redirect_url;
|
$owner_url = $redirect_url;
|
||||||
$osparkle = ' sparkle';
|
$osparkle = ' sparkle';
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,12 +136,14 @@ function group_content(&$a) {
|
||||||
'$delete' => t('Delete')
|
'$delete' => t('Delete')
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
|
||||||
|
|
||||||
$tpl = load_view_file('view/group_edit.tpl');
|
$tpl = load_view_file('view/group_edit.tpl');
|
||||||
$o .= replace_macros($tpl, array(
|
$o .= replace_macros($tpl, array(
|
||||||
'$gid' => $group['id'],
|
'$gid' => $group['id'],
|
||||||
'$name' => $group['name'],
|
'$name' => $group['name'],
|
||||||
'$drop' => $drop_txt,
|
'$drop' => $drop_txt,
|
||||||
'$selector' => contact_select('group_members_select','group_members_select',$preselected,25)
|
'$selector' => contact_select('group_members_select','group_members_select',$preselected,25,false,$celeb)
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,13 +41,15 @@ function network_content(&$a, $update = 0) {
|
||||||
else
|
else
|
||||||
$lockstate = 'unlock';
|
$lockstate = 'unlock';
|
||||||
|
|
||||||
|
$celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
|
||||||
|
|
||||||
$o .= replace_macros($tpl,array(
|
$o .= replace_macros($tpl,array(
|
||||||
'$return_path' => $a->cmd,
|
'$return_path' => $a->cmd,
|
||||||
'$baseurl' => $a->get_baseurl(),
|
'$baseurl' => $a->get_baseurl(),
|
||||||
'$defloc' => $a->user['default-location'],
|
'$defloc' => $a->user['default-location'],
|
||||||
'$visitor' => 'block',
|
'$visitor' => 'block',
|
||||||
'$lockstate' => $lockstate,
|
'$lockstate' => $lockstate,
|
||||||
'$acl' => populate_acl(($group) ? $group_acl : $a->user),
|
'$acl' => populate_acl((($group) ? $group_acl : $a->user), $celeb),
|
||||||
'$bang' => (($group) ? '!' : ''),
|
'$bang' => (($group) ? '!' : ''),
|
||||||
'$profile_uid' => $_SESSION['uid']
|
'$profile_uid' => $_SESSION['uid']
|
||||||
));
|
));
|
||||||
|
@ -111,7 +113,7 @@ function network_content(&$a, $update = 0) {
|
||||||
|
|
||||||
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
|
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
|
||||||
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
|
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
|
||||||
`contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
|
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
|
||||||
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
|
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
|
||||||
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||||
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
|
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
|
||||||
|
@ -139,7 +141,7 @@ function network_content(&$a, $update = 0) {
|
||||||
|
|
||||||
if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) {
|
if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) {
|
||||||
$url = $item['url'];
|
$url = $item['url'];
|
||||||
if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) {
|
if(($item['network'] === 'dfrn') && (! $item['self'])) {
|
||||||
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
||||||
$sparkle = ' class="sparkle"';
|
$sparkle = ' class="sparkle"';
|
||||||
}
|
}
|
||||||
|
@ -150,7 +152,7 @@ function network_content(&$a, $update = 0) {
|
||||||
}
|
}
|
||||||
if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) {
|
if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) {
|
||||||
$url = $item['url'];
|
$url = $item['url'];
|
||||||
if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) {
|
if(($item['network'] === 'dfrn') && (! $item['self'])) {
|
||||||
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
||||||
$sparkle = ' class="sparkle"';
|
$sparkle = ' class="sparkle"';
|
||||||
}
|
}
|
||||||
|
@ -202,7 +204,7 @@ function network_content(&$a, $update = 0) {
|
||||||
$commentww = 'ww';
|
$commentww = 'ww';
|
||||||
// If it is our contact, use a friendly redirect link
|
// If it is our contact, use a friendly redirect link
|
||||||
if(($item['owner-link'] == $item['url'])
|
if(($item['owner-link'] == $item['url'])
|
||||||
&& ($item['rel'] == REL_VIP || $item['rel'] == REL_BUD)) {
|
&& ($item['network'] === 'dfrn')) {
|
||||||
$owner_url = $redirect_url;
|
$owner_url = $redirect_url;
|
||||||
$osparkle = ' sparkle';
|
$osparkle = ' sparkle';
|
||||||
}
|
}
|
||||||
|
@ -238,7 +240,7 @@ function network_content(&$a, $update = 0) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'] )) {
|
if(($item['network'] === 'dfrn') && (! $item['self'] )) {
|
||||||
$profile_url = $redirect_url;
|
$profile_url = $redirect_url;
|
||||||
$sparkle = ' sparkle';
|
$sparkle = ' sparkle';
|
||||||
}
|
}
|
||||||
|
|
|
@ -480,6 +480,9 @@ function photos_content(&$a) {
|
||||||
$albumselect .= '<option value="' . $album['album'] . '">' . $album['album'] . '</option>';
|
$albumselect .= '<option value="' . $album['album'] . '">' . $album['album'] . '</option>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
|
||||||
|
|
||||||
$albumselect .= '</select>';
|
$albumselect .= '</select>';
|
||||||
$tpl = load_view_file('view/photos_upload.tpl');
|
$tpl = load_view_file('view/photos_upload.tpl');
|
||||||
$o .= replace_macros($tpl,array(
|
$o .= replace_macros($tpl,array(
|
||||||
|
@ -490,7 +493,7 @@ function photos_content(&$a) {
|
||||||
'$filestext' => t('Select files to upload: '),
|
'$filestext' => t('Select files to upload: '),
|
||||||
'$albumselect' => $albumselect,
|
'$albumselect' => $albumselect,
|
||||||
'$permissions' => t('Permissions'),
|
'$permissions' => t('Permissions'),
|
||||||
'$aclselect' => populate_acl($a->user),
|
'$aclselect' => populate_acl($a->user, $celeb),
|
||||||
'$archive' => $a->get_baseurl() . '/jumploader_z.jar',
|
'$archive' => $a->get_baseurl() . '/jumploader_z.jar',
|
||||||
'$nojava' => t('Use the following controls only if the Java uploader [above] fails to launch.'),
|
'$nojava' => t('Use the following controls only if the Java uploader [above] fails to launch.'),
|
||||||
'$uploadurl' => $a->get_baseurl() . '/photos',
|
'$uploadurl' => $a->get_baseurl() . '/photos',
|
||||||
|
@ -633,8 +636,8 @@ function photos_content(&$a) {
|
||||||
|
|
||||||
|
|
||||||
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
|
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
|
||||||
`contact`.`name`, `contact`.`photo`, `contact`.`url`,
|
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`network`,
|
||||||
`contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
|
`contact`.`rel`, `contact`.`thumb`, `contact`.`self`,
|
||||||
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
|
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
|
||||||
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||||
WHERE `parent-uri` = '%s' AND `uri` != '%s' AND `item`.`deleted` = 0
|
WHERE `parent-uri` = '%s' AND `uri` != '%s' AND `item`.`deleted` = 0
|
||||||
|
@ -724,7 +727,7 @@ function photos_content(&$a) {
|
||||||
|
|
||||||
|
|
||||||
if(local_user() && ($item['contact-uid'] == get_uid())
|
if(local_user() && ($item['contact-uid'] == get_uid())
|
||||||
&& ($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'] )) {
|
&& ($item['network'] == 'dfrn') && (! $item['self'] )) {
|
||||||
$profile_url = $redirect_url;
|
$profile_url = $redirect_url;
|
||||||
$sparkle = ' sparkle';
|
$sparkle = ' sparkle';
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,6 +138,7 @@ function profile_content(&$a, $update = 0) {
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$celeb = ((($a->profile['page-flags'] == PAGE_SOAPBOX) || ($a->profile['page-flags'] == PAGE_COMMUNITY)) ? true : false);
|
||||||
if(can_write_wall($a,$a->profile['profile_uid'])) {
|
if(can_write_wall($a,$a->profile['profile_uid'])) {
|
||||||
$tpl = load_view_file('view/jot-header.tpl');
|
$tpl = load_view_file('view/jot-header.tpl');
|
||||||
|
|
||||||
|
@ -156,7 +157,7 @@ function profile_content(&$a, $update = 0) {
|
||||||
'$visitor' => (($_SESSION['uid'] == $a->profile['profile_uid']) ? 'block' : 'none'),
|
'$visitor' => (($_SESSION['uid'] == $a->profile['profile_uid']) ? 'block' : 'none'),
|
||||||
'$lockstate' => $lockstate,
|
'$lockstate' => $lockstate,
|
||||||
'$bang' => '',
|
'$bang' => '',
|
||||||
'$acl' => (($_SESSION['uid'] == $a->profile['profile_uid']) ? populate_acl($a->user) : ''),
|
'$acl' => (($_SESSION['uid'] == $a->profile['profile_uid']) ? populate_acl($a->user, $celeb) : ''),
|
||||||
'$profile_uid' => $a->profile['profile_uid']
|
'$profile_uid' => $a->profile['profile_uid']
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -231,8 +232,8 @@ function profile_content(&$a, $update = 0) {
|
||||||
$a->set_pager_total($r[0]['total']);
|
$a->set_pager_total($r[0]['total']);
|
||||||
|
|
||||||
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
|
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
|
||||||
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
|
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`network`, `contact`.`rel`,
|
||||||
`contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
|
`contact`.`thumb`, `contact`.`self`,
|
||||||
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
|
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
|
||||||
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||||
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
|
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
|
||||||
|
@ -272,7 +273,7 @@ function profile_content(&$a, $update = 0) {
|
||||||
|
|
||||||
if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) {
|
if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) {
|
||||||
$url = $item['url'];
|
$url = $item['url'];
|
||||||
if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) {
|
if(($item['network'] === 'dfrn') && (! $item['self'])) {
|
||||||
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
||||||
$sparkle = ' class="sparkle" ';
|
$sparkle = ' class="sparkle" ';
|
||||||
}
|
}
|
||||||
|
@ -283,7 +284,7 @@ function profile_content(&$a, $update = 0) {
|
||||||
}
|
}
|
||||||
if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) {
|
if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) {
|
||||||
$url = $item['url'];
|
$url = $item['url'];
|
||||||
if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) {
|
if(($item['network'] === 'dfrn') && (! $item['self'])) {
|
||||||
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
||||||
$sparkle = ' class="sparkle" ';
|
$sparkle = ' class="sparkle" ';
|
||||||
}
|
}
|
||||||
|
@ -338,7 +339,7 @@ function profile_content(&$a, $update = 0) {
|
||||||
// I can go directly to their profile as an authenticated guest.
|
// I can go directly to their profile as an authenticated guest.
|
||||||
|
|
||||||
if(local_user() && ($item['contact-uid'] == $_SESSION['uid'])
|
if(local_user() && ($item['contact-uid'] == $_SESSION['uid'])
|
||||||
&& ($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'] )) {
|
&& ($item['network'] === 'dfrn') && (! $item['self'] )) {
|
||||||
$profile_url = $redirect_url;
|
$profile_url = $redirect_url;
|
||||||
$sparkle = ' sparkle';
|
$sparkle = ' sparkle';
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,14 +4,15 @@ function redir_init(&$a) {
|
||||||
|
|
||||||
if((! local_user()) || (! ($a->argc == 2)) || (! intval($a->argv[1])))
|
if((! local_user()) || (! ($a->argc == 2)) || (! intval($a->argv[1])))
|
||||||
goaway($a->get_baseurl());
|
goaway($a->get_baseurl());
|
||||||
$r = q("SELECT `issued-id`, `dfrn-id`, `duplex`, `poll` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$r = q("SELECT `network`, `issued-id`, `dfrn-id`, `duplex`, `poll` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($a->argv[1]),
|
intval($a->argv[1]),
|
||||||
intval($_SESSION['uid']));
|
intval(get_uid())
|
||||||
if(! count($r))
|
);
|
||||||
|
if((! count($r)) || ($r[0]['network'] !== 'dfrn'))
|
||||||
goaway($a->get_baseurl());
|
goaway($a->get_baseurl());
|
||||||
|
|
||||||
|
$dfrn_id = $orig_id = (($r[0]['issued-id']) ? $r[0]['issued-id'] : $r[0]['dfrn-id']);
|
||||||
|
|
||||||
$dfrn_id = $orig_id = $r[0]['issued-id'];
|
|
||||||
if($r[0]['duplex'] && $r[0]['issued-id']) {
|
if($r[0]['duplex'] && $r[0]['issued-id']) {
|
||||||
$orig_id = $r[0]['issued-id'];
|
$orig_id = $r[0]['issued-id'];
|
||||||
$dfrn_id = '1:' . $orig_id;
|
$dfrn_id = '1:' . $orig_id;
|
||||||
|
|
|
@ -57,6 +57,7 @@ function settings_post(&$a) {
|
||||||
$publish = (($_POST['profile_in_directory'] == 1) ? 1: 0);
|
$publish = (($_POST['profile_in_directory'] == 1) ? 1: 0);
|
||||||
$net_publish = (($_POST['profile_in_netdirectory'] == 1) ? 1: 0);
|
$net_publish = (($_POST['profile_in_netdirectory'] == 1) ? 1: 0);
|
||||||
$old_visibility = ((intval($_POST['visibility']) == 1) ? 1 : 0);
|
$old_visibility = ((intval($_POST['visibility']) == 1) ? 1 : 0);
|
||||||
|
$page_flags = ((intval($_POST['page-flags'])) ? intval($_POST['page-flags']) : 0);
|
||||||
|
|
||||||
$notify = 0;
|
$notify = 0;
|
||||||
|
|
||||||
|
@ -103,7 +104,7 @@ function settings_post(&$a) {
|
||||||
$str_group_deny = perms2str($_POST['group_deny']);
|
$str_group_deny = perms2str($_POST['group_deny']);
|
||||||
$str_contact_deny = perms2str($_POST['contact_deny']);
|
$str_contact_deny = perms2str($_POST['contact_deny']);
|
||||||
|
|
||||||
$r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `timezone` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `default-location` = '%s', `theme` = '%s' WHERE `uid` = %d LIMIT 1",
|
$r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `timezone` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `theme` = '%s' WHERE `uid` = %d LIMIT 1",
|
||||||
dbesc($username),
|
dbesc($username),
|
||||||
dbesc($email),
|
dbesc($email),
|
||||||
dbesc($timezone),
|
dbesc($timezone),
|
||||||
|
@ -112,6 +113,7 @@ function settings_post(&$a) {
|
||||||
dbesc($str_contact_deny),
|
dbesc($str_contact_deny),
|
||||||
dbesc($str_group_deny),
|
dbesc($str_group_deny),
|
||||||
intval($notify),
|
intval($notify),
|
||||||
|
intval($page_flags),
|
||||||
dbesc($defloc),
|
dbesc($defloc),
|
||||||
dbesc($theme),
|
dbesc($theme),
|
||||||
intval(get_uid())
|
intval(get_uid())
|
||||||
|
@ -176,6 +178,18 @@ function settings_content(&$a) {
|
||||||
if(! strlen($a->user['timezone']))
|
if(! strlen($a->user['timezone']))
|
||||||
$timezone = date_default_timezone_get();
|
$timezone = date_default_timezone_get();
|
||||||
|
|
||||||
|
$pageset_tpl = load_view_file('view/pagetypes.tpl');
|
||||||
|
$pagetype = replace_macros($pageset_tpl,array(
|
||||||
|
'$normal' => (($profile['page-flags'] == PAGE_NORMAL) ? " checked=\"checked\" " : ""),
|
||||||
|
'$soapbox' => (($profile['page-flags'] == PAGE_SOAPBOX) ? " checked=\"checked\" " : ""),
|
||||||
|
'$community' => (($profile['page-flags'] == PAGE_COMMUNITY) ? " checked=\"checked\" " : ""),
|
||||||
|
'$freelove' => (($profile['page-flags'] == PAGE_FREELOVE) ? " checked=\"checked\" " : ""),
|
||||||
|
'$page_normal' => PAGE_NORMAL,
|
||||||
|
'$page_soapbox' => PAGE_SOAPBOX,
|
||||||
|
'$page_community' => PAGE_COMMUNITY,
|
||||||
|
'$page_freelove' => PAGE_FREELOVE
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
$opt_tpl = load_view_file("view/profile-in-directory.tpl");
|
$opt_tpl = load_view_file("view/profile-in-directory.tpl");
|
||||||
$profile_in_dir = replace_macros($opt_tpl,array(
|
$profile_in_dir = replace_macros($opt_tpl,array(
|
||||||
|
@ -234,6 +248,8 @@ function settings_content(&$a) {
|
||||||
|
|
||||||
$stpl = load_view_file('view/settings.tpl');
|
$stpl = load_view_file('view/settings.tpl');
|
||||||
|
|
||||||
|
$celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
|
||||||
|
|
||||||
$o .= replace_macros($stpl,array(
|
$o .= replace_macros($stpl,array(
|
||||||
'$baseurl' => $a->get_baseurl(),
|
'$baseurl' => $a->get_baseurl(),
|
||||||
'$uid' => $_SESSION['uid'],
|
'$uid' => $_SESSION['uid'],
|
||||||
|
@ -247,13 +263,14 @@ function settings_content(&$a) {
|
||||||
'$profile_in_net_dir' => $profile_in_net_dir,
|
'$profile_in_net_dir' => $profile_in_net_dir,
|
||||||
'$permissions' => t('Default Post Permissions'),
|
'$permissions' => t('Default Post Permissions'),
|
||||||
'$visibility' => $profile['net-publish'],
|
'$visibility' => $profile['net-publish'],
|
||||||
'$aclselect' => populate_acl($a->user),
|
'$aclselect' => populate_acl($a->user,$celeb),
|
||||||
'$sel_notify1' => (($notify & NOTIFY_INTRO) ? ' checked="checked" ' : ''),
|
'$sel_notify1' => (($notify & NOTIFY_INTRO) ? ' checked="checked" ' : ''),
|
||||||
'$sel_notify2' => (($notify & NOTIFY_CONFIRM) ? ' checked="checked" ' : ''),
|
'$sel_notify2' => (($notify & NOTIFY_CONFIRM) ? ' checked="checked" ' : ''),
|
||||||
'$sel_notify3' => (($notify & NOTIFY_WALL) ? ' checked="checked" ' : ''),
|
'$sel_notify3' => (($notify & NOTIFY_WALL) ? ' checked="checked" ' : ''),
|
||||||
'$sel_notify4' => (($notify & NOTIFY_COMMENT) ? ' checked="checked" ' : ''),
|
'$sel_notify4' => (($notify & NOTIFY_COMMENT) ? ' checked="checked" ' : ''),
|
||||||
'$sel_notify5' => (($notify & NOTIFY_MAIL) ? ' checked="checked" ' : ''),
|
'$sel_notify5' => (($notify & NOTIFY_MAIL) ? ' checked="checked" ' : ''),
|
||||||
'$theme' => $theme_selector
|
'$theme' => $theme_selector,
|
||||||
|
'$pagetype' => $pagetype
|
||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
|
|
@ -30,22 +30,25 @@ function group_select($selname,$selclass,$preselected = false,$size = 4) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false) {
|
function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
// When used for private messages, we limit correspondence to mutual friends and the selector
|
// When used for private messages, we limit correspondence to mutual friends and the selector
|
||||||
// to one recipient. By default our selector allows multiple selects amongst all contacts.
|
// to one recipient. By default our selector allows multiple selects amongst all contacts.
|
||||||
|
|
||||||
if($privmail) {
|
|
||||||
$sql_extra = sprintf(" AND `rel` = %d ", intval(REL_BUD));
|
|
||||||
$o .= "<select name=\"$selname\" id=\"$selclass\" class=\"$selclass\" size=\"$size\" >\r\n";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$sql_extra = '';
|
$sql_extra = '';
|
||||||
$o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" >\r\n";
|
|
||||||
|
if($privmail || $celeb) {
|
||||||
|
$sql_extra = sprintf(" AND `rel` = %d ", intval(REL_BUD));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($privmail)
|
||||||
|
$o .= "<select name=\"$selname\" id=\"$selclass\" class=\"$selclass\" size=\"$size\" >\r\n";
|
||||||
|
else
|
||||||
|
$o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" >\r\n";
|
||||||
|
|
||||||
|
|
||||||
$r = q("SELECT `id`, `name`, `url` FROM `contact`
|
$r = q("SELECT `id`, `name`, `url` FROM `contact`
|
||||||
WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0
|
WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0
|
||||||
$sql_extra
|
$sql_extra
|
||||||
|
@ -73,7 +76,7 @@ function fixacl(&$item) {
|
||||||
$item = intval(str_replace(array('<','>'),array('',''),$item));
|
$item = intval(str_replace(array('<','>'),array('',''),$item));
|
||||||
}
|
}
|
||||||
|
|
||||||
function populate_acl($user = null) {
|
function populate_acl($user = null,$celeb = false) {
|
||||||
|
|
||||||
$allow_cid = $allow_gid = $deny_cid = $deny_gid = false;
|
$allow_cid = $allow_gid = $deny_cid = $deny_gid = false;
|
||||||
|
|
||||||
|
@ -104,7 +107,7 @@ function populate_acl($user = null) {
|
||||||
$o .= '</div>';
|
$o .= '</div>';
|
||||||
$o .= '<div id="contact_allow_wrapper">';
|
$o .= '<div id="contact_allow_wrapper">';
|
||||||
$o .= '<label id="acl-allow-contact-label" for="contact_allow" >' . t('Contacts') . '</label>';
|
$o .= '<label id="acl-allow-contact-label" for="contact_allow" >' . t('Contacts') . '</label>';
|
||||||
$o .= contact_select('contact_allow','contact_allow',$allow_cid);
|
$o .= contact_select('contact_allow','contact_allow',$allow_cid,4,false,$celeb);
|
||||||
$o .= '</div>';
|
$o .= '</div>';
|
||||||
$o .= '</div>' . "\r\n";
|
$o .= '</div>' . "\r\n";
|
||||||
$o .= '<div id="acl-allow-end"></div>' . "\r\n";
|
$o .= '<div id="acl-allow-end"></div>' . "\r\n";
|
||||||
|
@ -119,7 +122,7 @@ function populate_acl($user = null) {
|
||||||
$o .= '</div>';
|
$o .= '</div>';
|
||||||
$o .= '<div id="contact_deny_wrapper" >';
|
$o .= '<div id="contact_deny_wrapper" >';
|
||||||
$o .= '<label id="acl-deny-contact-label" for="contact_deny" >' . t('Contacts') . '</label>';
|
$o .= '<label id="acl-deny-contact-label" for="contact_deny" >' . t('Contacts') . '</label>';
|
||||||
$o .= contact_select('contact_deny','contact_deny', $deny_cid);
|
$o .= contact_select('contact_deny','contact_deny', $deny_cid,4,false, $celeb);
|
||||||
$o .= '</div>';
|
$o .= '</div>';
|
||||||
$o .= '</div>' . "\r\n";
|
$o .= '</div>' . "\r\n";
|
||||||
$o .= '<div id="acl-deny-end"></div>' . "\r\n";
|
$o .= '<div id="acl-deny-end"></div>' . "\r\n";
|
||||||
|
|
|
@ -5,8 +5,11 @@ $nickname_block
|
||||||
|
|
||||||
<form action="settings" id="settings-form" method="post" >
|
<form action="settings" id="settings-form" method="post" >
|
||||||
|
|
||||||
|
|
||||||
|
<h3 class="settings-heading">Basic Settings</h3>
|
||||||
|
|
||||||
<div id="settings-username-wrapper" >
|
<div id="settings-username-wrapper" >
|
||||||
<label id="settings-username-label" for="settings-username" >Username: </label>
|
<label id="settings-username-label" for="settings-username" >Full Name: </label>
|
||||||
<input type="text" name="username" id="settings-username" value="$username" />
|
<input type="text" name="username" id="settings-username" value="$username" />
|
||||||
</div>
|
</div>
|
||||||
<div id="settings-username-end" ></div>
|
<div id="settings-username-end" ></div>
|
||||||
|
@ -38,6 +41,14 @@ $theme
|
||||||
</div>
|
</div>
|
||||||
<div id="settings-theme-end"></div>
|
<div id="settings-theme-end"></div>
|
||||||
|
|
||||||
|
<div id="settings-submit-wrapper" >
|
||||||
|
<input type="submit" name="submit" id="settings-submit" value="Submit" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<h3 class="settings-heading">Privacy Settings</h3>
|
||||||
|
|
||||||
|
|
||||||
<input type="hidden" name="visibility" value="$visibility" />
|
<input type="hidden" name="visibility" value="$visibility" />
|
||||||
|
|
||||||
$profile_in_dir
|
$profile_in_dir
|
||||||
|
@ -56,26 +67,43 @@ $profile_in_net_dir
|
||||||
</div>
|
</div>
|
||||||
<div id="settings-default-perms-end"></div>
|
<div id="settings-default-perms-end"></div>
|
||||||
|
|
||||||
|
<div id="settings-submit-wrapper" >
|
||||||
|
<input type="submit" name="submit" id="settings-submit" value="Submit" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h3 class="settings-heading">Notification Settings</h3>
|
||||||
|
|
||||||
|
|
||||||
<div id="settings-notify-wrapper">
|
<div id="settings-notify-wrapper">
|
||||||
<div id="settings-notify-desc">Send me a notification email when: </div>
|
<div id="settings-notify-desc">Send a notification email when: </div>
|
||||||
<label for="notify1" id="settings-label-notify1">I receive an introduction</label>
|
<label for="notify1" id="settings-label-notify1">You receive an introduction</label>
|
||||||
<input id="notify1" type="checkbox" $sel_notify1 name="notify1" value="1" />
|
<input id="notify1" type="checkbox" $sel_notify1 name="notify1" value="1" />
|
||||||
<div id="notify1-end"></div>
|
<div id="notify1-end"></div>
|
||||||
<label for="notify2" id="settings-label-notify2">My introductions are confirmed</label>
|
<label for="notify2" id="settings-label-notify2">Your introductions are confirmed</label>
|
||||||
<input id="notify2" type="checkbox" $sel_notify2 name="notify2" value="2" />
|
<input id="notify2" type="checkbox" $sel_notify2 name="notify2" value="2" />
|
||||||
<div id="notify2-end"></div>
|
<div id="notify2-end"></div>
|
||||||
<label for="notify3" id="settings-label-notify3">Someone writes on my profile wall</label>
|
<label for="notify3" id="settings-label-notify3">Someone writes on your profile wall</label>
|
||||||
<input id="notify3" type="checkbox" $sel_notify3 name="notify3" value="4" />
|
<input id="notify3" type="checkbox" $sel_notify3 name="notify3" value="4" />
|
||||||
<div id="notify3-end"></div>
|
<div id="notify3-end"></div>
|
||||||
<label for="notify4" id="settings-label-notify4">Someone writes a followup comment</label>
|
<label for="notify4" id="settings-label-notify4">Someone writes a followup comment</label>
|
||||||
<input id="notify4" type="checkbox" $sel_notify4 name="notify4" value="8" />
|
<input id="notify4" type="checkbox" $sel_notify4 name="notify4" value="8" />
|
||||||
<div id="notify4-end"></div>
|
<div id="notify4-end"></div>
|
||||||
<label for="notify5" id="settings-label-notify5">I receive a private message</label>
|
<label for="notify5" id="settings-label-notify5">You receive a private message</label>
|
||||||
<input id="notify5" type="checkbox" $sel_notify5 name="notify5" value="16" />
|
<input id="notify5" type="checkbox" $sel_notify5 name="notify5" value="16" />
|
||||||
<div id="notify5-end"></div>
|
<div id="notify5-end"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="settings=notify-end"></div>
|
<div id="settings=notify-end"></div>
|
||||||
|
|
||||||
|
<div id="settings-submit-wrapper" >
|
||||||
|
<input type="submit" name="submit" id="settings-submit" value="Submit" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<h3 class="settings-heading">Password Settings</h3>
|
||||||
|
|
||||||
|
|
||||||
<div id="settings-password-wrapper" >
|
<div id="settings-password-wrapper" >
|
||||||
<p id="settings-password-desc" >
|
<p id="settings-password-desc" >
|
||||||
Leave password fields blank unless changing
|
Leave password fields blank unless changing
|
||||||
|
@ -92,14 +120,20 @@ Leave password fields blank unless changing
|
||||||
<div id="settings-confirm-end" ></div>
|
<div id="settings-confirm-end" ></div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="settings-submit-wrapper" >
|
||||||
|
<input type="submit" name="submit" id="settings-submit" value="Submit" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<h3 class="settings-heading">Advanced Page Settings</h3>
|
||||||
|
|
||||||
|
$pagetype
|
||||||
|
|
||||||
<div id="settings-submit-wrapper" >
|
<div id="settings-submit-wrapper" >
|
||||||
<input type="submit" name="submit" id="settings-submit" value="Submit" />
|
<input type="submit" name="submit" id="settings-submit" value="Submit" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -666,7 +666,11 @@ input#dfrn-url {
|
||||||
#profile-in-netdir-yes,
|
#profile-in-netdir-yes,
|
||||||
#profile-in-netdir-no,
|
#profile-in-netdir-no,
|
||||||
#hide-friends-yes,
|
#hide-friends-yes,
|
||||||
#hide-friends-no {
|
#hide-friends-no,
|
||||||
|
#settings-normal,
|
||||||
|
#settings-soapbox,
|
||||||
|
#settings-community,
|
||||||
|
#settings-freelove {
|
||||||
float: left;
|
float: left;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
@ -686,6 +690,20 @@ input#dfrn-url {
|
||||||
float: left;
|
float: left;
|
||||||
margin-bottom: 35px;
|
margin-bottom: 35px;
|
||||||
}
|
}
|
||||||
|
#settings-normal-label,
|
||||||
|
#settings-soapbox-label,
|
||||||
|
#settings-community-label,
|
||||||
|
#settings-freelove-label {
|
||||||
|
float: left;
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
#settings-normal-desc,
|
||||||
|
#settings-soapbox-desc,
|
||||||
|
#settings-community-desc,
|
||||||
|
#settings-freelove-desc {
|
||||||
|
float: left;
|
||||||
|
margin-left: 75px;
|
||||||
|
}
|
||||||
|
|
||||||
#profile-edit-profile-name-end,
|
#profile-edit-profile-name-end,
|
||||||
#profile-edit-name-end,
|
#profile-edit-name-end,
|
||||||
|
@ -706,7 +724,11 @@ input#dfrn-url {
|
||||||
#profile-in-netdir-break,
|
#profile-in-netdir-break,
|
||||||
#profile-in-netdir-end,
|
#profile-in-netdir-end,
|
||||||
#hide-friends-break,
|
#hide-friends-break,
|
||||||
#hide-friends-end {
|
#hide-friends-end,
|
||||||
|
#settings-normal-break,
|
||||||
|
#settings-soapbox-break,
|
||||||
|
#settings-community-break,
|
||||||
|
#settings-freelove-break {
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue