diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-10-18 00:43:49 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-10-18 00:43:49 -0700 |
commit | 511c761fec572a093e833541968635ca011cb71e (patch) | |
tree | 3db5bbc37e47d7bfb7da1086483fff28ca66e147 /mod | |
parent | be981a4f8a00fa7fb3e5bf9ac47aa38fd5187a35 (diff) | |
download | volse-hubzilla-511c761fec572a093e833541968635ca011cb71e.tar.gz volse-hubzilla-511c761fec572a093e833541968635ca011cb71e.tar.bz2 volse-hubzilla-511c761fec572a093e833541968635ca011cb71e.zip |
group/community/celebrity pages
Diffstat (limited to 'mod')
-rw-r--r-- | mod/contacts.php | 4 | ||||
-rw-r--r-- | mod/dfrn_poll.php | 7 | ||||
-rw-r--r-- | mod/display.php | 10 | ||||
-rw-r--r-- | mod/group.php | 4 | ||||
-rw-r--r-- | mod/network.php | 14 | ||||
-rw-r--r-- | mod/photos.php | 11 | ||||
-rw-r--r-- | mod/profile.php | 13 | ||||
-rw-r--r-- | mod/redir.php | 9 | ||||
-rw-r--r-- | mod/settings.php | 23 |
9 files changed, 62 insertions, 33 deletions
diff --git a/mod/contacts.php b/mod/contacts.php index dfd98961b..dbad2a158 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -172,7 +172,7 @@ function contacts_content(&$a) { break; } - if($r[0]['rel'] != REL_FAN) { + if(($r[0]['network'] === 'dfrn') && ($r[0]['rel'])) { $url = "redir/{$r[0]['id']}"; $sparkle = ' class="sparkle" '; } @@ -272,7 +272,7 @@ function contacts_content(&$a) { break; } - if($rr['rel'] != REL_FAN) { + if(($rr['network'] === 'dfrn') && ($rr['rel'])) { $url = "redir/{$rr['id']}"; $sparkle = ' class="sparkle" '; } diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php index fc663f797..84c249a58 100644 --- a/mod/dfrn_poll.php +++ b/mod/dfrn_poll.php @@ -38,7 +38,7 @@ function dfrn_poll_init(&$a) { $sql_extra = ''; switch($direction) { 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; break; case 0: @@ -56,7 +56,10 @@ function dfrn_poll_init(&$a) { $r = q("SELECT `contact`.*, `user`.`nickname` 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)) { diff --git a/mod/display.php b/mod/display.php index d8aca43e4..2b721aef8 100644 --- a/mod/display.php +++ b/mod/display.php @@ -86,7 +86,7 @@ function display_content(&$a) { $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `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` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 @@ -116,7 +116,7 @@ function display_content(&$a) { $sparkle = ''; if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) { $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']; $sparkle = ' class="sparkle"'; } @@ -127,7 +127,7 @@ function display_content(&$a) { } if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) { $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']; $sparkle = ' class="sparkle"'; } @@ -180,7 +180,7 @@ function display_content(&$a) { $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; $sparkle = ' sparkle'; } @@ -209,7 +209,7 @@ function display_content(&$a) { $template = $wallwall; $commentww = 'ww'; // 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; $osparkle = ' sparkle'; } diff --git a/mod/group.php b/mod/group.php index dc5dd3c71..56c3e21d1 100644 --- a/mod/group.php +++ b/mod/group.php @@ -136,12 +136,14 @@ function group_content(&$a) { '$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'); $o .= replace_macros($tpl, array( '$gid' => $group['id'], '$name' => $group['name'], '$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) )); } diff --git a/mod/network.php b/mod/network.php index 9d12d4346..347b7817f 100644 --- a/mod/network.php +++ b/mod/network.php @@ -41,13 +41,15 @@ function network_content(&$a, $update = 0) { else $lockstate = 'unlock'; + $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false); + $o .= replace_macros($tpl,array( '$return_path' => $a->cmd, '$baseurl' => $a->get_baseurl(), '$defloc' => $a->user['default-location'], '$visitor' => 'block', '$lockstate' => $lockstate, - '$acl' => populate_acl(($group) ? $group_acl : $a->user), + '$acl' => populate_acl((($group) ? $group_acl : $a->user), $celeb), '$bang' => (($group) ? '!' : ''), '$profile_uid' => $_SESSION['uid'] )); @@ -111,7 +113,7 @@ function network_content(&$a, $update = 0) { $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `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` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` 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'])) { $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']; $sparkle = ' class="sparkle"'; } @@ -150,7 +152,7 @@ function network_content(&$a, $update = 0) { } if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) { $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']; $sparkle = ' class="sparkle"'; } @@ -202,7 +204,7 @@ function network_content(&$a, $update = 0) { $commentww = 'ww'; // If it is our contact, use a friendly redirect link if(($item['owner-link'] == $item['url']) - && ($item['rel'] == REL_VIP || $item['rel'] == REL_BUD)) { + && ($item['network'] === 'dfrn')) { $owner_url = $redirect_url; $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; $sparkle = ' sparkle'; } diff --git a/mod/photos.php b/mod/photos.php index 35b03845d..767c02543 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -480,6 +480,9 @@ function photos_content(&$a) { $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>'; $tpl = load_view_file('view/photos_upload.tpl'); $o .= replace_macros($tpl,array( @@ -490,7 +493,7 @@ function photos_content(&$a) { '$filestext' => t('Select files to upload: '), '$albumselect' => $albumselect, '$permissions' => t('Permissions'), - '$aclselect' => populate_acl($a->user), + '$aclselect' => populate_acl($a->user, $celeb), '$archive' => $a->get_baseurl() . '/jumploader_z.jar', '$nojava' => t('Use the following controls only if the Java uploader [above] fails to launch.'), '$uploadurl' => $a->get_baseurl() . '/photos', @@ -633,8 +636,8 @@ function photos_content(&$a) { $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, - `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, + `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`network`, + `contact`.`rel`, `contact`.`thumb`, `contact`.`self`, `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` 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()) - && ($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'] )) { + && ($item['network'] == 'dfrn') && (! $item['self'] )) { $profile_url = $redirect_url; $sparkle = ' sparkle'; } diff --git a/mod/profile.php b/mod/profile.php index de0ae5745..b72c279e2 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -138,6 +138,7 @@ function profile_content(&$a, $update = 0) { 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'])) { $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'), '$lockstate' => $lockstate, '$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'] )); } @@ -231,8 +232,8 @@ function profile_content(&$a, $update = 0) { $a->set_pager_total($r[0]['total']); $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, - `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, + `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`network`, `contact`.`rel`, + `contact`.`thumb`, `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 @@ -272,7 +273,7 @@ function profile_content(&$a, $update = 0) { if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) { $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']; $sparkle = ' class="sparkle" '; } @@ -283,7 +284,7 @@ function profile_content(&$a, $update = 0) { } if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) { $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']; $sparkle = ' class="sparkle" '; } @@ -338,7 +339,7 @@ function profile_content(&$a, $update = 0) { // I can go directly to their profile as an authenticated guest. 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; $sparkle = ' sparkle'; } diff --git a/mod/redir.php b/mod/redir.php index c9b284ddd..e743d003e 100644 --- a/mod/redir.php +++ b/mod/redir.php @@ -4,14 +4,15 @@ function redir_init(&$a) { if((! local_user()) || (! ($a->argc == 2)) || (! intval($a->argv[1]))) 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($_SESSION['uid'])); - if(! count($r)) + intval(get_uid()) + ); + if((! count($r)) || ($r[0]['network'] !== 'dfrn')) 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']) { $orig_id = $r[0]['issued-id']; $dfrn_id = '1:' . $orig_id; diff --git a/mod/settings.php b/mod/settings.php index 5caf08b04..7adc5e6de 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -57,6 +57,7 @@ function settings_post(&$a) { $publish = (($_POST['profile_in_directory'] == 1) ? 1: 0); $net_publish = (($_POST['profile_in_netdirectory'] == 1) ? 1: 0); $old_visibility = ((intval($_POST['visibility']) == 1) ? 1 : 0); + $page_flags = ((intval($_POST['page-flags'])) ? intval($_POST['page-flags']) : 0); $notify = 0; @@ -103,7 +104,7 @@ function settings_post(&$a) { $str_group_deny = perms2str($_POST['group_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($email), dbesc($timezone), @@ -112,6 +113,7 @@ function settings_post(&$a) { dbesc($str_contact_deny), dbesc($str_group_deny), intval($notify), + intval($page_flags), dbesc($defloc), dbesc($theme), intval(get_uid()) @@ -176,6 +178,18 @@ function settings_content(&$a) { if(! strlen($a->user['timezone'])) $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"); $profile_in_dir = replace_macros($opt_tpl,array( @@ -234,6 +248,8 @@ function settings_content(&$a) { $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( '$baseurl' => $a->get_baseurl(), '$uid' => $_SESSION['uid'], @@ -247,13 +263,14 @@ function settings_content(&$a) { '$profile_in_net_dir' => $profile_in_net_dir, '$permissions' => t('Default Post Permissions'), '$visibility' => $profile['net-publish'], - '$aclselect' => populate_acl($a->user), + '$aclselect' => populate_acl($a->user,$celeb), '$sel_notify1' => (($notify & NOTIFY_INTRO) ? ' checked="checked" ' : ''), '$sel_notify2' => (($notify & NOTIFY_CONFIRM) ? ' checked="checked" ' : ''), '$sel_notify3' => (($notify & NOTIFY_WALL) ? ' checked="checked" ' : ''), '$sel_notify4' => (($notify & NOTIFY_COMMENT) ? ' checked="checked" ' : ''), '$sel_notify5' => (($notify & NOTIFY_MAIL) ? ' checked="checked" ' : ''), - '$theme' => $theme_selector + '$theme' => $theme_selector, + '$pagetype' => $pagetype )); return $o; |